Changeset 1001 for sans


Ignore:
Timestamp:
Jun 10, 2016 3:40:55 PM (7 years ago)
Author:
srkline
Message:

A number of simple fixes to make the macros compatible with Igor 7, and in some places back-compatible with Igor 6. There were only a few instances where the IgorVersion? was checked, so it does not caues a huge disruption.

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

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/ModelPicker/SANSModelPicker_v40.ipf

    r999 r1001  
    5656         
    5757        if(cmpstr("Macintosh",IgorInfo(2)) == 0) 
    58                 String/G root:Packages:NIST:gAngstStr = num2char(-127) 
     58                if(IgorVersion() >= 7) 
     59                        String/G root:Packages:NIST:gAngstStr = num2char(8491) 
     60                else 
     61                        String/G root:Packages:NIST:gAngstStr = num2char(-127) 
     62                endif 
    5963//              Variable/G root:myGlobals:gIsMac = 1 
    6064        else 
    6165                //either Windows or Windows NT 
    62                 String/G root:Packages:NIST:gAngstStr = num2char(-59) 
     66                if(IgorVersion() >= 7) 
     67                        String/G root:Packages:NIST:gAngstStr = num2char(8491) 
     68                else 
     69                        String/G root:Packages:NIST:gAngstStr = num2char(-59) 
     70                endif 
    6371//              Variable/G root:myGlobals:gIsMac = 0 
    6472                //SetIgorOption to keep some PC's (graphics cards?) from smoothing the 2D image 
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/Wrapper_v40.ipf

    r999 r1001  
    822822                         
    823823                endif 
     824 
     825// for Igor 7 -- add the flag /N=0 to force the curve fit to update at each iteration. Some loss in speed 
     826//   over the new default of no update, but the user can see what is happening. 
    824827                 
    825828                // now useCursors, useEps, and useConstr are all handled w/ /NWOK 
     
    827830                 
    828831                if(useResol && useResiduals && useTextBox)              //do it all 
    829                         FuncFit/H=getHStr(hold) /M=2 /NTHR=0 /TBOX=(tb) $funcStr cw, yw[pt1,pt2] /X=xw /W=sw /I=1 /E=eps /D=fitYw /C=constr /STRC=fs /R /NWOK 
     832                        FuncFit/H=getHStr(hold) /N=0 /M=2 /NTHR=0 /TBOX=(tb) $funcStr cw, yw[pt1,pt2] /X=xw /W=sw /I=1 /E=eps /D=fitYw /C=constr /STRC=fs /R /NWOK 
    830833                        break 
    831834                endif 
    832835                 
    833836                if(useResol && useResiduals)            //res + resid 
    834                         FuncFit/H=getHStr(hold) /M=2 /NTHR=0 $funcStr cw, yw[pt1,pt2] /X=xw /W=sw /I=1 /E=eps /D=fitYw /C=constr /STRC=fs /R /NWOK 
     837                        FuncFit/H=getHStr(hold) /N=0 /M=2 /NTHR=0 $funcStr cw, yw[pt1,pt2] /X=xw /W=sw /I=1 /E=eps /D=fitYw /C=constr /STRC=fs /R /NWOK 
    835838                        break 
    836839                endif 
     
    838841                 
    839842                if(useResol && useTextBox)              //res + text 
    840                         FuncFit/H=getHStr(hold) /M=2 /NTHR=0 /TBOX=(tb) $funcStr cw, yw[pt1,pt2] /X=xw /W=sw /I=1 /E=eps /D=fitYw /C=constr /STRC=fs /NWOK 
     843                        FuncFit/H=getHStr(hold) /N=0 /M=2 /NTHR=0 /TBOX=(tb) $funcStr cw, yw[pt1,pt2] /X=xw /W=sw /I=1 /E=eps /D=fitYw /C=constr /STRC=fs /NWOK 
    841844                        break 
    842845                endif 
     
    846849//                      Variable t0 = stopMStimer(-2) 
    847850 
    848                         FuncFit/H=getHStr(hold) /M=2 /NTHR=0 $funcStr cw, yw[pt1,pt2] /X=xw /W=sw /I=1 /E=eps /D=fitYw /C=constr /STRC=fs /NWOK 
     851                        FuncFit/H=getHStr(hold) /N=0 /M=2 /NTHR=0 $funcStr cw, yw[pt1,pt2] /X=xw /W=sw /I=1 /E=eps /D=fitYw /C=constr /STRC=fs /NWOK 
    849852                         
    850853//                      t0 = (stopMSTimer(-2) - t0)*1e-6 
     
    868871/////   same as above, but all without useResol (no /STRC flag) 
    869872                if(useResiduals && useTextBox)          //resid+ text 
    870                         FuncFit/H=getHStr(hold) /M=2 /NTHR=0 /TBOX=(tb) $funcStr cw, yw[pt1,pt2] /X=xw /W=sw /I=1 /E=eps /D=fitYw /C=constr /R /NWOK 
     873                        FuncFit/H=getHStr(hold) /N=0 /M=2 /NTHR=0 /TBOX=(tb) $funcStr cw, yw[pt1,pt2] /X=xw /W=sw /I=1 /E=eps /D=fitYw /C=constr /R /NWOK 
    871874                        break 
    872875                endif 
    873876                 
    874877                if(useResiduals)                //resid 
    875                         FuncFit/H=getHStr(hold) /M=2 /NTHR=0 $funcStr cw, yw[pt1,pt2] /X=xw /W=sw /I=1 /E=eps /D=fitYw /C=constr /R /NWOK 
     878                        FuncFit/H=getHStr(hold) /N=0 /M=2 /NTHR=0 $funcStr cw, yw[pt1,pt2] /X=xw /W=sw /I=1 /E=eps /D=fitYw /C=constr /R /NWOK 
    876879                        break 
    877880                endif 
     
    879882                 
    880883                if(useTextBox)          //text 
    881                         FuncFit/H=getHStr(hold) /M=2 /NTHR=0 /TBOX=(tb) $funcStr cw, yw[pt1,pt2] /X=xw /W=sw /I=1 /E=eps /D=fitYw /C=constr /NWOK 
     884                        FuncFit/H=getHStr(hold) /N=0 /M=2 /NTHR=0 /TBOX=(tb) $funcStr cw, yw[pt1,pt2] /X=xw /W=sw /I=1 /E=eps /D=fitYw /C=constr /NWOK 
    882885                        break 
    883886                endif 
     
    885888                //just a plain vanilla fit 
    886889 
    887                 FuncFit/H=getHStr(hold) /M=2 /NTHR=0 $funcStr cw, yw[pt1,pt2] /X=xw /W=sw /I=1 /E=eps /D=fitYw /C=constr /NWOK 
     890                FuncFit/H=getHStr(hold) /N=0 /M=2 /NTHR=0 $funcStr cw, yw[pt1,pt2] /X=xw /W=sw /I=1 /E=eps /D=fitYw /C=constr /NWOK 
    888891                 
    889892        while(0) 
     
    924927         
    925928        DoUpdate                //force update of table and graph with fitted values (why doesn't this work? - the table still does not update) 
    926          
     929 
     930//      this is the top graph, and I do this in Igor 7 to force update of the infoBox and for the report to appear 
     931        DoWindow/F $(WinName(0,1))       
    927932        // report the results (to the panel?) 
    928933        if(useGenCurveFit) 
  • sans/Dev/trunk/NCNR_User_Procedures/Common/Installer/CheckVersionFTP.ipf

    r769 r1001  
    9494 
    9595Function OpenHelpMoviePage() 
    96         DoAlert 1,"Your web browser will open to a page where you can view help movies. OK? (You must have QuickTime installed)" 
     96        DoAlert 1,"Your web browser will open to a page where you can view help movies. OK?" 
    9797        if(V_flag==1) 
    9898//              BrowseURL "ftp://webster.ncnr.nist.gov/pub/sans/kline/movies/" 
  • sans/Dev/trunk/NCNR_User_Procedures/Common/Packages/PlotManager/PlotManager_v40.ipf

    r888 r1001  
    157157        Variable rr,gg,bb 
    158158         
     159        SVAR angst = root:Packages:NIST:gAngstStr 
     160         
    159161        SetDataFolder $("root:"+DF) 
    160162        //iStr will end in "i" 
     
    175177                                 
    176178        Label left "I(q)" 
    177         Label bottom "q (A\\S-1\\M)" 
    178          
     179//      Label bottom "q (A\\S-1\\M)" 
     180        Label bottom "q ("+angst+"\\S-1\\M)"     
    179181        Legend 
    180182         
  • sans/Dev/trunk/NCNR_User_Procedures/Common/Packages/PlotManager/PlotUtils2D_v40.ipf

    r956 r1001  
    997997EndMacro 
    998998 
    999  
     999// 
     1000// in Igor 6, Gizmo windows are code 4096 
     1001// in Igor 7, Gizmo windows are code 65536 
     1002// need to check for version, since code 65536 is not allowed in Igor 6 
     1003//  
     1004// this function returns only the topmost window from the list 
    10001005Function/S TopGizmoWindow() 
    1001         Return(StringFromList(0,WinList("*",";","WIN:4096"))) 
     1006        if(IgorVersion() >= 7) 
     1007                return(StringFromList(0,WinList("*",";","WIN:65536"))) 
     1008        else 
     1009                return(StringFromList(0,WinList("*",";","WIN:4096"))) 
     1010        endif 
    10021011end 
    10031012 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/EventModeProcessing.ipf

    r999 r1001  
    33973397 
    33983398 
    3399 Macro DisplayForSlicing() 
     3399Proc DisplayForSlicing() 
    34003400 
    34013401        // plot the EventBarGraph? 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Menu.ipf

    r999 r1001  
    4848                "Adjust Events",ShowEventCorrectionPanel() 
    4949                "Create Custom Bins",Show_CustomBinPanel() 
     50                "Display Data For Slicing",DisplayForSlicing() 
    5051                "-" 
    5152                "Split Large File",SplitBigFile() 
Note: See TracChangeset for help on using the changeset viewer.