Ignore:
Timestamp:
Mar 23, 2010 4:10:58 PM (13 years ago)
Author:
srkline
Message:

Changes to move the "Do Combine Files" to a separate panel that is accessible from the MainPanel?->1D Ops tab.

Updated the help files.

Disabled the SANSBeta menu.

Location:
sans/Dev/trunk/NCNR_User_Procedures
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Common/NIST_XML_v40.ipf

    r626 r648  
    2222         
    2323        Variable rr,gg,bb 
    24         NVAR dQv = root:Packages:NIST:USANS_dQv 
     24        NVAR/Z dQv = root:Packages:NIST:USANS_dQv 
    2525 
    2626                 
     
    905905        Variable norm12,norm23 
    906906 
    907         Variable err=0,refNum,numCols 
    908         String fullPath="",formatStr="" 
     907        Variable err=0,refNum,numCols,dialog=1 
     908        String fullPath="",formatStr="",str2 
    909909        //check each wave - else REALLY FATAL error when writing file 
    910910        If(!(WaveExists(qw))) 
     
    927927        endif 
    928928         
    929         Variable dialog = 1 
     929// 05SEP05 SRK -- added to automatically combine files from a table - see the end of NSORT.ipf for details 
     930// - use the flag set in DoCombineFiles() to decide if the table entries should be used 
     931//Ê Êroot:myGlobals:CombineTable:useTable= (1) (0) 
     932//if(exists("root:myGlobals:CombineTable:SaveName")) 
     933        NVAR/Z useTable = root:myGlobals:CombineTable:useTable 
     934        if(NVAR_Exists(useTable) && useTable==1) 
     935                SVAR str=root:myGlobals:CombineTable:SaveNameStr        //messy, but pass in as a global 
     936                fullPath = str 
     937//              str2 = "Is the file name "+str+" correct?" 
     938//              DoAlert 1,str2 
     939//              if(V_flag==1) 
     940                        dialog=0                //bypass the dialog if the name is good (assumed, since DoAlert is bypassed) 
     941//              endif 
     942        endif 
     943 
    930944        if(dialog) 
    931945                PathInfo/S catPathName 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Includes_v520.ipf

    r647 r648  
    9393// menu will appear in the menubar. 
    9494// 
    95 Menu "SANSBeta" 
     95xMenu "SANSBeta" 
    9696        "Help for Beta Operations",DisplayHelpTopic/Z/K=1 "Beta SANS Tools" 
    9797        "-" 
     
    108108//      "-" 
    109109////    "Set3NSORTFiles" 
    110         "CreateTableToCombine" 
    111         "DoCombineFiles" 
     110//      "CreateTableToCombine"                  //moved to a separate panel available from the 1D Ops tab 
     111//      "DoCombineFiles" 
    112112        "-" 
    113113        "Convert To Lens" 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MainPanel.ipf

    r609 r648  
    7878        ShowNSORTPanel() 
    7979End 
     80 
     81Proc Combine1D_MainButtonProc(ctrlName) : ButtonControl 
     82        String ctrlName 
     83 
     84        ShowCombinePanel() 
     85End 
     86 
    8087 
    8188Proc Fit1D_MainButtonProc(ctrlName) : ButtonControl 
     
    309316        Button MainButton_2e,pos={120,90},size={110,20},proc=Arithmetic1D_MainButtonProc,title="1D Arithmetic" 
    310317        Button MainButton_2e,help={"Shows panel for doing arithmetic on 1D data sets"} 
     318        Button MainButton_2f,pos={120,120},size={130,20},proc=Combine1D_MainButtonProc,title="Combine 1D Files" 
     319        Button MainButton_2f,help={"Shows panel for batch combination of 1D data files. Use after you're comfortable with NSORT"} 
    311320        Button MainButton_2a,disable=1 
    312321        Button MainButton_2b,disable=1 
     
    314323        Button MainButton_2d,disable=1 
    315324        Button MainButton_2e,disable=1 
     325        Button MainButton_2f,disable=1 
     326 
     327 
    316328 
    317329//on tab(3) - 2-D Operations 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NSORT.ipf

    r629 r648  
    126126        if (WaveExists($(typPrefix+"_res"))) 
    127127                //6 col data loaded 
    128                 print "6 col data loaded" 
     128//              print "6 col data loaded" 
    129129                numCols = 6 
    130130                Duplicate/O $(typPrefix+"_q") $(trimPrefix+"_q") 
     
    143143                //Assume 
    144144                //3 col data loaded 
    145                 print "Assuming 3 col data loaded" 
     145//              print "Assuming 3 col data loaded" 
    146146                numcols = 3 
    147147                Duplicate/O $(typPrefix+"_q") $(trimPrefix+"_q") 
     
    170170        endswitch 
    171171         
     172        return(0) 
     173         
    172174End 
    173175 
     
    201203        Variable norm12,norm23 
    202204 
    203         Variable err=0,refNum,numCols 
    204         String fullPath="",formatStr="" 
     205        Variable err=0,refNum,numCols,dialog=1 
     206        String fullPath="",formatStr="",str2 
    205207        //check each wave - else REALLY FATAL error when writing file 
    206208        If(!(WaveExists(q3))) 
     
    223225        endif 
    224226         
    225         Variable dialog = 1 
     227// 05SEP05 SRK -- added to automatically combine files from a table - see the end of NSORT.ipf for details 
     228// - use the flag set in DoCombineFiles() to decide if the table entries should be used 
     229//Ê Êroot:myGlobals:CombineTable:useTable= (1) (0) 
     230//if(exists("root:myGlobals:CombineTable:SaveName")) 
     231        NVAR/Z useTable = root:myGlobals:CombineTable:useTable 
     232        if(NVAR_Exists(useTable) && useTable==1) 
     233                SVAR str=root:myGlobals:CombineTable:SaveNameStr        //messy, but pass in as a global 
     234                fullPath = str 
     235//              str2 = "Is the file name "+str+" correct?" 
     236//              DoAlert 1,str2 
     237//              if(V_flag==1) 
     238                        dialog=0                //bypass the dialog if the name is good (assumed, since DoAlert is bypassed) 
     239//              endif 
     240        endif 
     241         
    226242        if(dialog) 
    227243                PathInfo/S catPathName 
     
    14041420// testing, may speed up NSORT, NCNR-specific naming scheme of  
    14051421// run numbers and a run prefix 
    1406 Proc Set3NSORTFiles(low,med,hi,pref) 
    1407         Variable low=1,med=2,hi=3 
    1408         String pref="LIPID" 
     1422// 
     1423// 
     1424Function Set3NSORTFiles(low,med,hi,pref) 
     1425        Variable low,med,hi 
     1426        String pref 
    14091427         
    14101428        //make strings from the numbers 
     
    14131431        DoWindow/F NSORT_Panel 
    14141432         
     1433        SVAR lowQPopStr = root:myGlobals:NSORT:gDataPopList 
     1434        SVAR medHiQPopStr = root:myGlobals:NSORT:gDataPopList_3 
     1435         
     1436        String ext = ".ABS" 
     1437         
    14151438        //lowQ menu 
    1416         absStr = pref+ThreeDigitString(low)+".ABS" 
    1417         popNum = 1+WhichListItem(absStr,root:myGlobals:NSORT:gDataPopList,";",0) 
     1439        absStr = pref+ThreeDigitString(low)+ext 
     1440        popNum = 1+WhichListItem(absStr,lowQPopStr,";",0) 
    14181441        PopupMenu popup_1,win=NSORT_Panel,mode=(popNum) 
    14191442        //medQ (a different list for the popup) 
    1420         absStr = pref+ThreeDigitString(med)+".ABS" 
    1421         popNum = 1+WhichListItem(absStr,root:myGlobals:NSORT:gDataPopList_3,";",0) 
     1443        absStr = pref+ThreeDigitString(med)+ext 
     1444        popNum = 1+WhichListItem(absStr,medHiQPopStr,";",0) 
    14221445        PopupMenu popup_2,win=NSORT_Panel,mode=(popNum) 
    14231446        //highQ (same pop list as medQ) 
    14241447        if(hi != 0) 
    1425                 absStr = pref+ThreeDigitString(hi)+".ABS" 
    1426                 popNum = 1+WhichListItem(absStr,root:myGlobals:NSORT:gDataPopList_3,";",0) 
     1448                absStr = pref+ThreeDigitString(hi)+ext 
     1449                popNum = 1+WhichListItem(absStr,medHiQPopStr,";",0) 
    14271450                PopupMenu popup_3,win=NSORT_Panel,mode=(popNum) 
    14281451        else 
     
    14501473 
    14511474//more beta procedures - to create a table of scattering runs to combine with NSORT 
    1452 Proc CreateTableToCombine() 
     1475Proc CreateTableToCombine(ctrlName) 
     1476        String ctrlName 
    14531477         
    14541478        NewDataFolder/O root:myGlobals:CombineTable 
    1455         DoWindow/F CombineTable 
     1479//      DoWindow/F CombineTable 
    14561480         
    14571481        Make/O/T/N=0 $"root:myGlobals:CombineTable:Filenames" 
     
    14621486        Make/O/D/N=0 $"root:myGlobals:CombineTable:IsTrans" 
    14631487 
    1464         If(V_Flag==0) 
     1488//      If(V_Flag==0) 
    14651489                BuildCombineTableWindow() 
    1466                 ModifyTable width(:myGlobals:CombineTable:SDD)=40 
    1467                 ModifyTable width(:myGlobals:CombineTable:Labels)=180 
     1490                ModifyTable/W=CombinePanel#FilesToCombine width(:myGlobals:CombineTable:SDD)=40 
     1491                ModifyTable/W=CombinePanel#FilesToCombine width(:myGlobals:CombineTable:Labels)=180 
    14681492                 
    14691493                ModifyTable width(Point)=0              //JUN04, remove point numbers - confuses users since point != run 
    1470         Endif 
     1494//      Endif 
    14711495 
    14721496        //get a list of all files in the folder, some will be junk version numbers that don't exist      
     
    15621586        Wave/T saveName = $"root:myGlobals:CombineTable:SaveName" 
    15631587 
    1564         DoWindow/F ToCombine 
    1565         if(V_flag==0) 
    1566                 edit Low,Medium,High,Prefix,SaveName as "Run Numbers to Combine" 
    1567                 DoWindow/C ToCombine 
    1568         endif 
    1569         AutoPositionWindow/M=1/R=CombineTable toCombine 
    1570          
     1588//      DoWindow/F ToCombine 
     1589//      if(V_flag==0) 
     1590//              edit Low,Medium,High,Prefix,SaveName as "Run Numbers to Combine" 
     1591//              DoWindow/C ToCombine 
     1592//      endif 
     1593//      AutoPositionWindow/M=1/R=CombineTable toCombine 
     1594        AppendToTable/W=CombinePanel#RunNumbersToCombine Low,Medium,High,Prefix,SaveName 
    15711595         
    15721596        ///// 
     
    15841608         
    15851609//      Edit Filenames, Labels, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens as "Files to Combine" 
    1586         Edit Labels, SDD, runNum as "Files to Combine" 
     1610//      Edit Labels, SDD, runNum as "Files to Combine" 
     1611        AppendToTable/W=CombinePanel#FilesToCombine Labels, SDD, runNum 
     1612         
    15871613        SetWindow kwTopWin hook=CombineTableHook, hookevents=1  // mouse down events 
    15881614 
    1589         String name="CombineTable" 
    1590         DoWindow/C $name 
     1615//      String name="CombineTable" 
     1616//      DoWindow/C $name 
    15911617        return(0) 
    15921618End 
     
    16761702// 
    16771703// 
    1678 Proc  DoCombineFiles() 
     1704Function DoCombineFiles(ctrlName) 
     1705        String ctrlName 
    16791706         
    16801707        // pop all of the menus to make sure that they are properly populated 
     
    16831710        HighQPopMenuProc("",1,"") 
    16841711         
    1685         String savedDataFolder = GetDataFolder(1)               // save 
    1686         SetDataFolder root:myGlobals:CombineTable: 
     1712//      String savedDataFolder = GetDataFolder(1)               // save 
     1713        Wave LowRun = root:myGlobals:CombineTable:LowRun 
     1714        Wave MediumRun = root:myGlobals:CombineTable:MediumRun 
     1715        Wave HighRun = root:myGlobals:CombineTable:HighRun 
     1716        Wave/T prefix = root:myGlobals:CombineTable:Prefix 
     1717        Wave/T saveName = root:myGlobals:CombineTable:saveName 
    16871718 
    16881719        Variable/G useTable=1 
     
    17121743        Variable/G useTable=0 
    17131744         
    1714         SetDataFolder savedDataFolder 
    1715  
     1745        return(0) 
    17161746End 
    17171747 
     
    17531783Function SendSelectionToTable() 
    17541784 
    1755         DoWindow/F CombineTable 
     1785        DoWindow/F CombinePanel 
    17561786        if(V_flag==0) 
    17571787//              Make/O/N=0 $"root:myGlobals:CombineTable:Low" 
     
    17781808        endif 
    17791809         
    1780         GetSelection table,CombineTable,3 
    1781 //      Print V_startRow, V_endRow 
     1810        GetSelection table,CombinePanel#FilesToCombine,3 
     1811        Print V_startRow, V_endRow 
    17821812         
    17831813        //prompt for combined name, give the user a chance to cancel 
     
    18521882        Endif 
    18531883End 
     1884 
     1885//////////////////////// 
     1886// replaces the beta menu items 
     1887// 
     1888 
     1889Proc ShowCombinePanel() 
     1890        DoWindow/F CombinePanel 
     1891        if(V_flag==0) 
     1892                CombinePanel() 
     1893        endif 
     1894end 
     1895 
     1896Proc CombinePanel() 
     1897        PauseUpdate; Silent 1           // building window... 
     1898        NewPanel /W=(546,442,1197,915) /K=1 as "Sort and Combine Data Files" 
     1899        ModifyPanel cbRGB=(49151,53155,65535) 
     1900        DoWindow/C CombinePanel 
     1901        Button button0_0,pos={20,20},size={160,20},proc=CreateTableToCombine,title="List Files to Combine" 
     1902        Button button0_1,pos={206,20},size={140,20},proc=DoCombineFiles,title="Combine Files" 
     1903        Button button0_2,pos={509,40},size={60,20},proc=CombinePanelDone,title="Done" 
     1904        Button button0_3,pos={522,14},size={30,20},proc=ShowCombineHelp,title="?" 
     1905        Edit/W=(20,54,368,249)/HOST=#  
     1906        ModifyTable format=1,width=0 
     1907        RenameWindow #,FilesToCombine 
     1908        SetActiveSubwindow ## 
     1909        Edit/W=(20,263,634,455)/HOST=#  
     1910        ModifyTable format=1 
     1911        RenameWindow #,RunNumbersToCombine 
     1912        SetActiveSubwindow ## 
     1913EndMacro 
     1914 
     1915Proc ShowCombineHelp(ctrlName): ButtonControl 
     1916        String ctrlName 
     1917        DisplayHelpTopic/K=1/Z "SANS Data Reduction Tutorial[Batch Combine Data Files]" 
     1918        if(V_flag !=0) 
     1919                DoAlert 0,"The SANS Data Reduction Tutorial Help file could not be found" 
     1920        endif 
     1921end 
     1922 
     1923Function CombinePanelDone(ctrlName) 
     1924        String ctrlName 
     1925         
     1926        DoWindow/K CombinePanel 
     1927        return(0) 
     1928end 
Note: See TracChangeset for help on using the changeset viewer.