Changeset 139 for sans/SASCalc/trunk/SASCALC.ipf
- Timestamp:
- Aug 3, 2007 5:16:46 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/SASCalc/trunk/SASCALC.ipf
r84 r139 28 28 // - "simulation" of data and error bars given a model and a total number of detector counts 29 29 // - streamline code (globals needed in panel vs. wave needed for calculation) 30 // 31 // - there is a lot of re-calculation of things (a consequence of the fake-OO) that could be streamlined 30 32 // 31 33 // Done: … … 85 87 String/G root:SAS:gSourceApString = "1.43 cm;2.54 cm;3.81 cm;" 86 88 String/G root:SAS:gDeltaLambdaStr = "0.11;0.15;0.34;" 87 String/G root:SAS:gApPopStr = "1/16\";1/8\";3/16\";1/4\";5/16\";3/8\";7/16\";1/2\";9/16\";5/8\";11/16\";3/4\";" 89 String/G root:SAS:gApPopStr = "1/16\";1/8\";3/16\";1/4\";5/16\";3/8\";7/16\";1/2\";9/16\";5/8\";11/16\";3/4\";other;" 90 Variable/G root:SAS:gSamApOther = 10 //non-standard aperture diameter, in mm 88 91 89 92 //tick labels for SDD slider … … 302 305 SetDataFolder fldrSav0 303 306 307 SetVariable setvar0_3,pos={140,94},size={110,15},title="Diam (mm)",disable=1 308 SetVariable setvar0_3,limits={0,100,0.1},value= root:SAS:gSamApOther,proc=SourceApOtherSetVarProc 304 309 // set up a fake dependency to trigger recalculation 305 310 //root:SAS:gCalculate := ReCalculateInten(root:SAS:gTouched) … … 530 535 return(0) 531 536 End 537 532 538 533 539 // change the wavelength spread … … 1284 1290 end 1285 1291 1292 // change the sample aperture to a non-standard value 1293 Function SourceApOtherSetVarProc(ctrlName,varNum,varStr,varName) : SetVariableControl 1294 String ctrlName 1295 Variable varNum 1296 String varStr 1297 String varName 1298 1299 WAVE rw=root:SAS:realsRead 1300 rw[24] = varNum //sample aperture diameter in mm 1301 ReCalculateInten(1) 1302 return(0) 1303 End 1304 1286 1305 //parses the control for A2 diam 1287 1306 // updates the wave and global … … 1290 1309 ControlInfo popup0_1 1291 1310 1311 // Print "In sampleApertureDiam()" 1292 1312 //set the global 1293 1313 NVAR a2=root:SAS:gSamAp 1294 //1st item is 1/16", popup steps by 1/16" 1295 a2 = 2.54/16.0 * (V_Value) 1296 1314 1315 if(cmpstr(S_Value,"other") == 0) // "other" selected 1316 //enable the setvar, diameter in mm! 1317 SetVariable setvar0_3 disable=0 1318 // read its value (a global) 1319 NVAR a2other = root:SAS:gSamApOther 1320 a2=a2other/10 //a2 in cm 1321 else 1322 SetVariable setvar0_3 disable=1 1323 //1st item is 1/16", popup steps by 1/16" 1324 a2 = 2.54/16.0 * (V_Value) //convert to cm 1325 endif 1297 1326 WAVE rw=root:SAS:realsRead 1298 1327 rw[24] = a2*10 //sample aperture diameter in mm
Note: See TracChangeset
for help on using the changeset viewer.