Ignore:
Timestamp:
Apr 9, 2007 3:42:39 PM (15 years ago)
Author:
srkline
Message:

2nd pass of pulling out NCNR calls. Also cleared a lot of deadwood from the code, removing depricated functions that were mostly already commented out.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/ProtocolAsPanel.ipf

    r72 r76  
    8080        String waveStr="tempProtocol" 
    8181        SetDataFolder root:myGlobals:Protocols 
    82         Make/O/T/N=(nsteps) $"root:myGlobals:Protocols:tempProtocol" 
    83         do 
    84                 $"root:myGlobals:Protocols:tempProtocol"[ii] = "" 
    85                 ii+=1 
    86         while(ii<nsteps) 
     82        Make/O/T/N=(nsteps) $"root:myGlobals:Protocols:tempProtocol" = "" 
     83 
    8784        String/G root:myGlobals:Protocols:gSAM="ask" 
    8885        String/G root:myGlobals:Protocols:gBGD="ask" 
     
    203200                checked = 0 
    204201        Endif 
    205 //      numItems = ItemsInList(list,comma) 
    206 //      nameList = "" 
    207 //      ii=0 
    208 //      checked = 1 
    209 //      do 
    210 //              fullPath = StringFromList(ii,list,comma) 
    211 //              PathStr = GetPathStrFromFullName(fullPath) 
    212 //              item = GetFileNameFromPathKeepSemi(fullPath) 
    213 //              nameList += item+comma 
    214 //              If(cmpstr(item,"none") ==0) 
    215 //                      nameList = item 
    216 //                      checked = 0 
    217 //                      break 
    218 //              Endif 
    219 //              If(cmpstr(item,"ask") ==0) 
    220 //                      nameList = item 
    221 //                      checked = 1 
    222 //                      break 
    223 //              Endif 
    224 //              if((cmpstr(pathStr,catPathStr) != 0) %& !(specialProtocol)) 
    225 //                      Print "pathstr = ",pathStr 
    226 //                      Print "catPathStr = ",catPathStr 
    227 //                      Abort "saved protocol path and CAT path do not match - reset CAT/SHORT to pathStr" 
    228 //              Endif 
    229 //              ii+=1 
    230 //      while(ii<numItems) 
     202 
    231203        //set the global string to display and checkbox 
    232204        String/G root:myGlobals:Protocols:gBGD = nameList 
     
    239211                checked = 0 
    240212        Endif 
    241 //      numItems = ItemsInList(list,comma) 
    242 //      nameList = "" 
    243 //      ii=0 
    244 //      checked = 1 
    245 //      do 
    246 //              fullPath = StringFromList(ii,list,comma) 
    247 //              PathStr = GetPathStrFromFullName(fullPath) 
    248 //              item = GetFileNameFromPathKeepSemi(fullPath) 
    249 //              nameList += item+comma 
    250 //              If(cmpstr(item,"none") ==0) 
    251 //                      nameList = item 
    252 //                      checked = 0 
    253 //                      break 
    254 //              Endif 
    255 //              If(cmpstr(item,"ask") ==0) 
    256 //                      nameList = item 
    257 //                      checked = 1 
    258 //                      break 
    259 //              Endif 
    260 //              if((cmpstr(pathStr,catPathStr) != 0) %& !(specialProtocol)) 
    261 //                      Print "pathstr = ",pathStr 
    262 //                      Print "catPathStr = ",catPathStr 
    263 //                      Abort "saved protocol path and CAT path do not match" 
    264 //              Endif 
    265 //              ii+=1 
    266 //      while(ii<numItems) 
     213 
    267214        //set the global string to display and checkbox 
    268215        String/G root:myGlobals:Protocols:gEMP = nameList 
     
    275222                checked = 0 
    276223        Endif 
    277 //      list = w[2] 
    278 //      numItems = ItemsInList(list,comma) 
    279 //      nameList = "" 
    280 //      ii=0 
    281 //      checked = 1 
    282 //      do 
    283 //              fullPath = StringFromList(ii,list,comma) 
    284 //              PathStr = GetPathStrFromFullName(fullPath) 
    285 //              item = GetFileNameFromPathKeepSemi(fullPath) 
    286 //              nameList += item+comma 
    287 //              If(cmpstr(item,"none") ==0) 
    288 //                      nameList = item 
    289 //                      checked = 0 
    290 //                      break 
    291 //              Endif 
    292 //              If(cmpstr(item,"ask") ==0) 
    293 //                      nameList = item 
    294 //                      checked = 1 
    295 //                      break 
    296 //              Endif 
    297 //              if((cmpstr(pathStr,catPathStr) != 0) %& !(specialProtocol)) 
    298 //                      Print "pathstr = ",pathStr 
    299 //                      Print "catPathStr = ",catPathStr 
    300 //                      Abort "saved protocol path and CAT path do not match" 
    301 //              Endif 
    302 //              ii+=1 
    303 //      while(ii<numItems) 
     224 
    304225        //set the global string to display and checkbox 
    305226        String/G root:myGlobals:Protocols:gDIV = nameList 
     
    312233                checked = 0 
    313234        Endif 
    314 //      list = w[3] 
    315 //      numItems = ItemsInList(list,comma) 
    316 //      nameList = "" 
    317 //      ii=0 
    318 //      checked = 1 
    319 //      do 
    320 //              fullPath = StringFromList(ii,list,comma) 
    321 //              PathStr = GetPathStrFromFullName(fullPath) 
    322 //              item = GetFileNameFromPathKeepSemi(fullPath) 
    323 //              nameList += item+comma 
    324 //              If(cmpstr(item,"none") ==0) 
    325 //                      nameList = item 
    326 //                      checked = 0 
    327 //                      break 
    328 //              Endif 
    329 //              If(cmpstr(item,"ask") ==0) 
    330 //                      nameList = item 
    331 //                      checked = 1 
    332 //                      break 
    333 //              Endif 
    334 //              if((cmpstr(pathStr,catPathStr) != 0) %& !(specialProtocol)) 
    335 //                      Print "pathstr = ",pathStr 
    336 //                      Print "catPathStr = ",catPathStr 
    337 //                      Abort "saved protocol path and CAT path do not match" 
    338 //              Endif 
    339 //              ii+=1 
    340 //      while(ii<numItems) 
     235 
    341236        //set the global string to display and checkbox 
    342237        String/G root:myGlobals:Protocols:gMASK = nameList 
     
    606501         
    607502        return(0) 
    608 End 
    609  
    610 //********UNUSED************ 
    611 //7/2001 - plan to modify this function to parse the comma-delimited list, (possibly just run numbers) 
    612 //and return a valid comma-delimited list of full filenames (no paths) 
    613 // 
    614 //function that takes a comma separated list of filenames (without path or version) 
    615 //and returns a full list of path;name;vers (comma delimited)  
    616 //that is needed for the protocol, which is expecting the full path 
    617 //to directly open the file(s) in the list 
    618 //this function checks for the existence of files before adding to the list 
    619 //pathStr (input) is the path (as returned by pathInfo) 
    620 // 
    621 Function/S BuildList(list,pathstr) 
    622         String list,pathstr 
    623          
    624         //input list is probably just filename, no version number 
    625         //COMMA separated lists, since file names will (MAY) include semicolon version numbers 
    626         //find the file and version number - so that full path:file;vers for each item 
    627         //trailing comma OK at end of list, ExecuteProtocol() treats all as lists 
    628          
    629         String newList="",separator=",",tempstr="",partialName="" 
    630         Variable ii=0,numitems 
    631          
    632         numitems = ItemsInList(list,separator) 
    633         do 
    634                 tempstr = StringFromList(ii,list,separator) 
    635                 if(cmpstr(tempstr,"ask")==0) 
    636                                 newList = tempstr                                       //don't prepend path to "ask" option, no comma 
    637                                 break                                                           //get out - don't add anything else to list 
    638                 endif 
    639                 if(strlen(tempStr)!=0)          //skip any null items 
    640                         //add version number (if needed) and make sure the filename is valid 
    641                         partialName = FindValidFilename(tempStr) 
    642                         //can't check for RAW here - may be dealing with mask, div ... or other filetypes 
    643                         newList += pathstr+partialName+separator 
    644                 endif 
    645                 ii+=1 
    646         while(ii<numitems) 
    647          
    648         Return(newlist) 
    649          
    650503End 
    651504 
     
    1098951End 
    1099952 
    1100 //procedure called by protocol panel to ask user for agerage type choices 
     953//procedure called by protocol panel to ask user for average type choices 
    1101954// somewhat confusing and complex, but may be as good as it gets. 
    1102955// 
     
    11751028// Procedure files for creating and executing a data reduction protocol 
    11761029// 
    1177 //**** ONLY invoked from the MAIN PANEL**** 
     1030//**** ONLY invoked from the MAIN PANEL**** NOT REALLY EVER USED ****** 
    11781031//Procedure for reducing a sample file (multiple added files) with a specified 
    11791032//protocol. User may create a new protocol, and will be prompted 
     
    12091062        //samStr is set at top to "ask", since this is the action always desired from "ReduceAFile" 
    12101063         
    1211         ////// 
    1212         //PathInfo catPathName                  //this is where the files came from 
    1213         //String pathstr=S_path,samStr 
    1214         //samStr = BuildList(tempStr,pathStr)           //ExecuteProtocol() needs full path for SAM files 
    1215         ///// 
    1216          
    12171064        ExecuteProtocol(waveStr,samStr) 
    12181065         
     
    12561103        return(list) 
    12571104End 
    1258 //missing paramater dialog to solicit user for a waveStr for the protocal  
     1105 
     1106//missing paramater dialog to solicit user for a waveStr for the protocol  
    12591107//about to be created 
    12601108//name is passed back as a global string and calling procedure is responsible for 
     
    12721120//ensures that a valid protocol name was chosen, then fills out each "item" 
    12731121//(6 total) needed for reduction 
    1274 //it the user cancels at nay point, the partial protocol will be deleted 
     1122//it the user cancels at any point, the partial protocol will be deleted 
    12751123// 
    12761124Function ProtocolQuestionnare() 
Note: See TracChangeset for help on using the changeset viewer.