Ignore:
Timestamp:
Jun 24, 2013 4:29:54 PM (10 years ago)
Author:
srkline
Message:

Changes to panels so that they fit on a low-resolution laptop screen (Nx768).

  • Auto Fit
  • Event Mode
  • All polarization panels

In addition, Functionality was added to the event mode processing to (better) handle large files. Files can be split and either added as slices (if oscillatory) or decimated (if stream). The "tweaking" of the data stream is also a little bit more automated now, using some intelligent locating of the time steps and an overlay of the derivative.

Corrected a few bugs in file handling on the polarization panels in cases where the user canceled out of a file dialog.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization/Pol_FlipperPanel.ipf

    r867 r915  
    4040                DrawFlipperPanel() 
    4141        endif 
     42        // be sure that the panel is onscreen 
     43        DoIgorMenu "Control","Retrieve Window" 
    4244end 
    4345 
     
    6264         
    6365        PauseUpdate; Silent 1           // building window... 
    64         NewPanel /W=(1023,44,1832,526)/N=FlipperPanel/K=1 as "Flipper and Supermirror" 
     66        NewPanel /W=(250,44,1056,480)/N=FlipperPanel/K=1 as "Flipper and Supermirror" 
    6567        ModifyPanel cbRGB=(1,52428,26586) 
    6668         
    67         PopupMenu popup_0,pos={32,18},size={49,20},title="Field Condition",proc=FlipperPanelPopMenuProc 
     69        PopupMenu popup_0,pos={13,8},size={49,20},title="Field Condition",proc=FlipperPanelPopMenuProc 
    6870        PopupMenu popup_0,mode=1,value= #"D_ConditionNameList()" 
    6971         
    70         Button button_0,pos={42,310},size={100,20},proc=FlipperAverageButtonProc,title="Do Average" 
    71          
    72         GroupBox group_0,pos={39,350},size={335,103},title="AVERAGED RESULTS",fSize=10 
     72        Button button_0,pos={18,288},size={100,20},proc=FlipperAverageButtonProc,title="Do Average" 
     73         
     74        GroupBox group_0,pos={18,316},size={290,102},title="AVERAGED RESULTS",fSize=10 
    7375        GroupBox group_0,fStyle=1 
    74         SetVariable setvar_0,pos={49,385},size={250,15},title="Sam_depol*Psm*Pf" 
     76        SetVariable setvar_0,pos={33,351},size={250,15},title="Sam_depol*Psm*Pf" 
    7577        SetVariable setvar_0,fStyle=1 
    7678        SetVariable setvar_0,limits={0,0,0},value= root:Packages:NIST:Polarization:Cells:gPsmPf 
    77         SetVariable setvar_1,pos={49,417},size={250,15},title="Sam_depol*Psm",fStyle=1 
     79        SetVariable setvar_1,pos={33,383},size={250,15},title="Sam_depol*Psm",fStyle=1 
    7880        SetVariable setvar_1,limits={0,0,0},value= root:Packages:NIST:Polarization:Cells:gPsm 
    7981//      SetVariable setvar_2,pos={560,518},size={200,13},title="Gamma (h)",fStyle=1 
     
    8486         
    8587 
    86         Button button_1,pos={320,17},size={120,20},proc=AddFlipperConditionButton,title="Add Condition" 
    87         Button button_2,pos={403,295},size={110,20},proc=ClearAllFlipperWavesButton,title="Clear Table" 
    88         Button button_3,pos={183,310},size={120,20},proc=ShowFlipperCalcButton,title="Show Calc" 
    89         Button button_4,pos={540,295},size={110,20},proc=ClearFlipperRowButton,title="Clear Row" 
    90         Button button_5,pos={620,18},size={30,20},proc=FlipperHelpParButtonProc,title="?" 
    91         Button button_6,pos={488,418},size={100,20},proc=WindowSnapshotButton,title="Snapshot" 
    92         Button button_7,pos={488,380},size={130,20},proc=ManualEnterPfPsmButton,title="Manual Entry" 
    93  
     88        Button button_1,pos={322,8},size={120,20},proc=AddFlipperConditionButton,title="Add Condition" 
     89        Button button_2,pos={482,323},size={110,20},proc=ClearAllFlipperWavesButton,title="Clear Table" 
     90        Button button_3,pos={330,288},size={110,20},proc=ShowFlipperCalcButton,title="Show Calc" 
     91        Button button_4,pos={482,288},size={110,20},proc=ClearFlipperRowButton,title="Clear Row" 
     92        Button button_5,pos={759,8},size={30,20},proc=FlipperHelpParButtonProc,title="?" 
     93        Button button_6,pos={328,358},size={110,20},proc=WindowSnapshotButton,title="Snapshot" 
     94        Button button_7,pos={331,323},size={110,20},proc=ManualEnterPfPsmButton,title="Manual Entry" 
     95 
     96        Button button_8,pos={615,288},size={110,20},proc=SaveFlipperPanelButton,title="Save State" 
     97        Button button_9,pos={615,323},size={110,20},proc=RestoreFlipperPanelButton,title="Restore State" 
     98         
    9499        // table 
    95         Edit/W=(14,55,794,275)/HOST=#  
     100        Edit/W=(14,40,794,275)/HOST=#  
    96101        ModifyTable format=1,width=0 
    97102        RenameWindow #,T0 
     
    101106        return(0) 
    102107End 
     108 
     109Function SaveFlipperPanelButton(ba) : ButtonControl 
     110        STRUCT WMButtonAction &ba 
     111 
     112        switch( ba.eventCode ) 
     113                case 2: // mouse up 
     114                        // click code here 
     115                        SaveFlipperTable() 
     116                        break 
     117                case -1: // control being killed 
     118                        break 
     119        endswitch 
     120 
     121        return 0 
     122End 
     123 
     124Function RestoreFlipperPanelButton(ba) : ButtonControl 
     125        STRUCT WMButtonAction &ba 
     126 
     127        switch( ba.eventCode ) 
     128                case 2: // mouse up 
     129                        // click code here 
     130                        RestoreFlipperTable() 
     131                        break 
     132                case -1: // control being killed 
     133                        break 
     134        endswitch 
     135 
     136        return 0 
     137End 
     138 
    103139 
    104140// now, this does not depend on the cell, just the condition 
     
    11171153         
    11181154        Variable refnum 
    1119         String fname="CellParamSaveState.itx" 
     1155        String fname="CellParamSaveState" 
    11201156//      WAVE w=root:testMat 
    11211157        WAVE/T cellName=root:Packages:NIST:Polarization:Cells:CellName 
     
    11261162        WAVE err_mu=root:Packages:NIST:Polarization:Cells:err_mu 
    11271163         
    1128         Open/P=home refnum      //as fname              // creates a new file, or overwrites the existing file   
     1164        // get the full path to the new file name before creating it 
     1165        fname = DoSaveFileDialog("Save the Cell Table",fname=fname,suffix=".itx") 
     1166        If(cmpstr(fname,"")==0) 
     1167                //user cancel, don't write out a file 
     1168                Close/A 
     1169                Abort "no data file was written" 
     1170        Endif 
     1171         
     1172        Open/P=home refnum      as fname                // creates a new file, or overwrites the existing file   
     1173         
    11291174        fprintf refNum,"IGOR\r" 
    11301175         
     
    11791224        Variable num,ii,refnum 
    11801225         
    1181         fname = "CellDecayPanelSaveState.itx" 
     1226        fname = "CellDecayPanelSaveState" 
    11821227         
    11831228        // get a list of the Decay waves 
     
    11861231//      print listStr 
    11871232 
    1188         Open/P=home refnum      // as fname             // creates a new file, or overwrites the existing file   
     1233        // get the full path to the new file name before creating it 
     1234        fname = DoSaveFileDialog("Save the Cell Decay Table",fname=fname,suffix=".itx") 
     1235        If(cmpstr(fname,"")==0) 
     1236                //user cancel, don't write out a file 
     1237                Close/A 
     1238                Abort "no data file was written" 
     1239        Endif 
     1240 
     1241        Open/P=home refnum as fname             // creates a new file, or overwrites the existing file   
    11891242        fprintf refNum,"IGOR\r" 
    11901243                         
     
    12841337        Variable num,ii,refnum 
    12851338         
    1286         fname = "FlipperPanelSaveState.itx" 
     1339        fname = "FlipperPanelSaveState" 
    12871340         
    12881341        // get a list of the "Condition" waves 
     
    12911344//      print listStr 
    12921345 
     1346        // get the full path to the new file name before creating it 
     1347        fname = DoSaveFileDialog("Save the Flipper State Table",fname=fname,suffix=".itx") 
     1348        If(cmpstr(fname,"")==0) 
     1349                //user cancel, don't write out a file 
     1350                Close/A 
     1351                Abort "no data file was written" 
     1352        Endif 
     1353         
    12931354        Open/P=home refnum      // as fname             // creates a new file, or overwrites the existing file   
    12941355        fprintf refNum,"IGOR\r" 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization/Pol_PolarizationCorrection.ipf

    r867 r915  
    8282                restore=Initialize_PolCorPanel() 
    8383                PolCor_Panel() 
     84                 
     85                // be sure that the panel is onscreen 
     86                DoIgorMenu "Control","Retrieve Window" 
     87         
    8488                SetWindow PolCor_Panel hook(kill)=PolCorPanelHook               //to save the state when panel is killed 
    8589                //disable the controls on other tabs 
     
    131135        Variable num,ii,refnum 
    132136         
    133         fname = "PolCorPanelSaveState.itx" 
     137        fname = "PolCorPanelSaveState" 
    134138         
    135139        // get a list of the List waves 
     
    138142//      print listStr 
    139143 
     144 
     145        // get the full path to the new file name before creating it 
     146        fname = DoSaveFileDialog("Save the Pol_Cor Panel State",fname=fname,suffix=".itx") 
     147        If(cmpstr(fname,"")==0) 
     148                //user cancel, don't write out a file 
     149                Close/A 
     150                Abort "no data file was written" 
     151        Endif 
     152         
     153         
    140154        Open/P=home refnum// as fname           // creates a new file, or overwrites the existing file   
    141155        fprintf refNum,"IGOR\r" 
     
    327341Window PolCor_Panel() 
    328342        PauseUpdate; Silent 1           // building window... 
    329         NewPanel /W=(925,44,1662,800) /K=1 
     343        NewPanel /W=(300,44,1036,624) /K=1 as "Polarization Correction" 
    330344        ModifyPanel cbRGB=(64349,63913,44660) 
    331345//      ShowTools/A 
    332346        SetDrawEnv linethick= 2.00 
    333         DrawLine 10,510,600,510 
    334  
    335         TabControl PolCorTab,pos={15,27},size={708,401},proc=PolCorTabProc 
     347        DrawLine 11,427,696,427 
     348 
     349        TabControl PolCorTab,pos={15,20},size={515,360},proc=PolCorTabProc 
    336350        TabControl PolCorTab,tabLabel(0)="SAM",tabLabel(1)="EMP",tabLabel(2)="BGD" 
    337351        TabControl PolCorTab,value= 0 
    338352         
    339353        // always visible 
    340         Button button0,pos={26,445},size={80,20},proc=LoadRawPolarizedButton,title="Load ..." 
    341         Button button1,pos={26,473},size={130,20},proc=PolCorButton,title="Pol Correct Data" 
    342         Button button2,pos={222,445},size={130,20},proc=ShowPolMatrixButton,title="Show Coef Matrix" 
    343         Button button3,pos={222,473},size={160,20},proc=ChangeDisplayedPolData,title="Change Displayed Data" 
    344         Button button4,pos={620,18},size={30,20},proc=PolCorHelpParButtonProc,title="?" 
    345         Button button12,pos={440,473},size={120,20},proc=Display4XSButton,title="Display 4 XS" 
    346         Button button13,pos={440,446},size={120,20},proc=ClearPolCorEntries,title="Clear Entries" 
    347  
    348  
    349  
    350         TitleBox title0,pos={100,66},size={24,24},title="\\f01UU or + +",fSize=12 
    351         TitleBox title1,pos={430,66},size={24,24},title="\\f01DU or - +",fSize=12 
    352         TitleBox title2,pos={100,250},size={25,24},title="\\f01DD or - -",fSize=12 
    353         TitleBox title3,pos={430,250},size={24,24},title="\\f01UD or + -",fSize=12 
     354        Button button0,pos={23,396},size={80,20},proc=LoadRawPolarizedButton,title="Load ..." 
     355        Button button1,pos={136,397},size={130,20},proc=PolCorButton,title="Pol Correct Data" 
     356        Button button2,pos={546,92},size={130,20},proc=ShowPolMatrixButton,title="Show Coef Matrix" 
     357        Button button3,pos={546,151},size={160,20},proc=ChangeDisplayedPolData,title="Change Display Data" 
     358        Button button4,pos={503,9},size={30,20},proc=PolCorHelpParButtonProc,title="?" 
     359        Button button12,pos={546,121},size={120,20},proc=Display4XSButton,title="Display 4 XS" 
     360        Button button13,pos={360,9},size={110,20},proc=ClearPolCorEntries,title="Clear Entries" 
     361 
     362 
     363        TitleBox title0,pos={100,48},size={24,24},title="\\f01UU or + +",fSize=12 
     364        TitleBox title1,pos={380,48},size={24,24},title="\\f01DU or - +",fSize=12 
     365        TitleBox title2,pos={100,210},size={25,24},title="\\f01DD or - -",fSize=12 
     366        TitleBox title3,pos={380,210},size={24,24},title="\\f01UD or + -",fSize=12 
    354367         
    355368        // bits to set up reduction protocol 
    356         Button button5,pos={126,560},size={100,20},proc=PickDIVButton,title="set DIV file" 
     369        Button button5,pos={129,458},size={100,20},proc=PickDIVButton,title="set DIV file" 
    357370        Button button5,help={"This button will set the file selected in the File Catalog table to be the sensitivity file."} 
    358         Button button6,pos={126,590},size={100,20},proc=PickMASKButton,title="set MASK file" 
     371        Button button6,pos={129,482},size={100,20},proc=PickMASKButton,title="set MASK file" 
    359372        Button button6,help={"This button will set the file selected in the File Catalog table to be the mask file."} 
    360         Button button7,pos={126,620},size={110,20},proc=SetABSParamsButton,title="set ABS params" 
     373        Button button7,pos={129,506},size={110,20},proc=SetABSParamsButton,title="set ABS params" 
    361374        Button button7,help={"This button will prompt the user for absolute scaling parameters"} 
    362         Button button8,pos={126,650},size={150,20},proc=SetAverageParamsButtonProc,title="set AVERAGE params" 
     375        Button button8,pos={129,530},size={150,20},proc=SetAverageParamsButtonProc,title="set AVERAGE params" 
    363376        Button button8,help={"Prompts the user for the type of 1-D averaging to perform, as well as saving options"} 
    364         Button button9,pos={80,690},size={120,20},proc=ReducePolCorDataButton,title="Reduce Data" 
     377        Button button9,pos={581,515},size={120,20},proc=ReducePolCorDataButton,title="Reduce Data" 
    365378        Button button9,help={"Reduce PolCor data"} 
    366         Button button10,pos={226,690},size={120,20},proc=SavePolCorProtocolButton,title="Save Protocol" 
     379        Button button10,pos={581,460},size={120,20},proc=SavePolCorProtocolButton,title="Save Protocol" 
    367380        Button button10,help={"Save the PolCor protocol, within this experiment only"} 
    368         Button button11,pos={370,690},size={120,20},proc=RecallPolCorProtocolButton,title="Recall Protocol" 
    369         Button button11,help={"Recall a PolCor protocol from memory"}            
    370         Button button14,pos={226,720},size={120,20},proc=ExportPolCorProtocolButton,title="Export Protocol" 
     381        Button button11,pos={546,333},size={120,20},proc=RecallPolCorProtocolButton,title="Recall Protocol" 
     382        Button button11,help={"Recall a PolCor protocol from memory"} 
     383        Button button14,pos={546,303},size={120,20},proc=ExportPolCorProtocolButton,title="Export Protocol" 
    371384        Button button14,help={"Export the PolCor protocol, saving it on disk"} 
    372         Button button15,pos={370,720},size={120,20},proc=ImportPolCorProtocolButton,title="Import Protocol" 
     385        Button button15,pos={546,363},size={120,20},proc=ImportPolCorProtocolButton,title="Import Protocol" 
    373386        Button button15,help={"Import a PolCor protocol from a protocol previously saved to disk"} 
    374                  
    375         SetVariable setvar0,pos={322,560},size={250,15},title="file:" 
     387        Button button16,pos={546,216},size={110,20},proc=SavePolCorPanelButton,title="Save State" 
     388        Button button16,help={"Save the state of the panel for later recall"} 
     389        Button button17,pos={546,245},size={110,20},proc=RestorePolCorPanelButton,title="Restore State" 
     390        Button button17,help={"Recall a saved state of the Pol_Cor panel"} 
     391                         
     392        SetVariable setvar0,pos={303,458},size={250,15},title="file:" 
    376393        SetVariable setvar0,help={"Filename of the detector sensitivity file to be used in the data reduction"} 
    377         SetVariable setvar0,limits={-Inf,Inf,0},value= root:myGlobals:Protocols:gDIV 
    378         SetVariable setvar1,pos={322,590},size={250,15},title="file:" 
     394        SetVariable setvar0,limits={-inf,inf,0},value= root:myGlobals:Protocols:gDIV 
     395        SetVariable setvar1,pos={303,483},size={250,15},title="file:" 
    379396        SetVariable setvar1,help={"Filename of the mask file to be used in the data reduction"} 
    380         SetVariable setvar1,limits={-Inf,Inf,0},value= root:myGlobals:Protocols:gMASK 
    381         SetVariable setvar2,pos={322,620},size={250,15},title="parameters:" 
     397        SetVariable setvar1,limits={-inf,inf,0},value= root:myGlobals:Protocols:gMASK 
     398        SetVariable setvar2,pos={303,509},size={250,15},title="parameters:" 
    382399        SetVariable setvar2,help={"Keyword-string of values necessary for absolute scaling of data. Remaining parameters are taken from the sample file."} 
    383         SetVariable setvar2,limits={-Inf,Inf,0},value= root:myGlobals:Protocols:gAbsStr  
    384         SetVariable setvar3,pos={322,650},size={250,15},title="parameters:" 
     400        SetVariable setvar2,limits={-inf,inf,0},value= root:myGlobals:Protocols:gAbsStr 
     401        SetVariable setvar3,pos={303,535},size={250,15},title="parameters:" 
    385402        SetVariable setvar3,help={"Keyword-string of choices used for averaging and saving the 1-D data files"} 
    386         SetVariable setvar3,limits={-Inf,Inf,0},value= root:myGlobals:Protocols:gAVE     
    387          
    388         CheckBox check0,pos={10,560},size={72,14},title="Sensitivity" 
     403        SetVariable setvar3,limits={-inf,inf,0},value= root:myGlobals:Protocols:gAVE 
     404         
     405        CheckBox check0,pos={13,463},size={63,14},title="Sensitivity" 
    389406        CheckBox check0,help={"If checked, the specified detector sensitivity file will be included in the data reduction. If the file name is \"ask\", then the user will be prompted for the file"} 
    390407        CheckBox check0,value= 1 
    391         CheckBox check1,pos={10,590},size={72,14},title="Mask" 
    392         CheckBox check1,help={""} 
    393         CheckBox check1,value= 1 
    394         CheckBox check2,pos={10,620},size={72,14},title="Absolute Scale" 
    395         CheckBox check2,help={""} 
    396         CheckBox check2,value= 1 
    397         CheckBox check3,pos={10,650},size={72,14},title="Average and Save" 
    398         CheckBox check3,help={""} 
    399         CheckBox check3,value= 1                 
    400         CheckBox check4,pos={10,530},size={72,14},title="Use EMP?" 
    401         CheckBox check4,help={""} 
    402         CheckBox check4,value= 1         
    403         CheckBox check5,pos={100,530},size={72,14},title="Use BGD?" 
    404         CheckBox check5,help={""} 
    405         CheckBox check5,value= 1         
    406  
     408        CheckBox check1,pos={13,486},size={39,14},title="Mask",value= 1 
     409        CheckBox check2,pos={13,509},size={82,14},title="Absolute Scale",value= 1 
     410        CheckBox check3,pos={13,532},size={96,14},title="Average and Save",value= 1 
     411        CheckBox check4,pos={13,436},size={59,14},title="Use EMP?",value= 1 
     412        CheckBox check5,pos={103,436},size={60,14},title="Use BGD?",value= 1 
    407413         
    408414 
    409415// SAM Tab       
    410         PopupMenu popup_0_1,pos={230,60},size={102,20},title="Condition" 
     416        PopupMenu popup_0_1,pos={190,45},size={102,20},title="Condition" 
    411417        PopupMenu popup_0_1, mode=1,popvalue="none",value= #"P_GetConditionNameList()" 
    412418        // UU 
    413         ListBox ListBox_0_UU,pos={34,102},size={200,130},proc=PolCor_FileListBoxProc,frame=2 
     419        ListBox ListBox_0_UU,pos={34,80},size={200,120},proc=PolCor_FileListBoxProc,frame=2 
    414420        ListBox ListBox_0_UU,listWave=root:Packages:NIST:Polarization:ListWave_0_UU,titleWave=root:Packages:NIST:Polarization:lbTitles 
    415421        ListBox ListBox_0_UU,selWave=root:Packages:NIST:Polarization:lbSelWave_0_UU,mode= 6,selRow= 0,selCol= 0,editStyle= 2 
     
    436442 
    437443        // DU 
    438         ListBox ListBox_0_DU,pos={368,102},size={200,130},proc=PolCor_FileListBoxProc,frame=2 
     444        ListBox ListBox_0_DU,pos={310,80},size={200,120},proc=PolCor_FileListBoxProc,frame=2 
    439445        ListBox ListBox_0_DU,listWave=root:Packages:NIST:Polarization:ListWave_0_DU,titleWave=root:Packages:NIST:Polarization:lbTitles 
    440446        ListBox ListBox_0_DU,selWave=root:Packages:NIST:Polarization:lbSelWave_0_DU,mode= 6,selRow= 0,selCol= 0,editStyle= 2 
     
    461467 
    462468// DD 
    463         ListBox ListBox_0_DD,pos={33,286},size={200,130},proc=PolCor_FileListBoxProc,frame=2 
     469        ListBox ListBox_0_DD,pos={33,245},size={200,120},proc=PolCor_FileListBoxProc,frame=2 
    464470        ListBox ListBox_0_DD,listWave=root:Packages:NIST:Polarization:ListWave_0_DD,titleWave=root:Packages:NIST:Polarization:lbTitles 
    465471        ListBox ListBox_0_DD,selWave=root:Packages:NIST:Polarization:lbSelWave_0_DD,mode= 6,selRow= 0,selCol= 0,editStyle= 2 
     
    486492         
    487493// UD 
    488         ListBox ListBox_0_UD,pos={368,286},size={200,130},proc=PolCor_FileListBoxProc,frame=2 
     494        ListBox ListBox_0_UD,pos={310,245},size={200,120},proc=PolCor_FileListBoxProc,frame=2 
    489495        ListBox ListBox_0_UD,listWave=root:Packages:NIST:Polarization:ListWave_0_UD,titleWave=root:Packages:NIST:Polarization:lbTitles 
    490496        ListBox ListBox_0_UD,selWave=root:Packages:NIST:Polarization:lbSelWave_0_UD,mode= 6,selRow= 0,selCol= 0,editStyle= 2 
     
    512518 
    513519// EMP Tab 
    514         PopupMenu popup_1_1,pos={230,60},size={102,20},title="Condition" 
     520        PopupMenu popup_1_1,pos={190,45},size={102,20},title="Condition" 
    515521        PopupMenu popup_1_1, mode=1,popvalue="none",value= #"P_GetConditionNameList()"   
    516522        // UU 
    517         ListBox ListBox_1_UU,pos={34,102},size={200,130},proc=PolCor_FileListBoxProc,frame=2 
     523        ListBox ListBox_1_UU,pos={34,80},size={200,120},proc=PolCor_FileListBoxProc,frame=2 
    518524        ListBox ListBox_1_UU,listWave=root:Packages:NIST:Polarization:ListWave_1_UU,titleWave=root:Packages:NIST:Polarization:lbTitles 
    519525        ListBox ListBox_1_UU,selWave=root:Packages:NIST:Polarization:lbSelWave_1_UU,mode= 6,selRow= 0,selCol= 0,editStyle= 2 
     
    540546 
    541547        // DU 
    542         ListBox ListBox_1_DU,pos={368,102},size={200,130},proc=PolCor_FileListBoxProc,frame=2 
     548        ListBox ListBox_1_DU,pos={310,80},size={200,120},proc=PolCor_FileListBoxProc,frame=2 
    543549        ListBox ListBox_1_DU,listWave=root:Packages:NIST:Polarization:ListWave_1_DU,titleWave=root:Packages:NIST:Polarization:lbTitles 
    544550        ListBox ListBox_1_DU,selWave=root:Packages:NIST:Polarization:lbSelWave_1_DU,mode= 6,selRow= 0,selCol= 0,editStyle= 2 
     
    565571 
    566572// DD 
    567         ListBox ListBox_1_DD,pos={33,286},size={200,130},proc=PolCor_FileListBoxProc,frame=2 
     573        ListBox ListBox_1_DD,pos={33,245},size={200,120},proc=PolCor_FileListBoxProc,frame=2 
    568574        ListBox ListBox_1_DD,listWave=root:Packages:NIST:Polarization:ListWave_1_DD,titleWave=root:Packages:NIST:Polarization:lbTitles 
    569575        ListBox ListBox_1_DD,selWave=root:Packages:NIST:Polarization:lbSelWave_1_DD,mode= 6,selRow= 0,selCol= 0,editStyle= 2 
     
    590596 
    591597// UD 
    592         ListBox ListBox_1_UD,pos={368,286},size={200,130},proc=PolCor_FileListBoxProc,frame=2 
     598        ListBox ListBox_1_UD,pos={310,245},size={200,120},proc=PolCor_FileListBoxProc,frame=2 
    593599        ListBox ListBox_1_UD,listWave=root:Packages:NIST:Polarization:ListWave_1_UD,titleWave=root:Packages:NIST:Polarization:lbTitles 
    594600        ListBox ListBox_1_UD,selWave=root:Packages:NIST:Polarization:lbSelWave_1_UD,mode= 6,selRow= 0,selCol= 0,editStyle= 2 
     
    618624// file is necessary - this is "incorrectly" labeled as UU. I'll get around to changing this in the future... 
    619625// 
    620         TitleBox title_2_UU,pos={350,100},size={400,48},title="\\f01BGD files are independent of polarization\rEnter all as UU",fSize=12 
     626        TitleBox title_2_UU,pos={250,100},size={400,48},title="\\f01BGD files are independent of polarization\rEnter all as UU",fSize=12 
    621627 
    622628 
    623629        // UU 
    624         ListBox ListBox_2_UU,pos={34,102},size={200,130},proc=PolCor_FileListBoxProc,frame=2 
     630        ListBox ListBox_2_UU,pos={34,80},size={200,120},proc=PolCor_FileListBoxProc,frame=2 
    625631        ListBox ListBox_2_UU,listWave=root:Packages:NIST:Polarization:ListWave_2_UU,titleWave=root:Packages:NIST:Polarization:lbTitles 
    626632        ListBox ListBox_2_UU,selWave=root:Packages:NIST:Polarization:lbSelWave_2_UU,mode= 6,selRow= 0,selCol= 0,editStyle= 2 
     
    722728 
    723729EndMacro 
     730 
     731Function SavePolCorPanelButton(ba) : ButtonControl 
     732        STRUCT WMButtonAction &ba 
     733 
     734        switch( ba.eventCode ) 
     735                case 2: // mouse up 
     736                        // click code here 
     737                        SavePolCorPanelState() 
     738                        break 
     739                case -1: // control being killed 
     740                        break 
     741        endswitch 
     742 
     743        return 0 
     744End 
     745 
     746Function RestorePolCorPanelButton(ba) : ButtonControl 
     747        STRUCT WMButtonAction &ba 
     748 
     749        switch( ba.eventCode ) 
     750                case 2: // mouse up 
     751                        // click code here 
     752                        RestorePolCorPanelState() 
     753                        break 
     754                case -1: // control being killed 
     755                        break 
     756        endswitch 
     757 
     758        return 0 
     759End 
     760 
     761 
    724762 
    725763// action procedure for the list box that allows the popup menu 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization/Pol_PolarizationPanels.ipf

    r867 r915  
    144144                DrawCellParamPanel() 
    145145        endif 
    146  
     146        // be sure that the panel is onscreen 
     147        DoIgorMenu "Control","Retrieve Window" 
    147148end 
    148149 
     
    282283         
    283284        PauseUpdate; Silent 1           // building window... 
    284         NewPanel /W=(775,44,1375,377)/N=CellParamPanel/K=1 as "Fundamental Cell Parameters" 
     285        NewPanel /W=(150,44,750,377)/N=CellParamPanel/K=1 as "Fundamental Cell Parameters" 
    285286        ModifyPanel cbRGB=(65535,49151,55704) 
    286287        ModifyPanel fixedSize=1 
     
    289290        Button button_0,pos={10,10},size={90,20},proc=AddCellButtonProc,title="Add Cell" 
    290291        Button button_1,pos={118,10},size={160,20},proc=SaveCellParButtonProc,title="Update Parameters" 
    291         Button button_2,pos={300,10},size={130,20},proc=RevertCellParButtonProc,title="Revert Parameters" 
     292        Button button_2,pos={118,35},size={130,20},proc=RevertCellParButtonProc,title="Revert Parameters" 
    292293        Button button_3,pos={520,10},size={35,20},proc=CellHelpParButtonProc,title="?" 
    293294 
    294          
    295         Edit/W=(14,55,582,318)/HOST=# 
     295        Button button_4,pos={324,10},size={100,20},proc=SaveCellPanelButton,title="Save State" 
     296        Button button_5,pos={324,35},size={100,20},proc=RestoreCellPanelButton,title="Restore State" 
     297         
     298        Edit/W=(14,60,582,318)/HOST=# 
    296299        ModifyTable width(Point)=0 
    297300        RenameWindow #,T0 
     
    306309        return(0) 
    307310End 
     311 
     312 
     313Function SaveCellPanelButton(ba) : ButtonControl 
     314        STRUCT WMButtonAction &ba 
     315 
     316        switch( ba.eventCode ) 
     317                case 2: // mouse up 
     318                        // click code here 
     319                        SaveCellParameterTable() 
     320                        break 
     321                case -1: // control being killed 
     322                        break 
     323        endswitch 
     324 
     325        return 0 
     326End 
     327 
     328Function RestoreCellPanelButton(ba) : ButtonControl 
     329        STRUCT WMButtonAction &ba 
     330 
     331        switch( ba.eventCode ) 
     332                case 2: // mouse up 
     333                        // click code here 
     334                        RestoreCellParameterTable() 
     335                        break 
     336                case -1: // control being killed 
     337                        break 
     338        endswitch 
     339 
     340        return 0 
     341End 
     342 
     343 
     344 
    308345 
    309346Function CellHelpParButtonProc(ba) : ButtonControl 
     
    415452                DecayParamPanel() 
    416453        endif 
     454        // be sure that the panel is onscreen 
     455        DoIgorMenu "Control","Retrieve Window" 
    417456end 
    418457 
     
    441480         
    442481        PauseUpdate; Silent 1           // building window... 
    443         NewPanel /W=(759,44,1572,713)/N=DecayPanel/K=1 as "Cell Decay Parameters" 
     482        NewPanel /W=(200,44,1013,664)/N=DecayPanel/K=1 as "Cell Decay Parameters" 
    444483        ModifyPanel cbRGB=(32768,54615,65535) 
    445484//      Button button_3,pos={505,16},size={35,20},proc=DecayHelpParButtonProc,title="?" 
    446         PopupMenu popup_0,pos={32,18},size={49,20},title="Cell",proc=DecayPanelPopMenuProc 
     485        PopupMenu popup_0,pos={32,8},size={49,20},title="Cell",proc=DecayPanelPopMenuProc 
    447486        PopupMenu popup_0,mode=1,value= #"D_CellNameList()" 
    448487         
    449         Button button_0,pos={584,365},size={70,20},proc=DecayFitButtonProc,title="Do Fit" 
    450          
    451         GroupBox group_0,pos={550,399},size={230,149},title="FIT RESULTS",fSize=10 
     488        Button button_0,pos={560,294},size={70,20},proc=DecayFitButtonProc,title="Do Fit" 
     489         
     490        GroupBox group_0,pos={560,329},size={230,149},title="FIT RESULTS",fSize=10 
    452491        GroupBox group_0,fStyle=1 
    453         SetVariable setvar_0,pos={560,428},size={200,13},title="muPo of 3He" 
     492        SetVariable setvar_0,pos={570,358},size={200,13},title="muPo of 3He" 
    454493        SetVariable setvar_0,fStyle=1,limits={0,0,0},barmisc={0,1000} 
    455494        SetVariable setvar_0,value= root:Packages:NIST:Polarization:Cells:gMuPo 
    456         SetVariable setvar_1,pos={560,460},size={200,13},title="Po of 3He" 
     495        SetVariable setvar_1,pos={570,390},size={200,13},title="Po of 3He" 
    457496        SetVariable setvar_1,fStyle=1,limits={0,0,0},barmisc={0,1000} 
    458497        SetVariable setvar_1,value= root:Packages:NIST:Polarization:Cells:gPo 
    459         SetVariable setvar_2,pos={560,518},size={200,13},title="Gamma (h)",fStyle=1 
     498        SetVariable setvar_2,pos={570,448},size={200,13},title="Gamma (h)",fStyle=1 
    460499        SetVariable setvar_2,limits={0,0,0},barmisc={0,1000} 
    461500        SetVariable setvar_2,value= root:Packages:NIST:Polarization:Cells:gGamma 
    462         SetVariable setvar_3,pos={560,488},size={200,15},title="T0",fStyle=1 
     501        SetVariable setvar_3,pos={570,418},size={200,13},title="T0",fStyle=1 
    463502        SetVariable setvar_3,limits={0,0,0},value= root:Packages:NIST:Polarization:Cells:gT0 
    464503         
    465504 
    466         Button button_1,pos={579,294},size={120,20},proc=CalcRowParamButton,title="Calculate Rows" 
    467         Button button_2,pos={307,18},size={110,20},proc=ClearDecayWavesButton,title="Clear Table" 
    468         Button button_3,pos={579,333},size={120,20},proc=ShowCalcRowButton,title="Show Calc" 
    469         Button button_4,pos={440,18},size={110,20},proc=ClearDecayWavesRowButton,title="Clear Row" 
    470         Button button_5,pos={620,18},size={40,20},proc=DecayHelpParButtonProc,title="?" 
    471         Button button_6,pos={620,620},size={100,20},proc=WindowSnapshotButton,title="Snapshot" 
    472         Button button_7,pos={620,580},size={130,20},proc=ManualEnterDecayButton,title="Manual Entry" 
    473         CheckBox check0,mode=0,pos={600,550},title="Overrride T0?",value=0 
     505        Button button_1,pos={560,262},size={120,20},proc=CalcRowParamButton,title="Calculate Rows" 
     506        Button button_2,pos={307,8},size={110,20},proc=ClearDecayWavesButton,title="Clear Table" 
     507        Button button_3,pos={560,519},size={110,20},proc=ShowCalcRowButton,title="Show Calc" 
     508        Button button_4,pos={440,8},size={110,20},proc=ClearDecayWavesRowButton,title="Clear Row" 
     509        Button button_5,pos={620,8},size={40,20},proc=DecayHelpParButtonProc,title="?" 
     510        Button button_6,pos={560,574},size={110,20},proc=WindowSnapshotButton,title="Snapshot" 
     511        Button button_7,pos={560,547},size={110,20},proc=ManualEnterDecayButton,title="Manual Entry" 
     512        Button button_8,pos={690,547},size={110,20},proc=SaveDecayPanelButton,title="Save State" 
     513        Button button_9,pos={690,574},size={110,20},proc=RestoreDecayPanelButton,title="Restore State" 
     514        CheckBox check0,mode=0,pos={560,480},title="Overrride T0?",value=0 
    474515 
    475516 
    476517        // table 
    477         Edit/W=(14,55,794,275)/HOST=#  
     518        Edit/W=(14,35,794,240)/HOST=#  
    478519        ModifyTable format=1,width=0 
    479520        RenameWindow #,T0 
     
    481522         
    482523        // graph 
    483         Display/W=(15,291,540,652)/HOST=#  //root:yy vs root:xx 
     524        Display/W=(15,250,540,610)/HOST=#  //root:yy vs root:xx 
    484525        ModifyGraph frameStyle=2 
    485526        ModifyGraph mode=4 
     
    14221463End 
    14231464 
     1465Function SaveDecayPanelButton(ba) : ButtonControl 
     1466        STRUCT WMButtonAction &ba 
     1467 
     1468        switch( ba.eventCode ) 
     1469                case 2: // mouse up 
     1470                        // click code here 
     1471                        SaveCellDecayTable() 
     1472                        break 
     1473                case -1: // control being killed 
     1474                        break 
     1475        endswitch 
     1476 
     1477        return 0 
     1478End 
     1479 
     1480Function RestoreDecayPanelButton(ba) : ButtonControl 
     1481        STRUCT WMButtonAction &ba 
     1482 
     1483        switch( ba.eventCode ) 
     1484                case 2: // mouse up 
     1485                        // click code here 
     1486                        RestoreCellDecayTable() 
     1487                        break 
     1488                case -1: // control being killed 
     1489                        break 
     1490        endswitch 
     1491 
     1492        return 0 
     1493End 
     1494 
    14241495// null condition is not right. if the loop fails, then the  
    14251496// retStr will be ";;;;", not zero length. What's the proper test? 
Note: See TracChangeset for help on using the changeset viewer.