Changeset 3779


Ignore:
Timestamp:
Jan 11, 2019 12:58:31 PM (5 years ago)
Author:
vondreele
Message:

fix problems with image sum
fix problem with samplechangerpos

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIdataGUI.py

    r3778 r3779  
    31963196                if self.dataType == 'PWDR':
    31973197                    self.dataGridSizer.Add(self.Avg,0,wx.RIGHT,10)
    3198                 self.dataGridSizer.Add(wx.StaticText(self.panel,-1,' Result name: '+self.dataType),1,
     3198                self.dataGridSizer.Add(wx.StaticText(self.panel,-1,' Result type: '+self.dataType),1,
    31993199                    wx.LEFT|wx.ALIGN_CENTER_VERTICAL,1)
    3200                 self.name = G2G.ValidatedTxtCtrl(self.panel,self.data,-1,size=wx.Size(300,20))
    3201                 self.dataGridSizer.Add(self.name,0,wx.RIGHT|wx.TOP,10)
    32023200            mainSizer.Add(self.dataGridSizer,0,wx.EXPAND)
     3201            self.name = G2G.ValidatedTxtCtrl(self.panel,self.data,-1,size=wx.Size(300,20))
     3202            mainSizer.Add(self.name,0,wx.RIGHT|wx.TOP,10)
    32033203            self.OkBtn = wx.Button(self.panel,-1,"Ok")
    32043204            self.OkBtn.Bind(wx.EVT_BUTTON, self.OnOk)
     
    32433243                self.selectVals = ChoiceVals
    32443244            else:
    3245                 self.selectData = copy.copy(self.data[:-1])
     3245#                self.selectData = copy.copy(self.data[:-1])
    32463246                self.selectVals = len(self.data)*[0.0,]
    32473247            wx.CallAfter(self.Draw)
    32483248           
     3249        def GetData(self):
     3250            if self.dataType == 'PWDR':
     3251                return self.selectData+[self.data[-1],],self.result
     3252            else:
     3253                return self.selectData+[self.data[-1],],self.selectVals
     3254                       
    32493255        def onChar(self,event):
    32503256            'Respond to keyboard events in the Filter box'
     
    32873293                    if lenX:
    32883294                        if lenX != len(x):
    3289                             self.ErrorDialog('Data length error','Data to be summed must have same number of points'+
     3295                            self.GetParent().ErrorDialog('Data length error','Data to be summed must have same number of points'+
    32903296                                '\nExpected:'+str(lenX)+
    32913297                                '\nFound:   '+str(len(x))+'\nfor '+name)
     
    32953301                    if Xminmax[1]:
    32963302                        if Xminmax != [x[0],x[-1]]:
    3297                             self.ErrorDialog('Data range error','Data to be summed must span same range'+
     3303                            self.GetParent().ErrorDialog('Data range error','Data to be summed must span same range'+
    32983304                                '\nExpected:'+str(Xminmax[0])+' '+str(Xminmax[1])+
    32993305                                '\nFound:   '+str(x[0])+' '+str(x[-1])+'\nfor '+name)
     
    33443350            self.EndModal(wx.ID_CANCEL)             
    33453351           
    3346         def GetData(self):
    3347             if self.dataType == 'PWDR':
    3348                 return self.selectData+[self.data[-1],],self.result
    3349             else:
    3350                 return self.selectData+[self.data[-1],],self.selectVals
    3351                        
    33523352    def OnPwdrSum(self,event):
    33533353        'Sum or Average together powder data(?)'
     
    34463446                    First = True
    34473447                    Found = False
    3448                     for i,name in enumerate(result[:-1]):
    3449                         scale = scales[i]
     3448                    for name,scale in zip(result,scales):
    34503449                        if scale:
    34513450                            Found = True                               
    34523451                            Comments.append("%10.3f %s" % (scale,' * '+name))
     3452                            i = TextList.index(name)
    34533453                            Npix,imagefile,imagetag = DataList[i]
    34543454                            imagefile = G2IO.GetCheckImageFile(self,IdList[i])[1]
  • trunk/GSASIIimgGUI.py

    r3767 r3779  
    141141        min=0.,max=1.,typeHint=float),0,WACV)
    142142    mainSizer.Add(distSizer,0)
    143     if 'samplechangerpos' not in data:
     143    if 'samplechangerpos' not in data or data['samplechangerpos'] is None:
    144144        data['samplechangerpos'] = 0.0
    145145    mainSizer.Add(wx.StaticText(G2frame.dataWindow,label='Sample changer position %.2f mm'%data['samplechangerpos']),0,WACV)
Note: See TracChangeset for help on using the changeset viewer.