Changeset 170


Ignore:
Timestamp:
Sep 27, 2007 2:22:41 PM (15 years ago)
Author:
srkline
Message:

Fixed the routine that writes model data XY for export to be data-folder aware so that it can write out smeared models which are housed in data folders.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/WriteModelData.ipf

    r127 r170  
    44Proc WriteModelData(xwave,ywave,delim,term) 
    55        String xwave,ywave,delim,term 
    6         Prompt xwave,"X data",popup,WaveList("*",";","") 
    7         Prompt ywave,"y data",popup,WaveList("*",";","") 
     6        Prompt xwave,"X data",popup,PossibleModelWaves("x*") 
     7        Prompt ywave,"Y data",popup,PossibleModelWaves("y*") 
    88        Prompt delim,"delimeter",popup,"tab;space;" 
    99        Prompt term,"line termination",popup,"CR;LF;CRLF;" 
     
    1414         
    1515End 
     16 
     17Function/S PossibleModelWaves(filterStr) 
     18        String filterStr 
     19         
     20        String list,tmplist,DF,newList="" 
     21        Variable ii,num 
     22         
     23        //waves in root 
     24        list = WaveList(filterStr,";","") 
     25         
     26        //add possble smeared models that are housed in data folders 
     27        ControlInfo/W=WrapperPanel popup_0 
     28        if(V_flag==0 || cmpstr(S_Value,"No data loaded")==0) 
     29                return(list) 
     30        else 
     31                DF="root:"+S_Value 
     32                SetDataFolder $DF 
     33                if(cmpstr(filterStr,"x*")==0)  
     34                        tmplist = WaveList("*_q",";","") 
     35                else 
     36                        tmplist = WaveList("smea*",";","") 
     37                endif 
     38                //prepend these list items with the folder 
     39                num=itemsinlist(tmplist) 
     40                ii=0 
     41                do 
     42                        newList += DF+":"+StringFromList(ii, tmpList, ";") + ";" 
     43                        ii+=1 
     44                while(ii<num) 
     45                 
     46                //then add to the list 
     47                list += newList 
     48        endif 
     49         
     50        SetDataFolder root: 
     51        return(list) 
     52end 
    1653 
    1754Function fWriteModelData(xwave,ywave,delim,term) 
Note: See TracChangeset for help on using the changeset viewer.