def get_panels(self, parent): """ Create and return the list of wx.Panels for your plug-in. Define the plug-in perspective. Panels should inherit from DefaultPanel defined below, or should present the same interface. They must define "window_caption" and "window_name". :param parent: parent window :return: list of panels """ # # Save a reference to the parent self.parent = parent self.frame = MDIFrame(self.parent, None, 'None', (100, 200)) self.invariant_panel = InvariantPanel(parent=self.frame) self.frame.set_panel(self.invariant_panel) self._frame_set_helper() self.invariant_panel.set_manager(manager=self) self.perspective.append(self.invariant_panel.window_name) # Create reader when fitting panel are created self.state_reader = reader(self.set_state) # append that reader to list of available reader loader = Loader() loader.associate_file_reader(".inv", self.state_reader) # loader.associate_file_reader(".svs", self.state_reader) # Return the list of panels return [self.invariant_panel]
def __init__(self): PluginBase.__init__(self, name="Pr Inversion") ## Simulation window manager self.simview = None ## State data self.alpha = self.DEFAULT_ALPHA self.nfunc = self.DEFAULT_NFUNC self.max_length = self.DEFAULT_DMAX self.q_min = None self.q_max = None self.has_bck = False self.slit_height = 0 self.slit_width = 0 ## Remember last plottable processed self.last_data = "" self._current_file_data = None ## Time elapsed for last computation [sec] # Start with a good default self.elapsed = 0.022 self.iq_data_shown = False ## Current invertor self.invertor = None self.pr = None self.data_id = IQ_DATA_LABEL # Copy of the last result in case we need to display it. self._last_pr = None self._last_out = None self._last_cov = None ## Calculation thread self.calc_thread = None ## Estimation thread self.estimation_thread = None ## Result panel self.control_panel = None ## Currently views plottable self.current_plottable = None ## Number of P(r) points to display on the output plot self._pr_npts = 51 self._normalize_output = False self._scale_output_unity = False ## List of added P(r) plots self._added_plots = {} self._default_Iq = {} self.list_plot_id = [] # Associate the inversion state reader with .prv files from inversion_state import Reader # Create a CanSAS/Pr reader self.state_reader = Reader(self.set_state) self._extensions = '.prv' l = Loader() l.associate_file_reader('.prv', self.state_reader) #l.associate_file_reader(".svs", self.state_reader) # Log startup logging.info("Pr(r) plug-in started")
def get_panels(self, parent): """ Define the GUI panels """ self.parent = parent self.frame = MDIFrame(self.parent, None, 'None', (100,200)) self.data_id = IQ_DATA_LABEL self.corfunc_panel = CorfuncPanel(parent=self.frame) self.frame.set_panel(self.corfunc_panel) self.corfunc_panel.set_manager(self) self._frame_set_helper() self.perspective.append(self.corfunc_panel.window_name) l = Loader() l.associate_file_reader('.cor', self.state_reader) return [self.corfunc_panel]
def get_panels(self, parent): """ Define the GUI panels """ self.parent = parent self.frame = MDIFrame(self.parent, None, 'None', (100,200)) self.data_id = IQ_DATA_LABEL self.corfunc_panel = CorfuncPanel(parent=self.frame) self.frame.set_panel(self.corfunc_panel) self.corfunc_panel.set_manager(self) self._frame_set_helper() self.perspective.append(self.corfunc_panel.window_name) l = Loader() l.associate_file_reader('.crf', self.state_reader) return [self.corfunc_panel]