Пример #1
0
	def __init__(
			self, parent, top_mass_spec=None, bottom_mass_spec=None,
			top_label='', bottom_label='', id=wx.ID_ANY,
			pos=wx.DefaultPosition, size=wx.DefaultSize,
			style=0, name="Head2TailSpectrumPanel",
			):
		"""
		:param parent: The parent window.
		:type parent: wx.Window
		:param top_mass_spec: The Mass Spectrum to plot in the top half of the panel,
			or None for two-stage plotting
		:type top_mass_spec: :class:`pyms.Spectrum.MassSpectrum` or None
		:param bottom_mass_spec: The Mass Spectrum to plot in the bottom half of the panel,
			or None for two-stage plotting
		:type bottom_mass_spec: :class:`pyms.Spectrum.MassSpectrum` or None
		:param top_label: A label for the spectrum in the top half of the panel
		:type top_label: str, optional
		:param bottom_label: A label for the spectrum in the bottom half of the panel
		:type bottom_label: str, optional
		: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
		"""
		
		fig = Figure()
		ax = fig.add_subplot(111, projection="XPanAxes")  # 1x1 grid, first subplot
		
		ChartPanelBase.__init__(self, parent, fig, ax, id, pos, size, style, name)
		
		pub.subscribe(self.view_mode_changed, "view_mode_changed")
		
		self.constrain_zoom("x")
		
		self.top_mass_spec = None
		self.bottom_mass_spec = None
		self.top_label = None
		self.bottom_label = None
		self.all_masses = None
		self.legend = None
		self.plotted = False
		
		if top_mass_spec and bottom_mass_spec:
			self.plot_head2tail(top_mass_spec, bottom_mass_spec, top_label, bottom_label)
Пример #2
0
    def __init__(
        self,
        experiment,
        parent,
        id=wx.ID_ANY,
        pos=wx.DefaultPosition,
        size=wx.DefaultSize,
        style=0,
        name="ChromatogramPanel",
    ):
        """
		:param experiment:
		:type experiment:
		:param parent: The parent window.
		:type parent: wx.Window
		: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.experiment = experiment

        fig = Figure()
        ax = fig.add_subplot(111,
                             projection="XPanAxes")  # 1x1 grid, first subplot

        ChartPanelBase.__init__(self, parent, fig, ax, id, pos, size, style,
                                name)

        pub.subscribe(self.view_mode_changed, "view_mode_changed")

        self.display()
        self._view_spectrum_enabled = False