Changeset 109


Ignore:
Timestamp:
May 2, 2007 4:09:28 PM (15 years ago)
Author:
srkline
Message:

Added more informative dialog for setABSparams. Now a panel is presented that asks the same question in a more logical way, with two nicelay labeled buttons and a pale green background for the pollen of spring. Closes trac ticket #6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/ProtocolAsPanel.ipf

    r108 r109  
    19701970        //ask user if he wants to use a transmision file for absolute scaling 
    19711971        //or if he wants to enter his own information 
    1972         DoAlert 1,"<Yes> to enter your own values, <No> to select an empty beam flux file" 
    1973         If ( (V_Flag==1) )  
    1974                 //yes selected, prompt for values 
     1972        err = UseStdOrEmpForABS() 
     1973        //DoAlert 1,"<Yes> to enter your own values, <No> to select an empty beam flux file" 
     1974        If ( err==1 )  
     1975                //secondary standard selected, prompt for values 
    19751976                Execute "AskForAbsoluteParams()"                //missing parameters 
    19761977        else 
    1977                 //no selected, prompt for file, and use this to calculate KAPPA 
     1978                //empty beam flux file selected, prompt for file, and use this to calculate KAPPA 
    19781979                Variable kappa=1 
    19791980                 
     
    20732074                // SRK JUL 2006 don't clear the contents - just kill the window to force new data to be loaded 
    20742075                // - obsucre bug if "ask" in ABS section of protocol clears RAW folder, then Q-axes can't be set from RAW:RealsRead 
    2075                 //ClearDataFolder("RAW")         
    2076         Endif 
    2077         Print "Kappa was successfully calculated as = ",kappa 
     2076                //ClearDataFolder("RAW") 
     2077                Print "Kappa was successfully calculated as = ",kappa    
     2078        Endif 
     2079         
    20782080End 
    20792081 
     
    21252127        return(err) 
    21262128End 
     2129 
     2130Function UseStdOrEmpForABS() 
     2131                 
     2132        NewPanel/K=2 /W=(139,341,402,448) as "Absolute Scaling" 
     2133        DoWindow/C junkABSWindow 
     2134        ModifyPanel cbRGB=(57346,65535,49151) 
     2135        SetDrawLayer UserBack 
     2136        SetDrawEnv fstyle= 1 
     2137        DrawText 21,20,"Method of absolute calibration" 
     2138        Button button0,pos={52,33},size={150,20},proc=UserSelectABS_Continue,title="Empty Beam Flux" 
     2139        Button button1,pos={52,65},size={150,20},proc=UserSelectABS_Continue,title="Secondary Standard" 
     2140         
     2141        PauseForUser junkABSWindow 
     2142        NVAR val = root:myGlobals:tmpAbsVal 
     2143        return(val) 
     2144End 
     2145 
     2146//returns 0 if button0 (empty beam flux) 
     2147// or 1 if secondary standard 
     2148Function UserSelectABS_Continue(ctrlName) :buttonControl 
     2149        String ctrlName 
     2150         
     2151        variable val=0 
     2152        If(cmpstr(ctrlName,"button0")==0) 
     2153                val=0            
     2154        else 
     2155                val=1 
     2156        endif 
     2157//      print "val = ",ctrlName,val 
     2158        Variable/G root:myGlobals:tmpAbsVal = val 
     2159        DoWindow/K junkABSWindow                //kill panel 
     2160        return(0) 
     2161end 
     2162 
    21272163 
    21282164//save the protocol as an IGOR text wave (.itx) 
Note: See TracChangeset for help on using the changeset viewer.