Ignore:
Timestamp:
Nov 4, 2009 4:58:52 PM (13 years ago)
Author:
srkline
Message:

changes to how a fake VAX raw data file is written out. now call accepts optional parameters so that the index and label can be supplied, and the MC simulation can be very crudely scripted for unattended operation.

File:
1 edited

Legend:

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

    r583 r596  
    18681868        String type,fullpath 
    18691869        Variable dialog         //=1 will present dialog for name 
    1870          
     1870 
    18711871        String filename = "" 
    18721872        filename = Write_VAXRaw_Data(type,fullpath,dialog) 
     
    23582358// simulated VAX data file. 
    23592359// 
     2360// NCNR-Specific 
    23602361// 
    23612362Function SimulationVAXHeader(folder) 
     
    24042405        tw[9] = "ORNL  " 
    24052406         
     2407         
     2408        //get the run index and the sample label from the optional parameters, or from a dialog 
    24062409        NVAR index = root:Packages:NIST:SAS:gSaveIndex 
    24072410        SVAR prefix = root:Packages:NIST:SAS:gSavePrefix 
    2408  
    2409  
    2410          
    2411         String labelStr=" "      
    2412         Variable runNum = index 
    2413         Prompt labelStr, "Enter sample label "          // Set prompt for x param 
    2414         Prompt runNum,"Run Number (automatically increments)" 
    2415         DoPrompt "Enter sample label", labelStr,runNum 
    2416         if (V_Flag) 
    2417                 //Print "no sample label entered - no file written" 
    2418                 //index -=1 
    2419                 return -1                                                               // User canceled 
     2411// did the user pass in values? 
     2412        NVAR autoSaveIndex = root:Packages:NIST:SAS:gAutoSaveIndex 
     2413        SVAR autoSaveLabel = root:Packages:NIST:SAS:gAutoSaveLabel 
     2414         
     2415        String labelStr=""       
     2416        Variable runNum 
     2417        if( (autoSaveIndex != 0) && (strlen(autoSaveLabel) > 0) ) 
     2418                // all is OK, proceed with the save 
     2419                labelStr = autoSaveLabel 
     2420                runNum = autoSaveIndex          //user must take care of incrementing this! 
     2421        else 
     2422                //one or the other, or both are missing, so ask 
     2423                runNum = index 
     2424                Prompt labelStr, "Enter sample label "          // Set prompt for x param 
     2425                Prompt runNum,"Run Number (automatically increments)" 
     2426                DoPrompt "Enter sample label", labelStr,runNum 
     2427                if (V_Flag) 
     2428                        //Print "no sample label entered - no file written" 
     2429                        //index -=1 
     2430                        return -1                                                               // User canceled 
     2431                endif 
     2432                if(runNum != index) 
     2433                        index = runNum 
     2434                endif 
     2435                index += 1 
    24202436        endif 
    24212437         
    2422         if(runNum != index) 
    2423                 index = runNum 
    2424         endif 
    2425         index += 1 
     2438 
    24262439 
    24272440        //make a three character string of the run number 
Note: See TracChangeset for help on using the changeset viewer.