Ignore:
Timestamp:
Dec 1, 2009 10:02:58 PM (13 years ago)
Author:
ajj
Message:
  • Write out data file as XML
  • Fix XML input
  • Finished Data Arithmetic panel as replacement for Subtract_1D
Location:
sans/Dev/trunk/NCNR_User_Procedures/Analysis
Files:
2 edited

Legend:

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

    r570 r607  
    2828        //Ugly. Put this here to make sure things don't break 
    2929        String/G root:Packages:NIST:gXMLLoader_Title 
     30        Variable/G root:Packages:NIST:gXML_Write = 0 
    3031         
    3132        DoWindow/F WrapperPanel 
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/WriteModelData_v40.ipf

    r570 r607  
    108108        Prompt delim,"delimeter",popup,"tab;space;" 
    109109        Prompt term,"line termination",popup,"CR;LF;CRLF;" 
    110                  
    111         fReWrite1DData(folderStr,delim,term) 
    112          
     110         
     111        if (root:Packages:NIST:gXML_Write == 1) 
     112                SetDataFolder root: 
     113                ReWrite1DXMLData(folderStr) 
     114        else 
     115                SetDataFolder root: 
     116                fReWrite1DData(folderStr,delim,term) 
     117        endif    
    113118End 
    114119 
     
    116121// always asks for a file name 
    117122// - and right now, always expect 6-column data, either SANS or USANS (re-writes -dQv) 
     123// - AJJ Nov 2009 : better make sure we always fake 6 columns on reading then.... 
    118124Function fReWrite1DData(folderStr,delim,term) 
    119125        String folderStr,delim,term 
     
    121127        String formatStr="",fullpath="" 
    122128        Variable refnum,dialog=1 
     129         
     130        String dataSetFolderParent,basestr 
    123131         
    124132        //setup delimeter and terminator choices 
     
    140148        Endif 
    141149         
     150        //Abuse ParseFilePath to get path without folder name 
     151        dataSetFolderParent = ParseFilePath(1,folderStr,":",1,0) 
     152        //Abuse ParseFilePath to get basestr 
     153        basestr = ParseFilePath(0,folderStr,":",1,0) 
     154         
    142155        //make sure the waves exist 
    143         SetDataFolder $("root:"+folderStr) 
    144         WAVE/Z qw = $(folderStr+"_q") 
    145         WAVE/Z iw = $(folderStr+"_i") 
    146         WAVE/Z sw = $(folderStr+"_s") 
    147         WAVE/Z resw = $(folderStr+"_res") 
     156        SetDataFolder $(dataSetFolderParent+basestr) 
     157        WAVE/Z qw = $(baseStr+"_q") 
     158        WAVE/Z iw = $(baseStr+"_i") 
     159        WAVE/Z sw = $(baseStr+"_s") 
     160        WAVE/Z resw = $(baseStr+"_res") 
    148161         
    149162        if(WaveExists(qw) == 0) 
     
    179192        if(dialog) 
    180193                PathInfo/S catPathName 
    181                 fullPath = DoSaveFileDialog("Save data as",fname=folderStr+".txt") 
     194                fullPath = DoSaveFileDialog("Save data as",fname=baseStr+".txt") 
    182195                If(cmpstr(fullPath,"")==0) 
    183196                        //user cancel, don't write out a file 
     
    190203        Open refnum as fullpath 
    191204         
    192         fprintf refnum,"Modified data written from folder %s on %s\r\n",folderStr,(date()+" "+time()) 
     205        fprintf refnum,"Modified data written from folder %s on %s\r\n",baseStr,(date()+" "+time()) 
    193206        wfprintf refnum,formatStr,qw,iw,sw,sigQ,qbar,fs 
    194207        Close refnum 
Note: See TracChangeset for help on using the changeset viewer.