- Timestamp:
- Jun 29, 2009 1:51:03 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/Wrapper_v40.ipf
r515 r516 36 36 if(exists("root:Packages:NIST:suffixKWStr")==0) 37 37 String/G root:Packages:NIST:suffixKWStr="" 38 endif 39 if(exists("root:Packages:NIST:paramKWStr")==0) 40 String/G root:Packages:NIST:paramKWStr="" 38 41 endif 39 42 Execute "WrapperPanel()" … … 499 502 String paramStr="" 500 503 SVAR/Z listStr=root:Packages:NIST:paramKWStr 504 501 505 if(SVAR_Exists(listStr)) 502 506 paramStr = StringByKey(funcStr, listStr ,"=",";",0) … … 505 509 endif 506 510 else //global string does not exist, create it and fill it in 511 Variable/G root:Pacakges:NIST:gReconstructStrings = 1 //coefficients old style and must be rebuilt too 507 512 String/G root:Packages:NIST:paramKWStr="" 508 513 SVAR/Z listStr=root:Packages:NIST:paramKWStr 509 endif 510 // find everything511 SVAR suffixKWStr = root:Packages:NIST:suffixKWStr514 endif 515 516 // find everything to rebuild only if the model has been plotted (if so, coefficients will exist) 512 517 String coef = getFunctionCoef(funcStr) 513 String suffix = getModelSuffix(coef) //!! normally takes funcStr 514 515 // add to the suffix list 516 suffixKWStr += funcStr+"="+suffix+";" 517 518 // add to the paramList 518 if(strlen(coef)==0) 519 //model not plotted, don't reconstruct, return null string 520 return(paramStr) 521 endif 519 522 520 523 ///// NEED TO BE IN PROPER DATA FOLDER FOR SMEARED FUNCTIONS … … 533 536 SetDataFolder root: 534 537 endif 535 538 539 // model was plotted, find the suffix to fill in the parameter wave 540 SVAR suffListStr=root:Packages:NIST:suffixKWStr 541 String suffix = StringByKey(coef, suffListStr ,"=",";",0) 536 542 537 543 String paramWave = WaveList("*par*"+suffix,"","TEXT:1") //should be one wave name, no trailing semicolon … … 558 564 // 559 565 // does NOT return the leading "_" as part of the suffix 566 // may need to set the string correctly - so lost of messing around for back-compatibility 560 567 Function/S getModelSuffix(funcStr) 561 568 String funcStr … … 564 571 String suffixStr = StringByKey(funcStr, listStr ,"=",";",0) 565 572 566 if(strlen(suffixStr)==0) 567 // run through the param function to set the strings properly 568 String str = getFunctionParams(funcStr) 569 suffixStr = getModelSuffix(funcStr) //then call again 570 endif 571 return(suffixStr) 573 if(strlen(suffixStr) !=0) //found it, get out 574 return(suffixStr) 575 endif 576 577 // was the model plotted? 578 String coef = getFunctionCoef(funcStr) 579 if(strlen(coef)==0) 580 //nothing plotted 581 return("") 582 else 583 //plotted, find the coeff 584 String suffix = StringByKey(coef, ListStr ,"=",";",0) 585 586 // add to the suffix list in the new style, if it was found 587 if(strlen(suffix) !=0) 588 listStr += funcStr+"="+suffix+";" 589 endif 590 return(suffix) 591 endif 592 593 return("") 572 594 End 573 595
Note: See TracChangeset
for help on using the changeset viewer.