Ignore:
Timestamp:
Jan 13, 2009 8:12:56 AM (15 years ago)
Author:
Gervaise Alina <gervyh@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
b783024
Parents:
92c2345
Message:

reverse set_model_paramater_ to the version on Mathieu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/modelpage.py

    rdb709e4 ra5aaec9  
    366366            # Flag to register when a parameter has changed. 
    367367            is_modified = False 
     368            for item in self.parameters: 
     369                try: 
     370                     name=str(item[0].GetLabelText()) 
     371                     value= float(item[1].GetValue()) 
     372                     # If the value of the parameter has changed, 
     373                     # update the model and set the is_modified flag 
     374                     if value != self.model.getParam(name): 
     375                         self.model.setParam(name,value) 
     376                         is_modified = True 
     377                except: 
     378                     wx.PostEvent(self.parent.GrandParent, StatusEvent(status=\ 
     379                            "Model Drawing  Error:wrong value entered : %s"% sys.exc_value)) 
     380             
     381            # Here we should check whether the boundaries have been modified. 
     382            # If qmin and qmax have been modified, update qmin and qmax and  
     383            # set the is_modified flag to True 
    368384            if float(self.xmin.GetValue()) != self.qmin: 
    369385                self.qmin = float(self.xmin.GetValue()) 
     
    372388                self.qmax = float(self.xmax.GetValue()) 
    373389                is_modified = True 
    374             for item in self.parameters: 
    375                 try:  
    376                      
    377                     if item[1].IsModified() or is_modified: 
    378                         print str(item[0].GetLabelText()),item[1].IsModified() 
    379                         item[1].SetModified(False) 
    380                         name=str(item[0].GetLabelText()) 
    381                         value= float(item[1].GetValue()) 
    382                         self.model.setParam(name,value) 
    383  
    384                         is_modified=False 
    385                         print "self.enable2d",self.enable2D 
    386                         self.manager.draw_model(self.model, self.model.name,  
     390             
     391            if is_modified: 
     392                self.manager.draw_model(self.model, self.model.name,  
    387393                                        qmin=self.qmin, qmax=self.qmax, 
    388394                                        enable2D=self.enable2D) 
    389                  
    390                      
    391                 except: 
    392                      wx.PostEvent(self.parent.GrandParent, StatusEvent(status=\ 
    393                             "Model Drawing  Error:wrong value entered : %s"% sys.exc_value)) 
    394              
    395             # Here we should check whether the boundaries have been modified. 
    396             # If qmin and qmax have been modified, update qmin and qmax and  
    397             # set the is_modified flag to True 
    398            
     395            #self.manager.draw_model(self,model,description=None, 
    399396            # enable1D=True,qmin=None,qmax=None, qstep=None) 
    400397             
    401             self.model_view.SetFocus() 
    402              
    403              
    404              
     398             
     399             
     400             
     401               
Note: See TracChangeset for help on using the changeset viewer.