Changeset 3683
- Timestamp:
- Oct 18, 2018 4:25:25 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIctrlGUI.py
r3651 r3683 2268 2268 if event: event.Skip() 2269 2269 Obj = event.GetEventObject() 2270 id,limits,format = Indx[Obj] 2271 if 'bool' in format: 2272 self.values[id] = Obj.GetValue() 2270 format = Indx[Obj][-1] 2271 if type(format) is list: 2272 id,idl,limits = Indx[Obj][:3] 2273 self.values[id][idl] = Obj.GetValue() 2274 elif 'bool' in format: 2275 self.values[Indx[Obj][0]] = Obj.GetValue() 2273 2276 elif 'str' in format: 2277 id,limits = Indx[Obj][:2] 2274 2278 try: 2275 2279 val = Obj.GetValue() … … 2281 2285 Obj.SetValue('%s'%(val)) 2282 2286 elif 'choice' in format: 2283 self.values[ id] = Obj.GetValue()2287 self.values[Indx[Obj][0]] = Obj.GetValue() 2284 2288 else: 2289 id,limits = Indx[Obj][:2] 2285 2290 try: 2286 2291 val = float(Obj.GetValue()) … … 2299 2304 for id,[prompt,value,limits,format] in enumerate(zip(self.prompts,self.values,self.limits,self.formats)): 2300 2305 lineSizer.Add(wx.StaticText(self.panel,label=prompt),0,wx.ALIGN_CENTER) 2301 if 'bool' in format: 2306 if type(format) is list: #let's assume these are 'choice' for now 2307 valItem = wx.BoxSizer(wx.HORIZONTAL) 2308 for idl,item in enumerate(format): 2309 listItem = wx.ComboBox(self.panel,value=limits[idl][0],choices=limits[idl],style=wx.CB_READONLY|wx.CB_DROPDOWN) 2310 listItem.Bind(wx.EVT_COMBOBOX,OnValItem) 2311 valItem.Add(listItem,0,WACV) 2312 Indx[listItem] = [id,idl,limits,format] 2313 elif 'bool' in format: 2302 2314 valItem = wx.CheckBox(self.panel,label='') 2303 2315 valItem.Bind(wx.EVT_CHECKBOX,OnValItem) -
trunk/GSASIIpwdGUI.py
r3681 r3683 3685 3685 E,SGData = G2spc.SpcGroup(controls[13]) 3686 3686 testAtoms = ['',]+list(set([atom[1] for atom in controls[15]])) 3687 kvec = ['0','0','0',' ',' ',' ',' ',' ',' ',' ']3688 3687 Kx = [' ','0','1/2','-1/2','1/3','-1/3','2/3','1'] 3689 3688 Ky = [' ','0','1/2','1/3','2/3','1'] 3690 3689 Kz = [' ','0','1/2','3/2','1/3','2/3','1'] 3691 dlg = G2G.MultiDataDialog(G2frame,title='k-SUBGROUPSMAG options', 3692 prompts=[' kx1 as fr.',' ky1 as fr.',' kz1 as fr.',' kx2 as fr.',' ky2 as fr.',' kz2 as fr.', \ 3693 ' kx3 as fr.',' ky3 as fr.',' kz3 as fr.', \ 3694 ' Use whole star',' Filter by','preserve axes', \ 3695 'test for mag. atoms','all have moment','max unique'], 3696 values=kvec[:9]+[False,'',True,'',False,100], 3697 limits=[Kx[1:],Ky[1:],Kz[1:],Kx,Ky,Kz,Kx,Ky,Kz,[True,False],['',' Landau transition',' Only maximal subgroups',], 3690 kvec = [['0','0','0'],[' ',' ',' '],[' ',' ',' ',' ']] 3691 dlg = G2G.MultiDataDialog(G2frame,title='k-SUBGROUPSMAG options',prompts=[' k-vector1',' k-vector2',' k-vector3', \ 3692 ' Use whole star',' Filter by','preserve axes','test for mag. atoms','all have moment','max unique'], 3693 values=kvec+[False,'',True,'',False,100], 3694 limits=[[Kx[1:],Ky[1:],Kz[1:]],[Kx,Ky,Kz],[Kx,Ky,Kz],[True,False],['',' Landau transition',' Only maximal subgroups',], 3698 3695 [True,False],testAtoms,[True,False],[1,100]], 3699 formats=[ 'choice','choice','choice','choice','choice','choice','choice','choice','choice','bool','choice',3696 formats=[['choice','choice','choice'],['choice','choice','choice'],['choice','choice','choice'],'bool','choice', 3700 3697 'bool','choice','bool','%d',]) 3701 3698 if dlg.ShowModal() == wx.ID_OK: 3702 3699 magcells = [] 3703 3700 newVals = dlg.GetValues() 3704 kvec[:9] = newVals[ :9]3701 kvec[:9] = newVals[0]+newVals[1]+newVals[2] 3705 3702 nkvec = kvec.index(' ') 3706 star = newVals[ 9]3707 filterby = newVals[ 10]3708 keepaxes = newVals[ 11]3709 atype = newVals[ 12]3710 allmom = newVals[ 13]3711 maxequiv = newVals[ 14]3703 star = newVals[3] 3704 filterby = newVals[4] 3705 keepaxes = newVals[5] 3706 atype = newVals[6] 3707 allmom = newVals[7] 3708 maxequiv = newVals[8] 3712 3709 if 'maximal' in filterby: 3713 3710 maximal = True
Note: See TracChangeset
for help on using the changeset viewer.