- Timestamp:
- Jan 21, 2011 12:49:17 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:
- f53444be
- Parents:
- 75df58b
- Location:
- guiframe
- Files:
-
- 1 added
- 1 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/dataFitting.py
r32c0841 rf444b20 13 13 from DataLoader.data_info import Data2D as LoadData2D 14 14 15 15 16 class Data1D(PlotData1D, LoadData1D): 16 17 """ … … 28 29 self.group_id = None 29 30 self.is_data = True 31 self.path = None 32 self.title = "" 30 33 31 34 def copy_from_datainfo(self, data1d): … … 46 49 self.xaxis(data1d._xaxis, data1d._xunit) 47 50 self.yaxis(data1d._yaxis, data1d._yunit) 51 self.title = data1d.title 48 52 49 53 def __str__(self): … … 80 84 return result 81 85 86 87 82 88 class Theory1D(PlotTheory1D, LoadData1D): 83 89 """ … … 95 101 self.group_id = None 96 102 self.is_data = True 103 self.path = None 104 self.title = "" 97 105 98 106 def copy_from_datainfo(self, data1d): … … 111 119 self.xaxis(data1d._xaxis, data1d._xunit) 112 120 self.yaxis(data1d._yaxis, data1d._yunit) 121 self.title = data1d.title 113 122 114 123 def __str__(self): … … 162 171 dqx_data=dqx_data, dqy_data=dqy_data, 163 172 q_data=q_data, mask=mask) 173 self.id = None 174 self.path = None 175 self.title = "" 176 164 177 165 178 def copy_from_datainfo(self, data2d): … … 189 202 self.xaxis(data2d._xaxis, data2d._xunit) 190 203 self.yaxis(data2d._yaxis, data2d._yunit) 204 self.title = data2d.title 191 205 192 206 def __str__(self): -
guiframe/data_manager.py
r32c0841 rf444b20 12 12 available all data loaded for the current perspective. 13 13 14 All modules creating 15 fake Data posts their data to data_manager . Data_manager make these new data 16 available for all other perspectives. 14 All modules "creating Data" posts their data to data_manager . 15 Data_manager make these new data available for all other perspectives. 17 16 """ 18 17 18 import logging 19 logging.basicConfig(level=logging.DEBUG, 20 format='%(asctime)s %(levelname)s %(message)s', 21 filename='sans_app.log', 22 filemode='w') 23 19 24 class DataManager(object): 20 25 """ 21 26 Manage a list of data 22 27 """ 23 def __init__(self , parent):28 def __init__(self): 24 29 """ 25 30 Store opened path and data object created at the loading time 31 :param auto_plot: if True the datamanager sends data to plotting 32 plugin. 33 :param auto_set_data: if True the datamanager sends to the current 34 perspective 26 35 """ 27 self.loaded_data_list = [] 28 self.created_data_list = [] 29 self.list_of_data = [] 36 self._selected_data = [] 37 self.stored_data = {} 30 38 self.message = "" 31 self.parent = parent 39 40 def add_data(self, data_list): 41 """ 42 receive a list of 43 """ 44 self._selected_data = [] 45 for data in data_list: 46 if data.id in self.stored_data: 47 msg = "Data manager already stores %s" % str(data.name) 48 msg += "" 49 logging.info(msg) 50 self._selected_data.append(data) 51 self.stored_data[id] = data 52 53 def set_auto_plot(self, flag=False): 54 """ 55 When flag is true the data is plotted automatically 56 """ 57 self._auto_set_data = flag 58 59 def set_auto_set_data(self, flag=False): 60 """ 61 When flag is true the data is send to the current perspective 62 automatically 63 """ 64 self._auto_set_data = flag 32 65 33 66 def get_message(self): … … 37 70 return self.message 38 71 39 def set_loaded_data(self, data_list=None): 72 def get_by_id(self, id_list=None): 73 """ 74 get a list of data given a list of id 75 """ 76 self._selected_data = [] 77 for id in id_list: 78 if id in self.stored_data: 79 self._selected_data.append(self.stored_data[id]) 80 return self._selected_data 81 82 def delete_by_id(self, id_list=None): 40 83 """ 41 84 save data and path 42 85 """ 43 if data_list is None: 44 return 45 for data, path in data_list: 46 if data.name not in self.list_of_data: 47 self.loaded_data_list.append((data, path)) 48 self.list_of_data.append(data.name) 49 else: 50 self.message += " %s already loaded" % str(data.name) 86 for id in id_list: 87 if id in self.stored_data: 88 data = self.stored_data[id] 89 if data in self._selected_data: 90 self._selected_data.remove(data) 91 del self.stored_data[id] 92 93 def get_by_name(self, name_list=None): 94 """ 95 return a list of data given a list of data names 96 """ 97 self._selected_data = [] 98 for selected_name in name_list: 99 for data in self.stored_data.values(): 100 if data.name == selected_name: 101 self._selected_data.append(data) 102 return self._selected_data 103 104 def delete_by_name(self, name_list=None): 105 """ 106 save data and path 107 """ 108 for selected_name in name_list: 109 for data in self.stored_data.values(): 110 if data.name == selected_name: 111 if data in self._selected_data: 112 self._selected_data.remove(data) 113 if data.id in self.stored_data: 114 del self.stored_data[data.id] 115 116 def get_selected_data(self): 117 """ 118 Send list of selected data 119 """ 120 return self._selected_data 121 122 def get_all_data(self): 123 """ 124 return list of all available data 125 """ 126 return self.stored_data.values() 127 128 51 129 52 def set_created_data(self, data_list=None):53 """54 return55 """56 if data_list is None:57 return58 for data, path in data_list:59 for created_data, _ in self.created_data_list:60 if data.name == created_data.name:61 self.message += " %s already created" % str(data.name)62 else:63 self.created_data_list.append((data, path))64 65 def get_data(self):66 """67 Send list of available data68 """69 return self.loaded_data_list + self.created_data_list70 -
guiframe/gui_manager.py
rdf23f90 rf444b20 36 36 37 37 import logging 38 #from sans.guicomm.events import NewLoadedDataEvent 39 from sans.gui comm.events import EVT_STATUS40 #from sans.guicomm.events import EVT_NEW_PLOT 41 #from sans.guicomm.events import EVT_SLICER_PARS_UPDATE 42 from sans.gui comm.events import EVT_ADD_MANY_DATA43 #from data_manager import DataManager 38 39 from sans.guiframe.events import EVT_STATUS 40 from sans.guiframe.events import EVT_ADD_MANY_DATA 41 from sans.guiframe.events import StatusEvent 42 from sans.guiframe.events import NewPlotEvent 43 44 44 45 45 STATE_FILE_EXT = ['.inv', '.fitv', '.prv'] 46 46 47 47 DATA_MANAGER = False 48 AUTO_PLOT = False 49 AUTO_SET_DATA = True 48 50 49 51 class ViewerFrame(wx.Frame): … … 51 53 Main application frame 52 54 """ 53 def __init__(self, parent, id, title, window_height=300, window_width=300): 55 56 def __init__(self, parent, id, title, 57 window_height=300, window_width=300): 54 58 """ 55 59 Initialize the Frame object … … 81 85 self.app_manager = None 82 86 self._mgr = None 87 #data manager 88 from .data_manager import DataManager 89 self.data_manager = DataManager() 90 #add current perpsective 91 self._current_perspective = None 92 #file menu 83 93 self.file_menu = None 84 94 … … 104 114 # Default locations 105 115 self._default_save_location = os.getcwd() 106 116 107 117 # Welcome panel 108 118 self.defaultPanel = None … … 111 121 # Check for update 112 122 #self._check_update(None) 113 ## maximum number of opened files' paths to store114 self.n_maxfileopen = 2115 ## number of file open116 self.n_fileOpen = 0117 ## list of path of open files118 self.filePathList = []119 ## list of open file with name form menu120 #self._saveOpenData()121 ## Dictionary of open file where keys are filename and122 # values are number of copy of data plotted123 ## using the same loaded file124 self.indice_load_data = {}125 123 # Register the close event so it calls our own method 126 124 wx.EVT_CLOSE(self, self._onClose) … … 188 186 for item in self.plugins: 189 187 if plugin.__class__ == item.__class__: 190 #print "Plugin %s already loaded" % plugin.__class__.__name__ 188 msg = "Plugin %s already loaded" % plugin.__class__.__name__ 189 logging.info(msg) 191 190 is_loaded = True 192 191 if not is_loaded: … … 227 226 module = imp.load_module( name, file, item, info) 228 227 if hasattr(module, "PLUGIN_ID"): 229 try: 230 plugins.append(module.Plugin()) 228 try: 229 plug = module.Plugin() 230 if plug.set_default_perspective(): 231 self._current_perspective = plug 232 plugins.append(plug) 231 233 msg = "Found plug-in: %s" % module.PLUGIN_ID 232 234 logging.info(msg) … … 387 389 for plugin in self.plugins: 388 390 if len(plugin.populate_file_menu()) > 0: 389 390 391 for item in plugin.populate_file_menu(): 392 id = wx.NewId() 391 393 m_name, m_hint, m_handler = item 392 id = wx.NewId()393 394 self.filemenu.Append(id, m_name, m_hint) 394 395 wx.EVT_MENU(self, id, m_handler) … … 407 408 self._populate_file_menu() 408 409 id = wx.NewId() 409 self.filemenu.Append(id, '&Save ',410 'Save project as a San aView (svs) file')410 self.filemenu.Append(id, '&Save state into File', 411 'Save project as a SansView (svs) file') 411 412 wx.EVT_MENU(self, id, self._on_save) 412 413 #self.filemenu.AppendSeparator() … … 600 601 self._mgr.GetPane(self.panels["default"].window_name).IsShown(): 601 602 self.on_close_welcome_panel() 602 603 603 604 604 def _on_save(self, event): … … 697 697 flag = self.quit_guiframe() 698 698 if flag: 699 #import sys700 699 wx.Frame.Close(self) 701 700 wx.Exit() … … 762 761 dialog.ShowModal() 763 762 764 def _onreloaFile(self, event):765 """766 load a data previously opened767 """768 from .data_loader import plot_data769 for item in self.filePathList:770 id, _, path, _ = item771 if id == event.GetId():772 if path and os.path.isfile(path):773 plot_data(self, path)774 break775 776 763 def set_manager(self, manager): 777 764 """ … … 803 790 if item.set_default_perspective(): 804 791 item.on_perspective(event=None) 792 self._current_perspective = item 805 793 return 806 794 807 795 def set_perspective(self, panels): 808 796 """ … … 813 801 :param panels: list of panels 814 802 """ 803 815 804 for item in self.panels: 816 805 # Check whether this is a sticky panel … … 842 831 pass 843 832 return path 833 834 def add_data(self, data_list): 835 """ 836 receive a list of data . store them its data manager if possible 837 determine if data was be plot of send to data perspectives 838 """ 839 self.data_manager.add_data(data_list) 840 if AUTO_SET_DATA: 841 if self._current_perspective is not None: 842 try: 843 self._current_perspective.set_data(data_list) 844 except: 845 raise 846 #msg = str(sys.exc_value) 847 #wx.PostEvent(self, StatusEvent(status=msg, 848 # info="error")) 849 else: 850 msg = "Guiframe does not have a current perspective" 851 logging.info(msg) 852 if DATA_MANAGER: 853 print "will show data panel" 854 if AUTO_PLOT: 855 self.plot_data(data_list) 856 857 def plot_data(self, data_list): 858 """ 859 send a list of data to plot 860 """ 861 for new_plot in data_list: 862 wx.PostEvent(self, NewPlotEvent(plot=new_plot, 863 title=str(new_plot.title))) 864 865 def set_current_perspective(self, perspective): 866 """ 867 set the current active perspective 868 """ 869 self._current_perspective = perspective 844 870 845 871 class DefaultPanel(wx.Panel): -
guiframe/gui_style.py
rb7c7a1c rf444b20 8 8 DATAMANAGER = True 9 9 10 DEFAUL_GUIFRAME = LOADING | PLOTTING|DATAMANAGER -
guiframe/local_perspectives/data_loader/data_loader.py
rb70caa1 rf444b20 3 3 plugin DataLoader responsible of loading data 4 4 """ 5 import os 6 import sys 7 import wx 5 8 9 from DataLoader.loader import Loader 10 import DataLoader.data_info as DataInfo 6 11 from sans.guiframe.plugin_base import PluginBase 12 from sans.guiframe.events import StatusEvent 13 from sans.guiframe.events import NewPlotEvent 14 from sans.guiframe.dataFitting import Data1D 15 from sans.guiframe.dataFitting import Data2D 16 from sans.guiframe.utils import parse_name 17 18 STATE_FILE_EXT = ['P(r) files (*.prv)|*.prv', 19 'P(r) files (*.sav)|*.sav', 20 'P(r) files (*.svs)|*.svs', 21 'Fitting files (*.fitv)|*.fitv', 22 'Fitting files (*.svs)|*.svs', 23 'Invariant files (*.inv)|*.inv', 24 'Invariant files (*.svs)|*.svs'] 25 EXTENSIONS = ['.svs', '.prv', '.inv', '.fitv'] 7 26 8 27 class Plugin(PluginBase): 9 28 10 29 def __init__(self, standalone=False): 11 PluginBase.__init__(self, name="DataLaoder", standalone=standalone) 12 30 PluginBase.__init__(self, name="DataLoader", standalone=standalone) 31 #Default location 32 self._default_save_location = None 33 self.data_name_dict = {} 34 self.loader = Loader() 35 36 def populate_menu(self, id, owner): 37 """ 38 Create a menu for the Data plug-in 39 40 :param id: id to create a menu 41 :param owner: owner of menu 42 43 :return: list of information to populate the main menu 44 45 """ 46 #Menu for data loader 47 self.menu = wx.Menu() 48 #menu for data files 49 data_file_id = wx.NewId() 50 data_file_hint = "load one or more data in the application" 51 self.menu.Append(data_file_id, 52 '&Load Data File(s)', data_file_hint) 53 wx.EVT_MENU(owner, data_file_id, self._load_data) 54 #menu for data from folder 55 data_folder_id = wx.NewId() 56 data_folder_hint = "load multiple data in the application" 57 self.menu.Append(data_folder_id, 58 '&Load Data Folder', data_folder_hint) 59 wx.EVT_MENU(owner, data_folder_id, self._load_folder) 60 #create menubar items 61 return [(id, self.menu, "Data")] 62 13 63 def populate_file_menu(self): 14 64 """ … … 16 66 add load file menu item and load folder item 17 67 """ 18 hint_load_folder = "Read file(s) from a folder and load" 19 hint_load_folder += " them into the application" 20 hint_load_file = "Read files and load them into the application" 21 return [["Load File", hint_load_file, self.parent._on_open]] 22 #["Load File", hint_load_file, self._load_file], 23 #["Load Folder", hint_load_folder ,self._load_folder]] 68 69 hint_load_file = "Read state's files and load them into the application" 70 return [["Open State from File", hint_load_file, self._load_file]] 24 71 72 def _load_data(self, event): 73 """ 74 Load data 75 """ 76 flag = True 77 file_list = self.choose_data_file(flag) 78 if not file_list or file_list[0] is None: 79 return 80 self.get_data(file_list, flag=flag) 81 25 82 def _load_file(self, event): 26 83 """ 27 Load file(s) 28 """ 84 Load sansview defined files 85 """ 86 flag = False 87 file_list = self.choose_data_file(flag) 88 if not file_list or file_list[0] is None: 89 return 90 self.get_data(file_list, flag=flag) 91 29 92 def _load_folder(self, event): 30 93 """ 31 94 Load entire folder 32 95 """ 33 96 flag = True 97 path = self.choose_data_folder(flag) 98 if path is None: 99 return 100 file_list = self.get_file_path(path) 101 self.get_data(file_list, flag=flag) 102 103 def get_wild_card(self, flag=True): 104 """ 105 :param flag: is True load only data file, else load state file 106 return wild cards 107 """ 108 if flag: 109 cards = self.loader.get_wildcards() 110 for item in STATE_FILE_EXT: 111 if item in cards: 112 cards.remove(item) 113 else: 114 cards = STATE_FILE_EXT 115 return '|'.join(cards) 116 117 118 def choose_data_file(self, flag=True): 119 """ 120 Open the file dialog to load file(s) 121 """ 122 path = None 123 if self._default_save_location == None: 124 self._default_save_location = os.getcwd() 125 126 cards = self.loader.get_wildcards() 127 wlist = self.get_wild_card(flag) 128 if flag: 129 style = wx.OPEN|wx.FD_MULTIPLE 130 else: 131 style = wx.OPEN|wx.FD_DEFAULT_STYLE 132 133 dlg = wx.FileDialog(self.parent, 134 "Choose a file", 135 self._default_save_location, "", 136 wlist, 137 style=style) 138 if dlg.ShowModal() == wx.ID_OK: 139 path = dlg.GetPaths() 140 if len(path) >= 0 and not(path[0]is None): 141 self._default_save_location = os.path.dirname(path[0]) 142 dlg.Destroy() 143 return path 144 145 def choose_data_folder(self, flag=True): 146 """ 147 :param flag: is True load only data file, else load state file 148 return a list of folder to read 149 """ 150 path = None 151 if self._default_save_location == None: 152 self._default_save_location = os.getcwd() 153 154 wlist = self.get_wild_card(flag) 155 156 dlg = wx.DirDialog(self.parent, "Choose a directory", 157 self._default_save_location, 158 style=wx.DD_DEFAULT_STYLE) 159 if dlg.ShowModal() == wx.ID_OK: 160 path = dlg.GetPath() 161 self._default_save_location = path 162 dlg.Destroy() 163 return path 164 165 def load_error(self, error=None): 166 """ 167 Pop up an error message. 168 169 :param error: details error message to be displayed 170 """ 171 message = "The data file you selected could not be loaded.\n" 172 message += "Make sure the content of your file" 173 message += " is properly formatted.\n\n" 174 175 if error is not None: 176 message += "When contacting the DANSE team, mention the" 177 message += " following:\n%s" % str(error) 178 dial = wx.MessageDialog(self.parent, message, 'Error Loading File', 179 wx.OK | wx.ICON_EXCLAMATION) 180 dial.ShowModal() 181 182 def get_file_path(self, path): 183 """ 184 Receive a list containing folder then return a list of file 185 """ 186 if os.path.isdir(path): 187 return [os.path.join(os.path.abspath(path), 188 file) for file in os.listdir(path)] 189 190 def get_data(self, path, format=None, flag=True): 191 """ 192 """ 193 message = "" 194 output = [] 195 error_message = "" 196 for p_file in path: 197 basename = os.path.basename(p_file) 198 root, extension = os.path.splitext(basename) 199 if flag: 200 if extension.lower() in EXTENSIONS: 201 error_message = "Cannot load: %s\n" % str(p_file) 202 error_message += "Try File -> open ...." 203 continue 204 else: 205 if extension.lower() not in EXTENSIONS: 206 error_message = "Cannot load: %s\n" % str(p_file) 207 error_message += "Try Data -> Load ...." 208 continue 209 try: 210 temp = self.loader.load(p_file) 211 if temp.__class__.__name__ == "list": 212 for item in temp: 213 data = self.create_data(item, p_file) 214 output.append(data) 215 else: 216 data = self.create_data(temp, p_file) 217 output.append(data) 218 message = "Loading ..." + str(p_file) + "\n" 219 self.load_update(output=output, message=message) 220 except: 221 error_message = "Error while loading: %s\n" % str(p_file) 222 error_message += str(sys.exc_value) + "\n" 223 self.load_update(output=output, message=error_message) 224 225 message = "Loading Complete!" 226 self.load_complete(output=output, error_message=error_message, 227 message=message, path=path) 228 229 230 def old_get_data(self, path, format=None, flag=True): 231 """ 232 :param flag: is True load only data file, else load state file 233 Receive a list of file paths and return a list of Data objects 234 """ 235 from .load_thread import DataReader 236 message = "Start Loading \n" 237 wx.PostEvent(self.parent, StatusEvent(status=message, 238 info="info", type="progress")) 239 calc_load = DataReader(loader=self.loader, 240 path=path, 241 flag=flag, 242 transform_data=self.create_data, 243 updatefn=self.load_update, 244 completefn=self.load_complete) 245 calc_load.queue() 246 247 def load_update(self, output=None, message=""): 248 """ 249 print update on the status bar 250 """ 251 if message != "": 252 wx.PostEvent(self.parent, StatusEvent(status=message, 253 type="progress", 254 info="warning")) 255 256 def load_complete(self, output, message="", error_message="", path=None): 257 """ 258 post message to status bar and return list of data 259 """ 260 wx.PostEvent(self.parent, StatusEvent(status=message, 261 info="warning", 262 type="stop")) 263 self.parent.add_data(output) 264 if error_message != "": 265 self.load_error(error_message) 266 267 def create_data(self, data, path): 268 """ 269 Receive data from loader and create a data to use for guiframe 270 """ 271 272 if issubclass(DataInfo.Data2D, data.__class__): 273 new_plot = Data2D(image=None, err_image=None) 274 else: 275 new_plot = Data1D(x=[], y=[], dx=None, dy=None) 276 277 new_plot.copy_from_datainfo(data) 278 data.clone_without_data(clone=new_plot) 279 #creating a name for data 280 name = "" 281 title = "" 282 file_name = "" 283 if path is not None: 284 file_name = os.path.basename(path) 285 if data.run: 286 name = data.run[0] 287 if name == "": 288 name = file_name 289 ## name of the data allow to differentiate data when plotted 290 name = parse_name(name=name, expression="_") 291 292 max_char = name.find("[") 293 if max_char < 0: 294 max_char = len(name) 295 name = name[0:max_char] 296 297 if name not in self.data_name_dict: 298 self.data_name_dict[name] = 0 299 else: 300 self.data_name_dict[name] += 1 301 name = name + " [" + str(self.data_name_dict[name]) + "]" 302 #find title 303 if data.title.strip(): 304 title = data.title 305 if title.strip() == "": 306 title = file_name 307 308 if new_plot.filename.strip() == "": 309 new_plot.filename = file_name 310 311 new_plot.name = name 312 new_plot.title = title 313 ## allow to highlight data when plotted 314 new_plot.interactive = True 315 ## when 2 data have the same id override the 1 st plotted 316 new_plot.id = name 317 ##group_id specify on which panel to plot this data 318 new_plot.group_id = name 319 new_plot.is_data = True 320 new_plot.path = path 321 ##post data to plot 322 # plot data 323 return new_plot 324 325 -
guiframe/local_perspectives/data_loader/load_thread.py
rb70caa1 rf444b20 2 2 import time 3 3 import sys 4 import os 4 5 5 6 from data_util.calcthread import CalcThread 6 7 7 8 9 EXTENSIONS = ['.svs', '.prv', '.inv', '.fitv'] 8 10 9 11 class DataReader(CalcThread): … … 12 14 """ 13 15 def __init__(self, path, loader, 16 flag=True, 17 transform_data=None, 14 18 completefn=None, 15 19 updatefn = None, … … 21 25 yieldtime, 22 26 worktime) 27 self.load_state_flag = flag 28 self.transform_data = transform_data 23 29 self.list_path = path 24 30 #Instantiate a loader … … 46 52 error_message = "" 47 53 for path in self.list_path: 54 basename = os.path.basename(path) 55 root, extension = os.path.splitext(basename) 56 if self.load_state_flag: 57 if extension.lower() in EXTENSIONS: 58 pass 59 else: 60 if extension.lower() not in EXTENSIONS: 61 pass 48 62 try: 49 63 temp = self.loader.load(path) 50 64 elapsed = time.time() - self.starttime 51 65 if temp.__class__.__name__ == "list": 52 output += temp 66 for item in temp: 67 data = self.transform_data(item, path) 68 output.append(data) 53 69 else: 54 output.append(temp) 70 data = self.transform_data(temp, path) 71 output.append(data) 55 72 message = "Loading ..." + str(path) + "\n" 56 73 if self.updatefn is not None: -
guiframe/local_perspectives/plotting/plotting.py
rb7c7a1c rf444b20 14 14 import wx 15 15 import sys 16 from sans.gui comm.events import EVT_NEW_PLOT17 from sans.gui comm.events import StatusEvent16 from sans.guiframe.events import EVT_NEW_PLOT 17 from sans.guiframe.events import StatusEvent 18 18 19 19 from sans.guiframe.plugin_base import PluginBase -
guiframe/plugin_base.py
rb7c7a1c rf444b20 144 144 145 145 """ 146 self.parent.set_current_perspective(self) 146 147 self.parent.set_perspective(self.perspective) 147 148 … … 159 160 default perspective setting 160 161 """ 162 if self.standalone: 163 return True 161 164 return False 165 166 def set_data(self, data_list): 167 """ 168 receive a list of data and use it in the current perspective 169 """ -
guiframe/setup.py
r8db3904 rf444b20 9 9 import os 10 10 import sys 11 11 if len(sys.argv) == 1: 12 sys.argv.append('install') 12 13 13 14 path = os.path.join(os.getcwd(), 'local_perspectives') -
guiframe/statusbar.py
rb5ca223 rf444b20 1 1 import wx 2 2 from wx import StatusBar as wxStatusB 3 import wx.lib 4 #from wx.lib import newevent 5 (MessageEvent, EVT_MESSAGE) = wx.lib.newevent.NewEvent() 3 from wx.lib import newevent 4 (MessageEvent, EVT_MESSAGE) = newevent.NewEvent() 6 5 #numner of fields of the status bar 7 6 NB_FIELDS = 4 … … 254 253 if type.lower() == "progress": 255 254 self.nb_progress += 1 256 self.timer.Start( 0)255 self.timer.Start(1) 257 256 self.gauge.Pulse() 258 257 if type.lower() == "update": -
guiframe/utils.py
r32c0841 rf444b20 5 5 import re 6 6 7 def parse_name(name, expression): 8 """ 9 remove "_" in front of a name 10 """ 11 if re.match(expression, name) is not None: 12 word = re.split(expression, name, 1) 13 for item in word: 14 if item.lstrip().rstrip() != '': 15 return item 16 else: 17 return name 7 18 def format_number(value, high=False): 8 19 """
Note: See TracChangeset
for help on using the changeset viewer.