Changes in / [1:5213e9e10846:3:957bfa456237]
- Files:
-
- 9 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r0 r3 35 35 # It should end with the last directory. Please omit a trailing slash. 36 36 # 37 QOOXDOO_PATH = ../qooxdoo-0.7 -sdk37 QOOXDOO_PATH = ../qooxdoo-0.7.1-sdk 38 38 39 39 # -
source/class/pf/Application.js
r1 r3 14 14 15 15 ************************************************************************ */ 16 17 18 var plasma_entities = new Array( 19 { 20 name : "Gyrofrequency", 21 dimension : "frequency", 22 nspecies : 1, 23 section : "fundamental", 24 formula : "%s1.getGyroFrequency(this.B)" 25 }, 26 { 27 name : "Plasma frequency", 28 dimension : "frequency", 29 nspecies : 1, 30 section : "fundamental", 31 formula : "%s1.getPlasmaFrequency()" 32 }, 33 34 { 35 name : "Debye length", 36 dimension : "length", 37 nspecies : 1, 38 section : "fundamental", 39 formula : "%s1.getDebyeLength()" 40 }, 41 { 42 name : "Full Debye length", 43 dimension : "length", 44 nspecies : 1, 45 section : "fundamental", 46 formula : "this.getFullDebyeLength(%s1)" 47 }, 48 { 49 name : "deBroglie length", 50 dimension : "length", 51 nspecies : 1, 52 section : "fundamental", 53 formula : "%s1.getDeBroglieLength()" 54 }, 55 { 56 name : "Mean interparticle distance", 57 dimension : "length", 58 nspecies : 1, 59 section : "fundamental", 60 formula : "%s1.getMeanDistance()" 61 }, 62 { 63 name : "Distance of minimal approach", 64 dimension : "length", 65 nspecies : 1, 66 section : "fundamental", 67 formula : "%s1.getMinApproachDistance()" 68 }, 69 { 70 name : "Inertial length", 71 dimension : "length", 72 nspecies : 1, 73 section : "fundamental", 74 formula : "%s1.getInertialLength()" 75 }, 76 77 { 78 name : "Thermal velocity", 79 dimension : "velocity", 80 nspecies : 1, 81 section : "fundamental", 82 formula : "%s1.getThermalVelocity()" 83 }, 84 { 85 name : "Alfven velocity", 86 dimension : "velocity", 87 nspecies : 1, 88 section : "fundamental", 89 formula : "%s1.getAlfvenVelocity(this.B)" 90 }, 91 92 { 93 name : "Coupling parameter", 94 dimension : "none", 95 nspecies : 1, 96 section : "fundamental", 97 formula : "%s1.getCoupling()" 98 }, 99 { 100 name : "Typical Debye screening", 101 dimension : "none", 102 nspecies : 1, 103 section : "spectroscopy", 104 formula : "var r = %s1.getMeanDistance()/%s1.getDebyeLength(); \ 105 (1 + r)*Math.exp(-r)" 106 }, 107 108 { 109 name : "Transition energy", 110 dimension : "energy", 111 nspecies : 0, 112 section : "spectroscopy", 113 formula : "this.getWavenumber()" 114 }, 115 { 116 name : "Natural linewidth", 117 dimension : "energy", 118 nspecies : 0, 119 section : "spectroscopy", 120 formula : "this.getNaturalWidth()" 121 }, 122 { 123 name : "Doppler FWHM", 124 dimension : "energy", 125 nspecies : 0, 126 section : "spectroscopy", 127 formula : "2*this.getDopplerHwhm()" 128 }, 129 { 130 name : "Zeeman splitting", 131 dimension : "energy", 132 nspecies : 0, 133 section : "spectroscopy", 134 formula : "2*this.getZeemanSplitting()" 135 }, 136 { 137 name : "Stark FWHM", 138 dimension : "energy", 139 nspecies : 0, 140 section : "spectroscopy", 141 formula : "2*this.getStarkHwhm()" 142 }, 143 { 144 name : "QS Stark FWHM", 145 dimension : "energy", 146 nspecies : 1, 147 section : "spectroscopy", 148 formula : "2*this.getQsHwhm(%s1)" 149 }, 150 151 { 152 name : "Dynamic Stark range", 153 dimension : "energy", 154 nspecies : 1, 155 section : "spectroscopy", 156 formula : "this.getMicrofieldFrequency(%s1)/3e10/(2*Math.PI)" 157 }, 158 159 { 160 name : "Static/dynamic Stark ratio", 161 dimension : "none", 162 nspecies : 1, 163 section : "spectroscopy", 164 formula : "this.getStarkRatio(%s1)" 165 }, 166 { 167 name : "Stark quasistaticity", 168 dimension : "none", 169 nspecies : 1, 170 section : "spectroscopy", 171 formula : "this.getStarkQuasistaticity(%s1)" 172 }, 173 174 { 175 name : "Transition wavelength", 176 dimension : "length", 177 nspecies : 0, 178 section : "spectroscopy", 179 formula : "1/this.getWavenumber()" 180 }, 181 182 { 183 name : "Holtsmark field", 184 dimension : "efield", 185 nspecies : 1, 186 section : "spectroscopy", 187 formula : "%s1.getHoltsmarkField()" 188 }, 189 190 { 191 name : "Microfield frequency", 192 dimension : "frequency", 193 nspecies : 1, 194 section : "spectroscopy", 195 formula : "this.getMicrofieldFrequency(%s1)" 196 } 197 ); 198 199 200 function LymanA(n) 201 { 202 if (n <= 1) { 203 return 0; 204 } else { 205 return 8e9*256/9*n*Math.pow((n - 1)/(n + 1), 2*n)/((n*n - 1)*(n*n - 1)); 206 } 207 } 208 16 209 17 210 function NumPrint(v) … … 21 214 s = "0"; 22 215 } else 23 if (Math.abs(v) < 1.e6) { 216 if (!isFinite(v)) { 217 s = v; 218 } else 219 if (Math.abs(v) < 1.e6 && Math.abs(v) >= 0.1) { 24 220 s = sprintf("%.3f", v); 25 221 } else { … … 30 226 } 31 227 32 function changeN_e(e )33 { 34 var N_e = this.gui_N_e.getNumValue();35 36 if (isFinite(N_e)) {37 this.N_e = N_e;228 function changeN_e(ev) 229 { 230 var e = ev.getTarget(); 231 var N_e = e.getNumValue(); 232 233 if (isFinite(N_e) && this.e.setN(N_e)) { 38 234 this.updatePlasmaParameters(); 39 this.gui_N_i.setNumValue(this.N_i); 40 this.gui_N_r.setNumValue(this.N_r); 41 } 42 } 43 44 function changeZ_i(e) 45 { 46 var Z_i = parseInt(this.gui_Z_i.getValue()); 235 this.updateGUI(); 236 } 237 } 238 239 function changeT_e(ev) 240 { 241 var e = ev.getTarget(); 242 var T_e = e.getNumValue(); 243 244 if (isFinite(T_e)) { 245 this.e.setT(T_e); 246 this.i.setT(T_e); 247 this.r.setT(T_e); 248 this.updateGUI(); 249 } 250 } 251 252 function changeZ_i(ev) 253 { 254 var e = ev.getTarget(); 255 var Z_i = parseInt(e.getValue()); 47 256 48 257 if (isFinite(Z_i)) { 49 this. Z_i = Z_i;258 this.i.setQ(Z_i); 50 259 this.updatePlasmaParameters(); 51 this.gui_N_i.setNumValue(this.N_i); 52 this.gui_N_r.setNumValue(this.N_r); 53 } 54 } 55 56 function changeZ_r(e) 57 { 58 var Z_r = parseInt(this.gui_Z_r.getValue()); 260 this.updateGUI(); 261 } 262 } 263 264 function changeT_i(ev) 265 { 266 var e = ev.getTarget(); 267 var T_i = e.getNumValue(); 268 269 if (isFinite(T_i)) { 270 this.i.setT(T_i); 271 this.r.setT(T_i); 272 this.updateGUI(); 273 } 274 } 275 276 function changeZ_r(ev) 277 { 278 var e = ev.getTarget(); 279 var Z_r = parseInt(e.getValue()); 59 280 60 281 if (isFinite(Z_r)) { 61 this. Z_r = Z_r;282 this.r.setQ(Z_r); 62 283 this.updatePlasmaParameters(); 63 this. gui_N_i.setNumValue(this.N_i);64 this.gui_N_r.setNumValue(this.N_r);65 66 } 67 68 function changeP_r(e) 69 { 70 var P_r = parseInt( this.gui_P_r.getValue())/100.0;284 this.updateGUI(); 285 } 286 } 287 288 function changeP_r(ev) 289 { 290 var e = ev.getTarget(); 291 var P_r = parseInt(e.getValue())/100.0; 71 292 72 293 if (isFinite(P_r)) { 73 294 this.P_r = P_r; 74 295 this.updatePlasmaParameters(); 75 this.gui_N_i.setNumValue(this.N_i); 76 this.gui_N_r.setNumValue(this.N_r); 77 } 78 } 79 80 function changeB(e) 81 { 82 var v = this.gui_B.getNumValue(); 296 this.updateGUI(); 297 } 298 } 299 300 function changeT_r(ev) 301 { 302 var e = ev.getTarget(); 303 var T_r = e.getNumValue(); 304 305 if (isFinite(T_r)) { 306 this.r.setT(T_r); 307 this.updateGUI(); 308 } 309 } 310 311 function changeM_i(ev) 312 { 313 var e = ev.getTarget(); 314 var M_i = parseInt(e.getValue()); 315 316 if (isFinite(M_i)) { 317 this.i.setM(M_i); 318 this.updateGUI(); 319 } 320 } 321 322 function changeM_r(ev) 323 { 324 var e = ev.getTarget(); 325 var M_r = parseInt(e.getValue()); 326 327 if (isFinite(M_r)) { 328 this.r.setM(M_r); 329 this.updateGUI(); 330 } 331 } 332 333 function changeN_u(ev) 334 { 335 var e = ev.getTarget(); 336 var n_u = parseInt(e.getValue()); 337 338 this.n_u = n_u; 339 this.updateGUI(); 340 } 341 342 function changeN_l(ev) 343 { 344 var e = ev.getTarget(); 345 var n_l = parseInt(e.getValue()); 346 347 this.n_l = n_l; 348 this.updateGUI(); 349 } 350 351 function changeB(ev) 352 { 353 var e = ev.getTarget(); 354 var v = e.getNumValue(); 83 355 84 356 if (isFinite(v)) { 85 357 this.B = v; 86 358 } 359 } 360 361 function clickPropertyCB(ev) 362 { 363 var e = ev.getTarget(); 364 var entity = e.getUserData("entity"); 365 var formula; 366 if (entity.nspecies == 1) { 367 var species = e.getUserData("species"); 368 var species_str = "this." + species.id; 369 formula = entity.formula.replace(/\%s1/g, species_str); 370 } else { 371 formula = entity.formula; 372 } 373 374 var v = eval(formula); 375 this.gui_entity_value.setNumValue(v); 87 376 } 88 377 … … 102 391 members : 103 392 { 104 393 R0 : 1, // 0.3/0.7/1 ?; 394 105 395 checkPlasmaParameters : function() 106 396 { 107 if (this.N_e <= 0.0 || 108 (this.P_r < 0.0 || this.P_r > 1.0) || 397 if ((this.P_r < 0.0 || this.P_r > 1.0) || 109 398 this.Z_i < 1 || 110 399 this.P_r == 1.0 && this.Z_r == 0) { … … 122 411 } 123 412 413 var N_e = this.e.getN(); 414 var N_i, N_r; 415 124 416 if (this.P_r < 1.0) { 125 this.N_i = this.N_e*(1.0 - this.P_r)/126 (this. Z_i*(1.0 - this.P_r) + this.Z_r*this.P_r);417 N_i = N_e*(1.0 - this.P_r)/ 418 (this.i.getQ()*(1.0 - this.P_r) + this.r.getQ()*this.P_r); 127 419 128 this.N_r = this.N_i*this.P_r/(1.0 - this.P_r);420 N_r = N_i*this.P_r/(1.0 - this.P_r); 129 421 } else { 130 this.N_i = 0.0;131 this.N_r = this.N_e/this.Z_r;422 N_i = 0.0; 423 N_r = N_e/this.r.getQ(); 132 424 } 133 425 426 this.i.setN(N_i); 427 this.r.setN(N_r); 428 134 429 return true; 430 }, 431 432 updateGUI : function() 433 { 434 this.gui_N_i.setNumValue(this.i.getN()); 435 this.gui_N_r.setNumValue(this.r.getN()); 436 this.gui_T_i.setNumValue(this.i.getT()); 437 this.gui_T_r.setNumValue(this.r.getT()); 438 }, 439 440 getWavenumber : function() 441 { 442 var n_u = this.n_u; 443 var n_l = this.n_l; 444 var Z_core = this.r.getQ() + 1; 445 446 return 1.0974e5*Z_core*Z_core*(1/(n_l*n_l) - 1/(n_u*n_u)); 447 }, 448 449 getNaturalWidth : function() 450 { 451 var n_u = this.n_u; 452 var n_l = this.n_l; 453 var Z_core = this.r.getQ() + 1; 454 455 return Math.pow(Z_core, 4)* 456 (LymanA(n_u) + LymanA(n_l))/3e10/(2*Math.PI); 457 }, 458 459 getDopplerHwhm : function() 460 { 461 var v = this.r.getThermalVelocity(); 462 var nu = this.getWavenumber(); 463 464 return Math.sqrt(2*Math.log(2))*nu*v/3e10; 465 }, 466 467 getMicrofieldFrequency : function(s) 468 { 469 var r = s.getMeanDistance(); 470 var v_r = this.r.getThermalVelocity(); 471 var v_s = s.getThermalVelocity(); 472 var v = Math.sqrt(v_r*v_r + v_s*v_s); 473 474 return v/r; 475 }, 476 477 getFullDebyeLength : function(s) 478 { 479 var tmp = 0; 480 var m = s.getM(); 481 482 var sa = new Array(this.e, this.i, this.r); 483 for (var i = 0; i < 3; i++) { 484 var os = sa[i]; 485 if (os.getM() <= m) { 486 var ld = os.getDebyeLength(); 487 if (ld) { 488 tmp += 1/(ld*ld); 489 } 490 } 491 492 } 493 494 return 1/Math.sqrt(tmp); 495 }, 496 497 getPpiFactor : function(s) 498 { 499 var dl = this.getFullDebyeLength(s); 500 var r1 = s.getMeanDistance(); 501 var r; 502 if (isFinite(dl) && isFinite(r1)) { 503 r = r1/dl; 504 } else { 505 r = 0; 506 } 507 508 return (1 + r)*Math.exp(-r); 509 // return 1 - 0.6*r 510 }, 511 512 getRpiFactor : function(s) 513 { 514 // FIXME!!! 515 return 1; 516 }, 517 518 getQsHwhm : function(s) 519 { 520 var n_u = this.n_u; 521 var n_l = this.n_l; 522 var Z_core = this.r.getQ() + 1; 523 var ef = s.getHoltsmarkField(); 524 var ppi = this.getPpiFactor(s); 525 var rpi = this.getRpiFactor(s); 526 527 // 1.4385 is S_1 HWHM 528 return 1.4385*4.271417e-5*3/2*(n_u*n_u - n_l*n_l)/Z_core*ef*ppi*rpi; 529 }, 530 531 getStarkRatio : function(s) 532 { 533 var R; 534 var w_qs = this.getQsHwhm(s); 535 if (w_qs == 0) { 536 R = 0; 537 } else { 538 R = 2*w_qs/(this.getMicrofieldFrequency(s)/3e10/(2*Math.PI)); 539 } 540 541 return R; 542 }, 543 544 getStarkQuasistaticity : function(s) 545 { 546 var R = this.getStarkRatio(s); 547 return R/(R + this.R0); 548 }, 549 550 getStarkHwhm : function() 551 { 552 var w = 0; 553 554 var sa = new Array(this.e, this.i, this.r); 555 for (var i = 0; i < 3; i++) { 556 var s = sa[i]; 557 var qs = this.getQsHwhm(s); 558 var f = this.getStarkQuasistaticity(s); 559 560 w += Math.pow(f*qs, 3/2); 561 } 562 563 return Math.pow(w, 2/3); 564 }, 565 566 getZeemanSplitting : function() 567 { 568 return 0.466860*this.B; 135 569 }, 136 570 … … 151 585 152 586 // Defaults 153 this.N_e = 1e16; 154 this.Z_i = 1; 155 this.Z_r = 0; 587 588 this.r = new pf.base.Species("r", 1.0, 0, 0, 1.0, null); 589 this.e = new pf.base.Species("e", (1.0/1836.2), -1, 1e16, 1.0, this.r); 590 this.i = new pf.base.Species("i", 1.0, +1, 1e16, 1.0, this.r); 591 156 592 this.P_r = 0; 157 593 158 this.T_e = 1;159 this.T_i = 1;160 this.T_r = 1;161 162 this.M_i = 1;163 this.M_r = 1;164 165 594 this.B = 0; 595 596 this.n_u = 2; 597 this.n_l = 1; 166 598 167 599 if (this.updatePlasmaParameters() != true) { … … 169 601 } 170 602 603 604 // Top-level container 605 this.bl_top = new qx.ui.layout.VerticalBoxLayout("vertical"); 606 607 this.bl_top.addToDocument(); 608 609 610 // The toolbar 611 var tb = new qx.ui.toolbar.ToolBar; 612 this.bl_top.add(tb); 613 614 // ... and the buttons themselves 615 616 var sep = new qx.ui.toolbar.Separator; 617 tb.add(sep); 618 619 var btn = new qx.ui.toolbar.Button("About..."); 620 tb.add(btn); 621 // btn.addEventListener("execute", this.aboutCB, this); 622 623 var tf1 = new qx.ui.pageview.tabview.TabView; 624 // tf1.setSpacing(0); 625 this.bl_top.add(tf1); 626 627 this.tabbar = tf1.getBar(); 628 this.tabpane = tf1.getPane(); 629 this.tabpane.setPadding(0, 0, 0, 0); 630 this.tabpane.setBackgroundColor("white"); 631 632 633 var tab_id = new qx.ui.pageview.tabview.Button("Parameters"); 634 this.tabbar.add(tab_id); 635 var page_id = new qx.ui.pageview.tabview.Page(tab_id); 636 this.tabpane.add(page_id); 637 171 638 172 639 var fr, gl; 173 640 var l, e; 174 641 175 fr = new qx.ui.groupbox.GroupBox("Electrons"); 642 fr = new qx.ui.groupbox.GroupBox("Electrons", 643 "pf/image/e_small.png"); 176 644 fr.setDimension("auto", "auto"); 177 fr.setBackgroundColor("#ffeeee"); 178 179 fr.addToDocument(); 645 fr.setBackgroundColor("#eeeeff"); 646 647 // fr.addToDocument(); 648 page_id.add(fr); 180 649 181 650 gl = new qx.ui.layout.GridLayout; … … 194 663 l = new qx.ui.basic.Label("N<sub>e</sub> (cm<sup>-3</sup>):"); 195 664 gl.add(l, 0, 0); 196 e = new pf.ui.TextField(this. N_e);665 e = new pf.ui.TextField(this.e.getN()); 197 666 gl.add(e, 1, 0); 198 e.setLiveUpdate(true);667 // e.setLiveUpdate(true); 199 668 e.addEventListener("changeValue", changeN_e, this); 200 this.gui_N_e = e;201 669 202 670 // T_e 203 671 l = new qx.ui.basic.Label("T<sub>e</sub> (eV):"); 204 672 gl.add(l, 0, 1); 205 e = new pf.ui.TextField(this. T_e);673 e = new pf.ui.TextField(this.e.getT()); 206 674 gl.add(e, 1, 1); 207 208 209 fr = new qx.ui.groupbox.GroupBox("Ions"); 675 e.addEventListener("changeValue", changeT_e, this); 676 e.setLiveUpdate(true); 677 678 679 fr = new qx.ui.groupbox.GroupBox("Ions", 680 "pf/image/i_small.png"); 210 681 fr.setDimension("auto", "auto"); 211 fr.setBackgroundColor("#eeeeff"); 212 213 fr.addToDocument(); 682 fr.setBackgroundColor("#ffeeee"); 683 684 page_id.add(fr); 685 // fr.addToDocument(); 214 686 fr.setTop(100); 215 687 … … 231 703 l = new qx.ui.basic.Label("Z<sub>i</sub>:"); 232 704 gl.add(l, 0, 0); 233 e = new qx.ui.form.Spinner(1, this. Z_i, 100);705 e = new qx.ui.form.Spinner(1, this.i.getQ(), 100); 234 706 gl.add(e, 1, 0); 235 707 236 708 e.addEventListener("change", changeZ_i, this); 237 709 238 this.gui_Z_i = e;239 240 710 // M_i 241 711 l = new qx.ui.basic.Label("M<sub>i</sub>:"); 242 712 gl.add(l, 0, 1); 243 e = new qx.ui.form.Spinner(1, this. M_i, 200);713 e = new qx.ui.form.Spinner(1, this.i.getM(), 200); 244 714 gl.add(e, 1, 1); 245 this.gui_M_i = e;715 e.addEventListener("change", changeM_i, this); 246 716 247 717 // T_i 248 718 l = new qx.ui.basic.Label("T<sub>i</sub> (eV):"); 249 719 gl.add(l, 0, 2); 250 e = new pf.ui.TextField(this. T_i);720 e = new pf.ui.TextField(this.i.getT()); 251 721 gl.add(e, 1, 2); 722 e.addEventListener("changeValue", changeT_i, this); 723 e.setLiveUpdate(true); 724 this.gui_T_i = e; 252 725 253 726 // N_i 254 727 l = new qx.ui.basic.Label("N<sub>i</sub> (cm<sup>-3</sup>):"); 255 728 gl.add(l, 0, 3); 256 e = new pf.ui.TextField(this. N_i);729 e = new pf.ui.TextField(this.i.getN()); 257 730 gl.add(e, 1, 3); 258 731 e.setReadOnly(true); … … 260 733 261 734 262 fr = new qx.ui.groupbox.GroupBox("Radiators"); 735 fr = new qx.ui.groupbox.GroupBox("Radiators", 736 "pf/image/r_small.png"); 263 737 fr.setDimension("auto", "auto"); 264 738 fr.setBackgroundColor("#eeffee"); 265 739 266 fr.addToDocument(); 740 page_id.add(fr); 741 // fr.addToDocument(); 267 742 fr.setLeft(330); 268 743 … … 289 764 gl.add(e, 1, 0); 290 765 e.addEventListener("change", changeZ_r, this); 291 this.gui_Z_r = e;292 766 293 767 // M_r 294 768 l = new qx.ui.basic.Label("M<sub>r</sub>:"); 295 769 gl.add(l, 0, 1); 296 e = new qx.ui.form.Spinner(1, this. M_r, 200);770 e = new qx.ui.form.Spinner(1, this.r.getM(), 200); 297 771 gl.add(e, 1, 1); 298 this.gui_M_r = e;772 e.addEventListener("change", changeM_r, this); 299 773 300 774 // T_r 301 775 l = new qx.ui.basic.Label("T<sub>r</sub> (eV):"); 302 776 gl.add(l, 0, 2); 303 e = new pf.ui.TextField(this. T_r);777 e = new pf.ui.TextField(this.r.getT()); 304 778 gl.add(e, 1, 2); 779 e.addEventListener("changeValue", changeT_r, this); 780 this.gui_T_r = e; 305 781 306 782 // P_r … … 310 786 gl.add(e, 1, 3); 311 787 e.addEventListener("change", changeP_r, this); 312 this.gui_P_r = e;313 788 314 789 // N_r 315 790 l = new qx.ui.basic.Label("N<sub>r</sub> (cm<sup>-3</sup>):"); 316 791 gl.add(l, 0, 4); 317 e = new pf.ui.TextField(this. N_r);792 e = new pf.ui.TextField(this.r.getN()); 318 793 e.setReadOnly(true); 319 794 gl.add(e, 1, 4); … … 325 800 fr.setBackgroundColor("#ffffdd"); 326 801 327 fr.addToDocument(); 802 page_id.add(fr); 803 // fr.addToDocument(); 328 804 329 805 gl = new qx.ui.layout.GridLayout; … … 337 813 338 814 fr.add(gl); 339 340 fr.setLeft(330); 341 fr.setTop(202); 815 fr.setTop(268); 816 342 817 343 818 l = new qx.ui.basic.Label("B (T):"); … … 345 820 e = new pf.ui.TextField(this.B); 346 821 gl.add(e, 1, 0); 347 e.setLiveUpdate(true);822 // e.setLiveUpdate(true); 348 823 e.addEventListener("changeValue", changeB, this); 349 this.gui_B = e; 824 825 // 826 fr = new qx.ui.groupbox.GroupBox("Atomic system", 827 "pf/image/all_small.png"); 828 fr.setDimension("auto", "auto"); 829 fr.setBackgroundColor("#ffffdd"); 830 831 page_id.add(fr); 832 // fr.addToDocument(); 833 834 gl = new qx.ui.layout.GridLayout; 835 gl.setVerticalSpacing(4); 836 gl.setHorizontalSpacing(6); 837 gl.setColumnCount(2); 838 gl.setColumnWidth(0, 100); 839 gl.setColumnWidth(1, 200); 840 gl.setRowCount(2); 841 gl.setRowHeight(0, 30); 842 gl.setRowHeight(1, 30); 843 844 fr.add(gl); 845 fr.setLeft(330); 846 fr.setTop(202); 847 848 l = new qx.ui.basic.Label("n<sub>u</sub>:"); 849 gl.add(l, 0, 0); 850 e = new qx.ui.form.Spinner(2, this.n_u, 100); 851 gl.add(e, 1, 0); 852 e.addEventListener("change", changeN_u, this); 853 854 l = new qx.ui.basic.Label("n<sub>l</sub>:"); 855 gl.add(l, 0, 1); 856 e = new qx.ui.form.Spinner(1, this.n_l, 100); 857 gl.add(e, 1, 1); 858 e.addEventListener("change", changeN_l, this); 859 860 tab_id.setChecked(true); 861 862 863 var tab_id = new qx.ui.pageview.tabview.Button("Explorer"); 864 this.tabbar.add(tab_id); 865 var page_id = new qx.ui.pageview.tabview.Page(tab_id); 866 this.tabpane.add(page_id); 867 page_id.setDimension(600, 400); 868 page_id.setBackgroundColor("black"); 869 870 var sp = new qx.ui.splitpane.HorizontalSplitPane(200, "1*"); 871 sp.set( 872 { 873 left : 5, 874 right : 5, 875 top : 5, 876 bottom : 5, 877 border : "inset-thin", 878 backgroundColor : "white", 879 showKnob : true 880 }); 881 882 var fff = new qx.ui.layout.CanvasLayout(); 883 fff.set( 884 { 885 width: 600, 886 height: 400 887 }); 888 889 page_id.add(fff); 890 fff.add(sp); 891 892 var left_pane = sp.getLeftArea(); 893 left_pane.setPaddingRight(4); 894 var right_pane = sp.getRightArea(); 895 right_pane.setPaddingLeft(4); 896 var tree = new qx.ui.tree.Tree("Browser"); 897 tree.set( 898 { 899 top : 4, 900 left : 4, 901 bottom : 4, 902 backgroundColor : "white", 903 border : "inset-thin", 904 overflow : "scroll", 905 height : "100%", 906 width : "100%", 907 paddingLeft : 4, 908 paddingTop : 4 909 }); 910 left_pane.add(tree); 911 912 folder = new qx.ui.tree.TreeFolder("Frequencies"); 913 tree.add(folder); 914 this.gui_folder_freq = folder; 915 916 var folder = new qx.ui.tree.TreeFolder("Lengths"); 917 tree.add(folder); 918 this.gui_folder_length = folder; 919 920 var folder = new qx.ui.tree.TreeFolder("Velocities"); 921 tree.add(folder); 922 this.gui_folder_vel = folder; 923 924 folder = new qx.ui.tree.TreeFolder("Dimensionless"); 925 tree.add(folder); 926 this.gui_folder_none = folder; 927 928 folder = new qx.ui.tree.TreeFolder("Energies"); 929 tree.add(folder); 930 this.gui_folder_energy = folder; 931 932 folder = new qx.ui.tree.TreeFolder("Miscellaneous"); 933 tree.add(folder); 934 this.gui_folder_misc = folder; 935 936 var i, n = plasma_entities.length; 937 var sa = new Array(this.e, this.i, this.r); 938 for (var i = 0; i < n; i++) { 939 var entity = plasma_entities[i]; 940 var folder; 941 switch (entity.dimension) { 942 case "frequency": 943 folder = this.gui_folder_freq; 944 break; 945 case "length": 946 folder = this.gui_folder_length; 947 break; 948 case "velocity": 949 folder = this.gui_folder_vel; 950 break; 951 case "energy": 952 folder = this.gui_folder_energy; 953 break; 954 case "none": 955 folder = this.gui_folder_none; 956 break; 957 default: 958 folder = this.gui_folder_misc; 959 break; 960 } 961 962 var leaf; 963 964 switch (entity.nspecies) { 965 case 1: 966 for (var j = 0; j < 3; j++) { 967 var s = sa[j]; 968 var icon = "pf/image/" + s.id + "_small.png"; 969 970 leaf = new qx.ui.tree.TreeFile(entity.name, icon); 971 leaf.addEventListener("click", clickPropertyCB, this); 972 leaf.setUserData("entity", entity); 973 leaf.setUserData("species", s); 974 975 folder.add(leaf); 976 } 977 break; 978 default: 979 leaf = new qx.ui.tree.TreeFile(entity.name, 980 "pf/image/all_small.png"); 981 leaf.addEventListener("click", clickPropertyCB, this); 982 leaf.setUserData("entity", entity); 983 folder.add(leaf); 984 break; 985 } 986 } 987 tree.setHideNode(true); 988 tree.setRootOpenClose(true); 989 990 991 gl = new qx.ui.layout.GridLayout; 992 gl.set( 993 { 994 left: 4, 995 right: 4, 996 top: 4 997 }); 998 999 gl.setVerticalSpacing(4); 1000 gl.setHorizontalSpacing(6); 1001 gl.setColumnCount(2); 1002 gl.setColumnWidth(0, "30%"); 1003 gl.setColumnWidth(1, "65%"); 1004 gl.setRowCount(3); 1005 gl.setRowHeight(0, 30); 1006 gl.setRowHeight(1, 30); 1007 gl.setRowHeight(2, 30); 1008 1009 1010 l = new qx.ui.basic.Label("Value:"); 1011 gl.add(l, 0, 0); 1012 e = new pf.ui.TextField(""); 1013 e.setReadOnly(true); 1014 gl.add(e, 1, 0); 1015 this.gui_entity_value = e; 1016 1017 right_pane.add(gl); 350 1018 351 1019 },
Note: See TracChangeset
for help on using the changeset viewer.