- Timestamp:
- Feb 4, 2011 3:41:13 PM (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:
- 73b3ae2
- Parents:
- 3f0351c6
- Location:
- sansview/perspectives/fitting
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/basepage.py
rc8deee5 r3cd5806 11 11 from wx.lib.scrolledpanel import ScrolledPanel 12 12 from sans.guiframe.utils import format_number,check_float 13 from sans.guiframe.events import PanelOnFocusEvent 13 14 from sans.guiframe.events import StatusEvent 14 15 import pagestate … … 53 54 self.parent = parent 54 55 ## manager is the fitting plugin 55 self.manager = None56 56 ## owner of the page (fitting plugin) 57 57 self.event_owner = None … … 172 172 self.set_layout() 173 173 174 def on_set_focus(self, event): 175 """ 176 """ 177 print "fitting panel", self.window_name 178 if self._manager is not None: 179 wx.PostEvent(self._manager.parent, PanelOnFocusEvent(panel=self)) 180 174 181 class ModelTextCtrl(wx.TextCtrl): 175 182 """ … … 267 274 self.window_caption = page_info.window_caption 268 275 ## manager is the fitting plugin 269 self. manager= page_info.manager276 self._manager= page_info.manager 270 277 ## owner of the page (fitting plugin) 271 278 self.event_owner= page_info.event_owner … … 373 380 374 381 """ 375 self.manager = manager 382 print "manager", manager 383 self._manager = manager 376 384 self.state.manager = manager 377 385 … … 601 609 self.reset_page(previous_state) 602 610 603 def on_save _state(self, event):611 def on_save(self, event): 604 612 """ 605 613 Save the current state into file … … 617 625 return None 618 626 #the manager write the state into file 619 self. manager.save_fit_state(filepath=path, fitstate=new_state)627 self._manager.save_fit_state(filepath=path, fitstate=new_state) 620 628 return new_state 621 629 … … 668 676 if self.engine_type == None: 669 677 self.engine_type = "scipy" 670 if self. manager !=None:671 self. manager._on_change_engine(engine=self.engine_type)678 if self._manager !=None: 679 self._manager._on_change_engine(engine=self.engine_type) 672 680 673 681 self.state.engine_type = self.engine_type … … 973 981 self._on_select_model(event=None) 974 982 975 if self. manager !=None:976 self. manager._on_change_engine(engine=self.engine_type)983 if self._manager !=None: 984 self._manager._on_change_engine(engine=self.engine_type) 977 985 ## set the select all check box to the a given state 978 986 self.cb1.SetValue(state.cb1) … … 1330 1338 is_modified = False 1331 1339 1332 wx.PostEvent(self. manager.parent, StatusEvent(status=" \1340 wx.PostEvent(self._manager.parent, StatusEvent(status=" \ 1333 1341 updating ... ",type="update")) 1334 1342 … … 1363 1371 flag = self.update_pinhole_smear() 1364 1372 else: 1365 self. manager.set_smearer_nodraw(smearer=temp_smearer,1373 self._manager.set_smearer_nodraw(smearer=temp_smearer, 1366 1374 qmin=float(self.qmin_x), 1367 1375 qmax=float(self.qmax_x)) 1368 1376 elif not self._is_2D(): 1369 self. manager.set_smearer(smearer=temp_smearer,1377 self._manager.set_smearer(smearer=temp_smearer, 1370 1378 qmin=float(self.qmin_x), 1371 1379 qmax= float(self.qmax_x)) … … 1632 1640 temp_smear= self.current_smearer 1633 1641 1634 self. manager.draw_model(self.model,1642 self._manager.draw_model(self.model, 1635 1643 data=self.data, 1636 1644 smearer= temp_smear, … … 2173 2181 msg="Please select a Model first..." 2174 2182 wx.MessageBox(msg, 'Info') 2175 wx.PostEvent(self. manager.parent, StatusEvent(status=\2183 wx.PostEvent(self._manager.parent, StatusEvent(status=\ 2176 2184 "Polydispersion: %s"%msg)) 2177 2185 return … … 2475 2483 self.btSave_title = wx.StaticText(self, -1, 'Save the current Model') 2476 2484 self.btSave = wx.Button(self,wx.NewId(),'Save') 2477 self.btSave.Bind(wx.EVT_BUTTON, self.on_save _state,id= self.btSave.GetId())2485 self.btSave.Bind(wx.EVT_BUTTON, self.on_save,id= self.btSave.GetId()) 2478 2486 self.btSave.SetToolTipString("Save the current Model") 2487 self._set_save_flag(True) 2479 2488 2480 2489 sizer_save.Add(self.btSave_title) -
sansview/perspectives/fitting/fitpanel.py
rc8deee5 r3cd5806 6 6 7 7 from sans.guiframe.panel_base import PanelBase 8 from sans.guiframe.events import PanelOnFocusEvent 8 9 import basepage 9 10 … … 167 168 wx.aui.AUI_NB_DEFAULT_STYLE| 168 169 wx.CLIP_CHILDREN) 169 PanelBase.__init__(self )170 PanelBase.__init__(self, parent) 170 171 171 172 self._manager = None … … 188 189 self.Bind(basepage.EVT_PREVIOUS_STATE, self._onUndo) 189 190 self.Bind(basepage.EVT_NEXT_STATE, self._onRedo) 190 191 191 192 #add default pages 192 193 self.add_default_pages() 193 194 194 195 # increment number for model name 195 196 self.count = 0 … … 198 199 self.Center() 199 200 201 def on_set_focus(self, event): 202 """ 203 """ 204 pos = self.GetSelection() 205 selected_page = self.GetPage(pos) 206 print "panel on fogus", selected_page.window_name 207 wx.PostEvent(self.parent, PanelOnFocusEvent(panel=selected_page)) 208 200 209 def get_data(self): 201 210 """ … … 222 231 self.hint_page = HintFitPage(self) 223 232 self.AddPage(page=self.hint_page, caption="Hint") 224 233 self.hint_page.set_manager(self._manager) 225 234 #Add the first fit page 226 235 self.add_empty_page() … … 316 325 """ 317 326 self._manager = manager 327 for pos in range(self.GetPageCount()): 328 page = self.GetPage(pos) 329 if page is not None: 330 page.set_manager(self._manager) 318 331 319 332 -
sansview/perspectives/fitting/fitting.py
r13913ec r3cd5806 256 256 loader.associate_file_reader(".fitv", self.state_reader) 257 257 loader.associate_file_reader(".svs", self.state_reader) 258 from sans.perspectives.calculator.sld_panel import SldPanel259 258 #Send the fitting panel to guiframe 260 259 self.mypanels.append(self.fit_panel) 261 self.mypanels.append(SldPanel(parent=self.parent, base=self.parent))260 262 261 return self.mypanels 263 262 -
sansview/perspectives/fitting/hint_fitpage.py
rbf66f67 r3cd5806 1 1 import wx 2 from sans.guiframe.panel_base import PanelBase 2 3 3 4 class HintFitPage(wx.ScrolledWindow): 4 class HintFitPage(wx.ScrolledWindow, PanelBase): 5 5 """ 6 6 This class provide general structure of fitpanel page … … 13 13 def __init__(self, parent): 14 14 wx.ScrolledWindow.__init__(self, parent, 15 style= wx.FULL_REPAINT_ON_RESIZE 16 15 style= wx.FULL_REPAINT_ON_RESIZE) 16 PanelBase.__init__(self, parent) 17 17 msg = "right click on the data when it is highlighted " 18 18 msg += "the select option to fit for futher options"
Note: See TracChangeset
for help on using the changeset viewer.