Changeset 648 for sans/Dev/trunk/NCNR_User_Procedures
- Timestamp:
- Mar 23, 2010 4:10:58 PM (13 years ago)
- 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 22 22 23 23 Variable rr,gg,bb 24 NVAR dQv = root:Packages:NIST:USANS_dQv24 NVAR/Z dQv = root:Packages:NIST:USANS_dQv 25 25 26 26 … … 905 905 Variable norm12,norm23 906 906 907 Variable err=0,refNum,numCols 908 String fullPath="",formatStr="" 907 Variable err=0,refNum,numCols,dialog=1 908 String fullPath="",formatStr="",str2 909 909 //check each wave - else REALLY FATAL error when writing file 910 910 If(!(WaveExists(qw))) … … 927 927 endif 928 928 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 930 944 if(dialog) 931 945 PathInfo/S catPathName -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Includes_v520.ipf
r647 r648 93 93 // menu will appear in the menubar. 94 94 // 95 Menu "SANSBeta"95 xMenu "SANSBeta" 96 96 "Help for Beta Operations",DisplayHelpTopic/Z/K=1 "Beta SANS Tools" 97 97 "-" … … 108 108 // "-" 109 109 //// "Set3NSORTFiles" 110 "CreateTableToCombine" 111 "DoCombineFiles"110 // "CreateTableToCombine" //moved to a separate panel available from the 1D Ops tab 111 // "DoCombineFiles" 112 112 "-" 113 113 "Convert To Lens" -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MainPanel.ipf
r609 r648 78 78 ShowNSORTPanel() 79 79 End 80 81 Proc Combine1D_MainButtonProc(ctrlName) : ButtonControl 82 String ctrlName 83 84 ShowCombinePanel() 85 End 86 80 87 81 88 Proc Fit1D_MainButtonProc(ctrlName) : ButtonControl … … 309 316 Button MainButton_2e,pos={120,90},size={110,20},proc=Arithmetic1D_MainButtonProc,title="1D Arithmetic" 310 317 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"} 311 320 Button MainButton_2a,disable=1 312 321 Button MainButton_2b,disable=1 … … 314 323 Button MainButton_2d,disable=1 315 324 Button MainButton_2e,disable=1 325 Button MainButton_2f,disable=1 326 327 316 328 317 329 //on tab(3) - 2-D Operations -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NSORT.ipf
r629 r648 126 126 if (WaveExists($(typPrefix+"_res"))) 127 127 //6 col data loaded 128 print "6 col data loaded"128 // print "6 col data loaded" 129 129 numCols = 6 130 130 Duplicate/O $(typPrefix+"_q") $(trimPrefix+"_q") … … 143 143 //Assume 144 144 //3 col data loaded 145 print "Assuming 3 col data loaded"145 // print "Assuming 3 col data loaded" 146 146 numcols = 3 147 147 Duplicate/O $(typPrefix+"_q") $(trimPrefix+"_q") … … 170 170 endswitch 171 171 172 return(0) 173 172 174 End 173 175 … … 201 203 Variable norm12,norm23 202 204 203 Variable err=0,refNum,numCols 204 String fullPath="",formatStr="" 205 Variable err=0,refNum,numCols,dialog=1 206 String fullPath="",formatStr="",str2 205 207 //check each wave - else REALLY FATAL error when writing file 206 208 If(!(WaveExists(q3))) … … 223 225 endif 224 226 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 226 242 if(dialog) 227 243 PathInfo/S catPathName … … 1404 1420 // testing, may speed up NSORT, NCNR-specific naming scheme of 1405 1421 // 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 // 1424 Function Set3NSORTFiles(low,med,hi,pref) 1425 Variable low,med,hi 1426 String pref 1409 1427 1410 1428 //make strings from the numbers … … 1413 1431 DoWindow/F NSORT_Panel 1414 1432 1433 SVAR lowQPopStr = root:myGlobals:NSORT:gDataPopList 1434 SVAR medHiQPopStr = root:myGlobals:NSORT:gDataPopList_3 1435 1436 String ext = ".ABS" 1437 1415 1438 //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) 1418 1441 PopupMenu popup_1,win=NSORT_Panel,mode=(popNum) 1419 1442 //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) 1422 1445 PopupMenu popup_2,win=NSORT_Panel,mode=(popNum) 1423 1446 //highQ (same pop list as medQ) 1424 1447 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) 1427 1450 PopupMenu popup_3,win=NSORT_Panel,mode=(popNum) 1428 1451 else … … 1450 1473 1451 1474 //more beta procedures - to create a table of scattering runs to combine with NSORT 1452 Proc CreateTableToCombine() 1475 Proc CreateTableToCombine(ctrlName) 1476 String ctrlName 1453 1477 1454 1478 NewDataFolder/O root:myGlobals:CombineTable 1455 DoWindow/F CombineTable1479 // DoWindow/F CombineTable 1456 1480 1457 1481 Make/O/T/N=0 $"root:myGlobals:CombineTable:Filenames" … … 1462 1486 Make/O/D/N=0 $"root:myGlobals:CombineTable:IsTrans" 1463 1487 1464 If(V_Flag==0)1488 // If(V_Flag==0) 1465 1489 BuildCombineTableWindow() 1466 ModifyTable width(:myGlobals:CombineTable:SDD)=401467 ModifyTable width(:myGlobals:CombineTable:Labels)=1801490 ModifyTable/W=CombinePanel#FilesToCombine width(:myGlobals:CombineTable:SDD)=40 1491 ModifyTable/W=CombinePanel#FilesToCombine width(:myGlobals:CombineTable:Labels)=180 1468 1492 1469 1493 ModifyTable width(Point)=0 //JUN04, remove point numbers - confuses users since point != run 1470 Endif1494 // Endif 1471 1495 1472 1496 //get a list of all files in the folder, some will be junk version numbers that don't exist … … 1562 1586 Wave/T saveName = $"root:myGlobals:CombineTable:SaveName" 1563 1587 1564 DoWindow/F ToCombine1565 if(V_flag==0)1566 edit Low,Medium,High,Prefix,SaveName as "Run Numbers to Combine"1567 DoWindow/C ToCombine1568 endif1569 AutoPositionWindow/M=1/R=CombineTable toCombine1570 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 1571 1595 1572 1596 ///// … … 1584 1608 1585 1609 // 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 1587 1613 SetWindow kwTopWin hook=CombineTableHook, hookevents=1 // mouse down events 1588 1614 1589 String name="CombineTable"1590 DoWindow/C $name1615 // String name="CombineTable" 1616 // DoWindow/C $name 1591 1617 return(0) 1592 1618 End … … 1676 1702 // 1677 1703 // 1678 Proc DoCombineFiles() 1704 Function DoCombineFiles(ctrlName) 1705 String ctrlName 1679 1706 1680 1707 // pop all of the menus to make sure that they are properly populated … … 1683 1710 HighQPopMenuProc("",1,"") 1684 1711 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 1687 1718 1688 1719 Variable/G useTable=1 … … 1712 1743 Variable/G useTable=0 1713 1744 1714 SetDataFolder savedDataFolder 1715 1745 return(0) 1716 1746 End 1717 1747 … … 1753 1783 Function SendSelectionToTable() 1754 1784 1755 DoWindow/F Combine Table1785 DoWindow/F CombinePanel 1756 1786 if(V_flag==0) 1757 1787 // Make/O/N=0 $"root:myGlobals:CombineTable:Low" … … 1778 1808 endif 1779 1809 1780 GetSelection table,Combine Table,31781 //Print V_startRow, V_endRow1810 GetSelection table,CombinePanel#FilesToCombine,3 1811 Print V_startRow, V_endRow 1782 1812 1783 1813 //prompt for combined name, give the user a chance to cancel … … 1852 1882 Endif 1853 1883 End 1884 1885 //////////////////////// 1886 // replaces the beta menu items 1887 // 1888 1889 Proc ShowCombinePanel() 1890 DoWindow/F CombinePanel 1891 if(V_flag==0) 1892 CombinePanel() 1893 endif 1894 end 1895 1896 Proc 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 ## 1913 EndMacro 1914 1915 Proc 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 1921 end 1922 1923 Function CombinePanelDone(ctrlName) 1924 String ctrlName 1925 1926 DoWindow/K CombinePanel 1927 return(0) 1928 end
Note: See TracChangeset
for help on using the changeset viewer.