Changeset ba1f0b2 in sasview for sansview/perspectives/fitting/fitting.py
- Timestamp:
- Apr 18, 2011 8:22:51 AM (14 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:
- 1a74523
- Parents:
- 4bd492f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitting.py
rf932c02 rba1f0b2 486 486 panel. _on_fit_complete() 487 487 488 def set_smearer(self, uid, smearer, qmin=None, qmax=None, draw=True): 488 def set_smearer(self, uid, smearer, qmin=None, qmax=None, draw=True, 489 enable2D=False): 489 490 """ 490 491 Get a smear object and store it to a fit problem … … 497 498 raise ValueError, msg 498 499 self.page_finder[uid].set_smearer(smearer) 500 self.page_finder[uid].set_enable2D(enable2D) 499 501 if draw: 500 502 ## draw model 1D with smeared data … … 503 505 if model is None: 504 506 return 507 enable1D = True 508 enable2D = self.page_finder[uid].get_enable2D() 509 if enable2D: 510 enable1D = False 511 505 512 ## if user has already selected a model to plot 506 513 ## redraw the model with data smeared 507 514 smear = self.page_finder[uid].get_smearer() 508 515 self.draw_model(model=model, data=data, page_id=uid, smearer=smear, 516 enable1D=enable1D, enable2D=enable2D, 509 517 qmin=qmin, qmax=qmax) 510 518 … … 533 541 if data.__class__.__name__ == "Data1D" or not enable2D: 534 542 ## draw model 1D with no loaded data 535 536 543 self._draw_model1D(model=model, 537 544 data=data, … … 547 554 else: 548 555 ## draw model 2D with no initial data 549 556 self._draw_model2D(model=model, 550 557 page_id=page_id, 551 558 data=data, … … 595 602 page = self.fit_panel.get_page_by_id(page_id) 596 603 templist = page.get_param_list() 604 # missing fit parameters 605 #if not templist: 606 # return 607 # have the list 597 608 for element in templist: 598 609 name = str(element[1]) … … 607 618 current_page_id = page_id 608 619 except: 609 raise610 #msg= "%s error: %s" % (engineType, sys.exc_value)611 #wx.PostEvent(self.parent, StatusEvent(status=msg, info="error",612 #type="stop"))613 #return620 #raise 621 msg= "%s error: %s" % (engineType, sys.exc_value) 622 wx.PostEvent(self.parent, StatusEvent(status=msg, info="error", 623 type="stop")) 624 return 614 625 ## If a thread is already started, stop it 615 626 #if self.calc_fit!= None and self.calc_fit.isrunning(): … … 1083 1094 if model == None: 1084 1095 return 1085 1096 1086 1097 if self.page_finder[uid].get_model() is None: 1087 1098 model.name = "M" + str(self.index_model) … … 1392 1403 if (self.calc_2D is not None) and self.calc_2D.isrunning(): 1393 1404 self.calc_2D.stop() 1394 1395 1405 self.calc_2D = Calc2D(x=x, 1396 1406 y=y,
Note: See TracChangeset
for help on using the changeset viewer.