Changeset 92c2345 in sasview for guiframe/local_perspectives
- Timestamp:
- Jan 12, 2009 5:21:02 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:
- a5aaec9
- Parents:
- e23a20c
- Location:
- guiframe/local_perspectives/plotting
- Files:
-
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
guiframe/local_perspectives/plotting/Plotter2D.py
r4b91fd1 r92c2345 208 208 slicerpop.Append(id, '&Annulus [Phi view ]') 209 209 wx.EVT_MENU(self, id, self.onSectorPhi) 210 210 211 211 id = wx.NewId() 212 212 slicerpop.Append(id, '&Box Sum') … … 216 216 slicerpop.Append(id, '&Box averaging') 217 217 wx.EVT_MENU(self, id, self.onBoxavg) 218 219 id = wx.NewId() 220 slicerpop.Append(id, '&Clear slicer') 221 wx.EVT_MENU(self, id, self.onClearSlicer) 222 223 id = wx.NewId() 224 slicerpop.Append(id, '&Edit Slicer Parameters') 225 wx.EVT_MENU(self, id, self._onEditSlicer) 218 if self.slicer !=None: 219 id = wx.NewId() 220 slicerpop.Append(id, '&Clear slicer') 221 wx.EVT_MENU(self, id, self.onClearSlicer) 222 223 224 id = wx.NewId() 225 slicerpop.Append(id, '&Edit Slicer Parameters') 226 wx.EVT_MENU(self, id, self._onEditSlicer) 226 227 227 228 slicerpop.AppendSeparator() … … 310 311 event = self._getEmptySlicerEvent() 311 312 event.type = self.slicer.__class__.__name__ 313 print "event.type",event.type 312 314 event.obj_class = self.slicer.__class__ 313 315 event.params = self.slicer.get_params() 316 try: 317 event.result= self.slicer.get_result() 318 except: 319 event.result= None 320 print "event.result", event.result 314 321 wx.PostEvent(self.parent, event) 315 322 … … 369 376 Perform sector averaging on Q 370 377 """ 371 372 378 from SectorSlicer import SectorInteractor 373 379 self.onClearSlicer(event) … … 386 392 self.onClearSlicer(event) 387 393 wx.PostEvent(self.parent, InternalEvent(slicer= BoxSum)) 394 from BoxParameters import SlicerParameterPanel 395 396 dialog = SlicerParameterPanel(self.parent, -1, "Slicer Parameters") 397 398 if dialog.ShowModal() == wx.ID_OK: 399 dialog.Destroy() 400 401 def onBoxavg(self,event): 402 from boxSlicer import BoxInteractor 403 self.onClearSlicer(event) 404 wx.PostEvent(self.parent, InternalEvent(slicer= BoxInteractor)) 388 405 """ 389 406 self.onClearSlicer(event) … … 398 415 wx.PostEvent(self.parent, InternalEvent(slicer= BoxInteractor)) 399 416 print "onboxavg",self.slicer 400 """401 def onBoxavg(self,event):402 from boxSlicer import BoxInteractor403 self.onClearSlicer(event)404 wx.PostEvent(self.parent, InternalEvent(slicer= BoxInteractor))405 """406 self.onClearSlicer(event)407 self.slicer=BoxInteractor408 from SlicerParameters import SlicerParameterPanel409 410 dialog = SlicerParameterPanel(self.parent, -1, "Slicer Parameters")411 dialog.set_slicer(self.slicer.__name__,412 self.slicer.get_params())413 if dialog.ShowModal() == wx.ID_OK:414 dialog.Destroy()415 wx.PostEvent(self.parent, InternalEvent(slicer= BoxInteractor))416 print "onboxavg",self.slicer417 417 """ 418 418 -
guiframe/local_perspectives/plotting/boxSum.py
r9b05b2f r92c2345 74 74 75 75 self.update() 76 #self._post_data()76 self._post_data() 77 77 78 78 # Bind to slice parameter events … … 84 84 event.Skip() 85 85 if event.type == self.__class__.__name__: 86 #self.set_params(event.params)86 self.set_params(event.params) 87 87 self.base.update() 88 88 … … 180 180 y_max= self.top_line.y 181 181 box = Boxavg (x_min=x_min, x_max=x_max, y_min=y_min, y_max=y_max) 182 183 self.count, self.error= box(self.base.data2D) 184 185 186 182 self.count, self.error = box(self.base.data2D) 183 print "count, error",self.count, self.error 184 187 185 188 186 def moveend(self, ev): … … 192 190 event = SlicerParameters.SlicerParameterEvent() 193 191 event.type = self.__class__.__name__ 194 #event.params = self.get_params() 192 print "event type boxsum: ", event.type 193 event.params = self.get_params() 194 195 195 wx.PostEvent(self.base.parent, event) 196 196 … … 209 209 """ 210 210 print "in move" 211 if self.xmin <= x and x <= self.xmax:211 if self.xmin <= x and x <= self.xmax: 212 212 print "has move whole", x 213 213 … … 221 221 params["y_min"] = self.bottom_line.y 222 222 params["y_max"] = self.top_line.y 223 params["count"] = self.count 224 params["error"] = self.error 225 params["center_x"] = self.center_x 226 params["center_y"] = self.center_y 223 227 224 return params 228 225 226 227 def get_result(self): 228 """ 229 return the result of box summation 230 """ 231 result={} 232 result["count"] = self.count 233 result["error"] = self.error 234 return result 235 236 229 237 def set_params(self, params): 230 238 231 x_min = params["x_min"] 232 x_max = params["x_max"] 233 y_min = params["y_min"] 234 y_max = params["y_max"] 235 theta = params["theta"] 236 center_x = params["center_x"] 237 center_y = params["center_y"] 238 239 x_min = -math.fabs(params["x_min"] ) 240 x_max = math.fabs(params["x_max"] ) 241 y_min = -math.fabs(params["y_min"]) 242 y_max = math.fabs(params["y_max"]) 243 244 self.left_line.update(ymin= y_min ,ymax= y_max , x= x_min) 245 self.right_line.update(ymin= y_min ,ymax= y_max, x= x_max) 246 self.top_line.update( xmin= x_min ,xmax= x_max, y= y_max) 247 self.bottom_line.update(xmin= x_min ,xmax= x_max, y=y_min) 248 """ 239 249 self.left_line.update(mline= [center_x, center_y],ymin= y_min ,ymax= y_max) 240 250 self.right_line.update(mline= [center_x, center_y],ymin= y_min ,ymax= y_max) 241 251 self.top_line.update(mline= [center_x, center_y], xmin= x_min ,xmax= xmax) 242 252 self.bottom_line.update(mline= [center_x, center_y],xmin= xmin ,xmax= xmax) 243 253 """ 244 254 245 255 self._post_data() … … 363 373 params["radius"] = self.xmin 364 374 params["theta"] = self.xmax 375 365 376 return params 366 377
Note: See TracChangeset
for help on using the changeset viewer.