- Timestamp:
- Apr 8, 2010 1:28:21 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NSORT.ipf
r665 r670 1421 1421 // run numbers and a run prefix 1422 1422 // 1423 // it is assumed that you are combining data from the current reduction session, 1424 // so that the XML y/n hasn't changed. 1423 1425 // 1424 1426 Function Set3NSORTFiles(low,med,hi,pref) … … 1427 1429 1428 1430 //make strings from the numbers 1429 String absStr="" 1431 String absStr="",ext 1430 1432 Variable popNum 1431 1433 DoWindow/F NSORT_Panel … … 1434 1436 SVAR medHiQPopStr = root:myGlobals:NSORT:gDataPopList_3 1435 1437 1436 String ext = ".ABS" 1438 NVAR useXMLOutput = root:Packages:NIST:gXML_Write 1439 if(useXMLOutput) 1440 ext = ".ABSx" 1441 else 1442 ext = ".ABS" 1443 endif 1437 1444 1438 1445 //lowQ menu 1439 1446 absStr = pref+ThreeDigitString(low)+ext 1440 popNum = 1+WhichListItem(absStr,lowQPopStr,";",0) 1447 popNum = WhichListItem(absStr,lowQPopStr,";",0) 1448 if(popNum == -1) 1449 Abort "Could not find file: " + absStr +" aborting..." 1450 endif 1451 popNum += 1 // add 1 to get the item number 1441 1452 PopupMenu popup_1,win=NSORT_Panel,mode=(popNum) 1453 1442 1454 //medQ (a different list for the popup) 1443 1455 absStr = pref+ThreeDigitString(med)+ext 1444 popNum = 1+WhichListItem(absStr,medHiQPopStr,";",0) 1456 popNum = WhichListItem(absStr,medHiQPopStr,";",0) 1457 if(popNum == -1) 1458 Abort "Could not find file: "+absStr+" aborting..." 1459 endif 1460 popNum += 1 // add 1 to get the item number 1445 1461 PopupMenu popup_2,win=NSORT_Panel,mode=(popNum) 1462 1463 1446 1464 //highQ (same pop list as medQ) 1447 1465 if(hi != 0) 1448 1466 absStr = pref+ThreeDigitString(hi)+ext 1449 popNum = 1+WhichListItem(absStr,medHiQPopStr,";",0) 1467 popNum = WhichListItem(absStr,medHiQPopStr,";",0) 1468 if(popNum == -1) 1469 Abort "Could not find file: "+absStr+" aborting..." 1470 endif 1471 popNum += 1 // add 1 to get the item number 1450 1472 PopupMenu popup_3,win=NSORT_Panel,mode=(popNum) 1451 1473 else … … 1486 1508 Make/O/D/N=0 $"root:myGlobals:CombineTable:IsTrans" 1487 1509 1488 // If(V_Flag==0) 1489 BuildCombineTableWindow()1490 ModifyTable/W=CombinePanel#FilesToCombine width(:myGlobals:CombineTable:SDD)=40 1491 ModifyTable/W=CombinePanel#FilesToCombine width(:myGlobals:CombineTable:Labels)=1801492 1493 ModifyTable/W=CombinePanel#FilesToCombinewidth(Point)=0 //JUN04, remove point numbers - confuses users since point != run1494 // Endif 1510 1511 AppendToTable/W=CombinePanel#GroupedFiles root:myGlobals:CombineTable:Labels, root:myGlobals:CombineTable:SDD, root:myGlobals:CombineTable:RunNumber 1512 1513 ModifyTable/W=CombinePanel#GroupedFiles width(:myGlobals:CombineTable:SDD)=40 1514 ModifyTable/W=CombinePanel#GroupedFiles width(:myGlobals:CombineTable:Labels)=180 1515 ModifyTable/W=CombinePanel#GroupedFiles width(Point)=0 //JUN04, remove point numbers - confuses users since point != run 1516 1495 1517 1496 1518 //get a list of all files in the folder, some will be junk version numbers that don't exist … … 1554 1576 Make/O/T/N=0 $"root:myGlobals:CombineTable:Prefix" 1555 1577 Make/O/T/N=0 $"root:myGlobals:CombineTable:SaveName" 1556 MakeTableToCombine() 1557 1578 1579 SetDataFolder root:myGlobals:CombineTable 1580 1581 // make the second table 1582 AppendToTable/W=CombinePanel#RunNumbersToCombine LowRun,MediumRun,HighRun,Prefix,SaveName 1583 1584 SetDataFolder root: 1558 1585 End 1559 1586 … … 1575 1602 ii-=1 1576 1603 while(ii>=0) 1577 return(0)1578 End1579 1580 Function MakeTabletoCombine()1581 1582 Wave low = $"root:myGlobals:CombineTable:LowRun"1583 Wave medium = $"root:myGlobals:CombineTable:MediumRun"1584 Wave high = $"root:myGlobals:CombineTable:HighRun"1585 Wave/T prefix = $"root:myGlobals:CombineTable:Prefix"1586 Wave/T saveName = $"root:myGlobals:CombineTable:SaveName"1587 1588 // DoWindow/F ToCombine1589 // if(V_flag==0)1590 // edit Low,Medium,High,Prefix,SaveName as "Run Numbers to Combine"1591 // DoWindow/C ToCombine1592 // endif1593 // AutoPositionWindow/M=1/R=CombineTable toCombine1594 AppendToTable/W=CombinePanel#RunNumbersToCombine Low,Medium,High,Prefix,SaveName1595 1596 /////1597 // SetWindow kwTopWin hook=CombineTableHook, hookevents=1 // mouse down events1598 1599 end1600 1601 Function BuildCombineTableWindow()1602 Wave/T Filenames = $"root:myGlobals:CombineTable:Filenames"1603 Wave/T Labels = $"root:myGlobals:CombineTable:Labels"1604 Wave SDD = $"root:myGlobals:CombineTable:SDD"1605 Wave/T suffix = $"root:myGlobals:CombineTable:Suffix"1606 Wave runnum = $"root:myGlobals:CombineTable:RunNumber"1607 Wave isTrans = $"root:myGlobals:CombineTable:IsTrans"1608 1609 // Edit Filenames, Labels, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens as "Files to Combine"1610 // Edit Labels, SDD, runNum as "Files to Combine"1611 AppendToTable/W=CombinePanel#FilesToCombine Labels, SDD, runNum1612 1613 SetWindow kwTopWin hook=CombineTableHook, hookevents=1 // mouse down events1614 1615 // String name="CombineTable"1616 // DoWindow/C $name1617 1604 return(0) 1618 1605 End … … 1738 1725 WriteNSORTFileButton("") 1739 1726 1727 Print "wrote file : ",path+saveName[ii] 1740 1728 ii+=1 1741 1729 while(ii<num) … … 1747 1735 1748 1736 1749 // Commentized lines here are incomplete - and NON-FUNCTIONING1737 // only respond to clicks in the subwindow (table) rather than everywhere. Hooks can't be set for subwindows 1750 1738 // 1751 1739 //// Window hook example: 1740 // WINDOW:CombinePanel;HCSPEC:CombinePanel#GroupedFiles;EVENT:mouseup;MOUSEX:152;MOUSEY:143;TICKS:7722029;MODIFIERS:0; 1752 1741 // 1753 1742 Function CombineTableHook(infoStr) 1754 1743 String infoStr 1755 1744 String event= StringByKey("EVENT",infoStr) 1745 String subwin = StringByKey("HCSPEC",infoStr) 1746 // Print subwin 1747 // Print infoStr 1756 1748 // Print "EVENT= ",event 1757 strswitch(event) 1758 case "mousedown": 1759 Variable xpix= NumberByKey("MOUSEX",infoStr) 1760 Variable ypix= NumberByKey("MOUSEY",infoStr) 1761 Variable modif= NumberByKey("MODIFIERS",infoStr) 1762 //print modif 1763 if(modif & 2^1) //bit 1 set, shift key is down 1764 PopupContextualMenu/C=(xpix, ypix) "combine;" 1765 strswitch(S_selection) 1766 case "combine": 1767 //Print "combine the files" 1768 SendSelectionToTable() 1769 break 1770 // case "no": 1771 // break 1772 // case "maybe": 1773 // // do something because "maybe" was chosen 1774 // break 1775 endswitch //on selection 1776 endif 1777 endswitch // on event 1778 1749 if(cmpstr(subwin,"CombinePanel#GroupedFiles")==0) 1750 strswitch(event) 1751 case "mousedown": 1752 Variable xpix= NumberByKey("MOUSEX",infoStr) 1753 Variable ypix= NumberByKey("MOUSEY",infoStr) 1754 Variable modif= NumberByKey("MODIFIERS",infoStr) 1755 //print modif 1756 if(modif & 2^1) //bit 1 set, shift key is down 1757 PopupContextualMenu/C=(xpix, ypix) "combine;" 1758 strswitch(S_selection) 1759 case "combine": 1760 //Print "combine the files" 1761 SendSelectionToTable() 1762 break 1763 endswitch //on selection 1764 endif 1765 endswitch // on event 1766 endif 1779 1767 return 0 1780 1768 End … … 1808 1796 endif 1809 1797 1810 GetSelection table,CombinePanel# FilesToCombine,31811 Print V_startRow, V_endRow1798 GetSelection table,CombinePanel#GroupedFiles,3 1799 // Print V_startRow, V_endRow 1812 1800 1813 1801 //prompt for combined name, give the user a chance to cancel … … 1905 1893 Edit/W=(20,54,368,249)/HOST=# 1906 1894 ModifyTable format=1,width=0 1907 RenameWindow #, FilesToCombine1895 RenameWindow #,GroupedFiles 1908 1896 SetActiveSubwindow ## 1909 1897 Edit/W=(20,263,634,455)/HOST=# … … 1911 1899 RenameWindow #,RunNumbersToCombine 1912 1900 SetActiveSubwindow ## 1901 SetWindow kwTopWin hook=CombineTableHook, hookevents=1 // mouse down events 1913 1902 EndMacro 1914 1903
Note: See TracChangeset
for help on using the changeset viewer.