Changeset 1719
- Timestamp:
- Mar 16, 2015 4:20:06 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r1715 r1719 368 368 if not reader.strictExtension: 369 369 choices += "|any file (*.*)|*.*" 370 # get the file(s) 370 # get the file(s) (probably should remove wx.CHANGE_DIR here) 371 371 if multiple: 372 372 mode = style=wx.OPEN | wx.CHANGE_DIR | wx.MULTIPLE 373 373 else: 374 374 mode = style=wx.OPEN | wx.CHANGE_DIR 375 dlg = wx.FileDialog(self, message="Choose "+label+" input file", 376 defaultFile="",wildcard=choices, style=mode) 377 if self.Tutorials: 378 dlg.SetDirectory(os.path.join(GSASIIpath.path2GSAS2,'Exercises')) 379 self.Tutorials = False 380 try: 381 if dlg.ShowModal() == wx.ID_OK: 382 if multiple: 383 filelist = dlg.GetPaths() 384 if len(filelist) == 0: return [] 385 else: 386 filename = dlg.GetPath() 387 filelist = [filename,] 388 os.chdir(dlg.GetDirectory()) # to get Mac/Linux to change directory! 389 else: # cancel was pressed 390 return [] 391 finally: 392 dlg.Destroy() 375 filelist = self.GetImportFile(message="Choose "+label+" input file", 376 defaultFile="",wildcard=choices, style=mode) 393 377 rd_list = [] 394 378 filelist1 = [] … … 539 523 self.Bind(wx.EVT_MENU, self.OnImportPhase, id=item.GetId()) 540 524 525 def GetImportFile(self, message, defaultDir="", defaultFile="", style=wx.OPEN, 526 *args, **kwargs): 527 '''Defines a customized dialog that gets gets files from the appropriate 528 Import directory (unless overridden with defaultDir). The default 529 import directory is found in self.ImportDir, which will be set to 530 the location of the (first) file entered in this dialog. 531 532 :returns: a list of files or an empty list 533 ''' 534 dlg = wx.FileDialog(self, message, defaultDir, defaultFile, *args, 535 style=style, **kwargs) 536 if not defaultDir and self.ImportDir: 537 dlg.SetDirectory(self.ImportDir) 538 try: 539 if dlg.ShowModal() == wx.ID_OK: 540 if style & wx.MULTIPLE: 541 filelist = dlg.GetPaths() 542 if len(filelist) == 0: return [] 543 else: 544 filelist = [dlg.GetPath(),] 545 # not sure if we want to do this (why use wx.CHANGE_DIR?) 546 if style & wx.CHANGE_DIR: # to get Mac/Linux to change directory like windows! 547 os.chdir(dlg.GetDirectory()) 548 if not defaultDir and self.ImportDir: # if we are using a default and 549 # user moved, save the new location 550 self.ImportDir = os.path.split(filelist[0])[0] 551 #print 'default moved to',self.ImportDir 552 else: # cancel was pressed 553 return [] 554 finally: 555 dlg.Destroy() 556 return filelist 557 541 558 def OnImportPhase(self,event): 542 559 '''Called in response to an Import/Phase/... menu item … … 2134 2151 self.StrainKey = '' #ditto for new strain d-zeros 2135 2152 self.EnablePlot = True 2136 self.Tutorials = False #used for changing default directory 2153 if GSASIIpath.GetConfigValue('Starting_directory'): 2154 try: 2155 os.chdir(GSASIIpath.GetConfigValue('Starting_directory')) 2156 except: 2157 print('Ignoring Config Starting_directory value: '+ 2158 GSASIIpath.GetConfigValue('Starting_directory')) 2137 2159 arg = sys.argv 2138 2160 if len(arg) > 1 and arg[1]: … … 2147 2169 except: 2148 2170 print 'Error opening file',arg[1] 2171 2172 self.ImportDir = os.path.normpath(os.getcwd()) # specifies a default path to be used for imports 2173 if GSASIIpath.GetConfigValue('Import_directory'): 2174 self.ImportDir = GSASIIpath.GetConfigValue('Import_directory') 2149 2175 2150 2176 def OnSize(self,event): -
trunk/GSASIIctrls.py
r1709 r1719 1486 1486 print 'id=',event.GetId() 1487 1487 elif helpType == 'OldTutorials': # this will go away 1488 self.frame.Tutorials = True1488 #self.frame.Tutorials = True 1489 1489 ShowHelp(helpType,self.frame) 1490 1490 elif helpType == 'Tutorials': 1491 1491 dlg = OpenTutorial(self.frame) 1492 if dlg.ShowModal() == wx.ID_OK: 1493 self.frame.Tutorials = True 1492 dlg.ShowModal() 1493 #if dlg.ShowModal() == wx.ID_OK: 1494 #self.frame.Tutorials = True 1494 1495 dlg.Destroy() 1495 1496 return … … 2151 2152 URL = os.path.join(tutorialPath,'help',tutdir,htmlname) 2152 2153 ShowWebPage(URL,self.frame) 2154 self.frame.ImportDir = os.path.join(tutorialPath,'Exercises',exedir) 2153 2155 elif self.BrowseMode == 1: 2154 2156 # xfer data locally, open web page remotely … … 2156 2158 URL = os.path.join(G2BaseURL,'Tutorials',tutdir,htmlname) 2157 2159 ShowWebPage(URL,self.frame) 2160 self.frame.ImportDir = os.path.join(tutorialPath,'Exercises',exedir) 2158 2161 elif self.BrowseMode == 2: 2159 2162 # open web page remotely, don't worry about data 2160 2163 URL = os.path.join(G2BaseURL,'Tutorials',tutdir,htmlname) 2161 2164 ShowWebPage(URL,self.frame) 2165 self.frame.ImportDir = os.path.join(tutorialPath,'Exercises',exedir) 2162 2166 elif self.BrowseMode == 3: 2163 2167 # open web page that has already been transferred -
trunk/config_example.py
r1709 r1719 28 28 ''' 29 29 30 Enable_logging = None30 Enable_logging = False 31 31 'Set to True to enable use of command logging' 32 32 33 logging_debug = None33 logging_debug = False 34 34 'Set to True to enable debug for logging' 35 35 … … 47 47 This will allow users to download tutorial files into their own file space. 48 48 ''' 49 50 Starting_directory=None 51 '''Specifies a default location for starting GSAS-II 52 ''' 53 54 Import_directory=None 55 '''Specifies a default location for starting GSAS-II 56 ''' -
trunk/help/gsasII.html
r1709 r1719 2387 2387 links below, but to actually perform the tutorial exercises, the 2388 2388 sample data needs to be downloaded, which can be done most easily 2389 using the Help/Tutorials menu command. When that is used, data files 2390 (and optionally the web pages for off-line use) can be downloaded. 2389 using the 2390 <b style='mso-bidi-font-weight:normal'><span style='font-family:"Calibri","sans-serif"; 2391 mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family: 2392 Calibri;mso-bidi-theme-font:minor-latin'>Help/Download tutorial 2393 </span></b> 2394 menu entry. When 2395 this menu entry is used from inside GSAS-II (unless browse on web -- 2396 data not loaded is selected), data files (and optionally the web pages 2397 for off-line use) are downloaded. 2391 2398 2392 2399 <p><i>Getting started</i><UL> 2393 2400 <LI><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/StartingGSASII/Starting GSAS.htm"><span style='font-weight:normal'>Starting GSAS-II 2394 2401 </span></a></strong> 2395 (no files) 2396 </LI> 2402 (no exercise files)</LI> 2397 2403 2398 2404 <li><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/FitPeaks/Fit Peaks.htm"> 2399 2405 <span style='font-weight:normal'>Fitting individual peaks & autoindexing 2400 2406 </span></a></strong> 2401 ( <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/FitPeaks/">files</a>)</li>2407 (Link to <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/FitPeaks/">exercise files</a>)</li> 2402 2408 2403 2409 </ul><p><i>Rietveld fitting</i><ul> … … 2407 2413 <span style='font-weight:normal'>CW Neutron Powder fit for Yttrium-Iron Garnet 2408 2414 </span></a></strong> 2409 ( <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/CWNeutron">files</a>)</li>2415 (Link to <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/CWNeutron">exercise files</a>)</li> 2410 2416 2411 2417 <li><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/LabData/Laboratory X.htm"> 2412 2418 <span style='font-weight:normal'>Fitting laboratory X-ray powder data for fluoroapatite 2413 2419 </span></a></strong> 2414 ( <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/LabData">files</a>)</li>2420 (Link to <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/LabData">exercise files</a>)</li> 2415 2421 2416 2422 <li><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/CWCombined/Combined refinement.htm"> 2417 2423 <span style='font-weight:normal'>Combined X-ray/CW-neutron refinement of PbSO4 2418 2424 </span></a></strong> 2419 ( <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/CWCombined">files</a>)</li>2425 (Link to <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/CWCombined">exercise files</a>)</li> 2420 2426 2421 2427 <li><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/TOF-CW Joint Refinement/TOF combined XN Rietveld refinement in GSAS.htm"> 2422 2428 <span style='font-weight:normal'>Combined X-ray/TOF-neutron Rietveld refinement 2423 2429 </span></a></strong> 2424 ( <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/TOF-CW Joint Refinement">files</a>)</li>2430 (Link to <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/TOF-CW Joint Refinement">exercise files</a>)</li> 2425 2431 2426 2432 <li><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SeqRefine/SequentialTutorial.htm"> 2427 2433 <span style='font-weight:normal'>Sequential refinement of multiple datasets 2428 2434 </span></a></strong> 2429 ( <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/SeqRefine">files</a>)</li>2435 (Link to <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/SeqRefine">exercise files</a>)</li> 2430 2436 2431 2437 <li><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SeqParametric/ParametricFitting.htm"> 2432 2438 <span style='font-weight:normal'>Parametric Fitting and Pseudo Variables for Sequential Fits 2433 </span></a></strong> 2434 ( <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/SeqParametric">files</a>)</li>2439 </span></a></strong> 2440 (no exercise files)</LI> 2435 2441 2436 2442 </ul><p><i>Structure solution</i><ul> … … 2439 2445 <span style='font-weight:normal'>Charge Flipping structure solution for jadarite 2440 2446 </span></a></strong> 2441 ( <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/CFjadarite">files</a>)</li>2447 (no exercise files)</LI> 2442 2448 2443 2449 <li><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/CFsucrose/Charge Flipping - sucrose.htm"> 2444 2450 <span style='font-weight:normal'>Charge Flipping structure solution for sucrose 2445 2451 </span></a></strong> 2446 ( <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/CFsucrose">files</a>)</li>2452 (no exercise files)</LI> 2447 2453 2448 2454 <li><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/TOF Charge Flipping/Charge Flipping with TOF single crystal data in GSASII.htm"> 2449 2455 <span style='font-weight:normal'>Charge flipping with neutron TOF single crystal data 2450 2456 </span></a></strong> 2451 ( <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/TOF Charge Flipping">files</a>)</li>2457 (Link to <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/TOF Charge Flipping">exercise files</a>)</li> 2452 2458 2453 2459 <li><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/MCsimanneal/MCSA in GSAS.htm"> 2454 2460 <span style='font-weight:normal'>Monte-Carlo simulated annealing structure 2455 2461 </span></a></strong> 2456 ( <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/MCsimanneal">files</a>)</li>2462 (Link to <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/MCsimanneal">exercise files</a>)</li> 2457 2463 2458 2464 </ul><p><i>Calibration/Image Processing</i><ul> … … 2461 2467 <span style='font-weight:normal'>Calibration of an area detector 2462 2468 </span></a></strong> 2463 ( <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/2DCalibration">files</a>)</li>2469 (Link to <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/2DCalibration">exercise files</a>)</li> 2464 2470 2465 2471 <li><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/2DIntegration/Integration of area detector data in GSAS.htm"> 2466 2472 <span style='font-weight:normal'>Integration of area detector data 2467 2473 </span></a></strong> 2468 ( <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/2DIntegration">files</a>)</li>2474 (no exercise files)</LI> 2469 2475 2470 2476 <li><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/TOF Calibration/Calibration of a TOF powder diffractometer.htm"> 2471 2477 <span style='font-weight:normal'>Calibration of a Neutron TOF diffractometer 2472 2478 </span></a></strong> 2473 ( <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/TOF Calibration">files</a>)</li>2479 (Link to <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/TOF Calibration">exercise files</a>)</li> 2474 2480 2481 </ul><p><i>Small-Angle scattering</i><ul> 2482 2483 <li><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SAimages/Small Angle Image Processing.htm"> 2484 <span style='font-weight:normal'>Image Processing of small angle x-ray data 2485 </span></a></strong> 2486 (Link to <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/SAimages">exercise files</a>)</li> 2487 2488 <li><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SAfit/Fitting Small Angle Scattering Data.htm"> 2489 <span style='font-weight:normal'>Fitting small angle x-ray data (alumina powder) 2490 </span></a></strong> 2491 (Link to <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/SAfit">exercise files</a>)</li> 2492 2493 <li><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SAsize/Small Angle Size Distribution.htm"> 2494 <span style='font-weight:normal'>Small angle x-ray data size distribution (alumina powder) 2495 </span></a></strong> 2496 (Link to <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/SAsize">exercise files</a>)</li> 2497 2498 <li><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SAseqref/Sequential Refinement of Small Angle Scattering Data.htm"> 2499 <span style='font-weight:normal'>Sequential refinement with small angle scattering data 2500 </span></a></strong> 2501 (Link to <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/SAseqref">exercise files</a>)</li> 2502 </UL> 2503 2475 2504 </ul><p><i>Other</i><ul> 2476 2505 … … 2478 2507 <span style='font-weight:normal'>Strain fitting of 2D data 2479 2508 </span></a></strong> 2480 (<a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/2DStrain">files</a>)</li> 2481 2482 </ul><p><i>Small-Angle scattering</i><ul> 2483 2484 <li><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SAimages/Small Angle Image Processing.htm"> 2485 <span style='font-weight:normal'>Image Processing of small angle x-ray data 2486 </span></a></strong> 2487 (<a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/SAimages">files</a>)</li> 2488 2489 <li><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SAfit/Fitting Small Angle Scattering Data.htm"> 2490 <span style='font-weight:normal'>Fitting small angle x-ray data (alumina powder) 2491 </span></a></strong> 2492 (<a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/SAfit">files</a>)</li> 2493 2494 <li><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SAsize/Small Angle Size Distribution.htm"> 2495 <span style='font-weight:normal'>Small angle x-ray data size distribution (alumina powder) 2496 </span></a></strong> 2497 (<a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/SAsize">files</a>)</li> 2498 2499 <li><strong><a href="https://subversion.xray.aps.anl.gov/pyGSAS/Tutorials/SAseqref/Sequential Refinement of Small Angle Scattering Data.htm"> 2500 <span style='font-weight:normal'>Sequential refinement with small angle scattering data 2501 </span></a></strong> 2502 (<a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/SAseqref">files</a>)</li> 2503 </UL> 2509 (Link to <a href="https://subversion.xray.aps.anl.gov/pyGSAS/Exercises/2DStrain">exercise files</a>)</li> 2504 2510 2505 2511 <p class=MsoNormal><strong><o:p> </o:p></strong></p> … … 6431 6437 style='mso-bookmark:Pawley'><o:p> </o:p></span></p> 6432 6438 6433 <p class=MsoNormal><span style='mso-bookmark:Pawley'><!-- hhmts start -->Last modified: Sat Mar 14 17:30:03 CDT 2015 <!-- hhmts end -->6439 <p class=MsoNormal><span style='mso-bookmark:Pawley'><!-- hhmts start -->Last modified: Mon Mar 16 14:54:53 CDT 2015 <!-- hhmts end --> 6434 6440 </body> 6435 6441
Note: See TracChangeset
for help on using the changeset viewer.