Changeset 1181


Ignore:
Timestamp:
Jan 13, 2022 9:38:35 PM (7 months ago)
Author:
ilavsky
Message:

Improve Sample Plate survey code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/User Procedures/Indra 2/IN3_SamplePlate.ipf

    r1180 r1181  
    8080        IN3_UpdatePanelVersionNumber("SamplePlateSetup", IN3_SamplePlateSetupVersion)
    8181        IN3S_FixUSWAXSForAll()
     82        IN3S_UpdateListOfSavedSets()
    8283        IN3S_AddTagToImage(-4)  //remove all drawings, if needed       
    8384        SVAR WarningForUser = root:Packages:SamplePlateSetup:WarningForUser
     
    204205                        Button DisplayHookFunction,pos={300,370},size={240,20}, proc=IN3S_ButtonProc,title="Display Hook Function", help={"Displays hook function for user"}
    205206
     207                        TitleBox Tab1Info1 title="\Zr130These values are used only for beamtime calculation. They are not exported in command file.",pos={30,420},size={550,15},frame=0,fstyle=1,fColor=(65535,0,0),labelBack=0
     208
    206209                        SetVariable USAXSScanTime,pos={30,440},size={250,20},limits={30,360,15}, proc=IN3S_SetVarProc,title="USAXS time for run time estimate = "
    207210                        Setvariable USAXSScanTime,fStyle=2, variable=root:Packages:SamplePlateSetup:USAXSScanTime, help={"USAXS time from epics, used to calculate run time."}
     
    228231                        CheckBox ExportListOfPosSets variable=root:Packages:SamplePlateSetup:ExportListOfPosSets,  proc=IN3S_CheckProc, mode=1
    229232
    230                         TitleBox Tab2Info1 title="\Zr110Drag from here : ",pos={100,210},size={250,15},frame=0,fColor=(0,0,65535),labelBack=0
    231                         TitleBox Tab2Info2 title="\Zr110Drop here in order of export : ",pos={320,210},size={250,15},frame=0,fColor=(0,0,65535),labelBack=0
    232                         ListBox SourceBox,pos={20,230},size={250,350} , listwave=root:Packages:SamplePlateSetup:ListOfSavedSetsWv
     233                        TitleBox Tab2Info1 title="\Zr110Drag saved position from here : ",pos={60,210},size={250,15},frame=0,fColor=(0,0,65535),labelBack=0
     234                        TitleBox Tab2Info2 title="\Zr110Drop here in order of export : ",pos={350,210},size={250,15},frame=0,fColor=(0,0,65535),labelBack=0
     235                        ListBox SourceBox,pos={20,230},size={250,300} , listwave=root:Packages:SamplePlateSetup:ListOfSavedSetsWv
    233236                    ListBox SourceBox, selwave=root:Packages:SamplePlateSetup:SelListOfSavedSetsWv, mode=9, focusring=0
    234                     ListBox SourceBox, fsize=16, Proc=IN3S_DragDropListBoxProc
    235                     ListBox TargetBox, pos={300,230},size={250,350}, listwave=root:Packages:SamplePlateSetup:ListOfWavesForExport
     237                    ListBox SourceBox, Proc=IN3S_DragDropListBoxProc
     238                    ListBox TargetBox, pos={300,230},size={250,300}, listwave=root:Packages:SamplePlateSetup:ListOfWavesForExport
    236239                    ListBox TargetBox, selwave=root:Packages:SamplePlateSetup:SelListOfWavesForExport, mode=9, focusring=0
    237                     ListBox TargetBox, fsize=16, Proc=IN3S_DragDropListBoxProc
     240                    ListBox TargetBox, Proc=IN3S_DragDropListBoxProc
     241                        TitleBox Tab2Info5 title="\Zr110Make sure you saved the current Positions set !!!! The button needs to be green. ",pos={100,540},size={550,15},frame=0,fstyle=1,fColor=(65535,0,0),labelBack=0
     242                        TitleBox Tab2Info3 title="Drag a Set from left to right listbox. You can use sets multiple times.",pos={120,555},size={550,15},frame=0,fColor=(0,0,65535),labelBack=0
     243                        TitleBox Tab2Info4 title="Delete a Set from right listbox with right click. ",pos={160,570},size={550,15},frame=0,fColor=(0,0,65535),labelBack=0
    238244                               
    239245
     
    362368                        Button DisplayHookFunction,  win=SamplePlateSetup, disable=(tab!=1)
    363369                        PopupMenu ExportOrderPop,  win=SamplePlateSetup, disable=(tab!=1)
     370                        TitleBox Tab1Info1,  win=SamplePlateSetup, disable=(tab!=1)
    364371                       
    365372                        CheckBox ExportCurrentPosSet,  win=SamplePlateSetup, disable=(tab!=2)
     
    369376                        TitleBox Tab2Info1,  win=SamplePlateSetup, disable=(tab!=2||ExportCurrentPosSet)
    370377                        TitleBox Tab2Info2,  win=SamplePlateSetup, disable=(tab!=2||ExportCurrentPosSet)
     378                        TitleBox Tab2Info3,  win=SamplePlateSetup, disable=(tab!=2||ExportCurrentPosSet)
     379                        TitleBox Tab2Info4,  win=SamplePlateSetup, disable=(tab!=2||ExportCurrentPosSet)
     380                        TitleBox Tab2Info5,  win=SamplePlateSetup, disable=(tab!=2||ExportCurrentPosSet)
    371381                        ListBox SourceBox,  win=SamplePlateSetup, disable=(tab!=2||ExportCurrentPosSet)
    372382                    ListBox TargetBox,  win=SamplePlateSetup, disable=(tab!=2||ExportCurrentPosSet)
    373383                        IN3S_EstimateRunTime()
     384                        IN3S_UpdateListOfSavedSets()
    374385                        break
    375386                case -1: // control being killed
     
    15241535                //add this to list in waves for multi export
    15251536                if(AddToList)
    1526                         Wave/T ListOfSavedSetsWv=root:Packages:SamplePlateSetup:ListOfSavedSetsWv
    1527                         Wave SelListOfSavedSetsWv=root:Packages:SamplePlateSetup:SelListOfSavedSetsWv
    1528                         variable OldLength=numpnts(ListOfSavedSetsWv)
    1529                         redimension/N=(OldLength+1) ListOfSavedSetsWv, SelListOfSavedSetsWv
    1530                         ListOfSavedSetsWv[OldLength] = newUniqueName
     1537                        IN3S_UpdateListOfSavedSets()
     1538                        //Wave/T ListOfSavedSetsWv=root:Packages:SamplePlateSetup:ListOfSavedSetsWv
     1539                        //Wave SelListOfSavedSetsWv=root:Packages:SamplePlateSetup:SelListOfSavedSetsWv
     1540                        //variable OldLength=numpnts(ListOfSavedSetsWv)
     1541                        //redimension/N=(OldLength+1) ListOfSavedSetsWv, SelListOfSavedSetsWv
     1542                        //ListOfSavedSetsWv[OldLength] = newUniqueName
    15311543                endif
    15321544        SetDataFolder OldDf     
    15331545end
    1534 
     1546//*****************************************************************************************************************
     1547//*****************************************************************************************************************
     1548static Function IN3S_UpdateListOfSavedSets()
     1549
     1550        DFrEF OldDf=GetDataFolderDFR()
     1551        Wave/T ListOfSavedSetsWv=root:Packages:SamplePlateSetup:ListOfSavedSetsWv
     1552        Wave SelListOfSavedSetsWv=root:Packages:SamplePlateSetup:SelListOfSavedSetsWv
     1553        string ListOfSavedSetsStr
     1554        variable i
     1555        if(DataFolderExists("root:SavedSampleSets"))
     1556                SetDataFolder root:SavedSampleSets
     1557                DFrEF SavedSetsDRF=GetDataFolderDFR()
     1558                ListOfSavedSetsStr = DataFolderList("*", ";", SavedSetsDRF)
     1559                variable NewLength=ItemsInList(ListOfSavedSetsStr)
     1560                redimension/N=(NewLength) ListOfSavedSetsWv, SelListOfSavedSetsWv
     1561                SelListOfSavedSetsWv = 0
     1562                For(i=0;i<NewLength;i+=1)
     1563                        ListOfSavedSetsWv[i] = stringFromList(i,ListOfSavedSetsStr)
     1564                endfor
     1565        else
     1566                redimension/N=(0) ListOfSavedSetsWv, SelListOfSavedSetsWv
     1567        endif
     1568end
    15351569
    15361570//*****************************************************************************************************************
     
    16551689                        IN3S_LoadSavedSampleSet(folderToLoad="TempExportSetStored")
    16561690                        KillDataFolder/Z root:SavedSampleSets:TempExportSetStored:              //clean up the temp saved data set.
     1691                        CurNameStr = curFolder
    16571692                else
    16581693                        abort "Nothing is on the list here"
Note: See TracChangeset for help on using the changeset viewer.