- Timestamp:
- Oct 21, 2020 9:08:35 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/GSASIIconstrGUI.py ¶
r4609 r4615 260 260 'Convert atom to format needed to draw it' 261 261 generalData = data['General'] 262 deftype = G2obj.validateAtomDrawType( 263 GSASIIpath.GetConfigValue('DrawAtoms_default'),generalData) 262 264 if generalData['Type'] in ['nuclear','faulted',]: 263 atomInfo = [atom[:2]+atom[3:6]+['1' ,]+['vdW balls',]+264 ['' ,]+[[255,255,255],]+atom[9:]+[[],[]]][0]265 atomInfo = [atom[:2]+atom[3:6]+['1']+[deftype]+ 266 ['']+[[255,255,255]]+atom[9:]+[[],[]]][0] 265 267 ct,cs = [1,8] #type & color 266 268 atNum = generalData['AtomTypes'].index(atom[ct]) -
TabularUnified trunk/GSASIIctrlGUI.py ¶
r4604 r4615 5189 5189 self.helpIndex = helpIndex 5190 5190 self.wrap = wrap 5191 self.msg = self.msg.replace(' & ',' && ') 5191 5192 def _onClose(self,event): 5192 5193 self.dlg.EndModal(wx.ID_CANCEL) … … 5652 5653 self.sizer.Add(label, 0, wx.ALIGN_CENTRE|wx.ALL, 5) 5653 5654 self.choice = {} 5654 btn = G2ChoiceButton(self, sorted(self.vars.keys(),key=lambda s: s.lower()), 5655 choices = sorted([k for k in self.vars if not k.startswith('enum_')], 5656 key=lambda s: s.lower()) 5657 btn = G2ChoiceButton(self, choices, 5655 5658 strLoc=self.choice,strKey=0,onChoice=self.OnSelection) 5656 5659 btn.SetLabel("") … … 5755 5758 if var not in self.vars: 5756 5759 raise Exception("How did this happen?") 5757 if type(self.vars[var][0]) is int: 5760 if 'enum_'+var in self.vars: 5761 choices = self.vars['enum_'+var][0] 5762 self.colSel = EnumSelector(self,self.vars[var],1,choices, 5763 OnChange=self.OnChange) 5764 self.varsizer.Add(self.colSel, 0, wx.ALIGN_CENTRE|wx.ALL, 5) 5765 elif type(self.vars[var][0]) is int: 5758 5766 ed = ValidatedTxtCtrl(self,self.vars[var],1,typeHint=int,OKcontrol=self.OnChange) 5759 5767 self.varsizer.Add(ed, 0, wx.ALIGN_CENTRE|wx.ALL, 5) … … 5829 5837 self.varsizer.Add(self.resetBtn, 0, wx.ALIGN_CENTRE|wx.ALL, 5) 5830 5838 # show meaning, if defined 5831 self.doclbl.SetLabel("Description of "+str(var)) 5832 if self.vars[var][3]: 5833 self.docinfo.SetLabel(self.vars[var][3]) 5839 self.doclbl.SetLabel("Description of "+str(var)) 5840 vartxt = self.vars[var][3] 5841 vartxt = StripIndents(vartxt.replace(' & ',' && '),True) 5842 if vartxt: 5843 self.docinfo.SetLabel(vartxt) 5834 5844 else: 5835 5845 self.docinfo.SetLabel("(not documented)") 5846 self.docinfo.Wrap(500) 5836 5847 self.sizer.Fit(self) 5837 5848 self.CenterOnParent() -
TabularUnified trunk/GSASIIobj.py ¶
r4590 r4615 3270 3270 #%% 3271 3271 3272 def validateAtomDrawType(typ,generalData={}): 3273 '''Confirm that the selected Atom drawing type is valid for the current 3274 phase. If not, use 'vdW balls'. This is currently used only for setting a 3275 default when atoms are added to the atoms draw list. 3276 ''' 3277 if typ in ('lines','vdW balls','sticks','balls & sticks','ellipsoids'): 3278 return typ 3279 elif generalData.get('Type','') == 'macromolecular': 3280 if typ in ('backbone','ribbons','schematic'): 3281 return typ 3282 elif typ == 'polyhedra': 3283 return 'polyhedra' 3284 return 'vdW balls' 3285 3272 3286 if __name__ == "__main__": 3273 3287 # test variable descriptions -
TabularUnified trunk/GSASIIphsGUI.py ¶
r4614 r4615 1119 1119 Amat,Bmat = G2lat.cell2AB(generalData['Cell'][1:7]) 1120 1120 SGData = generalData['SGData'] 1121 deftype = G2obj.validateAtomDrawType( 1122 GSASIIpath.GetConfigValue('DrawAtoms_default'),generalData) 1121 1123 if generalData['Type'] in ['nuclear','faulted',]: 1122 1124 if oldatom: … … 1129 1131 atomInfo = [atom[:2]+list(X)+oldatom[5:9]+atom[9:]+oldatom[17:]][0] 1130 1132 else: 1131 atomInfo = [atom[:2]+atom[3:6]+['1',]+[ 'vdW balls',]+1133 atomInfo = [atom[:2]+atom[3:6]+['1',]+[deftype]+ 1132 1134 ['',]+[[255,255,255],]+atom[9:]+[[],[]]][0] 1133 1135 ct,cs = [1,8] #type & color … … 1148 1150 atomInfo = [atom[:2]+list(X)+list(Mom)+oldatom[8:12]+atom[12:]+oldatom[20:]][0] 1149 1151 else: 1150 atomInfo = [atom[:2]+atom[3:6]+atom[7:10]+['1',]+[ 'vdW balls',]+1152 atomInfo = [atom[:2]+atom[3:6]+atom[7:10]+['1',]+[deftype]+ 1151 1153 ['',]+[[255,255,255],]+atom[12:]+[[],[]]][0] 1152 1154 ct,cs = [1,11] #type & color … … 1158 1160 atomInfo = [[atom[1].strip()+atom[0],]+ 1159 1161 [AA1letter[oneLetter]+atom[0],]+atom[2:5]+ 1160 atom[6:9]+['1',]+[ 'vdW balls',]+['',]+[[255,255,255],]+atom[12:]+[[],[]]][0]1162 atom[6:9]+['1',]+[deftype]+['',]+[[255,255,255],]+atom[12:]+[[],[]]][0] 1161 1163 ct,cs = [4,11] #type & color 1162 1164 atNum = generalData['AtomTypes'].index(atom[ct]) -
TabularUnified trunk/config_example.py ¶
r4345 r4615 223 223 newly-read images, but if changed the new value will be saved. 224 224 ''' 225 226 enum_DrawAtoms_default = ['','lines','vdW balls','sticks','balls & sticks', 227 'ellipsoids','polyhedra','backbone','ribbons','schematic'] 228 'choices for DrawAtoms_default' 229 DrawAtoms_default = '' 230 '''Allows selection of the default plotting mode for structures 231 in Draw Atoms. The only valid values are: 232 'lines', 'vdW balls', 'sticks', 'balls & sticks', 'ellipsoids', 'polyhedra', 233 'backbone', 'ribbons', 'schematic', where 'polyhedra' is invalid for 234 macromolecular phases and 'backbone', 'ribbons' & 'schematic' is invalid for 235 non-macromolecular phases. %% If a non-valid choice is used (the default) 236 'vdW balls' is used. 237 ''' 238
Note: See TracChangeset
for help on using the changeset viewer.