Ignore:
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • .hgtags

    r326 r333  
    77b47c44506c830cd63d62d77300daa714fdf80fee hg_start
    88e62158696bc29ddd771699760c58742568b25688 pf-0.9.1
    9 b2ed9015dfb7c96fd5566f0ff62c0afcfba63299 Makefile
    10 5de30e5cfcc2d03adc6c6350ffd94a114af4e807 Makefilea
    11 5de30e5cfcc2d03adc6c6350ffd94a114af4e807 Makefilea
    12 0000000000000000000000000000000000000000 Makefilea
    13 0000000000000000000000000000000000000000 Makefilea
    14 0000000000000000000000000000000000000000 Makefilea
    15 b2ed9015dfb7c96fd5566f0ff62c0afcfba63299 Makefile
    16 0000000000000000000000000000000000000000 Makefile
    17 0000000000000000000000000000000000000000 Makefile
    18 0000000000000000000000000000000000000000 Makefile
    199c038d471343d129210a47183df19fd5482254d96 pf-0.9.3
    20106a5437ba9e4db5924d84f3e162e1b6ca8a17666c qx-1.5.1
    21 5045634f136c9761cd5d84ed0ec82bc926c4613c qx-1_0_2
    22 0000000000000000000000000000000000000000 qx-1_0_2
    23 b9efbf5ce6d35d35b93f0da6ff4bce144d42ba0a qx-1_1_1
    24 0000000000000000000000000000000000000000 qx-1_1_1
    25 89f0b2d9b6e22306e8f4563c51218659429a9b57 qx-1_3_1
    26 0000000000000000000000000000000000000000 qx-1_3_1
    27 822641d9288c0f8b623411e0419f1bc33b868a09 qx-1_2
    28 0000000000000000000000000000000000000000 qx-1_2
     1138122f4e5fa6733e2c6cad853e6a1aeedb908ef6 qx-2.0.1
  • config.json

    r309 r315  
    3232  {
    3333    "APPLICATION"  : "pf",
    34     "QOOXDOO_PATH" : "/usr/local/share/qooxdoo/1.6.1",
     34    "QOOXDOO_PATH" : "/usr/local/share/qooxdoo/2.0.1",
    3535    "QXTHEME"      : "pf.theme.Modern",
    3636    "API_EXCLUDE"  : ["qx.test.*", "${APPLICATION}.theme.*"],
    37     "OPTIMIZE"     : ["basecalls", "privates"],
     37    "OPTIMIZE"     : ["basecalls", "privates", "whitespace", "comments"],
    3838    "LOCALES"      : [ "en" ],
    3939    "CACHE"        : "${TMPDIR}/cache",
  • source/class/pf/Application.js

    r327 r333  
    24752475        createSaveLoadDialog : function()
    24762476        {
    2477             var w, rc1, e, btn;
     2477            var w, layout, rc1, e, btn;
    24782478            // "Save as..." dialog
    24792479            w = new pf.ui.DialogWindow();
     
    24902490            var btn_rename = new qx.ui.toolbar.Button("Rename",
    24912491                "pf/image/rename.png");
     2492            var btn_export = new qx.ui.toolbar.Button("Export",
     2493                "pf/image/export.png");
     2494            var btn_import = new qx.ui.toolbar.Button("Import",
     2495                "pf/image/import.png");
    24922496            btn_delete.setEnabled(false);
    24932497            btn_rename.setEnabled(false);
     2498            btn_export.setEnabled(false);
    24942499            tbpart.add(btn_delete);
    24952500            tbpart.add(btn_rename);
     2501            tbpart.add(new qx.ui.toolbar.Separator());
     2502            tbpart.add(btn_export);
     2503            tbpart.add(btn_import);
    24962504            tb.add(tbpart);
    24972505            w.add(tb);
     
    25252533            var sm = lv.getSelectionModel();
    25262534            sm.setSelectionMode(qx.ui.table.selection.Model.SINGLE_SELECTION);
     2535           
     2536            // Export/import window
     2537            var eiw = new pf.ui.DialogWindow();
     2538            eiw.set({
     2539                width:  350,
     2540                height: 400
     2541            });
     2542            eiw.setResizable(true);
     2543            eiw.setLayout(new qx.ui.layout.VBox(0));
     2544            eiw.setContentPadding(0);
     2545           
     2546            var note = new qx.ui.basic.Label("Label", {height: 20});
     2547            eiw.add(note);
     2548               
     2549            var text_area = new qx.ui.form.TextArea();
     2550            text_area.setWrap(true);
     2551            eiw.add(text_area, {flex: 1});
     2552
     2553
     2554            layout = new qx.ui.layout.HBox(10, "right");
     2555            rc1 = new qx.ui.container.Composite(layout);
     2556            rc1.setMargin(10, 10, 10, 10);
     2557            eiw.add(rc1);
     2558
     2559            btn = new qx.ui.form.Button("Cancel", "pf/image/cancel.png");
     2560            btn.addListener("execute", function(ev) {
     2561                    eiw.close();
     2562                }, this);
     2563            rc1.add(btn);
     2564
     2565            btn = new qx.ui.form.Button("OK", "pf/image/ok.png");
     2566            btn.addListener("execute", function(ev) {
     2567                    var type = eiw.getUserData("type");
     2568                    if (type == "import") {
     2569                        var configstr = text_area.getValue();
     2570                       
     2571                        var config;
     2572                        try {
     2573                            config = qx.lang.Json.parse(configstr);
     2574                        } catch (err) {
     2575                            this.error(err);
     2576                        }
     2577
     2578                        if (config) {
     2579                            var name = config.name;
     2580                           
     2581                            var d = new Date();
     2582                            var time = d.getTime();
     2583           
     2584                            var configPtr = new Object;
     2585                            configPtr.name = name;
     2586                            configPtr.hash = time;
     2587                            configPtr.time = time;
     2588                           
     2589                            this.prefs.configPtrs.push(configPtr);
     2590                           
     2591                            var cookie_name = "pf_config_" + configPtr.hash;
     2592                            qx.bom.Cookie.set(cookie_name, configstr, 3650);
     2593                           
     2594                            this.savePreferences();
     2595                            this.updateSaveLoadList();
     2596                           
     2597                            eiw.close();
     2598                        } else {
     2599                            this.msgWindow.error("Cannot parse the configuration!");
     2600                        }
     2601                    } else {
     2602                        eiw.close();
     2603                    }
     2604                }, this);
     2605            rc1.add(btn);
     2606           
     2607            this.doc.add(eiw);
    25272608
    25282609            btn_delete.addListener("execute", function(ev) {
     
    25512632                        var name = rowData[0];
    25522633                       
    2553                        
    25542634                        this.promptDialog.prompt("Rename \"" + name + "\" to",
    25552635                            name, function(newname) {
     
    25672647                }, this);
    25682648
     2649            btn_export.addListener("execute", function(ev) {
     2650                    if (!sm.isSelectionEmpty()) {
     2651                        var index = sm.getLeadSelectionIndex();
     2652                        var rowData = tm.getRowData(index);
     2653                        var name = rowData[0];
     2654                       
     2655                        var configPtr = this.getConfig(name);
     2656                        if (!configPtr) {
     2657                            return false;
     2658                        }
     2659
     2660                        var cookie_name = "pf_config_" + configPtr.hash;
     2661
     2662                        var configstr = qx.bom.Cookie.get(cookie_name);
     2663                        if (!configstr) {
     2664                            return false;
     2665                        }
     2666
     2667                        var config = qx.lang.Json.parse(configstr);
     2668                        config.name = name;
     2669
     2670                        text_area.setValue(
     2671                            qx.lang.Json.stringify(config, undefined, 4));
     2672                       
     2673                        eiw.setCaption("Export configuration")
     2674                        eiw.setIcon("pf/image/export.png");
     2675                        eiw.setUserData("type", "export");
     2676                       
     2677                        text_area.setReadOnly(true);
     2678                       
     2679                        var nstr =
     2680                            "Copy the contents below to a text editor and save";
     2681                        note.setValue(nstr);
     2682                       
     2683                        eiw.open();
     2684                    }
     2685                }, this);
     2686
     2687            btn_import.addListener("execute", function(ev) {
     2688                    eiw.setCaption("Import configuration")
     2689                    eiw.setIcon("pf/image/import.png");
     2690                    eiw.setUserData("type", "import");
     2691
     2692                    text_area.setReadOnly(false);
     2693                    text_area.setValue("");
     2694
     2695                    var nstr =
     2696                        "Copy a previously saved config to the space below";
     2697                    note.setValue(nstr);
     2698
     2699                    eiw.open();
     2700                }, this);
     2701
    25692702            e = new qx.ui.form.TextField();
    25702703            e.setMarginTop(1);
     
    25772710                        btn_delete.setEnabled(false);
    25782711                        btn_rename.setEnabled(false);
     2712                        btn_export.setEnabled(false);
    25792713                    } else {
    25802714                        var index = sm.getLeadSelectionIndex();
     
    25832717                        btn_rename.setEnabled(true);
    25842718                        btn_delete.setEnabled(true);
     2719                        btn_export.setEnabled(true);
    25852720                    }
    25862721                });
    25872722           
    2588             var layout = new qx.ui.layout.HBox(10, "right");
     2723            layout = new qx.ui.layout.HBox(10, "right");
    25892724            rc1 = new qx.ui.container.Composite(layout);
    25902725            rc1.setMargin(10, 10, 10, 10);
     
    27482883            var btn3 = new qx.ui.form.RadioButton("Simple");
    27492884            btn3.setModel("simple");
     2885            var btn4 = new qx.ui.form.RadioButton("Indigo");
     2886            btn4.setModel("indigo");
    27502887           
    27512888            fr.add(btn1);
    27522889            fr.add(btn2);
    27532890            fr.add(btn3);
    2754            
    2755             var rm = new qx.ui.form.RadioGroup(btn1, btn2, btn3);
     2891            fr.add(btn4);
     2892           
     2893            var rm = new qx.ui.form.RadioGroup(btn1, btn2, btn3, btn4);
    27562894            var sels;
    27572895            switch (this.prefs.themeName) {
     
    27612899            case "simple":
    27622900                sels = new Array(btn3);
     2901                break;
     2902            case "indigo":
     2903                sels = new Array(btn4);
    27632904                break;
    27642905            default:
     
    27872928                theme = qx.theme.Simple;
    27882929                break;
     2930            case "indigo":
     2931                theme = qx.theme.Indigo;
     2932                break;
    27892933            default:
    27902934                theme = pf.theme.Modern;
     
    28482992            this.bl_top = new qx.ui.container.Composite(layout);
    28492993
    2850             this.doc.add(this.bl_top, {width :'100%', height: "100%"});
     2994            this.doc.add(this.bl_top, {width :"100%", height: "100%"});
    28512995
    28522996            // The menubar
  • source/class/pf/Plasma.js

    r305 r317  
    259259        },
    260260       
     261        getFermiVelocity: function()
     262        {
     263            return Math.sqrt(2*this.getFermiEnergy());
     264        },
     265       
     266        getFermiLength: function()
     267        {
     268            var n_e = this.e.getN();
     269            var E_F = this.getFermiEnergy();
     270            return Math.sqrt(E_F/(6*Math.PI*n_e));
     271        },
     272       
    261273        getAlfvenVelocity: function()
    262274        {
     
    331343                   this.i.getMassDensity() +
    332344                   this.r.getMassDensity();
     345        },
     346       
     347        // griem:1997a, Eq (7.75)
     348        getLteNe: function()
     349        {
     350            var Z_core = this.r.getZcore();
     351            var E12 = 3.0/8.0*Z_core*Z_core;
     352            return 5/Math.sqrt(Math.PI)*pf.base.Bohr.alpha3*
     353                Math.pow(E12, 3)*Math.sqrt(2*this.e.getT());
     354        },
     355       
     356        dE2dWl: function(dE)
     357        {
     358            var E = this.r.getTransitionEnergy();
     359            return (2*Math.PI)*pf.base.Bohr.c*dE/(E*E);
    333360        },
    334361
  • source/entities.js

    r308 r318  
    136136    },
    137137    {
     138        id        : "natural_linewidth_wl",
     139        name      : "Natural linewidth (wl)",
     140        dimension : "length",
     141        nspecies  : 0,
     142        section   : "spectroscopy",
     143        formula   : "this.plasma.dE2dWl(this.plasma.r.getNaturalWidth())"
     144    },
     145    {
    138146        id        : "Fine_structure",
    139147        name      : "Fine structure",
     
    145153    },
    146154    {
     155        id        : "Fine_structure_wl",
     156        name      : "Fine structure (wl)",
     157        dimension : "length",
     158        nspecies  : 0,
     159        section   : "spectroscopy",
     160        formula   : "this.plasma.dE2dWl(this.plasma.r.getFineStructure())",
     161        wikiLink  : "Fine_structure"
     162    },
     163    {
    147164        id        : "doppler_fwhm",
    148165        name      : "Doppler FWHM",
     
    154171    },
    155172    {
     173        id        : "doppler_fwhm_wl",
     174        name      : "Doppler FWHM (wl)",
     175        dimension : "length",
     176        nspecies  : 0,
     177        section   : "spectroscopy",
     178        formula   : "this.plasma.dE2dWl(2*this.plasma.r.getDopplerHwhm())",
     179        wikiLink  : "Doppler_broadening"
     180    },
     181    {
    156182        id        : "zeeman_splitting",
    157183        name      : "Zeeman splitting",
     
    162188    },
    163189    {
     190        id        : "zeeman_splitting_wl",
     191        name      : "Zeeman splitting (wl)",
     192        dimension : "length",
     193        nspecies  : 0,
     194        section   : "spectroscopy",
     195        formula   : "this.plasma.dE2dWl(2*this.plasma.getZeemanSplitting())"
     196    },
     197    {
    164198        id        : "total_stark_fwhm",
    165199        name      : "Total Stark FWHM",
     
    170204    },
    171205    {
     206        id        : "total_stark_fwhm_wl",
     207        name      : "Total Stark FWHM (wl)",
     208        dimension : "length",
     209        nspecies  : 0,
     210        section   : "spectroscopy",
     211        formula   : "this.plasma.dE2dWl(2*this.plasma.getStarkHwhm())"
     212    },
     213    {
    172214        id        : "stark_fwhm",
    173215        name      : "Stark FWHM",
     
    223265        formula   : "this.plasma.getFermiEnergy()",
    224266        wikiLink  : "Fermi_energy"
     267    },
     268    {
     269        id        : "fermi_velocity",
     270        name      : "Fermi velocity",
     271        dimension : "velocity",
     272        nspecies  : 0,
     273        section   : "fundamental",
     274        formula   : "this.plasma.getFermiVelocity()",
     275        wikiLink  : "Fermi_velocity"
     276    },
     277    {
     278        id        : "fermi_length",
     279        name      : "Fermi screening length",
     280        dimension : "length",
     281        nspecies  : 0,
     282        section   : "fundamental",
     283        formula   : "this.plasma.getFermiLength()",
     284        wikiLink  : "Electric-field_screening"
    225285    },
    226286    {
     
    296356        section   : "spectroscopy",
    297357        formula   : "this.plasma.r.getEinsteinA()",
     358        wikiLink  : "Einstein_coefficients"
     359    },
     360
     361    {
     362        id        : "LTE_parameter",
     363        name      : "LTE parameter",
     364        dimension : "none",
     365        nspecies  : 0,
     366        section   : "spectroscopy",
     367        formula   : "this.plasma.e.getN()/this.plasma.getLteNe()",
    298368        wikiLink  : "Einstein_coefficients"
    299369    },
Note: See TracChangeset for help on using the changeset viewer.