- Timestamp:
- Apr 11, 2013 4:08:43 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_Igor_Procedures/NCNR_Package_Loader.ipf
r884 r903 4 4 // load/unload courtesy of Jan Ilavsky 5 5 // June 2008 6 6 // 7 7 // - SRK Oct 2008 8 8 // rather than deleting the macros, it is preferable to simply hide the appropriate panels. 9 9 // deleting the ipf files will break dependencies, leave panels hanging open without 10 10 // their associated procedures, etc. 11 11 // 12 12 // names of everything have been changed so I won't clash with Jan's code 13 // - make this an independent module in case of bad compilation...? 13 14 // 14 15 // 15 // - make this an independent module in case of bad compilation... 16 // a "(" anywhere in the menuItemString will disable that menu item 17 // <U underlines, <U bolds (?? maybe use these to show which is actually loaded) 18 19 16 20 17 21 18 22 Menu "Macros" 23 "-" 19 24 StrVarOrDefault("root:Packages:NCNRItemStr1a","Load NCNR Analysis Macros"), NCNR_AnalysisLoader(StrVarOrDefault("root:Packages:NCNRItemStr1a","Load NCNR Analysis Macros")) 20 StrVarOrDefault("root:Packages:NCNRItemStr1b","-"), NCNR_AnalysisLoader(StrVarOrDefault("root:Packages:NCNRItemStr1b","-")) 21 22 StrVarOrDefault("root:Packages:NCNRItemStr2a","Load NCNR SANS Reduction Macros"), NCNR_SANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr2a","Load NCNR SANS Reduction Macros")) 23 StrVarOrDefault("root:Packages:NCNRItemStr2b","-"), NCNR_SANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr2b","-")) 24 25 StrVarOrDefault("root:Packages:NCNRItemStr3a","Load NCNR USANS Reduction Macros"), NCNR_USANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr3a","Load NCNR USANS Reduction Macros")) 26 StrVarOrDefault("root:Packages:NCNRItemStr3b","-"), NCNR_USANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr3b","-")) 25 // StrVarOrDefault("root:Packages:NCNRItemStr1b","-"), NCNR_AnalysisLoader(StrVarOrDefault("root:Packages:NCNRItemStr1b","-")) 26 27 Submenu "Load SANS Reduction Macros" 28 StrVarOrDefault("root:Packages:NCNRItemStr2a","Load NCNR SANS Reduction Macros"), NCNR_SANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr2a","Load NCNR SANS Reduction Macros")) 29 StrVarOrDefault("root:Packages:NCNRItemStr2b","Load QUOKKA SANS Reduction Macros"), NCNR_SANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr2b","Load QUOKKA SANS Reduction Macros")) 30 StrVarOrDefault("root:Packages:NCNRItemStr2c","Load ILL SANS Reduction Macros"), NCNR_SANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr2c","Load ILL SANS Reduction Macros")) 31 StrVarOrDefault("root:Packages:NCNRItemStr2d","Load HFIR SANS Reduction Macros"), NCNR_SANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr2d","Load HFIR SANS Reduction Macros")) 32 StrVarOrDefault("root:Packages:NCNRItemStr2e","Load HANARO SANS Reduction Macros"), NCNR_SANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr2e","Load HANARO SANS Reduction Macros")) 33 // StrVarOrDefault("root:Packages:NCNRItemStr2b","-"), NCNR_SANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr2b","-")) 34 End 35 36 Submenu "Load USANS Reduction Macros" 37 StrVarOrDefault("root:Packages:NCNRItemStr3a","Load NCNR USANS Reduction Macros"), NCNR_USANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr3a","Load NCNR USANS Reduction Macros")) 38 StrVarOrDefault("root:Packages:NCNRItemStr3b","Load HANARO USANS Reduction Macros"), NCNR_USANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr3b","Load HANARO USANS Reduction Macros")) 39 // StrVarOrDefault("root:Packages:NCNRItemStr3b","-"), NCNR_USANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr3b","-")) 40 End 27 41 28 42 StrVarOrDefault("root:Packages:NCNRItemStr4a","Load NCNR SANS Live Data"), NCNR_SANSLiveLoader(StrVarOrDefault("root:Packages:NCNRItemStr4a","Load NCNR SANS Live Data")) 29 StrVarOrDefault("root:Packages:NCNRItemStr4b","-"), NCNR_SANSLiveLoader(StrVarOrDefault("root:Packages:NCNRItemStr4b","-"))43 // StrVarOrDefault("root:Packages:NCNRItemStr4b","-"), NCNR_SANSLiveLoader(StrVarOrDefault("root:Packages:NCNRItemStr4b","-")) 30 44 31 45 // for testing ONLY … … 37 51 "Load Real Space Modeling - Beta",RealSpaceLoader() 38 52 "Event Mode Processing - Beta",EventModeLoader() 39 "-"53 // "-" 40 54 41 55 end … … 59 73 case "Load NCNR Analysis Macros": 60 74 Execute/P "INSERTINCLUDE \"SA_Includes_v410\"" 61 Execute/P "INSERTINCLUDE \"PlotUtilsMacro_v40\""62 Execute/P "INSERTINCLUDE \"GaussUtils_v40\""63 Execute/P "INSERTINCLUDE \"WriteModelData_v40\""64 Execute/P "INSERTINCLUDE \"USANS_SlitSmearing_v40\""65 Execute/P "INSERTINCLUDE \"SANSModelPicker_v40\""66 75 Execute/P "COMPILEPROCEDURES " 67 76 Execute/P ("Init_WrapperPanel()") … … 78 87 // very dangerous - don't really want to implement this because it will surely crash 79 88 Execute/P "DELETEINCLUDE \"SA_Includes_v410\"" 80 Execute/P "DELETEINCLUDE \"PlotUtilsMacro_v40\""81 Execute/P "DELETEINCLUDE \"GaussUtils_v40\""82 Execute/P "DELETEINCLUDE \"WriteModelData_v40\""83 Execute/P "DELETEINCLUDE \"USANS_SlitSmearing_v40\""84 Execute/P "DELETEINCLUDE \"SANSModelPicker_v40\""85 89 Execute/P "COMPILEPROCEDURES " 86 90 DoWindow wrapperPanel … … 125 129 126 130 // now add for the SANS Reduction 131 // a = NCNR 132 // b = QUOKKA 133 // c = ILL 134 // d = HFIR 135 // e = HANARO 136 // 127 137 Function NCNR_SANSReductionLoader(itemStr) 128 138 String itemStr … … 133 143 134 144 NewDataFolder/O root:Packages //create the folder for string variable 135 String/G root:Packages:NCNRItemStr2a = itemStr 136 String/G root:Packages:NCNRItemStr2b = itemStr 145 146 String/G root:Packages:NCNRItemStr2a = "Load NCNR SANS Reduction Macros" 147 String/G root:Packages:NCNRItemStr2b = "Load QUOKKA SANS Reduction Macros" 148 String/G root:Packages:NCNRItemStr2c = "Load ILL SANS Reduction Macros" 149 String/G root:Packages:NCNRItemStr2d = "Load HFIR SANS Reduction Macros" 150 String/G root:Packages:NCNRItemStr2e = "Load HANARO SANS Reduction Macros" 137 151 SVAR gMenuStr2a = root:Packages:NCNRItemStr2a 138 152 SVAR gMenuStr2b = root:Packages:NCNRItemStr2b 153 SVAR gMenuStr2c = root:Packages:NCNRItemStr2c 154 SVAR gMenuStr2d = root:Packages:NCNRItemStr2d 155 SVAR gMenuStr2e = root:Packages:NCNRItemStr2e 139 156 140 157 String SANSRed_WinList = "Main_Panel;CatVSTable;SANS_Data;Plot_Manager;Average_Panel;Plot_1d;CatWin;Surface_3D;FitPanel;FitWindow;" … … 144 161 SANSRed_WinList += "Trial_Configuration;Saved_Configurations;DataArithmeticPanel;DAPlotPanel;" 145 162 strswitch(itemStr) // string switch 163 146 164 case "Load NCNR SANS Reduction Macros": 147 165 Execute/P "INSERTINCLUDE \"Includes_v520\"" … … 150 168 Execute/P ("DoIgorMenu \"Control\" \"Retrieve All Windows\"") 151 169 170 // change the facility label, disable the others 152 171 gMenuStr2a = "Hide NCNR SANS Reduction Macros" 153 // gMenuStr2b = "Unload NCNR SANS Reduction Macros" 154 gMenuStr2b = "-" 155 BuildMenu "Macros" 156 157 break 158 case "Unload NCNR SANS Reduction Macros": 159 // very dangerous - don't really want to implement this because it will surely crash 160 Execute/P "DELETEINCLUDE \"Includes_v520\"" 161 Execute/P "COMPILEPROCEDURES " 162 DoWindow Main_Panel 163 if(V_Flag) 164 DoWindow/K Main_Panel 165 endif 166 167 gMenuStr2a = "Load NCNR SANS Reduction Macros" 168 gMenuStr2b = "-" 169 170 BuildMenu "Macros" 171 172 break 172 gMenuStr2b += "(" 173 gMenuStr2c += "(" 174 gMenuStr2d += "(" 175 gMenuStr2e += "(" 176 177 BuildMenu "Macros" 178 break 179 180 case "Load QUOKKA SANS Reduction Macros": 181 Print "QUOKKA macros not in SVN yet - NCNR macros loaded instead" 182 Execute/P "INSERTINCLUDE \"Includes_v520\"" 183 // Execute/P "INSERTINCLUDE \"QKK_Includes_ANSTO\"" 184 Execute/P "COMPILEPROCEDURES " 185 Execute/P ("Initialize()") 186 Execute/P ("DoIgorMenu \"Control\" \"Retrieve All Windows\"") 187 188 // change the facility label, disable the others 189 gMenuStr2a += "(" 190 gMenuStr2b = "Hide QUOKKA SANS Reduction Macros" 191 gMenuStr2c += "(" 192 gMenuStr2d += "(" 193 gMenuStr2e += "(" 194 195 BuildMenu "Macros" 196 break 197 198 case "Load ILL SANS Reduction Macros": 199 Execute/P "INSERTINCLUDE \"Includes_v520_ILL\"" 200 Execute/P "COMPILEPROCEDURES " 201 Execute/P ("Initialize()") 202 Execute/P ("DoIgorMenu \"Control\" \"Retrieve All Windows\"") 203 204 // change the facility label, disable the others 205 gMenuStr2a += "(" 206 gMenuStr2b += "(" 207 gMenuStr2c = "Hide ILL SANS Reduction Macros" 208 gMenuStr2d += "(" 209 gMenuStr2e += "(" 210 211 BuildMenu "Macros" 212 break 213 214 case "Load HFIR SANS Reduction Macros": 215 Execute/P "INSERTINCLUDE \"HFIR_Includes_v520\"" 216 Execute/P "COMPILEPROCEDURES " 217 Execute/P ("Initialize()") 218 Execute/P ("DoIgorMenu \"Control\" \"Retrieve All Windows\"") 219 220 // change the facility label, disable the others 221 gMenuStr2a += "(" 222 gMenuStr2b += "(" 223 gMenuStr2c += "(" 224 gMenuStr2d = "Hide HFIR SANS Reduction Macros" 225 gMenuStr2e += "(" 226 227 BuildMenu "Macros" 228 break 229 230 case "Load HANARO SANS Reduction Macros": 231 Print "HANARO not loaded into SVN yet. NCNR is loaded" 232 Execute/P "INSERTINCLUDE \"Includes_v520\"" 233 Execute/P "COMPILEPROCEDURES " 234 Execute/P ("Initialize()") 235 Execute/P ("DoIgorMenu \"Control\" \"Retrieve All Windows\"") 236 237 // change the facility label, disable the others 238 gMenuStr2a += "(" 239 gMenuStr2b += "(" 240 gMenuStr2c += "(" 241 gMenuStr2d += "(" 242 gMenuStr2e += "Hide HANARO SANS Reduction Macros" 243 244 BuildMenu "Macros" 245 break 246 247 //////////// 173 248 case "Hide NCNR SANS Reduction Macros": 174 249 HideShowWindowsInList(SANSRed_WinList,1) 175 176 gMenuStr2a = "Show NCNR SANS Reduction Macros" 177 // gMenuStr2b = "Unload NCNR SANS Reduction Macros" 178 gMenuStr2b = "-" 179 BuildMenu "Macros" 180 181 break 250 251 // change the facility label, disable the others 252 gMenuStr2a = "Show NCNR SANS Reduction Macros" 253 gMenuStr2b += "(" 254 gMenuStr2c += "(" 255 gMenuStr2d += "(" 256 gMenuStr2e += "(" 257 258 BuildMenu "Macros" 259 break 260 261 case "Hide QUOKKA SANS Reduction Macros": 262 HideShowWindowsInList(SANSRed_WinList,1) 263 264 // change the facility label, disable the others 265 gMenuStr2a += "(" 266 gMenuStr2b = "Show QUOKKA SANS Reduction Macros" 267 gMenuStr2c += "(" 268 gMenuStr2d += "(" 269 gMenuStr2e += "(" 270 271 BuildMenu "Macros" 272 break 273 274 case "Hide ILL SANS Reduction Macros": 275 HideShowWindowsInList(SANSRed_WinList,1) 276 277 // change the facility label, disable the others 278 gMenuStr2a += "(" 279 gMenuStr2b += "(" 280 gMenuStr2c = "Show ILL SANS Reduction Macros" 281 gMenuStr2d += "(" 282 gMenuStr2e += "(" 283 284 BuildMenu "Macros" 285 break 286 287 case "Hide HFIR SANS Reduction Macros": 288 HideShowWindowsInList(SANSRed_WinList,1) 289 290 // change the facility label, disable the others 291 gMenuStr2a += "(" 292 gMenuStr2b += "(" 293 gMenuStr2c += "(" 294 gMenuStr2d = "Show HFIR SANS Reduction Macros" 295 gMenuStr2e += "(" 296 297 BuildMenu "Macros" 298 break 299 300 case "Hide HANARO SANS Reduction Macros": 301 HideShowWindowsInList(SANSRed_WinList,1) 302 303 // change the facility label, disable the others 304 gMenuStr2a += "(" 305 gMenuStr2b += "(" 306 gMenuStr2c += "(" 307 gMenuStr2d += "(" 308 gMenuStr2e = "Show HANARO SANS Reduction Macros" 309 310 BuildMenu "Macros" 311 break 312 313 /////////////// 182 314 case "Show NCNR SANS Reduction Macros": 183 315 HideShowWindowsInList(SANSRed_WinList,0) 184 316 317 // change the facility label, disable the others 185 318 gMenuStr2a = "Hide NCNR SANS Reduction Macros" 186 // gMenuStr2b = "Unload NCNR SANS Reduction Macros" 187 gMenuStr2b = "-" 188 BuildMenu "Macros" 189 190 break 319 gMenuStr2b += "(" 320 gMenuStr2c += "(" 321 gMenuStr2d += "(" 322 gMenuStr2e += "(" 323 324 BuildMenu "Macros" 325 break 326 327 case "Show QUOKKA SANS Reduction Macros": 328 HideShowWindowsInList(SANSRed_WinList,0) 329 330 // change the facility label, disable the others 331 gMenuStr2a += "(" 332 gMenuStr2b = "Hide QUOKKA SANS Reduction Macros" 333 gMenuStr2c += "(" 334 gMenuStr2d += "(" 335 gMenuStr2e += "(" 336 337 BuildMenu "Macros" 338 break 339 340 case "Show ILL SANS Reduction Macros": 341 HideShowWindowsInList(SANSRed_WinList,0) 342 343 // change the facility label, disable the others 344 gMenuStr2a += "(" 345 gMenuStr2b += "(" 346 gMenuStr2c = "Hide ILL SANS Reduction Macros" 347 gMenuStr2d += "(" 348 gMenuStr2e += "(" 349 350 BuildMenu "Macros" 351 break 352 353 case "Show HFIR SANS Reduction Macros": 354 HideShowWindowsInList(SANSRed_WinList,0) 355 356 // change the facility label, disable the others 357 gMenuStr2a += "(" 358 gMenuStr2b += "(" 359 gMenuStr2c += "(" 360 gMenuStr2d = "Hide HFIR SANS Reduction Macros" 361 gMenuStr2e += "(" 362 363 BuildMenu "Macros" 364 break 365 366 case "Show HANARO SANS Reduction Macros": 367 HideShowWindowsInList(SANSRed_WinList,0) 368 369 // change the facility label, disable the others 370 gMenuStr2a += "(" 371 gMenuStr2b += "(" 372 gMenuStr2c += "(" 373 gMenuStr2d += "(" 374 gMenuStr2e = "Hide HANARO SANS Reduction Macros" 375 376 BuildMenu "Macros" 377 break 378 379 380 // case "Unload NCNR SANS Reduction Macros": 381 // // very dangerous - don't really want to implement this because it will surely crash 382 // Execute/P "DELETEINCLUDE \"Includes_v520\"" 383 // Execute/P "COMPILEPROCEDURES " 384 // DoWindow Main_Panel 385 // if(V_Flag) 386 // DoWindow/K Main_Panel 387 // endif 388 // 389 // gMenuStr2a = "Load NCNR SANS Reduction Macros" 390 // gMenuStr2b = "-" 391 // 392 // BuildMenu "Macros" 393 // 394 // break 395 191 396 default: 192 397 Abort "Invalid Menu Selection" … … 195 400 end 196 401 197 // now add for the SANS Reduction 402 // now add for the USANS Reduction 403 // a = NCNR 404 // b = HANARO 198 405 Function NCNR_USANSReductionLoader(itemStr) 199 406 String itemStr … … 204 411 205 412 NewDataFolder/O root:Packages //create the folder for string variable 206 String/G root:Packages:NCNRItemStr3a = itemStr207 String/G root:Packages:NCNRItemStr3b = itemStr413 String/G root:Packages:NCNRItemStr3a = "Load NCNR USANS Reduction Macros" 414 String/G root:Packages:NCNRItemStr3b = "Load HANARO USANS Reduction Macros" 208 415 SVAR gMenuStr3a = root:Packages:NCNRItemStr3a 209 416 SVAR gMenuStr3b = root:Packages:NCNRItemStr3b … … 213 420 strswitch(itemStr) // string switch 214 421 case "Load NCNR USANS Reduction Macros": 215 Execute/P "INSERTINCLUDE \" USANS_Includes_v230\""422 Execute/P "INSERTINCLUDE \"NCNR_USANS_Includes_v230\"" 216 423 Execute/P "COMPILEPROCEDURES " 217 424 Execute/P ("ShowUSANSPanel()") 218 425 Execute/P ("DoIgorMenu \"Control\" \"Retrieve All Windows\"") 219 426 427 // change the facility label, disable the others 220 428 gMenuStr3a = "Hide NCNR USANS Reduction Macros" 221 // gMenuStr3b = "Unload NCNR USANS Reduction Macros"222 gMenuStr3b = "-"223 BuildMenu "Macros" 224 225 break226 case " Unload NCNRUSANS Reduction Macros":227 // very dangerous - don't really want to implement this because it will surely crash228 Execute/P " DELETEINCLUDE \"USANS_Includes_v230\""229 Execute/P "COMPILEPROCEDURES "230 DoWindow USANS_Panel231 if(V_Flag) 232 DoWindow/K USANS_Panel233 endif234 235 gMenuStr3a = "Load NCNR USANS Reduction Macros"236 gMenuStr3b = "-"237 238 BuildMenu "Macros"239 240 break 429 gMenuStr3b += "(" 430 431 BuildMenu "Macros" 432 break 433 434 case "Load HANARO USANS Reduction Macros": 435 Execute/P "INSERTINCLUDE \"KIST_USANS_Includes_v230\"" 436 Execute/P "COMPILEPROCEDURES " 437 Execute/P ("ShowUSANSPanel()") 438 Execute/P ("DoIgorMenu \"Control\" \"Retrieve All Windows\"") 439 440 // change the facility label, disable the others 441 gMenuStr3a += "(" 442 gMenuStr3b = "Hide HANARO USANS Reduction Macros" 443 444 BuildMenu "Macros" 445 break 446 447 /////////////////// 448 241 449 case "Hide NCNR USANS Reduction Macros": 242 450 HideShowWindowsInList(USANS_WinList,1) 243 451 452 // change the facility label, disable the others 244 453 gMenuStr3a = "Show NCNR USANS Reduction Macros" 245 // gMenuStr3b = "Unload NCNR USANS Reduction Macros" 246 gMenuStr3b = "-" 247 BuildMenu "Macros" 248 249 break 454 gMenuStr3b += "(" 455 456 BuildMenu "Macros" 457 break 458 459 case "Hide HANARO USANS Reduction Macros": 460 HideShowWindowsInList(USANS_WinList,1) 461 462 // change the facility label, disable the others 463 gMenuStr3a += "(" 464 gMenuStr3b = "Show HANARO USANS Reduction Macros" 465 466 BuildMenu "Macros" 467 break 468 469 /////////////////// 250 470 case "Show NCNR USANS Reduction Macros": 251 471 HideShowWindowsInList(USANS_WinList,0) 252 472 473 // change the facility label, disable the others 253 474 gMenuStr3a = "Hide NCNR USANS Reduction Macros" 254 // gMenuStr3b = "Unload NCNR USANS Reduction Macros" 255 gMenuStr3b = "-" 256 BuildMenu "Macros" 257 258 break 475 gMenuStr3b += "(" 476 477 BuildMenu "Macros" 478 break 479 480 case "Show HANARO USANS Reduction Macros": 481 HideShowWindowsInList(USANS_WinList,0) 482 483 // change the facility label, disable the others 484 gMenuStr3a += "(" 485 gMenuStr3b = "Hide HANARO USANS Reduction Macros" 486 487 BuildMenu "Macros" 488 break 489 490 491 // case "Unload NCNR USANS Reduction Macros": 492 // // very dangerous - don't really want to implement this because it will surely crash 493 // Execute/P "DELETEINCLUDE \"USANS_Includes_v230\"" 494 // Execute/P "COMPILEPROCEDURES " 495 // DoWindow USANS_Panel 496 // if(V_Flag) 497 // DoWindow/K USANS_Panel 498 // endif 499 // 500 // gMenuStr3a = "Load NCNR USANS Reduction Macros" 501 // gMenuStr3b = "-" 502 // 503 // BuildMenu "Macros" 504 // 505 // break 259 506 default: 260 507 Abort "Invalid Menu Selection"
Note: See TracChangeset
for help on using the changeset viewer.