Ignore:
Timestamp:
Nov 2, 2009 10:55:37 AM (13 years ago)
Author:
srkline
Message:

Added conditional compile instructions to some reduction procedure files that have only minor facility-specific changes. These changes are not significant enough to merit a separate facility file that must be maintained with essentially duplicate functions.

#define SYMBOL was attempted, but did not work since the symbols weren't actually defined until after the compile... and I couldn't figure out how to define - then compile. in additon, the table is static until Igor is quit - so multiple symbols could be defined, and compiling would fail.

So... the method now that appears to work is to put a dummy function for each facility in its facility specific "Includes" file. Then the conditional compilation checks for exists("function").

File:
1 edited

Legend:

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

    r577 r588  
    2121//parsing the filenames in the list and (dispatching) to write out the  
    2222//appropriate information to the notebook window 
    23 Proc BuildCatVeryShortTable() 
     23Function BuildCatVeryShortTable() 
    2424         
    2525        Variable err 
     
    5555        Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:Field" 
    5656        Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:MCR"              //added Mar 2008 
    57 //#ifdef ILL_D22 
    58 //      Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:Reactorpower"       //activate for ILL, June 2008, 
    59 //#endif 
    60  
     57#if (exists("ILL_D22")==6) 
     58        Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:Reactorpower"       //activate for ILL, June 2008, 
     59        WAVE ReactorPower = $"root:myGlobals:CatVSHeaderInfo:Reactorpower" 
     60#endif 
     61 
     62        WAVE/T Filenames = $"root:myGlobals:CatVSHeaderInfo:Filenames" 
     63        WAVE/T Suffix = $"root:myGlobals:CatVSHeaderInfo:Suffix" 
     64        WAVE/T Labels = $"root:myGlobals:CatVSHeaderInfo:Labels" 
     65        WAVE/T DateAndTime = $"root:myGlobals:CatVSHeaderInfo:DateAndTime" 
     66        WAVE SDD = $"root:myGlobals:CatVSHeaderInfo:SDD" 
     67        WAVE Lambda = $"root:myGlobals:CatVSHeaderInfo:Lambda" 
     68        WAVE CntTime = $"root:myGlobals:CatVSHeaderInfo:CntTime" 
     69        WAVE TotCnts = $"root:myGlobals:CatVSHeaderInfo:TotCnts" 
     70        WAVE CntRate = $"root:myGlobals:CatVSHeaderInfo:CntRate" 
     71        WAVE Transmission = $"root:myGlobals:CatVSHeaderInfo:Transmission" 
     72        WAVE Thickness = $"root:myGlobals:CatVSHeaderInfo:Thickness" 
     73        WAVE XCenter = $"root:myGlobals:CatVSHeaderInfo:XCenter" 
     74        WAVE YCenter = $"root:myGlobals:CatVSHeaderInfo:YCenter" 
     75        //WAVE/B NumGuides = $"root:myGlobals:CatVSHeaderInfo:NumGuides" 
     76        WAVE/B NumAttens = $"root:myGlobals:CatVSHeaderInfo:NumAttens" 
     77        WAVE RunNumber = $"root:myGlobals:CatVSHeaderInfo:RunNumber" 
     78        WAVE IsTrans = $"root:myGlobals:CatVSHeaderInfo:IsTrans" 
     79        WAVE RotAngle = $"root:myGlobals:CatVSHeaderInfo:RotAngle" 
     80        WAVE Temperature = $"root:myGlobals:CatVSHeaderInfo:Temperature" 
     81        WAVE Field = $"root:myGlobals:CatVSHeaderInfo:Field" 
     82        WAVE MCR = $"root:myGlobals:CatVSHeaderInfo:MCR"                //added Mar 2008 
     83         
     84         
    6185        If(V_Flag==0) 
    6286                BuildTableWindow() 
     
    7498                ModifyTable width(:myGlobals:CatVSHeaderInfo:Field)=50 
    7599                ModifyTable width(:myGlobals:CatVSHeaderInfo:MCR)=50 
    76 //#ifdef ILL_D22 
    77 //              ModifyTable width(:myGlobals:CatVSHeaderInfo:Reactorpower)=50           //activate for ILL, June 2008 
    78 //#endif 
     100#if (exists("ILL_D22")==6) 
     101                ModifyTable width(:myGlobals:CatVSHeaderInfo:Reactorpower)=50           //activate for ILL, June 2008 
     102#endif 
    79103 
    80104                ModifyTable width(Point)=0              //JUN04, remove point numbers - confuses users since point != run 
     
    174198        Wave GField = $"root:myGlobals:CatVSHeaderInfo:Field" 
    175199        Wave GMCR = $"root:myGlobals:CatVSHeaderInfo:MCR"               //added Mar 2008 
    176 //#ifdef ILL_D22 
    177 //      Wave GReactPow = $"root:myGlobals:CatVSHeaderInfo:ReactorPower"         //activate for ILL June 2008 ( and the sort line too) 
    178 //      Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR,GReactPow 
    179 //#else 
     200#if (exists("ILL_D22")==6) 
     201        Wave GReactPow = $"root:myGlobals:CatVSHeaderInfo:ReactorPower"         //activate for ILL June 2008 ( and the sort line too) 
     202        Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR,GReactPow 
     203#else 
    180204        Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR 
    181 //#endif 
     205#endif 
    182206 
    183207        return(0) 
     
    205229        Wave Field= $"root:myGlobals:CatVSHeaderInfo:Field" 
    206230        Wave MCR = $"root:myGlobals:CatVSHeaderInfo:MCR"                //added Mar 2008 
    207 //#ifdef ILL_D22 
     231#if (exists("ILL_D22")==6) 
    208232// for ILL 
    209 //      Wave ReactorPower = $"root:myGlobals:CatVSHeaderInfo:reactorpower"       //activate for ILL, June 08 (+ edit line) 
    210 //      Edit Filenames, Labels, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR, ReactorPower as "Data File Catalog" 
    211 //#else 
     233        Wave ReactorPower = $"root:myGlobals:CatVSHeaderInfo:reactorpower"       //activate for ILL, June 08 (+ edit line) 
     234        Edit Filenames, Labels, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR, ReactorPower as "Data File Catalog" 
     235#else 
    212236// original order, magnetic at the end 
    213237        Edit Filenames, Labels, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR as "Data File Catalog" 
    214238// alternate ordering, put the magnetic information first 
    215239//      Edit Filenames, Labels, RotAngle, Temperature, Field, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens as "Data File Catalog" 
    216 //#endif 
     240#endif 
    217241 
    218242        String name="CatVSTable" 
     
    254278        Wave GField = $"root:myGlobals:CatVSHeaderInfo:Field" 
    255279        Wave GMCR = $"root:myGlobals:CatVSHeaderInfo:MCR" 
    256 //#ifdef ILL_D22 
    257 //      Wave GReactpow = $"root:myGlobals:CatVSHeaderInfo:reactorpower"         //activate for ILL, Jne 2008, (+ last insert @ end of function)  
    258 //#endif 
     280#if (exists("ILL_D22")==6) 
     281        Wave GReactpow = $"root:myGlobals:CatVSHeaderInfo:reactorpower"         //activate for ILL, Jne 2008, (+ last insert @ end of function)  
     282#endif 
    259283        lastPoint = numpnts(GLambda) 
    260284                 
     
    344368        GMCR[lastPoint]  = getMonitorCount(fname)/ctime         //total monitor count / total count time 
    345369 
    346 //#ifdef ILL_D22         
    347 //      // Reactor Power (activate for ILL) 
    348 //      InsertPoints lastPoint,1,GReactpow 
    349 //      GReactPow[lastPoint]  = getReactorPower(fname) 
    350 //#endif         
     370#if (exists("ILL_D22")==6) 
     371        // Reactor Power (activate for ILL) 
     372        InsertPoints lastPoint,1,GReactpow 
     373        GReactPow[lastPoint]  = getReactorPower(fname) 
     374#endif   
    351375 
    352376        return(0) 
Note: See TracChangeset for help on using the changeset viewer.