Changeset 1000 for sans


Ignore:
Timestamp:
May 27, 2016 4:42:06 PM (7 years ago)
Author:
srkline
Message:

read/write for lateral + vertical offset of detectors, eliminating some extra unused fields.

more additions to the mask editor to give some basic functionality (add/del tubes, save mask)

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

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Alpha/Tinker/FFT_Panel.ipf

    r971 r1000  
    112112 
    113113        SetVariable FFTSetVar_4,pos={7,47},size={100,15},title="FFT time(s)" 
    114         SetVariable FFTSetVar_4,limits={0,0,0},value= FFT_estTime,noedit= 1,live= 1,format="%d" 
     114        SetVariable FFTSetVar_4,limits={0,0,0},value= FFT_estTime,noedit= 1,live= 1,format="%g" 
    115115        Button FFTButton_9,pos={200,400},size={100,20},proc=FFT_Get2DSlice,title="Get 2D Slice" 
    116116 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Read.ipf

    r999 r1000  
    14301430End 
    14311431 
     1432// only return value for B and L/R detectors. everything else returns zero 
    14321433Function V_getDet_LateralOffset(fname,detStr) 
    14331434        String fname,detStr 
    14341435 
     1436        if(cmpstr(detStr,"FT") == 0 || cmpstr(detStr,"FB") == 0) 
     1437                return(0) 
     1438        endif 
     1439        if(cmpstr(detStr,"MT") == 0 || cmpstr(detStr,"MB") == 0) 
     1440                return(0) 
     1441        endif    
     1442         
    14351443        String path = "entry:instrument:detector_"+detStr+":lateral_offset" 
    14361444        return(V_getRealValueFromHDF5(fname,path)) 
    14371445End 
    14381446 
    1439 // TODO - be sure this is defined correctly (with correct units!) 
    1440 // -- only returns for T/B detectors 
    1441 Function V_getDet_TBSetback(fname,detStr) 
     1447// only return values for T/B. everything else returns zero 
     1448Function V_getDet_VerticalOffset(fname,detStr) 
    14421449        String fname,detStr 
    14431450 
     
    14521459        endif    
    14531460         
     1461        String path = "entry:instrument:detector_"+detStr+":vertical_offset" 
     1462        return(V_getRealValueFromHDF5(fname,path)) 
     1463End 
     1464 
     1465// TODO - be sure this is defined correctly (with correct units!) 
     1466// -- only returns for T/B detectors 
     1467Function V_getDet_TBSetback(fname,detStr) 
     1468        String fname,detStr 
     1469 
     1470        if(cmpstr(detStr,"B") == 0) 
     1471                return(0) 
     1472        endif 
     1473        if(cmpstr(detStr,"FR") == 0 || cmpstr(detStr,"FL") == 0) 
     1474                return(0) 
     1475        endif 
     1476        if(cmpstr(detStr,"MR") == 0 || cmpstr(detStr,"ML") == 0) 
     1477                return(0) 
     1478        endif    
     1479         
    14541480        String path = "entry:instrument:detector_"+detStr+":setback" 
    14551481        return(V_getRealValueFromHDF5(fname,path)) 
     
    14581484End 
    14591485 
    1460 //Function V_getDet_VerticalOffset(fname,detStr) 
    1461 //      String fname,detStr 
    1462 // 
    1463 //      String path = "entry:instrument:detector_"+detStr+":vertical_offset" 
    1464 //      return(V_getRealValueFromHDF5(fname,path)) 
    1465 //End 
    14661486 
    14671487 
     
    15061526//End 
    15071527 
    1508 Function/S V_getDetType(fname,detStr) 
    1509         String fname,detStr 
    1510  
    1511         String path = "entry:instrument:detector_"+detStr+":type" 
    1512         Variable num=60 
    1513         return(V_getStringFromHDF5(fname,path,num)) 
    1514 End 
     1528//Function/S V_getDetType(fname,detStr) 
     1529//      String fname,detStr 
     1530// 
     1531//      String path = "entry:instrument:detector_"+detStr+":type" 
     1532//      Variable num=60 
     1533//      return(V_getStringFromHDF5(fname,path,num)) 
     1534//End 
    15151535 
    15161536Function V_getDet_x_pixel_size(fname,detStr) 
     
    15411561End 
    15421562 
    1543 // TODO -- be clear on how this is defined. Separation as defined from what point? Units? 
    1544 Function V_getDetPanelSeparation(fname,detStr) 
    1545         String fname,detStr 
    1546  
    1547         String path = "entry:instrument:detector_"+detStr+":separation" 
    1548         if(cmpstr(detStr,"B") == 0) 
    1549                 return(0) 
    1550         else 
    1551                 return(V_getRealValueFromHDF5(fname,path)) 
    1552         endif 
    1553 End 
     1563// this has been deleted from the definition 
     1564//Function V_getDetPanelSeparation(fname,detStr) 
     1565//      String fname,detStr 
     1566// 
     1567//      String path = "entry:instrument:detector_"+detStr+":separation" 
     1568//      if(cmpstr(detStr,"B") == 0) 
     1569//              return(0) 
     1570//      else 
     1571//              return(V_getRealValueFromHDF5(fname,path)) 
     1572//      endif 
     1573//End 
    15541574 
    15551575// TODO -- write this function to return a WAVE with the data 
     
    16881708 
    16891709///////  sample_aperture (1) (data folder) 
     1710// this is the INTERNAL sample aperture 
     1711// 
    16901712Function/S V_getSampleAp_Description(fname) 
    16911713        String fname 
     
    17381760 
    17391761///////  sample_aperture_2 (data folder) 
     1762// sample aperture (2) is the external paerture, which may or may not be present 
    17401763 
    17411764Function/S V_getSampleAp2_Description(fname) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Write.ipf

    r994 r1000  
    39083908End 
    39093909 
     3910// this is only written for B and L/R detectors 
    39103911Function V_writeDet_LateralOffset(fname,detStr,val) 
    39113912        String fname,detStr 
     
    39133914 
    39143915//      String path = "entry:instrument:detector_"+detStr+":lateral_offset" 
    3915          
     3916 
     3917        if(cmpstr(detStr,"FT") == 0 || cmpstr(detStr,"FB") == 0) 
     3918                return(0) 
     3919        endif 
     3920        if(cmpstr(detStr,"MT") == 0 || cmpstr(detStr,"MB") == 0) 
     3921                return(0) 
     3922        endif    
     3923                 
    39163924        Make/O/D/N=1 wTmpWrite 
    39173925//      Make/O/R/N=1 wTmpWrite 
    39183926        String groupName = "/entry/instrument/detector_"+detStr  
    39193927        String varName = "lateral_offset" 
     3928        wTmpWrite[0] = val 
     3929 
     3930        variable err 
     3931        err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     3932        if(err) 
     3933                Print "HDF write err = ",err 
     3934        endif 
     3935        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     3936//      err = V_KillNamedDataFolder(fname) 
     3937//      if(err) 
     3938//              Print "DataFolder kill err = ",err 
     3939//      endif 
     3940        return(err) 
     3941End 
     3942 
     3943 
     3944// this is only written for T/B detectors 
     3945Function V_writeDet_VerticalOffset(fname,detStr,val) 
     3946        String fname,detStr 
     3947        Variable val 
     3948 
     3949//      String path = "entry:instrument:detector_"+detStr+":vertical_offset" 
     3950 
     3951        if(cmpstr(detStr,"B") == 0) 
     3952                return(0) 
     3953        endif 
     3954        if(cmpstr(detStr,"FR") == 0 || cmpstr(detStr,"FL") == 0) 
     3955                return(0) 
     3956        endif 
     3957        if(cmpstr(detStr,"MR") == 0 || cmpstr(detStr,"ML") == 0) 
     3958                return(0) 
     3959        endif    
     3960                 
     3961        Make/O/D/N=1 wTmpWrite 
     3962//      Make/O/R/N=1 wTmpWrite 
     3963        String groupName = "/entry/instrument/detector_"+detStr  
     3964        String varName = "vertical_offset" 
    39203965        wTmpWrite[0] = val 
    39213966 
     
    39724017 
    39734018 
    3974          
    3975  
    3976 //Function V_writeDet_VerticalOffset(fname,detStr,val) 
    3977 //      String fname,detStr 
    3978 //      Variable val 
    3979 // 
    3980 ////    String path = "entry:instrument:detector_"+detStr+":vertical_offset" 
    3981 //       
    3982 //      Make/O/D/N=1 wTmpWrite 
    3983 ////    Make/O/R/N=1 wTmpWrite 
    3984 //      String groupName = "/entry/instrument/detector_"+detStr  
    3985 //      String varName = "vertical_offset" 
    3986 //      wTmpWrite[0] = val 
    3987 // 
    3988 //      variable err 
    3989 //      err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
    3990 //      if(err) 
    3991 //              Print "HDF write err = ",err 
    3992 //      endif 
    3993 //      // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
    3994 ////    err = V_KillNamedDataFolder(fname) 
    3995 ////    if(err) 
    3996 ////            Print "DataFolder kill err = ",err 
    3997 ////    endif 
    3998 //      return(err) 
    3999 //End 
    40004019 
    40014020//// only defined for the "B" detector, and only to satisfy NXsas 
     
    41104129//End 
    41114130 
    4112 Function V_writeDetType(fname,detStr,str) 
    4113         String fname,detStr,str 
    4114  
    4115 //      String path = "entry:instrument:detector_"+detStr+":type" 
    4116  
    4117         Make/O/T/N=1 tmpTW 
    4118         String groupName = "/entry/instrument/detector_"+detStr //       
    4119         String varName = "type" 
    4120         tmpTW[0] = str // 
    4121  
    4122         variable err 
    4123         err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 
    4124         if(err) 
    4125                 Print "HDF write err = ",err 
    4126         endif 
    4127          
    4128         // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
    4129 //      err = V_KillNamedDataFolder(fname) 
    4130 //      if(err) 
    4131 //              Print "DataFolder kill err = ",err 
    4132 //      endif 
    4133                  
    4134         return(err) 
    4135 End 
     4131//Function V_writeDetType(fname,detStr,str) 
     4132//      String fname,detStr,str 
     4133// 
     4134////    String path = "entry:instrument:detector_"+detStr+":type" 
     4135// 
     4136//      Make/O/T/N=1 tmpTW 
     4137//      String groupName = "/entry/instrument/detector_"+detStr //       
     4138//      String varName = "type" 
     4139//      tmpTW[0] = str // 
     4140// 
     4141//      variable err 
     4142//      err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 
     4143//      if(err) 
     4144//              Print "HDF write err = ",err 
     4145//      endif 
     4146//       
     4147//      // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     4148////    err = V_KillNamedDataFolder(fname) 
     4149////    if(err) 
     4150////            Print "DataFolder kill err = ",err 
     4151////    endif 
     4152//               
     4153//      return(err) 
     4154//End 
    41364155 
    41374156Function V_writeDet_x_pixel_size(fname,detStr,val) 
     
    42174236End 
    42184237 
    4219 // TODO -- be clear on how this is defined. Separation as defined from what point? Units? 
    4220 Function V_writeDetPanelSeparation(fname,detStr,val) 
    4221         String fname,detStr 
    4222         Variable val 
    4223  
    4224 //      String path = "entry:instrument:detector_"+detStr+":separation" 
    4225         if(cmpstr(detStr,"B") == 0) 
    4226                 return(0) 
    4227         else 
    4228          
    4229                 Make/O/D/N=1 wTmpWrite 
    4230         //      Make/O/R/N=1 wTmpWrite 
    4231                 String groupName = "/entry/instrument/detector_"+detStr  
    4232                 String varName = "separation" 
    4233                 wTmpWrite[0] = val 
    4234  
    4235                 variable err 
    4236                 err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
    4237                 if(err) 
    4238                         Print "HDF write err = ",err 
    4239                 endif 
    4240                 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
    4241 //              err = V_KillNamedDataFolder(fname) 
     4238// deleted from definition 
     4239//Function V_writeDetPanelSeparation(fname,detStr,val) 
     4240//      String fname,detStr 
     4241//      Variable val 
     4242// 
     4243////    String path = "entry:instrument:detector_"+detStr+":separation" 
     4244//      if(cmpstr(detStr,"B") == 0) 
     4245//              return(0) 
     4246//      else 
     4247//       
     4248//              Make/O/D/N=1 wTmpWrite 
     4249//      //      Make/O/R/N=1 wTmpWrite 
     4250//              String groupName = "/entry/instrument/detector_"+detStr  
     4251//              String varName = "separation" 
     4252//              wTmpWrite[0] = val 
     4253// 
     4254//              variable err 
     4255//              err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
    42424256//              if(err) 
    4243 //                      Print "DataFolder kill err = ",err 
     4257//                      Print "HDF write err = ",err 
    42444258//              endif 
    4245                 return(err) 
    4246         endif 
    4247 End 
     4259//              // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     4260////            err = V_KillNamedDataFolder(fname) 
     4261////            if(err) 
     4262////                    Print "DataFolder kill err = ",err 
     4263////            endif 
     4264//              return(err) 
     4265//      endif 
     4266//End 
    42484267 
    42494268// TODO -- write this function to return a WAVE with the data 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MainPanel.ipf

    r994 r1000  
    4747        String ctrlName 
    4848         
    49         DrawMask() 
     49        Edit_a_Mask() 
    5050End 
    5151 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MaskUtils.ipf

    r999 r1000  
    5656        PauseUpdate; Silent 1           // building window... 
    5757 
    58         NewPanel /W=(662,418,1586,960)/N=MaskEditPanel/K=1 
     58        NewPanel /W=(662,418,1300,960)/N=MaskEditPanel   /K=1 
    5959//      ShowTools/A 
    6060         
    6161        PopupMenu popup_0,pos={20,50},size={109,20},proc=SetMaskPanelPopMenuProc,title="Detector Panel" 
    62         PopupMenu popup_0,mode=1,popvalue="FL",value= #"\"FL;FR;FT;FB;MR;ML;MT;MB;B;\"" 
     62        PopupMenu popup_0,mode=1,popvalue="FT",value= #"\"FL;FR;FT;FB;MR;ML;MT;MB;B;\"" 
    6363        PopupMenu popup_2,pos={20,20},size={109,20},title="Data Source"//,proc=SetFldrPopMenuProc 
    64         PopupMenu popup_2,mode=1,popvalue="VCALC",value= #"\"RAW;SAM;VCALC;\"" 
    65                  
    66 //      Button button_0,pos={486,20},size={80,20},proc=DetFitGuessButtonProc,title="Guess" 
    67 //      Button button_1,pos={615,20},size={80,20},proc=DetFitButtonProc,title="Do Fit" 
    68 //      Button button_2,pos={744,20},size={80,20},proc=DetFitHelpButtonProc,title="Help" 
    69 //      Button button_3,pos={615,400},size={110,20},proc=WriteCtrButtonProc,title="Write Centers" 
    70 //      Button button_4,pos={730,400},size={110,20},proc=CtrTableButtonProc,title="Ctr table" 
    71 //      Button button_5,pos={730,440},size={110,20},proc=WriteCtrTableButtonProc,title="Write table" 
     64        PopupMenu popup_2,mode=1,popvalue="RAW",value= #"\"RAW;SAM;VCALC;\"" 
     65 
     66        SetVariable setvar0,pos={247.00,20.00},size={150.00,14.00},title="tube number" 
     67        SetVariable setvar0,limits={0,128,1},value= _NUM:0 
     68        Button button_0,pos={249.00,46.00},size={50.00,20.00},proc=AddToMaskButtonProc,title="Add" 
     69        Button button_1,pos={309.00,46.00},size={50.00,20.00},proc=RemoveFromMaskButtonProc,title="Del" 
     70        Button button_2,pos={389.00,46.00},size={90.00,20.00},proc=ToggleMaskButtonProc,title="Toggle" 
     71        Button button_3,pos={489.00,46.00},size={80.00,20.00},proc=SaveMaskButtonProc,title="Save" 
    7272 
    7373// TODO -- need buttons for save? quit? 
     
    7777 
    7878// TODO - get rid of the hard-wired panel choice 
    79         duplicate/O root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_FL:det_FL curDispPanel 
     79//      duplicate/O root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_FL:det_FL curDispPanel 
     80        Make/O/D/N=(48,128) curDispPanel                //will this work? 
    8081        SetScale/P x 0,1, curDispPanel 
    8182        SetScale/P y 0,1, curDispPanel 
     
    8384        // draw the correct images 
    8485        //draw the detector panel 
    85         DrawPanelToMask("FL") 
     86        DrawPanelToMask("FT") 
    8687         
    8788        // overlay the current mask 
    88         V_OverlayMask("FL",1) 
     89        V_OverlayMask("FT",1) 
    8990//      OverlayMaskPanel("FL") 
    9091 
    9192EndMacro 
     93 
     94 
     95Function ToggleMaskButtonProc(ba) : ButtonControl 
     96        STRUCT WMButtonAction &ba 
     97 
     98        switch( ba.eventCode ) 
     99                case 2: // mouse up 
     100                        // click code here 
     101                         
     102                        ControlInfo popup_0 
     103                        String str=S_Value 
     104 
     105                        wave/Z overlay = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":overlay") 
     106                         
     107                        CheckDisplayed/W=MaskEditPanel#DetData overlay 
     108                        Variable state = !(V_flag)              //if V_flag == 0, then set to 1 (and vice versa) 
     109                        V_OverlayMask(str,state) 
     110 
     111                        break 
     112                case -1: // control being killed 
     113                        break 
     114        endswitch 
     115 
     116        return 0 
     117End 
     118 
     119 
     120Function AddToMaskButtonProc(ba) : ButtonControl 
     121        STRUCT WMButtonAction &ba 
     122 
     123        switch( ba.eventCode ) 
     124                case 2: // mouse up 
     125                        // click code here 
     126                        ControlInfo popup_0 
     127                        String str=S_Value 
     128                         
     129                        wave/Z maskData = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":data") 
     130                         
     131                        Variable val 
     132                        ControlInfo setvar0 
     133                        val = V_Value 
     134                        maskData[val][] = 1 
     135                         
     136                        V_OverlayMask(str,1) 
     137                         
     138//                      Print "add tube to mask" 
     139                        break 
     140                case -1: // control being killed 
     141                        break 
     142        endswitch 
     143 
     144        return 0 
     145End 
     146 
     147Function RemoveFromMaskButtonProc(ba) : ButtonControl 
     148        STRUCT WMButtonAction &ba 
     149 
     150        switch( ba.eventCode ) 
     151                case 2: // mouse up 
     152                        // click code here 
     153                        ControlInfo popup_0 
     154                        String str=S_Value 
     155                         
     156                        wave/Z maskData = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":data") 
     157                         
     158                        Variable val 
     159                        ControlInfo setvar0 
     160                        val = V_Value 
     161                        maskData[val][] = 0 
     162                         
     163                        V_OverlayMask(str,1)                     
     164//                      Print "remove tube from mask" 
     165                        break 
     166                case -1: // control being killed 
     167                        break 
     168        endswitch 
     169 
     170        return 0 
     171End 
    92172 
    93173// 
     
    200280         
    201281 
    202         Variable scale = 5 
     282        Variable scale = 10 
    203283         
    204284        // common values (panel position, etc) 
     
    289369        String maskPath = "root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":data" 
    290370        if(WaveExists($maskPath) == 1) 
    291                 //duplicate the mask, which is named "data" 
    292                 wave maskW = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":data") 
    293  
    294                 Duplicate/O maskW $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":overlay") 
    295                 wave overlay = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":overlay") 
    296  
    297                 Redimension/D overlay 
    298                 SetScale/P x 0,1, overlay 
    299                 SetScale/P y 0,1, overlay 
    300          
    301                 String tempStr = "root:Packages:NIST:MSK:overlay" 
    302                 overlay = (maskW == 1) ? 1 : NaN 
    303 //              ResetLoop(tempStr)              //keeps 1's and sets 0's to NaN 
    304  
    305                 AppendImage/W=MaskEditPanel#DetData overlay 
    306                 ModifyImage/W=MaskEditPanel#DetData overlay ctab= {0,*,BlueRedGreen,0}   
    307  
    308 //       
    309 //              //check to see if mask overlay is currently displayed 
    310 //              DoWindow SANS_Data 
    311 //              if(V_flag==0) 
    312 //                      return(0) 
    313 //              endif 
    314 //               
    315 //              CheckDisplayed/W=SANS_Data root:Packages:NIST:MSK:overlay 
    316 //              //Print "V_flag = ",V_flag 
    317 //       
    318 //              If(V_Flag == 1)         //overlay is present 
    319 //                      if(state==0) 
    320 //                              RemoveImage overlay 
    321 //                      endif           //don't need to do anything if we want to keep the mask 
    322 //              Else            //overlay is not present 
    323 //                      if(state==1) 
    324 //                              //append the new overlay 
    325 //                              AppendImage/L=left/B=bottom root:Packages:NIST:MSK:overlay 
    326 //                              //set the color table to vary from 0 to * (=max data = 1), with blue maximum 
    327 //                              //Nan's will appear transparent (just a general feature of images) 
    328 //                              ModifyImage/W=SANS_Data overlay ctab={0,*,BlueRedGreen,0} 
    329 //                      endif           //don't do anything if we don't want the overlay 
    330 //              Endif 
    331 //               
     371                if(state == 1) 
     372                        //duplicate the mask, which is named "data" 
     373                        wave maskW = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":data") 
     374         
     375                        Duplicate/O maskW $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":overlay") 
     376                        wave overlay = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":overlay") 
     377         
     378                        Redimension/D overlay 
     379                        SetScale/P x 0,1, overlay 
     380                        SetScale/P y 0,1, overlay 
     381                 
     382                        String tempStr = "root:Packages:NIST:MSK:overlay" 
     383        //              overlay = (maskW == 1) ? 1 : NaN                        //no need to do this - simply adjust the coloring 
     384         
     385                        CheckDisplayed/W=MaskEditPanel#DetData overlay 
     386                        if(V_flag==0)           //so the overlay doesn't get appended more than once 
     387                                AppendImage/W=MaskEditPanel#DetData overlay 
     388                                ModifyImage/W=MaskEditPanel#DetData overlay ctab= {0.9,1,BlueRedGreen,0}        ,minRGB=NaN,maxRGB=0 
     389                //              ModifyImage/W=MaskEditPanel#DetData overlay ctab= {0,*,BlueRedGreen,0}   
     390                        endif 
     391                endif 
     392 
     393                if(state == 0) 
     394                        wave overlay = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":overlay") 
     395                        CheckDisplayed/W=MaskEditPanel#DetData overlay 
     396//                      Print "V_flag = ",V_flag 
     397         
     398                        If(V_Flag == 1)         //overlay is present 
     399                                RemoveImage/W=MaskEditPanel#DetData overlay 
     400                        endif 
     401                endif 
    332402        Endif 
    333403         
    334404        return(0) 
     405End 
     406 
     407 
     408Function SaveMaskButtonProc(ba) : ButtonControl 
     409        STRUCT WMButtonAction &ba 
     410 
     411        switch( ba.eventCode ) 
     412                case 2: // mouse up 
     413                        // click code here 
     414                         
     415                        Execute "H_Setup_VSANS_MASK_Structure()" 
     416                         
     417                        // fill with current "stuff" 
     418                                SetDataFolder root:VSANS_MASK_file:entry         
     419                        Wave/T title    = title 
     420                        title = "This is a custom MASK file for VSANS" 
     421                        SetDataFolder root: 
     422                         
     423                         
     424                // copy over for all of the detector panels 
     425 
     426                        Variable ii 
     427                        String str 
     428                        for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 
     429                                str = StringFromList(ii, ksDetectorListAll, ";") 
     430                                Wave det_str = $("root:VSANS_MASK_file:entry:instrument:detector_"+str+":data")  
     431                                wave maskW = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+str+":data")                    
     432                                det_str = maskW 
     433                        endfor 
     434 
     435                        //save it 
     436//                      String fileName = "ThisIsAMASK" 
     437 
     438                        Execute "Save_VSANS_MASK_Nexus()" 
     439                         
     440                        break 
     441                case -1: // control being killed 
     442                        break 
     443        endswitch 
     444 
     445        SetDataFolder root: 
     446        return 0 
    335447End 
    336448 
Note: See TracChangeset for help on using the changeset viewer.