Changeset a3c96f7a in sasview
- Timestamp:
- Mar 21, 2011 5:18:01 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:
- ec611aad
- Parents:
- 6512644
- Location:
- guiframe
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/data_manager.py
r5080cda ra3c96f7a 120 120 return name 121 121 122 def add_data(self, data_list): 123 """ 124 receive a list of 122 def add_theory_data(self, data_list): 123 """ 125 124 """ 126 125 for id, data in data_list.iteritems(): … … 130 129 logging.info(msg) 131 130 data_state = self.stored_data[id] 131 data_state.theory_data = data 132 else: 133 data_state = DataState(theory_data=data) 134 data_state.id = data.id 135 self.stored_data[id] = data_state 136 137 def add_data(self, data_list): 138 """ 139 receive a list of 140 """ 141 for id, data in data_list.iteritems(): 142 if id in self.stored_data: 143 msg = "Data manager already stores %s" % str(data.name) 144 msg += "" 145 logging.info(msg) 146 data_state = self.stored_data[id] 147 data_state.data = data 132 148 else: 133 149 data_state = DataState(data) 134 data_state.id = time.time()150 data_state.id = id 135 151 self.stored_data[id] = data_state 136 152 -
guiframe/data_panel.py
rb5e79f7 ra3c96f7a 287 287 self.tree_ctrl = DataTreeCtrl(parent=self) 288 288 self.tree_ctrl.Bind(CT.EVT_TREE_ITEM_CHECKING, self.on_check_item) 289 self.tree_ctrl.Bind(CT.EVT_TREE_ITEM_RIGHT_CLICK, self.on_right_click)290 label = wx.StaticText(self, -1, "LOADED DATA")291 label.SetForegroundColour('blue')292 self.sizer1.Add(label, 0, wx.LEFT, 10)293 289 self.sizer1.Add(self.tree_ctrl,1, wx.EXPAND|wx.ALL, 10) 294 295 296 def on_right_click(self, event):297 """298 """299 ## Create context menu for data300 self.popUpMenu = wx.Menu()301 msg = "Edit %s"%str(self.tree_ctrl.GetItemText(event.GetItem()))302 id = wx.NewId()303 self.edit_data_mitem = wx.MenuItem(self.popUpMenu,id,msg,304 "Edit meta data")305 wx.EVT_MENU(self, id, self.on_edit_data)306 self.popUpMenu.AppendItem(self.edit_data_mitem)307 self.Bind(wx.EVT_CONTEXT_MENU, self.onContextMenu)308 309 def on_edit_data(self, event):310 """311 """312 print "editing data"313 290 314 291 def onContextMenu(self, event): -
guiframe/data_state.py
r5080cda ra3c96f7a 17 17 Store information about data 18 18 """ 19 def __init__(self, data, parent=None):19 def __init__(self, data, theory_data=None, model=None, parent=None): 20 20 """ 21 21 22 22 """ 23 self.model = model 24 self.theory_data = theory_data 23 25 self.parent = parent 24 26 self.data = data … … 36 38 _str += "Data ID : %s \n" % str(self.data.id) 37 39 else: 38 _str += "Data: %s \n" % str(self.data) 40 _str += "Theory Data: %s \n" % str(self.theory_data) 41 if self.theory_data is not None: 42 _str += "Data name : %s \n" % str(self.theory_data.name) 43 _str += "Theory Data ID : %s \n" % str(self.theory_data.id) 44 else: 45 _str += "Theory Data: %s \n" % str(self.theory_data) 39 46 40 47 _str += "Theories available: %s \n" % len(self.theory_list) … … 74 81 self.data = data 75 82 83 def set_theory_data(self, theory_data): 84 """ 85 """ 86 self.theory_data = theory_data 87 88 def get_theory_data(self): 89 """ 90 """ 91 return self.theory_data 92 93 def set_model(self, model): 94 """ 95 """ 96 self.model = model 97 98 def get_model(self): 99 """ 100 """ 101 return self.model 102 76 103 def get_data(self): 77 104 return self.data -
guiframe/local_perspectives/plotting/Plotter1D.py
rd7f727d ra3c96f7a 242 242 wx.EVT_MENU(self, id, self.onPrinterPreview) 243 243 244 symbol_menu = wx.Menu() 245 for label in self._symbol_labels: 246 id = wx.NewId() 247 symbol_menu.Append(id, str(label), str(label)) 248 wx.EVT_MENU(self, id, self.onChangeSymbol) 249 id = wx.NewId() 250 self._slicerpop.AppendMenu(id,'&Modify Symbol', symbol_menu) 251 self._slicerpop.AppendSeparator() 252 244 253 245 #add menu of other plugins 254 246 item_list = self.parent.get_context_menu(self) … … 274 266 self._slicerpop.Append(id, '&Freeze', 'Freeze') 275 267 wx.EVT_MENU(self, id, self.onFreeze) 268 symbol_menu = wx.Menu() 269 for label in self._symbol_labels: 270 id = wx.NewId() 271 symbol_menu.Append(id, str(label), str(label)) 272 wx.EVT_MENU(self, id, self.onChangeSymbol) 273 id = wx.NewId() 274 self._slicerpop.AppendMenu(id,'&Modify Symbol', symbol_menu) 275 self._slicerpop.AppendSeparator() 276 276 #else: 277 277 id = wx.NewId()
Note: See TracChangeset
for help on using the changeset viewer.