Changeset 874 for sans/Dev/trunk/NCNR_User_Procedures/Reduction
- Timestamp:
- Nov 8, 2012 11:45:21 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/EventModeProcessing.ipf
r871 r874 8 8 // 9 9 // -- fix the log/lin display - it's not working correctly 10 // -- add controls to show the bar graph10 // X- add controls to show the bar graph 11 11 // x- add popup for selecting the binning type 12 12 // x- add ability to save the slices to RAW VAX files 13 // -- add control to show the bin counts and bin end times13 // X- add control to show the bin counts and bin end times 14 14 // x- ADD buttons, switches, etc for the oscillatory mode - so that this can be accessed 15 15 // … … 37 37 38 38 39 MacroShow_Event_Panel()39 Proc Show_Event_Panel() 40 40 DoWindow/F EventModePanel 41 41 if(V_flag ==0) … … 48 48 Function Init_Event() 49 49 String/G root:Packages:NIST:gEvent_logfile 50 String/G root:Packages:NIST:gEventDisplayString="Details of the file load" 51 50 52 Variable/G root:Packages:NIST:AIMTYPE_XY=0 // XY Event 51 53 Variable/G root:Packages:NIST:AIMTYPE_XYM=2 // XY Minor event … … 80 82 Proc EventModePanel() 81 83 PauseUpdate; Silent 1 // building window... 82 NewPanel /K=2 /W=(100,50,600,680)/N=EventModePanel84 NewPanel /W=(100,50,600,840)/N=EventModePanel/K=2 83 85 DoWindow/C EventModePanel 84 86 ModifyPanel fixedSize=1,noEdit =1 85 87 //ShowTools/A 86 88 SetDrawLayer UserBack 87 Button button0,pos ={10,10}, size={150,20},title="Load Event Log File",fSize=1289 Button button0,pos={10,10}, size={150,20},title="Load Event Log File",fSize=12 88 90 Button button0,proc=LoadEventLog_Button 89 SetVariable setvar3,pos= {20,590},size={460,20},title=" ",fSize=12 90 SetVariable setvar3,disable=2,variable=root:Packages:NIST:gEvent_logfile 91 92 TitleBox tb1,pos={20,650},size={460,80},fSize=12 93 TitleBox tb1,variable=root:Packages:NIST:gEventDisplayString 94 91 95 CheckBox chkbox1,pos={170,15},title="Oscillatory Mode?" 92 96 CheckBox chkbox1,variable = root:Packages:NIST:gEvent_mode 93 Button doneButton,pos={4 00,10}, size={50,20},title="Done",fSize=1297 Button doneButton,pos={435,12}, size={50,20},title="Done",fSize=12 94 98 Button doneButton,proc=EventDone_Proc 99 100 Button button2,pos={20,122},size={140,20},proc=ShowEventDataButtonProc,title="Show Event Data" 101 Button button3,pos={20,147},size={140,20},proc=ShowBinDetailsButtonProc,title="Show Bin Details" 102 Button button4,pos={175,122},size={140,20},proc=UndoTimeSortButtonProc,title="Undo Time Sort" 103 Button button5,pos={175,147},size={140,20},proc=ExportSlicesButtonProc,title="Export Slices as VAX" 104 Button button6,pos={378,13},size={40,20},proc=EventModeHelpButtonProc,title="?" 95 105 96 106 //DrawLine 10,35,490,35 … … 111 121 SetVariable setvar0,value= root:Packages:NIST:gEvent_tsdisp 112 122 SetVariable setvar0,proc=sliceSelectEvent_Proc 113 Display/W=(20,1 20,480,580)/HOST=EventModePanel/N=Event_slicegraph123 Display/W=(20,180,480,640)/HOST=EventModePanel/N=Event_slicegraph 114 124 AppendImage/W=EventModePanel#Event_slicegraph/T root:Packages:NIST:Event:dispsliceData 115 125 ModifyImage/W=EventModePanel#Event_slicegraph ''#0 ctab= {*,*,Grays,0} … … 128 138 EndMacro 129 139 140 Function ShowEventDataButtonProc(ba) : ButtonControl 141 STRUCT WMButtonAction &ba 142 143 switch( ba.eventCode ) 144 case 2: // mouse up 145 // click code here 146 Execute "ShowRescaledTimeGraph()" 147 break 148 case -1: // control being killed 149 break 150 endswitch 151 152 return 0 153 End 154 155 Function ShowBinDetailsButtonProc(ba) : ButtonControl 156 STRUCT WMButtonAction &ba 157 158 switch( ba.eventCode ) 159 case 2: // mouse up 160 // click code here 161 Execute "ShowBinTable()" 162 Execute "BinEventBarGraph()" 163 break 164 case -1: // control being killed 165 break 166 endswitch 167 168 return 0 169 End 170 171 Function UndoTimeSortButtonProc(ba) : ButtonControl 172 STRUCT WMButtonAction &ba 173 174 switch( ba.eventCode ) 175 case 2: // mouse up 176 // click code here 177 Execute "UndoTheSorting()" 178 break 179 case -1: // control being killed 180 break 181 endswitch 182 183 return 0 184 End 185 186 Function ExportSlicesButtonProc(ba) : ButtonControl 187 STRUCT WMButtonAction &ba 188 189 switch( ba.eventCode ) 190 case 2: // mouse up 191 // click code here 192 Execute "ExportSlicesAsVAX()" //will invoke the dialog 193 break 194 case -1: // control being killed 195 break 196 endswitch 197 198 return 0 199 End 200 201 Function EventModeHelpButtonProc(ba) : ButtonControl 202 STRUCT WMButtonAction &ba 203 204 switch( ba.eventCode ) 205 case 2: // mouse up 206 // click code here 207 DoAlert 0,"The help file has not been written yet" 208 break 209 case -1: // control being killed 210 break 211 endswitch 212 213 return 0 214 End 215 216 130 217 Function EventDone_Proc(ba) : ButtonControl 131 218 STRUCT WMButtonAction &ba … … 222 309 223 310 224 MacroUndoTheSorting()311 Proc UndoTheSorting() 225 312 Osc_UndoSort() 226 313 End … … 683 770 684 771 // 772 // for the bit shifts, see the decimal-binary conversion 773 // http://www.binaryconvert.com/convert_unsigned_int.html 774 // 685 775 Function LoadEvents() 686 776 … … 690 780 691 781 SVAR filepathstr = root:Packages:NIST:gEvent_logfile 782 SVAR dispStr = root:Packages:NIST:gEventDisplayString 783 692 784 SetDataFolder root:Packages:NIST:Event 693 785 … … 773 865 // 774 866 // 775 Printf "numXYevents = %d\r",numXYevents 776 Printf "XY = num0 = %d\r",num0 777 Printf "XY time = num2 = %d\r",num2 778 Printf "time MSW = num1 = %d\r",num1 779 Printf "Rollover = num3 = %d\r",num3 780 781 Printf "num0 + num2 = %d\r",num0+num2 867 // Printf "numXYevents = %d\r",numXYevents 868 // Printf "XY = num0 = %d\r",num0 869 // Printf "XY time = num2 = %d\r",num2 870 // Printf "time MSW = num1 = %d\r",num1 871 // Printf "Rollover = num3 = %d\r",num3 872 873 // Printf "num0 + num2 = %d\r",num0+num2 874 875 String fileStr = ParseFilePath(0, filepathstr, ":", 1, 0),tmpStr 876 877 sprintf tmpStr, "%s: %d total bytes",fileStr,totBytes 878 dispStr = tmpStr 879 sPrintf tmpStr,"\rnumXYevents = %d\rXY = num0 = %d",numXYevents,num0 880 dispStr += tmpStr 881 sPrintf tmpStr,"\rXY time = num2 = %d\rtime MSW = num1 = %d",num2,num1 882 dispStr += tmpStr 883 sPrintf tmpStr,"\rRollover = num3 = %d",num3 884 dispStr += tmpStr 885 886 782 887 783 888 Make/O/U/N=(numXYevents) xLoc,yLoc … … 821 926 type = (dataval & 0xC0000000)/1073741824 //right shift by 2^30 822 927 928 if(verbose > 0) 929 verbose -= 1 930 endif 823 931 // 824 932 switch(type) … … 845 953 if(verbose) 846 954 // printf "%u : %u : %u : %u\r",dataval,time_lsw,time_msw,timeval 847 printf " %u : %u : %u : %u\r",dataval,timeval,xval,yval955 printf "d=%u : t=%u : msw=%u : lsw=%u : %u : %u \r",dataval,timeval,time_msw,time_lsw,xval,yval 848 956 endif 849 957 … … 893 1001 if(verbose) 894 1002 // printf "%u : %u : %u : %u\r",dataval,time_lsw,time_msw,timeval 895 printf " %u : %u : %u : %u : %u\r",dataval,time_lsw,time_msw,timeval,t_longest1003 printf "d=%u : t=%u : msw=%u : lsw=%u : tlong=%u\r",dataval,timeval,time_msw,time_lsw,t_longest 896 1004 endif 897 1005 … … 908 1016 case ATMAR: 909 1017 if(verbose3) 910 // verbose = 1 1018 // verbose = 15 1019 verbose = 2 911 1020 printf "MAR : " 912 1021 endif … … 940 1049 /// 941 1050 942 MacroBinEventBarGraph()1051 Proc BinEventBarGraph() 943 1052 PauseUpdate; Silent 1 // building window... 944 1053 String fldrSav0= GetDataFolder(1) … … 962 1071 End 963 1072 964 MacroShowBinTable() : Table1073 Proc ShowBinTable() : Table 965 1074 PauseUpdate; Silent 1 // building window... 966 1075 String fldrSav0= GetDataFolder(1) … … 974 1083 // only show the first 1500 data points 975 1084 // 976 MacroShowRescaledTimeGraph() : Graph1085 Proc ShowRescaledTimeGraph() : Graph 977 1086 PauseUpdate; Silent 1 // building window... 978 1087 String fldrSav0= GetDataFolder(1) … … 992 1101 993 1102 994 MacroExportSlicesAsVAX(firstNum,prefix)1103 Proc ExportSlicesAsVAX(firstNum,prefix) 995 1104 Variable firstNum=1 996 1105 String prefix="SAMPL"
Note: See TracChangeset
for help on using the changeset viewer.