Changeset 482


Ignore:
Timestamp:
Mar 13, 2009 5:21:21 PM (14 years ago)
Author:
ajj
Message:
  • Re-introduce live data display
  • Fix to load real data file
Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Includes_v520.ipf

    r448 r482  
    4747// removed RT button from main panel AUG2006 
    4848// removed RT ipf file in 29MAR07 branch (do not delete, but do not include or maintain) 
    49 //#include "RealTimeUpdate_RT"          version>=5.0             
     49//Add back Real Time for ICE 
     50#include "RealTimeUpdate_RT"            version>=5.0             
    5051#include "SANSPreferences"                              version>=5.0            //NEW 05MAY03 
    5152#include "Subtract_1D"                          version>=5.0                    //NEW 14MAY03 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MainPanel.ipf

    r412 r482  
    262262        Button MainButton_0c,pos={15,150},size={110,20},proc=TransMainButtonProc,title="Transmission" 
    263263        Button MainButton_0c,help={"Shows the \"Patch\" panel which allows calculation of sample transmissions and entering these values into raw data headers"} 
    264 //      Button MainButton_0d,pos={15,180},size={130,20},proc=RealTime_MainButtonProc,title="RealTime Display" 
    265 //      Button MainButton_0d,help={"Shows the panel for control of the RealTime data display. Only used during data collection"} 
     264        Button MainButton_0d,pos={15,180},size={130,20},proc=RealTime_MainButtonProc,title="RealTime Display" 
     265        Button MainButton_0d,help={"Shows the panel for control of the RealTime data display. Only used during data collection"} 
    266266 
    267267//on tab(1) - Reduction 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Marquee.ipf

    r418 r482  
    501501        DoWindow/C SANS_Histo 
    502502        DoWindow/T SANS_Histo,"Histogram" 
    503         ModifyGraph mode=5,grid=1,mirror=2 
     503        ModifyGraph mode=0,grid=1,mirror=2 
    504504        ModifyGraph rgb=(21845,21845,21845) 
    505505        ModifyGraph standoff=0 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/RealTimeUpdate_RT.ipf

    r412 r482  
    5353Function Init_RT() 
    5454        //create folders 
    55         NewDataFolder/O root:RealTime 
     55        NewDataFolder/O root:Packages:NIST:RealTime 
    5656        NewDataFolder/O/S root:myGlobals:RT 
    5757        //create default globals only if they don't already exist, so you don't overwrite user-entered values. 
     
    116116Proc RT_Panel()  
    117117        PauseUpdate; Silent 1           // building window... 
    118         NewPanel /W=(500,350,802,531) /K=2 
     118        NewPanel /W=(500,350,802,480) /K=2 
    119119        DoWindow/C RT_Panel 
    120120        DoWindow/T RT_Panel,"Real Time Display Controls" 
     
    125125        Button bkgStart,pos={171,54},size={120,20},proc=UpdateHSTButton,title="Start Updating" 
    126126        Button bkgStart,help={"Starts or stops the updating of the real-time SANS image"} 
    127         SetVariable setvar_0,pos={15,29},size={100,15},proc=RT_Param_SetVarProc,title="X Center" 
    128         SetVariable setvar_0,help={"Set this to the current beamcenter x-coordinate (in pixels)"} 
    129         SetVariable setvar_0,limits={0,128,0},value= root:myGlobals:RT:xCtr 
    130         SetVariable setvar_1,pos={14,46},size={100,15},proc=RT_Param_SetVarProc,title="Y Center" 
    131         SetVariable setvar_1,help={"Set this to the current beamcenter y-coordinate (in pixels)"} 
    132         SetVariable setvar_1,limits={0,128,0},value= root:myGlobals:RT:yCtr 
    133         SetVariable setvar_2,pos={14,64},size={100,15},proc=RT_Param_SetVarProc,title="SDD (m)" 
    134         SetVariable setvar_2,help={"Set this to the sample-to-detector distance of the current instrument configuration"} 
    135         SetVariable setvar_2,limits={0,1600,0},value= root:myGlobals:RT:SDD 
    136         SetVariable setvar_3,pos={15,82},size={100,15},proc=RT_Param_SetVarProc,title="Lambda (A)" 
    137         SetVariable setvar_3,help={"Set this to the wavelength of the current instrument configuration"} 
    138         SetVariable setvar_3,limits={0,30,0},value= root:myGlobals:RT:lambda 
    139         SetVariable setvar_4,pos={11,116},size={150,15},proc=UpdateInt_SetVarProc,title="Update Interval (s)" 
     127//      SetVariable setvar_0,pos={15,29},size={100,15},proc=RT_Param_SetVarProc,title="X Center" 
     128//      SetVariable setvar_0,help={"Set this to the current beamcenter x-coordinate (in pixels)"} 
     129//      SetVariable setvar_0,limits={0,128,0},value= root:myGlobals:RT:xCtr 
     130//      SetVariable setvar_1,pos={14,46},size={100,15},proc=RT_Param_SetVarProc,title="Y Center" 
     131//      SetVariable setvar_1,help={"Set this to the current beamcenter y-coordinate (in pixels)"} 
     132//      SetVariable setvar_1,limits={0,128,0},value= root:myGlobals:RT:yCtr 
     133//      SetVariable setvar_2,pos={14,64},size={100,15},proc=RT_Param_SetVarProc,title="SDD (m)" 
     134//      SetVariable setvar_2,help={"Set this to the sample-to-detector distance of the current instrument configuration"} 
     135//      SetVariable setvar_2,limits={0,1600,0},value= root:myGlobals:RT:SDD 
     136//      SetVariable setvar_3,pos={15,82},size={100,15},proc=RT_Param_SetVarProc,title="Lambda (A)" 
     137//      SetVariable setvar_3,help={"Set this to the wavelength of the current instrument configuration"} 
     138//      SetVariable setvar_3,limits={0,30,0},value= root:myGlobals:RT:lambda 
     139        SetVariable setvar_4,pos={11,31},size={150,20},proc=UpdateInt_SetVarProc,title="Update Interval (s)" 
    140140        SetVariable setvar_4,help={"This is the period of the update"} 
    141141        SetVariable setvar_4,limits={1,3600,0},value= root:myGlobals:RT:updateInt 
    142         SetVariable setvar_5,pos={11,135},size={150,15},title="Timeout Interval (s)" 
     142        SetVariable setvar_5,pos={11,56},size={150,20},title="Timeout Interval (s)" 
    143143        SetVariable setvar_5,help={"After the timeout interval has expired, the update process will automatically stop"} 
    144144        SetVariable setvar_5,limits={1,3600,0},value= root:myGlobals:RT:timeout 
    145145        Button button_1,pos={170,29},size={120,20},proc=LoadRTButtonProc,title="Load Live Data" 
    146146        Button button_1,help={"Load the data file for real-time display"} 
    147         Button button_2,pos={229,80},size={60,20},proc=RT_HelpButtonProc,title="Help" 
     147        Button button_2,pos={250,2},size={30,20},proc=RT_HelpButtonProc,title="?" 
    148148        Button button_2,help={"Display the help file for real-time controls"} 
    149         Button button_3,pos={230,105},size={60,20},proc=RT_DoneButtonProc,title="Done" 
     149        Button button_3,pos={230,80},size={60,20},proc=RT_DoneButtonProc,title="Done" 
    150150        Button button_3,help={"Closes the panel and stops the updating process"} 
    151         SetVariable setvar_6,pos={11,153},size={200,15},title="Total Detector Counts" 
     151        SetVariable setvar_6,pos={11,82},size={200,20},title="Total Detector Counts" 
    152152        SetVariable setvar_6,help={"Total counts on the detector, as displayed"} 
    153153        SetVariable setvar_6,limits={0,Inf,0},value= root:myGlobals:RT:totalCounts 
     
    178178        String ctrlName 
    179179 
    180         DoAlert 0,"The RealTime detector image is located on Bach/tmp/Run.hst" 
    181         Read_RT_File("Select the Run.hst file") 
     180        DoAlert 0,"The RealTime detector image is located somewhere" 
     181        Read_RT_File("Select the Live Data file") 
    182182        return(0) 
    183183End 
     
    200200        String varName 
    201201 
    202         Wave rw=$"root:RealTime:RealsRead" 
     202        Wave rw=$"root:Packages:NIST:RealTime:RealsRead" 
    203203        if(WaveExists(rw)==0) 
    204204                return(1) 
     
    292292        pathStr = GetPathStrFromfullName(filename) 
    293293        NewPath/O RT_Path,pathStr 
    294         Variable/G root:RealTime:gIsLogScale = 0                //force data to linear scale (1st read) 
     294        Variable/G root:Packages:NIST:RealTime:gIsLogScale = 0          //force data to linear scale (1st read) 
    295295        String/G root:myGlobals:RT:RT_fileStr=filename  //full path:file of the Run.hst file to re-read 
    296296        //read in the data 
    297         ReadOrdelaHST(filename) 
     297        //ReadOrdelaHST(filename) 
     298         
     299        ReadHeaderAndData(filename) 
     300        Raw_to_Work("RealTime") 
    298301 
    299302        //the calling macro must change the display type 
    300303        String/G root:myGlobals:gDataDisplayType="RealTime"             //displayed data type is RealTime 
    301304         
    302         FillFakeHeader()                //uses info on the panel, if available 
     305        //FillFakeHeader()              //uses info on the panel, if available 
    303306 
    304307        //data is displayed here, and needs header info 
     
    315318//function that does the guts of reading the binary data file 
    316319//fname is the full path:name;vers required to open the file 
    317 //The final root:RealTime:data wave is the real 
     320//The final root:Packages:NIST:RealTime:data wave is the real 
    318321//neutron counts and can be directly used 
    319322// 
     
    323326        String fname 
    324327        //this function is for reading in RealTime data only, so it will always put data in RealTime folder 
    325         SetDataFolder "root:RealTime"    
     328        SetDataFolder "root:Packages:NIST:RealTime"      
    326329        //keep a string with the filename in the RealTime folder 
    327         String/G root:RealTime:fileList = "Real-Time Data Display" 
     330        String/G root:Packages:NIST:RealTime:fileList = "Real-Time Data Display" 
    328331        //get log/linear state based on SANS_Data window 
    329         Variable isLogScale=NumVarOrDefault("root:RealTime:gIsLogScale", 0) 
    330         Variable/G root:RealTime:gIsLogScale = isLogScale               //creates if needed, "sets" to cur val if already exists 
     332        Variable isLogScale=NumVarOrDefault("root:Packages:NIST:RealTime:gIsLogScale", 0) 
     333        Variable/G root:Packages:NIST:RealTime:gIsLogScale = isLogScale         //creates if needed, "sets" to cur val if already exists 
    331334         
    332335        Variable refNum=0,ii,p1,p2,tot,num=128 
     
    365368        Redimension/N=(128,128) a1 
    366369 
    367         if(exists("root:RealTime:data")!=1)             //wave DN exist 
    368                 Make/O/N=(128,128) $"root:RealTime:data" 
    369         endif 
    370         WAVE data=$"root:RealTime:data" 
    371         Duplicate/O data,$"root:RealTime:linear_data" 
    372         WAVE lin_data=$"root:RealTime:linear_data" 
     370        if(exists("root:Packages:NIST:RealTime:data")!=1)               //wave DN exist 
     371                Make/O/N=(128,128) $"root:Packages:NIST:RealTime:data" 
     372        endif 
     373        WAVE data=$"root:Packages:NIST:RealTime:data" 
     374        Duplicate/O data,$"root:Packages:NIST:RealTime:linear_data" 
     375        WAVE lin_data=$"root:Packages:NIST:RealTime:linear_data" 
    373376        lin_data=a1 
    374377        if(isLogScale) 
     
    391394Function FillFakeHeader() 
    392395 
    393         Make/O/N=23 $"root:RealTime:IntegersRead" 
    394         Make/O/N=52 $"root:RealTime:RealsRead" 
    395         Make/O/T/N=11 $"root:RealTime:TextRead" 
    396          
    397         Wave intw=$"root:RealTime:IntegersRead" 
    398         Wave realw=$"root:RealTime:RealsRead" 
    399         Wave/T textw=$"root:RealTime:TextRead" 
     396        Make/O/N=23 $"root:Packages:NIST:RealTime:IntegersRead" 
     397        Make/O/N=52 $"root:Packages:NIST:RealTime:RealsRead" 
     398        Make/O/T/N=11 $"root:Packages:NIST:RealTime:TextRead" 
     399         
     400        Wave intw=$"root:Packages:NIST:RealTime:IntegersRead" 
     401        Wave realw=$"root:Packages:NIST:RealTime:RealsRead" 
     402        Wave/T textw=$"root:Packages:NIST:RealTime:TextRead" 
    400403         
    401404        //Put in appropriate "fake" values 
     
    482485Function BkgUpdateHST() 
    483486 
    484         WAVE data = $"root:RealTime:data" 
     487        WAVE data = $"root:Packages:NIST:RealTime:data" 
    485488        NVAR elapsed=root:myGlobals:RT:elapsed 
    486489        NVAR timeout=root:myGlobals:RT:timeout 
     
    509512                ControlUpdate/W=SANS_Data/A 
    510513                 
    511                 err = ReadOrdelaHST(RT_fileStr) 
     514                //err = ReadOrdelaHST(RT_fileStr) 
     515                err = ReadHeaderAndData(RT_fileStr) 
    512516                if(err==1) 
    513517                        Button $"bkgStop",win=RT_Panel,title="Start Updating",rename=bkgStart 
    514518                        return(err)     //file not found 
    515519                Endif 
     520                Raw_to_work("RealTime") 
    516521                // for testing only... 
    517522//              data += abs(enoise(data)) 
     
    521526                title="Real-Time Data Display" 
    522527                //sum the total counts, global variable will automatically update 
    523                 WAVE/Z linear_data = $"root:RealTime:linear_data" 
     528                WAVE/Z linear_data = $"root:Packages:NIST:RealTime:linear_data" 
    524529                if(WaveExists(linear_data)) 
    525530                        totCounts = sum(linear_data, -Inf, Inf ) 
    526531                else 
    527                         WAVE/Z data = $"root:RealTime:data" 
     532                        WAVE/Z data = $"root:Packages:NIST:RealTime:data" 
    528533                        totCounts = sum(data, -Inf, Inf ) 
    529534                endif 
     
    539544         
    540545End 
    541  
Note: See TracChangeset for help on using the changeset viewer.