- Timestamp:
- Apr 9, 2010 6:37:48 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Common/DataSetHandling.ipf
r666 r681 16 16 17 17 // 18 FunctionMakeDMPanel()18 Proc MakeDMPanel() 19 19 DoWindow/F DataManagementPanel 20 20 if(V_flag==0) 21 21 fMakeDMPanel() 22 22 endif 23 24 return(0) 25 End 26 27 Function fMakeDMPanel() 23 End 24 25 Proc fMakeDMPanel() 28 26 PauseUpdate; Silent 1 // building window... 29 NewPanel /W=(459,44,959, 300)/N=DataManagementPanel/K=2 as "Data Set Management"27 NewPanel /W=(459,44,959,410)/N=DataManagementPanel/K=2 as "Data Set Management" 30 28 ModifyPanel fixedSize=1,cbRGB=(30000,60000,60000) 31 29 … … 33 31 GroupBox grpBox_0,pos={20,10},size={460,100} 34 32 GroupBox grpBox_1,pos={20,130},size={460,70} 35 36 Button DS_button,pos={300,20},size={150,20},proc=DM_LoadDataSetProc,title="Load 1D Data Set" 37 Button Save_button,title="Save 1D Data Set",pos={300,50},size={150,20} 33 GroupBox grpBox_2,pos={20,220},size={460,40} 34 35 GroupBox grpBox_3,pos={20,280},size={460,40} 36 37 Button DS_button,title="Load 1D Data Set",pos={300,20},size={150,20} 38 Button DS_button,proc=DM_LoadDataSetProc 39 Button Unload_button,title="Unload 1D Data Set",pos={300,50},size={150,20} 40 Button Unload_button,proc=DM_UnloadProc 41 Button Save_button,title="Save 1D Data Set",pos={300,80},size={150,20} 38 42 Button Save_button,proc=DM_SaveProc 39 Button Unload_button,title="Unload 1D Data Set",pos={300,80},size={150,20} 40 Button Unload_button,proc=DM_UnloadProc 41 PopupMenu DS_popup,pos={30,52},size={318,20},title="Data Set ",proc=DM_PopupProc 43 PopupMenu DS_popup,pos={30,40},size={318,20},title="Data Set ",proc=DM_PopupProc 42 44 PopupMenu DS_popup,mode=1,value= #"DM_DataSetPopupList()" 45 46 CheckBox XMLStateCtrl,pos={30,82},size={124,14},title="XML Output Enabled (change in Preferences)" 47 CheckBox XMLStateCtrl,help={"Default output format is canSAS XML rather than NIST 6 column"} 48 CheckBox XMLStateCtrl,value= root:Packages:NIST:gXML_Write,disable=2 43 49 44 50 Button Rename_button,title="Rename",pos={75,170},size={150,20} … … 49 55 SetVariable NewName_setvar,title="New Name (max 25 characters)",pos={50,140},size={400,20} 50 56 SetVariable NewName_setvar,fsize=12,value=_STR:"",proc=DMNameSetvarproc,live=1 51 52 Button DMDone_button,title="Done",pos={360,210},size={60,20} 57 58 Button SaveAsXML_button,title="Save as canSAS XML",pos={75,230},size={150,20} 59 Button SaveAsXML_button,proc=DMSaveAsXMLproc 60 61 Button SaveAs6col_button,title="Save as NIST 6 column",pos={275,230},size={150,20} 62 Button SaveAs6col_button,proc=DMSaveAs6colproc 63 64 Button BatchConvertData_button,title="Convert Format of 1D Data Files",pos={75,290},size={350,20} 65 Button BatchConvertData_button,proc=DMBatchConvertProc 66 67 Button DMDone_button,title="Done",pos={360,330},size={60,20} 53 68 Button DMDone_button,proc=DMDoneButtonProc 54 Button DMHelp_button,title="?",pos={440, 210},size={30,20}69 Button DMHelp_button,title="?",pos={440,330},size={30,20} 55 70 Button DMHelp_button,proc=DMHelpButtonProc 56 71 … … 68 83 endif 69 84 85 End 86 87 Function DMBatchConvertProc(ba) : ButtonControl 88 STRUCT WMButtonAction &ba 89 90 switch( ba.eventCode) 91 case 2: 92 Execute "MakeBatchConvertPanel()" 93 break 94 endswitch 95 96 return 0 70 97 End 71 98 … … 300 327 if(V_flag !=0) 301 328 DoAlert 0,"The Data Set Management Help file could not be found" 329 endif 330 break 331 endswitch 332 333 return 0 334 End 335 336 /////////////////////// Batch Data Conversion Panel //////////////////////////////////// 337 // 338 // 339 340 Proc MakeNCNRBatchConvertPanel() 341 NCNRInitBatchConvert() 342 DoWindow/F NCNRBatchConvertPanel 343 if(V_flag==0) 344 fMakeNCNRBatchConvertPanel() 345 endif 346 End 347 348 349 Function NCNRInitBatchConvert() 350 NewDataFolder/O/S root:Packages:NIST:BatchConvert 351 Make/O/T/N=1 filewave="" 352 Make/O/N=1 selWave=0 353 Variable/G ind=0 354 SetDataFolder root: 355 End 356 357 Proc fMakeNCNRBatchConvertPanel() 358 PauseUpdate; Silent 1 // building window... 359 NewPanel /W=(658,347,1018,737)/N=NCNRBatchConvertPanel/K=2 as "Batch Convert 1D Data" 360 ModifyPanel cbRGB=(40000,50000,32896) 361 ModifyPanel fixedSize=1 362 363 ListBox fileList,pos={13,11},size={206,179} 364 ListBox fileList,listWave=root:Packages:NIST:BatchConvert:fileWave 365 ListBox fileList,selWave=root:Packages:NIST:BatchConvert:selWave,mode= 4 366 367 Button button7,pos={238,20},size={100,20},proc=NCNRBatchConvertNewFolder,title="New Folder" 368 Button button7,help={"Select a new data folder"} 369 TitleBox msg0,pos={238,140},size={100,30},title="\JCShift-click to\rselect multiple files" 370 TitleBox msg0,frame=0,fixedSize=1 371 372 GroupBox filterGroup,pos={13,200},size={206,60},title="Filter list by input file type" 373 374 Button button8,pos={238,76},size={100,20},proc=NCNRBatchConvertHelpProc,title="Help" 375 Button button9,pos={238,48},size={100,20},proc=NCNRBatchConvertRefresh,title="Refresh List" 376 Button button0,pos={238,106},size={100,20},proc=NCNRBatchConvertDone,title="Done" 377 378 GroupBox outputGroup,pos={13,270},size={206,60},title="Output File Type" 379 380 381 Button button6,pos={13,350},size={206,20},proc=NCNRBatchConvertFiles,title="Convert File(s)" 382 Button button6,help={"Converts the files to the format selected"} 383 384 385 386 End 387 388 389 Function NCNRBatchConvertFiles(ba) : ButtonControl 390 STRUCT WMButtonAction &ba 391 392 switch (ba.eventCode) 393 case 2: 394 Wave/T fileWave=$"root:Packages:NIST:BatchConvert:fileWave" 395 Wave sel=$"root:BatchConvert:NIST:BatchConvert:selWave" 396 397 break 398 endswitch 399 400 return 0 401 End 402 403 404 Function NCNRBatchConvertNewFolder(ba) : ButtonControl 405 STRUCT WMButtonAction &ba 406 407 switch (ba.eventcode) 408 case 2: 409 A_PickPath() 410 NCNRBatchConvertGetList() 411 break 412 endswitch 413 414 End 415 416 Function NCNRBatchConvertGetList() 417 418 //make sure that path exists 419 PathInfo catPathName 420 if (V_flag == 0) 421 Abort "Folder path does not exist - use \"New Folder\" button" 422 Endif 423 424 String newList = A_ReducedDataFileList("") 425 Variable num 426 427 num=ItemsInList(newlist,";") 428 WAVE/T fileWave=$"root:Packages:NIST:BatchConvert:fileWave" 429 WAVE selWave=$"root:Packages:NIST:BatchConvert:selWave" 430 Redimension/N=(num) fileWave 431 Redimension/N=(num) selWave 432 fileWave = StringFromList(p,newlist,";") 433 Sort filewave,filewave 434 End 435 436 Function NCNRBatchConvertRefresh(ba) : ButtonControl 437 STRUCT WMButtonAction &ba 438 439 switch (ba.eventCode) 440 case 2: 441 NCNRBatchConvertGetList() 442 break 443 endswitch 444 445 return 0 446 End 447 448 449 Function NCNRBatchConvertDone(ba) : ButtonControl 450 STRUCT WMButtonAction &ba 451 452 switch (ba.eventCode) 453 case 2: 454 DoWindow/K NCNRBatchConvertPanel 455 break 456 endswitch 457 458 return 0 459 End 460 461 Function NCNRBatchConvertHelpProc(ba) : ButtonControl 462 STRUCT WMButtonAction &ba 463 464 String win = ba.win 465 466 switch (ba.eventCode) 467 case 2: 468 // click code here 469 DisplayHelpTopic/Z/K=1 "Batch Data Conversion" 470 if(V_flag !=0) 471 DoAlert 0,"The Batch Data Conversion Help file could not be found" 302 472 endif 303 473 break
Note: See TracChangeset
for help on using the changeset viewer.