Пример #1
0
	def on_new_experiment(self, event):  # wxGlade: _WelcomeDialog.<event_handler>
		# if hasattr(self, "new_experiment_dialog"):
		# 	# Already open
		# 	self.new_experiment_dialog.SetFocus()
		# else:
		self.new_experiment_dialog = Experiment.NewExperimentDialog(self, wx.ID_ANY)
		self.new_experiment_dialog.ShowModal()
    def add_ident_tab(self):
        if self.notebook.GetPageIndex(self.ident_panel) != wx.NOT_FOUND:
            # Tab already exists
            return

        self.ident_panel = Experiment.SinglePeakIdentificationPanel(
            self, self.project.experiment_objects)
        self.notebook.AddPage(self.ident_panel, "Single Peak", select=True)
Пример #3
0
	def export_pdf(self, input_filename, output_filename):
		Experiment.SinglePeakCompoundsPDFExporter(
				self.selected_peak,
				self.peak_list,
				self.expr_names,
				input_filename=input_filename,
				output_filename=output_filename,
				)
    def add_ident_tab(self):
        if self.notebook.GetPageIndex(self.ident_panel) != wx.NOT_FOUND:
            # Tab already exists
            return

        self.ident_panel = Experiment.IdentificationPanel(
            self, self.experiment.ident_peaks)
        self.notebook.AddPage(self.ident_panel, "Compounds", select=True)
Пример #5
0
 def on_new_experiment(self, _):
     # TODO: check to see if dialog is already open
     # if hasattr(self, "new_experiment_dialog"):
     # 	# Already open
     # 	self.new_experiment_dialog.SetFocus()
     # else:
     self.new_experiment_dialog = Experiment.NewExperimentDialog(
         self, wx.ID_ANY)
     self.new_experiment_dialog.Show()
Пример #6
0
    def on_new_experiment(self,
                          _):  # wxGlade: NewProjectDialog.<event_handler>
        with Experiment.NewExperimentDialog(self, wx.ID_ANY) as dlg:
            print(dlg.ShowModal())

            for expr_filename in dlg.filenames:
                # if expr_filename in self.experiment_list:
                if expr_filename in self.project.experiment_file_list:
                    self.flag_duplicate(expr_filename)
                    continue
                # self.experiment_list.append(expr_filename)
                self.project.add_experiment(expr_filename)

            self.update_expr_list()
Пример #7
0
 def on_new_experiment_multiple(self, _):
     # TODO: check to see if dialog is already open
     Experiment.MultipleExperimentsDialog(self, wx.ID_ANY).Show()
Пример #8
0
    def __init__(self,
                 parent,
                 project,
                 id=wx.ID_ANY,
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 style=0,
                 name="ProjectDataPanel"):
        """
		:param parent: The parent window.
		:type parent: wx.Window
		:param project:
		:type project:
		:param id: An identifier for the panel. wx.ID_ANY is taken to mean a default.
		:type id: wx.WindowID, optional
		:param pos: The panel position. The value wx.DefaultPosition indicates a default position, chosen by either the windowing system or wxWidgets, depending on platform.
		:type pos: wx.Point, optional
		:param size: The panel size. The value wx.DefaultSize indicates a default size, chosen by either the windowing system or wxWidgets, depending on platform.
		:type size: wx.Size, optional
		:param style: The window style. See wxPanel.
		:type style: int, optional
		:param name: Window name.
		:type name: str, optional
		"""

        self.project = project

        ProjExprPanelBase.__init__(self,
                                   parent,
                                   id=id,
                                   pos=pos,
                                   size=size,
                                   style=style | wx.TAB_TRAVERSAL,
                                   name=name)

        self.project_info = Project.ProjectInfoPanel(self, self.project,
                                                     self.notebook, wx.ID_ANY)
        self.notebook.AddPage(self.project_info, "Project Info")

        # Make tabs
        self.method_tab = None
        self.make_method_tab()

        self.project_ammo = None
        self.make_ammo_tab()

        self.experiment_pages = {}

        # Add Experiments
        for experiment in self.project.experiment_objects:
            experiment_page = Experiment.ExperimentDataPanel(
                experiment, self.notebook, wx.ID_ANY)
            self.notebook.AddPage(experiment_page, experiment.name)
            self.experiment_pages[experiment.name] = experiment_page

        self.alignment_page = None
        if self.project.alignment_performed:
            self.create_alignment_page()

        # self.ident_panel = None
        # if any(experiment.identification_performed for experiment in self.project.experiment_objects):
        # 	self.add_ident_tab()

        self.compounds_tab = Project.CompoundsDataPanel(self)
        self.notebook.AddPage(self.compounds_tab, "Compounds")

        # self.consolidate_panel = None
        # if self.project.consolidate_performed:
        # 	self.add_consolidate_tab()

        for page_idx in range(self.notebook.PageCount):
            if self.notebook.GetPageText(page_idx) == "Project Info":
                self.notebook.SetSelection(page_idx)
                break
        else:
            self.notebook.SetSelection(0)

        self._bind_events()

        self.project._unsaved_changes = False
        self.project.ammo_details_unsaved = False
        self.project.method_unsaved = False
Пример #9
0
    def __init__(self,
                 parent,
                 mass_spec,
                 label='',
                 id=wx.ID_ANY,
                 title="Calibre Search",
                 pos=wx.DefaultPosition,
                 style=0,
                 name=wx.FrameNameStr):
        """
		:param parent: The window parent. This may be, and often is, None. If it is not None, the frame will be minimized when its parent is minimized and restored when it is restored (although it will still be possible to minimize
		:type parent: wx.Window
		:param mass_spec:
		:type mass_spec:
		:param label:
		:type label: str, optional
		:param id: The window identifier. It may take a value of -1 to indicate a default value.
		:type id: wx.WindowID, optional
		:param title: The caption to be displayed on the frame’s title bar.
		:type title: str, optional
		:param pos: The window position. The value DefaultPosition indicates a default position, chosen by either the windowing system or wxWidgets, depending on platform.
		:type pos: wx.Point, optional
		:param style: The window style. See wx.Frame class description.
		:type style: int, optional
		:param name: The name of the window. This parameter is used to associate a name with the item, allowing the application user to set Motif resource values for individual windows.
		:type name: str, optional
		"""

        args = (parent, id)
        kwds = {
            "pos": pos,
            "size": (1000, 600),
            "title": title,
            "style": style,
            "name": name,
        }

        # begin wxGlade: SpectrumFrame.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.SetSize((1000, 600))

        self.__set_properties()
        self.__do_layout()
        # end wxGlade

        self.menubar = SpectrumViewerMenu(self)
        self.SetMenuBar(self.menubar)

        self.SpectrumPanel = Experiment.SpectrumPanel(self, mass_spec)
        # self.SpectrumPanel2 = SpectrumPanel(self, None, wx.ID_ANY)

        self._mgr.AddPane(
            self.SpectrumPanel,
            aui.AuiPaneInfo().Name("Spectrum Panel").Caption(
                "Spectrum").CenterPane())
        # self._mgr.AddPane(
        # 		self.SpectrumPanel2,
        # 		aui.AuiPaneInfo().Name("Spectrum Panel2").Caption("Spectrum2").CloseButton(True).
        # 							MaximizeButton(True).Bottom().Layer(1).Position(1)
        # 		)

        self.toolbar.add_to_manager(self._mgr)

        self._mgr.Update()

        # self.Bind(wx.EVT_SIZE, self.size_change)
        # self.Bind(wx.EVT_MAXIMIZE, self.size_change)
        self.Bind(wx.EVT_CLOSE, self.OnClose)
 def make_tic_tab(self):
     self.experiment_tic = Experiment.ChromatogramPanel(
         self.experiment, self.notebook, wx.ID_ANY)
     self.notebook.AddPage(self.experiment_tic, "TIC")
 def export_peak_list_pdf(self, input_filename, output_filename):
     Experiment.PeakListPDFExporter(
         self.experiment,
         input_filename=input_filename,
         output_filename=output_filename,
     )
 def export_compounds_pdf(self, input_filename, output_filename):
     Experiment.CompoundsPDFExporter(
         self.experiment,
         input_filename=input_filename,
         output_filename=output_filename,
     )