Changeset d318616 in sasview for invariantview/perspectives/invariant/invariant_panel.py
- Timestamp:
- Jul 27, 2010 11:36:25 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:
- 0881f51
- Parents:
- 51fb7ab
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
invariantview/perspectives/invariant/invariant_panel.py
r51fb7ab rd318616 82 82 self.new_state = False 83 83 self.is_power_out = False 84 self.is_state_data = False 84 85 85 86 #container of invariant value … … 117 118 """ 118 119 """ 120 119 121 n = self.data_cbbox.GetCurrentSelection() 120 data, path = self.data_cbbox.GetClientData(n) 121 self._manager.compute_helper(data=data) 122 122 try: 123 data, path = self.data_cbbox.GetClientData(n) 124 125 if not self._data == data: 126 self._manager.compute_helper(data=data) 127 else: 128 msg = "The data named %s is already loaded..."% data.name 129 wx.PostEvent(self.parent, StatusEvent(status=msg)) 130 except: 131 self.data_cbbox.SetSelection(0) 123 132 124 133 def set_data(self, list=[], state=None): … … 128 137 if not list: 129 138 return 139 count_bf = self.data_cbbox.GetCount() 130 140 for data, path in list: 131 141 if data.__class__.__name__ != "Data2D" and \ 132 142 data.name not in self.data_cbbox.GetItems(): 133 self.data_cbbox.Insert(item=data.name, pos=0, 143 position = self.data_cbbox.GetCount() 144 self.data_cbbox.Insert(item=data.name, pos=position, 134 145 clientData=(data, path)) 135 if self.data_cbbox.GetCount() >0: 136 self.data_cbbox.SetSelection(0) 137 self.data_cbbox.Enable() 138 self.on_select_data(event=None) 146 count = self.data_cbbox.GetCount() 147 if count >0: 148 # set data only on the first or state data 149 if count ==1 or self.is_state_data: 150 # when count increased especially if self.is_state_data. 151 if count > count_bf: 152 self.data_cbbox.SetSelection(count-1) 153 154 self.data_cbbox.Enable() 155 self.on_select_data(event=None) 156 self.is_state_data = False 157 139 158 title = "Untitled" 140 159 if hasattr(data,"title"): … … 144 163 else: 145 164 title = str(data.name) 146 165 147 166 wx.PostEvent(self.parent, NewPlotEvent(plot=data, title=title)) 148 167
Note: See TracChangeset
for help on using the changeset viewer.