Changeset 181
- Timestamp:
- Oct 19, 2007 5:04:09 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Packages/Wrapper.ipf
r180 r181 1 1 #pragma rtGlobals=1 // Use modern global access method. 2 2 #pragma IgorVersion=6.0 3 3 4 4 // … … 57 57 CheckBox check_1,pos={440,42},size={74,14},title="Use Epsilon?",value= 0 58 58 CheckBox check_2,pos={440,65},size={95,14},title="Use Constraints?",value= 0 59 // CheckBox check_3,pos={544,18},size={72,14},title="From target",value= 0 59 CheckBox check_3,pos={530,18},size={72,14},title="2D Functions?",value= 0 60 CheckBox check_3 proc=Toggle2DControlsCheckProc 60 61 CheckBox check_4,pos={440,85},size={72,14},title="Report?",value= 0 61 62 CheckBox check_5,pos={454,103},size={72,14},title="Save it?",value= 0 … … 550 551 // folderStr is the data folder for the desired data set 551 552 // 552 // -- this looks like something that can be made rather generic rather easily553 553 // 554 554 Function FitWrapper(folderStr,funcStr,coefStr,useCursors,useEps,useConstr) … … 681 681 endif 682 682 683 ///// same as above, but all without useRes 683 ///// same as above, but all without useRes (no /STRC flag) 684 684 if(useEps && useCursors && useConstr) //do it all 685 685 FuncFit/H=getHStr(hold) /NTHR=0 $funcStr cw, yw[pcsr(A),pcsr(B)] /X=xw /W=sw /I=1 /E=eps /D=fitYw /C=constr … … 764 764 String topGraph= WinName(0,1) //this is the topmost graph 765 765 766 DoUpdate //force an update of the graph before making a copy of it for the report 767 766 768 W_GenerateReport(funcStr,folderStr,$parStr,cw,yesSave,V_chisq,W_sigma,V_npnts,V_FitError,V_FitQuitReason,V_startRow,V_endRow,topGraph) 767 769 endif … … 840 842 841 843 // 842 Wave dataXw = $("root:"+dataname+":"+dataname+"_q") 844 // no "fitted range" for 2D data, so make sure that this exists before using it 845 Wave/Z dataXw = $("root:"+dataname+":"+dataname+"_q") 843 846 // 844 847 Notebook $nb ruler=Normal … … 849 852 sprintf str,"Npnts = %g \t\t Sqrt(X^2/N) = %g\r",npts,sqrt(chiSq/npts) 850 853 Notebook $nb textRGB=(0,0,0),fstyle=0, text=str 851 sprintf str "Fitted range = [%d,%d] = %g < Q < %g\r",fitStart,fitEnd,dataXw(fitStart),dataXw(fitEnd) 852 Notebook $nb textRGB=(0,0,0),fstyle=0, text=str 854 if(WaveExists(dataXw)) 855 sprintf str "Fitted range = [%d,%d] = %g < Q < %g\r",fitStart,fitEnd,dataXw(fitStart),dataXw(fitEnd) 856 Notebook $nb textRGB=(0,0,0),fstyle=0, text=str 857 endif 853 858 sprintf str,"FitError = %s\t\tFitQuitReason = %s\r",W_ErrorMessage(FitErr),W_QuitMessage(FitQuit) 854 859 Notebook $nb textRGB=(65000,0,0),fstyle=1,text=str … … 856 861 857 862 // insert graphs 858 Notebook $nb picture={$topGraph(0, 0, 400, 300), 0, 1}, text="\r" 859 860 863 if(WaveExists(dataXw)) 864 Notebook $nb picture={$topGraph(0, 0, 400, 300), 0, 1}, text="\r" 865 // 866 else //must be 2D Gizmo 867 Execute "ExportGizmo Clip" 868 LoadPict/Q/O "Clipboard",tmp_Gizmo 869 Notebook $nb picture={tmp_Gizmo(0, 0, 400, 300), 0, 1}, text="\r" 870 endif 861 871 //Notebook Report picture={Table1, 0, 0}, text="\r" 862 872 … … 880 890 // E=2 is PICT @2x screen resolution 881 891 /// SavePICT /E=-5/O/P=home /I/W=(0,0,3,3) as pictStr 882 SavePICT /E=-5/O/P=home/WIN=$topGraph /W=(0,0,400,300) as pictStr 892 if(WaveExists(dataXw)) 893 SavePICT /E=-5/O/P=home/WIN=$topGraph /W=(0,0,400,300) as pictStr 894 else 895 Execute "ExportGizmo /P=home as \""+pictStr+"\"" 896 //SavePICT /E=-5/O/P=home/WIN=$topGraph /W=(0,0,400,300) as pictStr 897 endif 883 898 Endif 884 899 … … 886 901 End 887 902 888 staticFunction/S W_ErrorMessage(code)903 Function/S W_ErrorMessage(code) 889 904 Variable code 890 905 … … 907 922 end 908 923 909 staticFunction/S W_QuitMessage(code)924 Function/S W_QuitMessage(code) 910 925 Variable code 911 926 … … 928 943 end 929 944 945 Function Toggle2DControlsCheckProc(cba) : CheckBoxControl 946 STRUCT WMCheckboxAction &cba 947 948 switch( cba.eventCode ) 949 case 2: // mouse up 950 Variable checked = cba.checked 951 if(checked) 952 //print "change the buttons to 2D" 953 Button button_0,proc=Do2DFitButtonProc,title="Do 2D Fit" 954 Button button_1,size={120,20},proc=Plot2DFunctionButtonProc,title="Plot 2D Function" 955 Button button_2,size={100,20},proc=Append2DModelButtonProc,title="Append 2D" 956 Button button_3,size={100,20},proc=Load2DDataButtonProc,title="Load 2D Data" 957 958 Button button_2D_0,pos={520,37},size={70,20},proc=LogToggle2DButtonProc,title="Log/Lin" 959 Button button_2D_1,pos={520,60},size={100,20},proc=Plot2DButtonProc,title="Plot 2D Data" 960 961 Button button_2D_0,disable=0 //visible again, and enabled 962 Button button_2D_1,disable=0 963 else 964 //print "unchecked, change them back to 1D" 965 Button button_0,pos={520,93},size={100,20},proc=DoTheFitButton,title="Do 1D Fit" 966 Button button_1,pos={240,57},size={120,20},proc=PlotModelFunction,title="Plot 1D Function" 967 Button button_2,pos={240,93},size={100,20},proc=AppendModelToTarget,title="Append 1D" 968 Button button_3,pos={240,20},size={100,20},proc=W_LoadDataButtonProc,title="Load 1D Data" 969 970 Button button_2D_0,disable=3 //hide the extra 2D buttons, and disable 971 Button button_2D_1,disable=3 972 endif 973 break 974 endswitch 975 976 return 0 977 End
Note: See TracChangeset
for help on using the changeset viewer.