- Timestamp:
- Aug 3, 2009 6:22:39 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/ProDiv.ipf
r541 r544 375 375 case 2: // mouse up 376 376 // click code here 377 //parse for the first run number 378 SVAR gPlex = root:myGlobals:Protocols:gPlex 379 String item,fname 380 381 item = StringFromList(0, gPlex ,",") 382 fname = FindFileFromRunNumber(str2num(item)) 383 if(strlen(fname) == 0) 384 Abort "Bad file number in Plex field" 385 endif 386 // load the file 387 ReadHeaderAndData(fname) //this is the full Path+file 388 UpdateDisplayInformation("RAW") 389 //draw a box of the specified size. This is persistent on the display as you scroll to the offset data 390 NVAR x1 = root:myGlobals:Protocols:gPlexX1 391 NVAR x2 = root:myGlobals:Protocols:gPlexX2 392 NVAR y1 = root:myGlobals:Protocols:gPlexY1 393 NVAR y2 = root:myGlobals:Protocols:gPlexY2 394 395 SetDrawLayer/W=SANS_Data/K UserFront //set the layer, and clear it 396 SetDrawEnv/W=SANS_Data xcoord=bottom,ycoord=left,fillpat=0,linethick=3,linefgc=(65535, 65535, 65535) 397 DrawRect/W=SANS_Data x1, y2, x2, y1 398 377 if(cmpstr(ba.ctrlName, "ShowBox") == 0) 378 379 //parse for the first run number 380 SVAR gPlex = root:myGlobals:Protocols:gPlex 381 String item,fname 382 383 item = StringFromList(0, gPlex ,",") 384 fname = FindFileFromRunNumber(str2num(item)) 385 if(strlen(fname) == 0) 386 Abort "Bad file number in Plex field" 387 endif 388 // load the file 389 ReadHeaderAndData(fname) //this is the full Path+file 390 UpdateDisplayInformation("RAW") 391 //draw a box of the specified size. This is persistent on the display as you scroll to the offset data 392 NVAR x1 = root:myGlobals:Protocols:gPlexX1 393 NVAR x2 = root:myGlobals:Protocols:gPlexX2 394 NVAR y1 = root:myGlobals:Protocols:gPlexY1 395 NVAR y2 = root:myGlobals:Protocols:gPlexY2 396 397 SetDrawLayer/W=SANS_Data/K UserFront //set the layer, and clear it 398 SetDrawEnv/W=SANS_Data xcoord=bottom,ycoord=left,fillpat=0,linethick=3,linefgc=(65535, 65535, 65535) 399 DrawRect/W=SANS_Data x1, y2, x2, y1 400 401 Button $ba.ctrlName,title="Clear Box",rename=HideBox,win=DIV_Panel 402 403 else 404 if(winType("SANS_Data")==1) 405 SetDrawLayer/W=SANS_Data/K UserFront //set the layer, and clear it 406 Button $ba.ctrlName,title="Show Box",rename=ShowBox,win=DIV_Panel 407 else 408 Button $ba.ctrlName,title="Show Box",rename=ShowBox,win=DIV_Panel 409 endif 410 endif 411 399 412 break 400 413 endswitch … … 545 558 // SetVariable setvar003,pos={16,441},size={250,15},title="DIV FILE NAME" 546 559 // SetVariable setvar003,value= root:myGlobals:Protocols:gPlexName 547 Button button0,pos={226,325},size={90,20},proc=ShowBoxButtonProc,title="Show Box"560 Button ShowBox,pos={226,325},size={90,20},proc=ShowBoxButtonProc,title="Show Box" 548 561 Button button1,pos={25,441},size={150,20},proc=GenerateDIVButtonProc,title="Generate DIV File" 549 562 Button button2,pos={25,481},size={150,20},proc=ReloadDIVButtonProc,title="Load DIV File" 563 Button button4,pos={240,481},size={80,20},proc=DoneDIVButtonProc,title="Done" 550 564 Button button3,pos={240,10},size={50,20},proc=DIVHelpButtonProc,title="Help" 551 565 SetVariable setvar00201,pos={84,297},size={50,15},limits={0,128,1},title=" ",value= root:myGlobals:Protocols:gPlexY2 … … 555 569 EndMacro 556 570 571 572 // done 573 // 574 Function DoneDIVButtonProc(ba) : ButtonControl 575 STRUCT WMButtonAction &ba 576 577 switch( ba.eventCode ) 578 case 2: // mouse up 579 // click code here 580 DoWindow/K DIV_Panel 581 break 582 endswitch 583 584 return 0 585 End 557 586 558 587 // load in a DIV file, print out the stats, display in SANS_Data
Note: See TracChangeset
for help on using the changeset viewer.