Changeset bf7ad65 in sasview
- Timestamp:
- Apr 13, 2012 11:48:09 AM (13 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:
- a5e749f
- Parents:
- 5625551
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansguiframe/src/sans/guiframe/local_perspectives/plotting/masking.py
r046af80 rbf7ad65 1 1 """ 2 Mask editor 3 """ 2 4 ################################################################################ 3 5 #This software was developed by the University of Tennessee as part of the … … 28 30 from sans.guiframe.dataFitting import Data1D, Data2D 29 31 from boxMask import BoxMask 30 from sectorMask import SectorMask31 32 from sans.guiframe.events import SlicerEvent 32 33 from sans.guiframe.events import StatusEvent … … 64 65 """ 65 66 """ 66 CalcThread.__init__(self, completefn,67 CalcThread.__init__(self, completefn, 67 68 updatefn, 68 69 yieldtime, … … 278 279 self.slicer_mask = self.slicer.update() 279 280 280 def onOuterSectorMask(self, event=None):281 def onOuterSectorMask(self, event=None): 281 282 """ 282 283 Call Draw Sector Slicer and get mask outside of the sector … … 319 320 self.onClearSlicer(event) 320 321 self.slicer_z += 1 321 self.slicer = CircularMask(self, self.subplot,322 self.slicer = CircularMask(self, self.subplot, 322 323 zorder=self.slicer_z, side=False) 323 324 self.subplot.set_ylim(self.data.ymin, self.data.ymax) … … 350 351 Erase new mask from old mask 351 352 """ 352 if not self.slicer ==None:353 if not self.slicer == None: 353 354 self.slicer_mask = self.slicer.update() 354 355 mask = self.data.mask 355 mask[self.slicer_mask ==False] = True356 mask[self.slicer_mask == False] = True 356 357 self._check_display_mask(mask, event) 357 358 … … 394 395 self.slicer = None 395 396 396 def _setSlicer(self):397 """398 Clear the previous slicer and create a new one.Post an internal399 event.400 401 :param slicer: slicer class to create402 """403 ## Clear current slicer404 if not self.slicer == None:405 self.slicer.clear()406 ## Create a new slicer407 self.slicer_z += 1408 self.slicer = slicer(self, self.subplot, zorder=self.slicer_z)409 self.subplot.set_ylim(self.data2D.ymin, self.data2D.ymax)410 self.subplot.set_xlim(self.data2D.xmin, self.data2D.xmax)411 ## Draw slicer412 self.update()413 self.slicer.update()414 msg = "Plotter2D._setSlicer %s"%self.slicer.__class__.__name__415 wx.PostEvent(self.parent, StatusEvent(status=msg))416 # Post slicer event417 event = self._getEmptySlicerEvent()418 event.type = self.slicer.__class__.__name__419 event.obj_class = self.slicer.__class__420 event.params = self.slicer.get_params()421 wx.PostEvent(self, event)422 423 397 def update(self, draw=True): 424 398 """ … … 440 414 pass 441 415 442 def _update_mask(self, mask):416 def _update_mask(self, mask): 443 417 """ 444 418 Respond to changes in masking … … 460 434 # set temp_data value for self.mask==True, else still None 461 435 #temp_mask[mask] = temp_data[mask] 462 temp_data.data[mask==False] = temp_mask[mask==False] 436 437 #TODO: refactor this horrible logic 438 temp_data.data[mask == False] = temp_mask[mask == False] 463 439 self.plotpanel.clear() 464 440 if self.slicer != None: … … 541 517 def OnClose(self, event): 542 518 """ 519 Processing close event 543 520 """ 544 521 try: … … 720 697 self.plots[plot.name] = plot 721 698 #init graph 722 self.g aph = Graph()699 self.graph = Graph() 723 700 #add plot 724 701 self.graph.add(plot) … … 781 758 pass 782 759 else: 783 self.subplot.figure.canvas.draw_idle()760 self.subplot.figure.canvas.draw_idle() 784 761 785 762 msg = 'Plotting Completed.' … … 794 771 795 772 id = wx.NewId() 796 slicerpop.Append(id, '&Print Image', 'Print image')773 slicerpop.Append(id, '&Print Image', 'Print image') 797 774 wx.EVT_MENU(self, id, self.onPrint) 798 775
Note: See TracChangeset
for help on using the changeset viewer.