Changeset 24ea33c in sasview for sansview/perspectives/fitting/modelpage.py
- Timestamp:
- Jan 10, 2009 12:08:54 PM (16 years ago)
- 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:
- 20be946
- Parents:
- 4b91fd1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/modelpage.py
r86c1832 r24ea33c 80 80 self.sizer4.Add(wx.StaticText(self, -1, 'x range'),(iy, ix),(1,1),\ 81 81 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 82 83 qmin= 0.001 84 qmax= 1.0 82 ## Q range 83 self.qmin= 0.001 84 self.qmax= 0.1 85 85 86 ix += 1 86 87 self.xmin = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20)) 87 self.xmin.SetValue(format_number( qmin))88 self.xmin.SetValue(format_number(self.qmin)) 88 89 self.xmin.SetToolTipString("Minimun value of x in linear scale.") 89 90 self.xmin.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) … … 94 95 ix += 2 95 96 self.xmax = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20)) 96 self.xmax.SetValue(format_number( qmax))97 self.xmax.SetValue(format_number(self.qmax)) 97 98 self.xmax.SetToolTipString("Maximum value of x in linear scale.") 98 99 self.xmax.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter) … … 174 175 call manager to plot model in 2D 175 176 """ 176 self.enable2D=True 177 print "modelpage name", self.prevmodel_name 178 self.manager.draw_model(model=self.model,name=self.prevmodel_name, 177 # If the 2D display is not currently enabled, plot the model in 2D 178 # and set the enable2D flag. 179 if self.enable2D==False: 180 self.enable2D=True 181 self.manager.draw_model(model=self.model,name=self.prevmodel_name, 179 182 description=None, 180 183 enable2D=self.enable2D, 181 qmin=float(self.xmin.GetValue()), 182 qmax=float(self.xmax.GetValue())) 184 qmin=float(self.qmin), 185 qmax=float(self.qmax)) 186 183 187 def populate_box(self, dict): 184 188 """ … … 358 362 def set_model_parameter(self): 359 363 if len(self.parameters) !=0 and self.model !=None: 364 # Flag to register when a parameter has changed. 365 is_modified = False 360 366 for item in self.parameters: 361 367 try: 362 368 name=str(item[0].GetLabelText()) 363 369 value= float(item[1].GetValue()) 364 self.model.setParam(name,value) 370 # If the value of the parameter has changed, 371 # update the model and set the is_modified flag 372 if value != self.model.getParam(name): 373 self.model.setParam(name,value) 374 is_modified = True 365 375 except: 366 376 wx.PostEvent(self.parent.GrandParent, StatusEvent(status=\ 367 377 "Model Drawing Error:wrong value entered : %s"% sys.exc_value)) 368 378 369 print self.enable2D 370 self.manager.draw_model(self.model,qmin=float(self.xmin.GetValue()), 371 qmax=float(self.xmax.GetValue()), 372 enable2D=self.enable2D) 379 # Here we should check whether the boundaries have been modified. 380 # If qmin and qmax have been modified, update qmin and qmax and 381 # set the is_modified flag to True 382 if float(self.xmin.GetValue()) != self.qmin: 383 self.qmin = float(self.xmin.GetValue()) 384 is_modified = True 385 if float(self.xmax.GetValue()) != self.qmax: 386 self.qmax = float(self.xmax.GetValue()) 387 is_modified = True 388 389 if is_modified: 390 self.manager.draw_model(self.model, self.model.name, 391 qmin=self.qmin, qmax=self.qmax, 392 enable2D=self.enable2D) 373 393 #self.manager.draw_model(self,model,description=None, 374 394 # enable1D=True,qmin=None,qmax=None, qstep=None)
Note: See TracChangeset
for help on using the changeset viewer.