Changeset 2326 for trunk/GSASIIgrid.py
- Timestamp:
- Jun 15, 2016 9:21:13 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIgrid.py
r2323 r2326 2807 2807 2808 2808 def AddNewAnglePseudoVar(event): 2809 print 'Add bond angle pseudo-variable here - TBD'2810 2809 dlg = G2exG.AngleDialog( 2811 2810 G2frame.dataDisplay,Phases,PSvarDict, … … 2813 2812 VarLabel = "New Angle") 2814 2813 if dlg.ShowModal() == wx.ID_OK: 2815 obj = dlg.GetSelection() 2814 pName,Oatom,Tatoms = dlg.GetSelection() 2815 if Tatoms: 2816 Phase = Phases[pName] 2817 General = Phase['General'] 2818 cx,ct = General['AtomPtrs'][:2] 2819 pId = Phase['pId'] 2820 SGData = General['SGData'] 2821 Atoms = Phase['Atoms'] 2822 aNames = [atom[ct-1] for atom in Atoms] 2823 tIds = [] 2824 symNos = [] 2825 cellNos = [] 2826 oId = aNames.index(Oatom) 2827 Tatoms = Tatoms.split(';') 2828 for Tatom in Tatoms: 2829 sB = Tatom.find('(')+1 2830 symNo = 0 2831 if sB: 2832 sF = Tatom.find(')') 2833 symNo = int(Tatom[sB:sF]) 2834 symNos.append(symNo) 2835 cellNo = [0,0,0] 2836 cB = Tatom.find('[') 2837 if cB>0: 2838 cF = Tatom.find(']')+1 2839 cellNo = eval(Tatom[cB:cF]) 2840 cellNos.append(cellNo) 2841 tIds.append(aNames.index(Tatom.split('+')[0])) 2842 # create an expression object 2843 obj = G2obj.ExpressionObj() 2844 obj.expression = 'Angle(%s,%s,\n%s)'%(Tatoms[0],Oatom,Tatoms[1]) 2845 obj.angle_dict = {'pId':pId,'SGData':SGData,'symNo':symNos,'cellNo':cellNos} 2846 obj.angle_atoms = [oId,tIds] 2816 2847 else: 2817 2848 dlg.Destroy() … … 2819 2850 dlg.Destroy() 2820 2851 if obj: 2821 calcobj = G2obj.ExpressionCalcObj(obj) 2822 Controls['SeqPseudoVars'][calcobj.eObj.expression] = obj 2852 Controls['SeqPseudoVars'][obj.expression] = obj 2823 2853 UpdateSeqResults(G2frame,data,G2frame.dataDisplay.GetSize()) # redisplay variables 2824 2854
Note: See TracChangeset
for help on using the changeset viewer.