Ignore:
Timestamp:
Feb 19, 2009 4:41:06 PM (14 years ago)
Author:
srkline
Message:

Added save/restore buttons to SimpleGlobal? fit to be able to restore the state of the checkboxes if possible. Checkboxes are reset when new data sets are selected.

Typos in SANSRedn help file have been corrected.

Error bar styles have been changed to /T=0, a vertical line with no horizontal bar. My preference - I got tired of seeing more of the horizontal bar than the actual data.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/GlobalFit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/GlobalFit/GlobalFit2_NCNR_v40.ipf

    r476 r477  
    49124912        //the text 
    49134913        // -- modify to put in the coefficient labels... 
    4914         String dataFileStr,funcStr,nameStr,paramStr,suffix,savDF 
     4914        String dataFileStr,funcStr,nameStr,paramStr,suffix,savDF,tmpindex 
    49154915        Variable num,ii 
    49164916        savDF = GetDataFolder(1) 
     
    49234923        num=numpnts(pw) 
    49244924         
    4925 //      String/G root:beforeStr=GF_resultStr 
     4925        String/G root:beforeStr=GF_resultStr 
    49264926        //SRK clean up text a bit 
    49274927        GF_resultStr = ReplaceString("data set ",GF_resultStr, "", 1)           //case-sensitive 
    49284928         
    4929         for(ii=0;ii<num;ii+=1) 
     4929        // loop through backwards so that coef_1 does not replace part of coef_10, coef_11, etc. 
     4930        for(ii=num-1;ii>=0;ii-=1) 
     4931//              tmpIndex=num2str(ii) 
     4932//              print "Coef_"+tmpindex 
    49304933                GF_resultStr = ReplaceString("; Coef_"+num2str(ii), GF_resultStr,"") 
    49314934        endfor 
    49324935        //eSRK 
    4933         for(ii=0;ii<num;ii+=1) 
     4936        for(ii=num-1;ii>=0;ii-=1) 
    49344937                GF_resultStr = ReplaceString("Coef_"+num2str(ii), GF_resultStr, pw[ii]) 
    49354938        endfor 
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/GlobalFit/SimpleGlobalFit_NCNR_v40.ipf

    r476 r477  
    11#pragma rtGlobals=1             // Use modern global access method. 
    22 
     3 
     4// panel meant to make it easier to fit two data sets with a single model 
     5// typically (but not necessarily) U+S, resolution smeared 
     6// 
    37// Uses a lot of the functionality from the Wrapper Panel - so be careful 
    48// if the behavior of that panel changes - especially the popup menus 
    5 // 
    6 // 
    7 // panel meant to make it easier to fit two data sets with a single model 
    8 // typically (but not necessarily) U+S, resolution smeared 
    99// 
    1010// currently unsupported: 
    1111// mask 
    1212// constraints 
    13 // epsilon (used? but not user-settable?) 
     13// epsilon (used, set behind the scenes but is not user-settable) 
     14// 
     15// ** some of the other assumptions/behaviors are: 
     16// - if a global variable is held by one set, it is (must be) held for the other set 
     17//   even though I don't automatically check the other box 
     18// - global parameter values are set from SET A. values in set B are overwritten during 
     19//   the fit 
     20// - upon initialization of the coefficients, coef_A and coef_B are set to those from the  
     21//   first data set (A). So the appropriate model must be plotted for set A. It does not 
     22//   need to be plotted for set B, although if you fit the sets separately, each fit can  
     23//   be used as a good first guess for the global fitting by cut/pase into the table. 
     24// - reports are always generated and automatically saved. Beware overwriting. 
     25// - weighting waves are automatically selected, as usual, since I know the data sets 
     26// - both data sets should be on the top graph. The fit, when finished, will try to append 
     27//   the results of the fit on the top graph. 
    1428// 
    1529// SRK FEB 2009  
     
    101115        Button button_0,pos={344,13},size={100,20},title="Do Fit" 
    102116        Button button_0 proc=SGF_DoFitButtonProc 
     117        Button button_1,pos={369,173},size={50,20},proc=SaveCheckStateButtonProc,title="Save" 
     118        Button button_2,pos={429,173},size={70,20},proc=RestoreCheckStateButtonProc,title="Restore" 
    103119         
    104120        Edit/W=(14,174,348,495)/HOST=#  
     
    108124         
    109125EndMacro 
     126 
     127// save the state of the checkboxes 
     128Function SaveCheckStateButtonProc(ba) : ButtonControl 
     129        STRUCT WMButtonAction &ba 
     130 
     131        switch( ba.eventCode ) 
     132                case 2: // mouse up 
     133                        // click code here 
     134                        Duplicate/O root:Packages:NewGlobalFit:selW, root:Packages:NewGlobalFit:selW_saved 
     135                        break 
     136        endswitch 
     137 
     138        return 0 
     139End 
     140 
     141//restore the state of the checkboxes if the number of rows is correct 
     142Function RestoreCheckStateButtonProc(ba) : ButtonControl 
     143        STRUCT WMButtonAction &ba 
     144 
     145        switch( ba.eventCode ) 
     146                case 2: // mouse up 
     147                        // click code here 
     148                        Wave sw_cur = root:Packages:NewGlobalFit:selW 
     149                        Wave sw_sav = root:Packages:NewGlobalFit:selW_saved 
     150 
     151                        Variable num_cur,num_sav 
     152                        num_cur = DimSize(sw_cur,0) 
     153                        num_sav = DimSize(sw_sav,0) 
     154 
     155                        if(num_cur == num_sav) 
     156                                sw_cur = sw_sav 
     157                        endif 
     158                         
     159                        break 
     160        endswitch 
     161 
     162        return 0 
     163End 
     164 
     165 
     166 
    110167 
    111168// show the appropriate coefficient waves 
Note: See TracChangeset for help on using the changeset viewer.