Changeset 4887
- Timestamp:
- Apr 19, 2021 9:50:52 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIElem.py
r4659 r4887 216 216 if El not in atmdata.XrayFF and El not in atmdata.MagFF: 217 217 if ElS not in atmdata.XrayFF: 218 print('Atom type '+El+' not found, using H') 219 ElS = 'H' 220 # return # not sure what this element should be! 218 if ElS.endswith('0') and ElS[:-1] in atmdata.XrayFF: 219 ElS = ElS[:-1] 220 else: 221 ElS = 'H' 221 222 print('Atom type '+El+' not found, using '+ElS) 222 223 El = ElS -
trunk/GSASIIctrlGUI.py
r4884 r4887 5877 5877 self.OnChange() 5878 5878 dlg.Destroy() 5879 5880 def onSelExec(self,event): 5881 'Select an executable file from a menu' 5882 var = self.choice[0] 5883 is_exe = lambda fpath: os.path.isfile(fpath) and os.access(fpath, os.X_OK) 5884 defD = defF = '' 5885 if self.vars[var][1] is not None and os.path.exists(self.vars[var][1]): 5886 defD,defF=os.path.split(self.vars[var][1]) 5887 repeat = True 5888 while repeat: 5889 repeat = False 5890 if sys.platform == "win32": 5891 dlg = wx.FileDialog(self, "Choose a .exe file:", 5892 defaultDir=defD,defaultFile=defF, 5893 style=wx.FD_DEFAULT_STYLE|wx.FD_FILE_MUST_EXIST, 5894 wildcard="Executable files|*.exe") 5895 else: 5896 dlg = wx.FileDialog(self, "Choose an executable image:", 5897 defaultDir=defD,defaultFile=defF, 5898 style=wx.FD_DEFAULT_STYLE|wx.FD_FILE_MUST_EXIST) 5899 if dlg.ShowModal() == wx.ID_OK: 5900 val = dlg.GetPath() 5901 if os.path.exists(val) and is_exe(val): 5902 self.vars[var][1] = val 5903 self.strEd.SetValue(self.vars[var][1]) 5904 self.OnChange() 5905 else: 5906 dlg.Destroy() 5907 G2MessageBox(self,'File not found or not executable', 5908 'Invalid file') 5909 repeat = True 5910 continue 5911 dlg.Destroy() 5912 5879 5913 5880 5914 def OnSelection(self): 5881 'show a selected variable '5915 'show a selected variable and allow it to be changed' 5882 5916 def OnNewColorBar(event): 5883 5917 self.vars['Contour_color'][1] = self.colSel.GetValue() … … 5927 5961 if var.endswith('_directory') or var.endswith('_location'): 5928 5962 btn = wx.Button(self,wx.ID_ANY,'Select from dialog...') 5963 btn.Bind(wx.EVT_BUTTON,self.onSelDir) 5964 sz = (400,-1) 5965 elif var.endswith('_exec'): 5966 btn = wx.Button(self,wx.ID_ANY,'Select from dialog...') 5967 btn.Bind(wx.EVT_BUTTON,self.onSelExec) 5929 5968 sz = (400,-1) 5930 5969 else: … … 5951 5990 if self.vars[var][1] is not None: 5952 5991 self.strEd.SetValue(self.vars[var][1]) 5953 self.varsizer.Add(self.strEd, 0, wx.ALIGN_CENTRE|wx.ALL, 5) 5954 if btn: 5955 btn.Bind(wx.EVT_BUTTON,self.onSelDir) 5956 self.varsizer.Add(btn, 0, wx.ALIGN_CENTRE|wx.ALL, 5) 5992 if btn: 5993 self.varsizer.Add(self.strEd, 0, wx.ALL|wx.EXPAND, 5) 5994 self.varsizer.Add(btn, 0, wx.ALIGN_CENTRE|wx.ALL, 5) 5995 else: 5996 self.varsizer.Add(self.strEd, 0, wx.ALIGN_CENTRE|wx.ALL, 5) 5957 5997 # button for reset to default value 5958 5998 lbl = "Reset to Default" … … 7248 7288 # Deal with Origin 1/2 ambiguities ################################################################################ 7249 7289 def ChooseOrigin(G2frame,rd): 7290 G2elem.SetupGeneral(rd.Phase,G2frame.dirname) 7250 7291 # make copy of Phase but shift atoms Origin 1->2 7251 7292 O2Phase = copy.deepcopy(rd.Phase) … … 7285 7326 if i: txt += ', ' 7286 7327 txt += '{}*{}'.format(cellContents[k],k) 7287 G2elem.SetupGeneral(phObj,G2frame.dirname)7288 7328 den,_ = G2mth.getDensity(phObj['General']) 7289 7329 txt += "\n Density {:.2f} g/cc\n".format(den) -
trunk/GSASIIpath.py
r4741 r4887 1012 1012 1013 1013 BinaryPathLoaded = False 1014 binaryPath = '' 1014 1015 def SetBinaryPath(printInfo=False, loadBinary=True): 1015 1016 ''' … … 1020 1021 ''' 1021 1022 # do this only once no matter how many times it is called 1022 global BinaryPathLoaded 1023 global BinaryPathLoaded,binaryPath 1023 1024 if BinaryPathLoaded: return 1024 1025 try: … … 1057 1058 if binpath: # were GSAS-II binaries found 1058 1059 sys.path.insert(0,binpath) 1060 binaryPath = binpath 1059 1061 if printInfo: 1060 1062 print('GSAS-II binary directory: {}'.format(binpath)) … … 1074 1076 print('GSAS-II binary directory: {}'.format(binpath)) 1075 1077 sys.path.insert(0,binpath) 1078 binaryPath = binpath 1076 1079 BinaryPathLoaded = True 1077 1080 # this must be imported before anything that imports any .pyd/.so file for GSASII … … 1107 1110 if TestSPG(fpth): 1108 1111 sys.path.insert(0,binpath) 1112 binaryPath = binpath 1109 1113 if printInfo: 1110 1114 print('\n'+75*'*')
Note: See TracChangeset
for help on using the changeset viewer.