Changeset d468daa in sasview for guiframe/local_perspectives/plotting
- Timestamp:
- Feb 5, 2009 1:51:33 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:
- 888e62c
- Parents:
- f6a9248
- Location:
- guiframe/local_perspectives/plotting
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/local_perspectives/plotting/AnnulusSlicer.py
rca88b2e rd468daa 54 54 self.base.parent.Bind(EVT_SLICER_PARS, self._onEVT_SLICER_PARS) 55 55 56 56 57 57 58 def _onEVT_SLICER_PARS(self, event): … … 85 86 self.inner_circle.clear() 86 87 #self.base.connect.disconnect() 87 self.base.parent.Unbind(EVT_SLICER_PARS) 88 #self.base.parent.Unbind(EVT_SLICER_PARS) 89 self.base.Unbind(EVT_SLICER_PARS) 88 90 89 91 def update(self): … … 167 169 event.type = self.__class__.__name__ 168 170 event.params = self.get_params() 169 wx.PostEvent(self.base.parent, event)170 171 #wx.PostEvent(self.base.parent, event) 172 wx.PostEvent(self.base, event) 171 173 self._post_data() 172 174 … … 231 233 232 234 233 print "sign",self.sign,self.sign*math.fabs(self._inner_mouse_x)235 #print "sign",self.sign,self.sign*math.fabs(self._inner_mouse_x) 234 236 235 237 try: -
guiframe/local_perspectives/plotting/Plotter1D.py
r0d9dae8 rd468daa 152 152 """ 153 153 if not self.graph.selected_plottable == None: 154 print self.graph.selected_plottable 155 156 154 #print self.graph.selected_plottable 157 155 self.graph.delete(self.plots[self.graph.selected_plottable]) 158 156 del self.plots[self.graph.selected_plottable] … … 187 185 self.action_ids[str(id)] = plot 188 186 wx.EVT_MENU(self, id, self._onRemove) 189 187 190 188 # Option to hide 191 189 #TODO: implement functionality to hide a plottable (legend click) 192 slicerpop.AppendSeparator()190 193 191 194 192 # Various plot options … … 197 195 wx.EVT_MENU(self, id, self.onSaveImage) 198 196 199 197 slicerpop.AppendSeparator() 200 198 item_list = self.parent.get_context_menu(self.graph) 199 #print "item_list",item_list 201 200 if (not item_list==None) and (not len(item_list)==0): 202 slicerpop.AppendSeparator()203 201 for item in item_list: 204 202 try: … … 207 205 wx.EVT_MENU(self, id, item[2]) 208 206 except: 209 p rint sys.exc_value210 print RuntimeError, "View1DPanel.onContextMenu: bad menu item"211 212 slicerpop.AppendSeparator()213 207 pass 208 #print sys.exc_value 209 #print RuntimeError, "View1DPanel.onContextMenu: bad menu item" 210 211 214 212 if self.graph.selected_plottable in self.plots: 215 213 if self.plots[self.graph.selected_plottable].__class__.__name__=="Theory1D": … … 224 222 wx.EVT_MENU(self, id, self.onFitting) 225 223 226 227 224 slicerpop.AppendSeparator() 228 225 id = wx.NewId() 229 226 slicerpop.Append(id, '&Change scale') … … 231 228 232 229 id = wx.NewId() 233 #slicerpop.AppendSeparator()234 230 slicerpop.Append(id, '&Reset Graph') 235 wx.EVT_MENU(self, id, self.onResetGraph) 231 wx.EVT_MENU(self, id, self.onResetGraph) 232 233 slicerpop.AppendSeparator() 234 id = wx.NewId() 235 slicerpop.Append(id,'&Printer setup', 'Set image size') 236 wx.EVT_MENU(self, id, self.onPrinterSetup) 237 238 id = wx.NewId() 239 slicerpop.Append(id,'&Printer Preview', 'Set image size') 240 wx.EVT_MENU(self, id, self.onPrinterPreview) 241 242 id = wx.NewId() 243 slicerpop.Append(id,'&Print image', 'Print image ') 244 wx.EVT_MENU(self, id, self.onPrint) 236 245 237 246 pos = event.GetPosition() … … 297 306 path = dlg.GetPath() 298 307 mypath = os.path.basename(path) 299 print path308 #print path 300 309 dlg.Destroy() 301 310 … … 310 319 try: 311 320 if len(self.action_ids[id].y) != len(self.action_ids[id].dy): 312 print "Y and dY have different lengths"321 #print "Y and dY have different lengths" 313 322 has_errors = False 314 323 except: … … 331 340 out.close() 332 341 333 342 343 334 344 def _onToggleScale(self, event): 335 345 if self.get_yscale() == 'log': -
guiframe/local_perspectives/plotting/Plotter2D.py
r0690e1d rd468daa 76 76 self.slicer_z = 5 77 77 self.slicer = None 78 self.parent.Bind(EVT_INTERNAL, self._onEVT_INTERNAL) 78 #self.parent.Bind(EVT_INTERNAL, self._onEVT_INTERNAL) 79 self.Bind(EVT_INTERNAL, self._onEVT_INTERNAL) 79 80 self.axes_frozen = False 80 81 … … 92 93 93 94 def _onEVT_SLICER_PARS(self, event): 94 print "paramaters entered on slicer panel", event.type, event.params95 #print "paramaters entered on slicer panel", event.type, event.params 95 96 self.slicer.set_params(event.params) 96 97 from sans.guicomm.events import SlicerPanelEvent … … 99 100 100 101 def _onEVT_SLICER_PANEL(self, event): 101 print "box move plotter2D", event.type, event.params102 #print "box move plotter2D", event.type, event.params 102 103 self.panel_slicer.set_slicer(event.type, event.params) 103 104 from sans.guicomm.events import SlicerPanelEvent … … 185 186 slicerpop.set_plots(self.plots) 186 187 slicerpop.set_graph(self.graph) 187 188 # Option to save the data displayed189 188 190 # Various plot options191 id = wx.NewId()192 slicerpop.Append(id,'&Save image', 'Save image as PNG')193 wx.EVT_MENU(self, id, self.onSaveImage)194 195 196 189 item_list = self.parent.get_context_menu(self.graph) 197 190 if (not item_list==None) and (not len(item_list)==0): 198 slicerpop.AppendSeparator()191 199 192 for item in item_list: 200 193 try: … … 203 196 wx.EVT_MENU(self, id, item[2]) 204 197 except: 205 print sys.exc_value 206 print RuntimeError, "View1DPanel2D.onContextMenu: bad menu item" 198 pass 199 #print sys.exc_value 200 #print RuntimeError, "View1DPanel2D.onContextMenu: bad menu item" 207 201 208 202 slicerpop.AppendSeparator() … … 236 230 wx.EVT_MENU(self, id, self.onClearSlicer) 237 231 238 239 232 id = wx.NewId() 240 233 slicerpop.Append(id, '&Edit Slicer Parameters') 241 234 wx.EVT_MENU(self, id, self._onEditSlicer) 242 243 slicerpop.AppendSeparator() 244 235 slicerpop.AppendSeparator() 236 245 237 id = wx.NewId() 246 238 slicerpop.Append(id, '&Save image') 247 239 wx.EVT_MENU(self, id, self.onSaveImage) 248 240 241 # Option to save the data displayed 242 id = wx.NewId() 243 slicerpop.Append(id,'&Printer setup', 'Set image size') 244 wx.EVT_MENU(self, id, self.onPrinterSetup) 245 246 id = wx.NewId() 247 slicerpop.Append(id,'&Printer Preview', 'Set image size') 248 wx.EVT_MENU(self, id, self.onPrinterPreview) 249 250 id = wx.NewId() 251 slicerpop.Append(id,'&Print image', 'Print image ') 252 wx.EVT_MENU(self, id, self.onPrint) 253 slicerpop.AppendSeparator() 249 254 id = wx.NewId() 250 255 slicerpop.Append(id, '&Toggle Linear/Log scale') 251 256 wx.EVT_MENU(self, id, self._onToggleScale) 252 257 258 253 259 pos = event.GetPosition() 254 260 pos = self.ScreenToClient(pos) … … 306 312 self.slicer_z += 1 307 313 self.slicer = slicer(self, self.subplot, zorder=self.slicer_z) 308 print "come here"314 #print "come here" 309 315 self.subplot.set_ylim(self.data2D.ymin, self.data2D.ymax) 310 316 self.subplot.set_xlim(self.data2D.xmin, self.data2D.xmax) … … 319 325 event.obj_class = self.slicer.__class__ 320 326 event.params = self.slicer.get_params() 321 print "Plotter2D: event.type",event.type,event.params, self.parent 322 323 wx.PostEvent(self.parent, event) 327 #print "Plotter2D: event.type",event.type,event.params, self.parent 328 329 #wx.PostEvent(self.parent, event) 330 wx.PostEvent(self, event) 324 331 325 332 def onCircular(self, event): … … 332 339 self.qmax= self.data2D.xmax 333 340 self.radius= math.sqrt( math.pow(self.qmax,2)+math.pow(self.qmax,2)) 334 print "radius?",self.radius341 #print "radius?",self.radius 335 342 # bin_width = self.qmax -self.qmin/nbins 336 343 #nbins= 30 … … 379 386 Perform sector averaging on Q 380 387 """ 381 print "onsector self.data2Dxmax",self.data2D.xmax388 #print "onsector self.data2Dxmax",self.data2D.xmax, self.parent 382 389 from SectorSlicer import SectorInteractor 383 390 self.onClearSlicer(event) 384 wx.PostEvent(self.parent, InternalEvent(slicer= SectorInteractor)) 391 #wx.PostEvent(self.parent, InternalEvent(slicer= SectorInteractor)) 392 wx.PostEvent(self, InternalEvent(slicer= SectorInteractor)) 385 393 386 394 def onSectorPhi(self, event): … … 390 398 from AnnulusSlicer import AnnulusInteractor 391 399 self.onClearSlicer(event) 392 wx.PostEvent(self.parent, InternalEvent(slicer= AnnulusInteractor)) 400 #wx.PostEvent(self.parent, InternalEvent(slicer= AnnulusInteractor)) 401 wx.PostEvent(self, InternalEvent(slicer= AnnulusInteractor)) 393 402 394 403 def onBoxSum(self,event): … … 400 409 self.slicer_z += 1 401 410 self.slicer = BoxSum(self, self.subplot, zorder=self.slicer_z) 402 print "come here"411 #print "come here" 403 412 self.subplot.set_ylim(self.data2D.ymin, self.data2D.ymax) 404 413 self.subplot.set_xlim(self.data2D.xmin, self.data2D.xmax) … … 414 423 event.obj_class = self.slicer.__class__ 415 424 event.params = self.slicer.get_params() 416 print "Plotter2D: event.type",event.type,event.params, self.parent425 #print "Plotter2D: event.type",event.type,event.params, self.parent 417 426 418 427 from slicerpanel import SlicerPanel … … 427 436 from sans.guicomm.events import SlicerPanelEvent 428 437 wx.PostEvent(self.parent, SlicerPanelEvent (panel= self.panel_slicer)) 429 print "finish box sum"438 #print "finish box sum" 430 439 431 440 def onBoxavgX(self,event): 432 441 from boxSlicer import BoxInteractorX 433 442 self.onClearSlicer(event) 434 wx.PostEvent(self.parent, InternalEvent(slicer= BoxInteractorX)) 435 """ 436 from slicerpanel import SlicerPanel 437 new_panel = SlicerPanel(self.parent, -1, style=wx.RAISED_BORDER) 438 439 from sans.guicomm.events import SlicerPanelEvent 440 wx.PostEvent(self.parent, SlicerPanelEvent (panel= new_panel)) 441 """ 443 #wx.PostEvent(self.parent, InternalEvent(slicer= BoxInteractorX)) 444 wx.PostEvent(self, InternalEvent(slicer= BoxInteractorX)) 445 446 442 447 def onBoxavgY(self,event): 443 448 from boxSlicer import BoxInteractorY 444 449 self.onClearSlicer(event) 445 wx.PostEvent(self.parent, InternalEvent(slicer= BoxInteractorY)) 446 """ 447 from slicerpanel import SlicerPanel 448 new_panel = SlicerPanel(self.parent, -1, style=wx.RAISED_BORDER) 449 450 from sans.guicomm.events import SlicerParameterEvent 451 wx.PostEvent(self.parent, SlicerParameterEvent (panel= new_panel)) 452 """ 450 wx.PostEvent(self, InternalEvent(slicer= BoxInteractorY)) 451 #wx.PostEvent(self.parent, InternalEvent(slicer= BoxInteractorY)) 452 453 453 def onClearSlicer(self, event): 454 454 """ … … 462 462 # Post slicer None event 463 463 event = self._getEmptySlicerEvent() 464 wx.PostEvent(self.parent, event) 464 #wx.PostEvent(self.parent, event) 465 wx.PostEvent(self, event) 465 466 466 467 def _onEditDetector(self, event): -
guiframe/local_perspectives/plotting/SectorSlicer.py
r0d9dae8 rd468daa 97 97 self.right_line.clear() 98 98 #self.base.connect.disconnect() 99 self.base.parent.Unbind(EVT_SLICER_PARS) 99 #self.base.parent.Unbind(EVT_SLICER_PARS) 100 self.base.Unbind(EVT_SLICER_PARS) 100 101 101 102 def update(self): … … 199 200 event.type = self.__class__.__name__ 200 201 event.params = self.get_params() 201 wx.PostEvent(self.base.parent, event) 202 #wx.PostEvent(self.base.parent, event) 203 wx.PostEvent(self.base, event) 202 204 self._post_data() 203 205 -
guiframe/local_perspectives/plotting/SlicerParameters.py
r0d9dae8 rd468daa 41 41 @param event: EVT_SLICER event 42 42 """ 43 print "went here"43 #print "went here" 44 44 event.Skip() 45 45 if event.obj_class==None: -
guiframe/local_perspectives/plotting/boxSlicer.py
r0d9dae8 rd468daa 120 120 121 121 if self.top_line.has_move: 122 print"top has moved"122 #print"top has moved" 123 123 self.top_line.update() 124 124 self.bottom_line.update(ymin= -self.top_line.y1, … … 130 130 131 131 if self.bottom_line.has_move: 132 print "bottom has move"132 #print "bottom has move" 133 133 self.bottom_line.update() 134 134 self.top_line.update(ymin= -self.bottom_line.y1, … … 410 410 Process move to a new position, making sure that the move is allowed. 411 411 """ 412 print "horizontal move x y "412 #print "horizontal move x y " 413 413 self.y1= y 414 414 self.has_move=True -
guiframe/local_perspectives/plotting/boxSum.py
ree69839 rd468daa 72 72 73 73 # Bind to slice parameter events 74 print "box sum self.base.parent",self.base.parent74 #print "box sum self.base.parent",self.base.parent 75 75 self.base.parent.Bind(SlicerParameters.EVT_SLICER_PARS, self._onEVT_SLICER_PARS) 76 76 … … 115 115 """ 116 116 if self.center.has_move: 117 print "center has move"117 #print "center has move" 118 118 self.center.update() 119 119 self.horizontal_lines.update( center= self.center) … … 121 121 122 122 if self.horizontal_lines.has_move: 123 print "top has moved"123 #print "top has moved" 124 124 self.horizontal_lines.update() 125 125 self.vertical_lines.update(y1=self.horizontal_lines.y1, … … 127 127 height= self.horizontal_lines.half_height ) 128 128 if self.vertical_lines.has_move: 129 print "right has moved"129 #print "right has moved" 130 130 self.vertical_lines.update() 131 131 self.horizontal_lines.update(x1=self.vertical_lines.x1, … … 464 464 Draw the new roughness on the graph. 465 465 """ 466 print "self.half_height",self.half_height,self.half_width466 #print "self.half_height",self.half_height,self.half_width 467 467 if width!=None: 468 468 self.half_width= width … … 472 472 self.center_x= center.x 473 473 self.center_y= center.y 474 print "vertical width",self.half_width ,self.center_x474 #print "vertical width",self.half_width ,self.center_x 475 475 self.x1 = self.half_width + self.center_x 476 476 self.x2= -self.half_width + self.center_x … … 543 543 544 544 self.half_width= math.fabs(self.x1-self.x2)/2 545 print "Move vert: vertical width",self.half_width ,self.center_x545 #print "Move vert: vertical width",self.half_width ,self.center_x 546 546 self.has_move=True 547 547 self.base.base.update() … … 658 658 Draw the new roughness on the graph. 659 659 """ 660 print "self.half_width",self.half_width660 #print "self.half_width",self.half_width 661 661 if width!=None: 662 662 self.half_width= width -
guiframe/local_perspectives/plotting/slicerpanel.py
r0d9dae8 rd468daa 57 57 58 58 else: 59 print "when here not empty event",event.type, event.params59 #print "when here not empty event",event.type, event.params 60 60 self.set_slicer(event.type, event.params) 61 61 … … 96 96 for item in keys: 97 97 if item.lower() in ["errors", "count"]: 98 #print "went here" 98 99 n += 1 99 100 text = wx.StaticText(self, -1, item+": ", style=wx.ALIGN_LEFT)
Note: See TracChangeset
for help on using the changeset viewer.