Changeset 763
- Timestamp:
- Oct 28, 2010 10:57:04 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Tile_2D.ipf
r665 r763 175 175 for(ii=startInd;ii<ind;ii+=1) 176 176 AppendLayoutObject/F=1/R=(72,40,144,112) picture $("RAW"+num2str(ii)+"L_PNG") 177 ModifyLayout top($("RAW"+num2str(ii)+"L_PNG"))=(40+mod(30*ii,560)) //separate the graphics (in points)178 ModifyLayout/I width($("RAW"+num2str(ii)+"L_PNG"))=(wd),height($("RAW"+num2str(ii)+"L_PNG"))=(wd) //(in inches)177 // ModifyLayout top($("RAW"+num2str(ii)+"L_PNG"))=(40+mod(30*ii,560)) //separate the graphics (in points) 178 // ModifyLayout/I width($("RAW"+num2str(ii)+"L_PNG"))=(wd),height($("RAW"+num2str(ii)+"L_PNG"))=(wd) //(in inches) 179 179 endfor 180 // maybe don't tile or stackthe objects in the layout - it alters the aspect ratio180 //careful tiling the objects in the layout - it alters the aspect ratio 181 181 Variable totalNumPNGs = itemsinlist(PICTList("*L_PNG", ";", "WIN:")) 182 182 String rcStr="/A=(4,3)" 183 wd = 2.5 183 184 // Print totalNumPNGs 184 185 if(totalNumPNGs>12) 185 186 rcStr="/A=(5,4)" 187 wd = 1.9 186 188 endif 187 189 if(totalNumPNGs>20) 188 190 rcStr="/A=(7,5)" 191 wd = 1.4 189 192 endif 190 193 if(totalNumPNGs>35) 191 194 rcStr="/A=(8,5)" 195 wd = 1.2 192 196 endif 193 197 if(totalNumPNGs>40) 194 198 rcStr="" 199 wd = 1 195 200 endif 196 201 Execute "Tile"+rcStr+"/O=8" 202 203 // pick an appropriate width and height (the same) for the permutations of rows and columns to get the 204 // largest possible images 205 // -- then propogate this change to the Add All to Layout function 206 // 207 for(ii=startInd;ii<ind;ii+=1) 208 ModifyLayout/I width($("RAW"+num2str(ii)+"L_PNG"))=(wd),height($("RAW"+num2str(ii)+"L_PNG"))=(wd) //(in inches) 209 endfor 197 210 198 211 defaultScaling = oldState //set the scaling back to the previous state … … 293 306 // DoWindow/F $layoutStr 294 307 // endif 295 Variable jj 308 Variable jj,kk 309 String rcStr="" 310 311 // determine the appropriate scaling for the number of files. 312 // if < 40 files, pick the scaling. if > 40, use wd =1, and the last 313 // layout may be sparse, but will be scaled like the others. 314 315 if(num>12) 316 rcStr="/A=(5,4)" 317 wd = 1.9 318 endif 319 if(num>20) 320 rcStr="/A=(7,5)" 321 wd = 1.4 322 endif 323 if(num>35) 324 rcStr="/A=(8,5)" 325 wd = 1.2 326 endif 327 if(num>40) 328 rcStr="" 329 wd = 1 330 endif 331 332 296 333 297 334 NewLayout … … 304 341 jj+=1 305 342 while( (jj<ii+numPerLayout) && (jj<ind) ) //index in batch, keep from running over total number of PNGs 306 Execute "Tile/O=8" //done with this layout 343 Execute "Tile"+rcStr+"/O=8" 344 //now make them square 345 for(kk=ii;kk<jj;kk+=1) 346 ModifyLayout/I width($("RAW"+num2str(kk)+"L_PNG"))=(wd),height($("RAW"+num2str(kk)+"L_PNG"))=(wd) //(in inches) 347 endfor 348 307 349 if(jj<ind) //need another layout 308 350 NewLayout … … 310 352 endif 311 353 endfor 312 Execute "Tile/O=8" //tile the last layout 313 354 314 355 defaultScaling = oldState //set the scaling back to the previous state 315 356 return(0) … … 460 501 461 502 //procedure for drawing the simple panel to export raw->ascii 462 // 503 //root:myGlobals:RAW2ASCII:selWave = 1 463 504 Proc RAW_to_ASCII() 464 505 PauseUpdate; Silent 1 // building window... … … 468 509 ListBox fileList,listWave=root:myGlobals:RAW2ASCII:fileWave 469 510 ListBox fileList,selWave=root:myGlobals:RAW2ASCII:selWave,mode= 4 470 Button button0,pos={239,1 12},size={110,20},proc=RA_ExportButtonProc,title="Export File(s)"511 Button button0,pos={239,132},size={110,20},proc=RA_ExportButtonProc,title="Export File(s)" 471 512 Button button0,help={"Exports (saves to disk) the selected files as ASCII format"} 472 513 Button button1,pos={270,156},size={50,20},proc=RawExportDoneButtonProc,title="Done" … … 482 523 CheckBox check2,pos={220,82},size={104,14},title="Det. Coord, Grasp compatible",value= 0,mode=1 483 524 CheckBox check2,proc=RA_ExportCheckProc 525 CheckBox check3,pos={220,110},size={104,14},title="Select All Files",value= 0 526 CheckBox check3,proc=RA_SelectAllCheckProc 484 527 EndMacro 528 529 Function RA_SelectAllCheckProc(ctrlName,checked) : CheckBoxControl 530 String ctrlName 531 Variable checked 532 533 WAVE w = root:myGlobals:RAW2ASCII:selWave 534 if(checked) 535 w = 1 // select everything 536 CheckBox check3,value=1 537 else 538 w = 0 // deselect all 539 CheckBox check3,value=0 540 endif 541 542 543 return(0) 544 End 485 545 486 546 Function RA_ExportCheckProc(ctrlName,checked) : CheckBoxControl
Note: See TracChangeset
for help on using the changeset viewer.