Exemplo n.º 1
0
    def __init__(self):
        super(TestApp, self).__init__()
        # Form plotnames
        self.plots_l = ['signal1', 'signal2']
        self.plots_r = ['aux_signal1']

        self.plotter = DataPlotter(self.plots_l,
                                   right_plotlist=self.plots_r,
                                   parent=self,
                                   left_log=True,
                                   title='Awesome plots',
                                   yaxis_left_label='Log sine, cos',
                                   yaxis_right_label='Noisy line',
                                   xaxis_label='Time since start [s]',
                                   legend='right',
                                   left_thickness=[2, 8],
                                   right_thickness=6,
                                   left_colors=['firebrick', 'darkolivegreen'],
                                   right_colors=['darksalmon'])

        hbox = QtGui.QHBoxLayout()
        hbox.addWidget(self.plotter.plot)
        self.setLayout(hbox)
        self.setGeometry(5, 5, 500, 500)

        self.start = time.time()
        QtCore.QTimer.singleShot(10, self.main)
Exemplo n.º 2
0
    def __init__(self, temp_control_comp):
        super(SimplePlot, self).__init__()
        self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        self.sock.settimeout(0.5)

        self.tcc = temp_control_comp

        # Set up the user interface from Designer.
        self.gui = Ui_temp_control()
        self.gui.setupUi(self)

        # Init local variables
        self.scale = 1E-8
        self.active = False
        self.start = None
        self.ramp_start = 0
        self.ramp = {}
        self.ramp['time'] = {}
        self.ramp['temp'] = {}
        self.ramp['step'] = {}
        # Set up plot (using pretty much all the possible options)
        self.plots_l = ['temperature', 'setpoint']
        self.plots_r = ['dutycycle']
        self.plotter = DataPlotter(self.plots_l,
                                   right_plotlist=self.plots_r,
                                   parent=self,
                                   left_log=False,
                                   title='Temperature control',
                                   yaxis_left_label='Temperature',
                                   yaxis_right_label='Dutycycle',
                                   xaxis_label='Time since start [s]',
                                   legend='right',
                                   left_thickness=[2, 3],
                                   right_thickness=2,
                                   left_colors=['firebrick', 'darkolivegreen'],
                                   right_colors=['darksalmon'])
        self.gui.horizontalLayout.removeWidget(self.gui.place_holder_qwt)
        self.gui.place_holder_qwt.setParent(None)
        self.gui.horizontalLayout.addWidget(self.plotter.plot)

        # Connect signals
        QtCore.QObject.connect(self.gui.start_ramp_button,
                               QtCore.SIGNAL('clicked()'), self.on_start_ramp)
        QtCore.QObject.connect(self.gui.stop_ramp_button,
                               QtCore.SIGNAL('clicked()'), self.on_stop_ramp)
        QtCore.QObject.connect(self.gui.start_button,
                               QtCore.SIGNAL('clicked()'), self.on_start)
        QtCore.QObject.connect(self.gui.stop_button,
                               QtCore.SIGNAL('clicked()'), self.on_stop)
        QtCore.QObject.connect(self.gui.quit_button,
                               QtCore.SIGNAL('clicked()'),
                               QtCore.QCoreApplication.instance().quit)
        QtCore.QObject.connect(self.gui.new_setpoint,
                               QtCore.SIGNAL('returnPressed()'),
                               self.update_setpoint)
Exemplo n.º 3
0
    def __init__(self, sputtergun):
        super(SimplePlot, self).__init__()

        self.sputtergun = sputtergun

        # Set up the user interface from Designer.
        self.gui = Ui_Specs()
        self.gui.setupUi(self)

        # Init local variables
        self.scale = 1E-8
        self.active = False
        self.start = None
        self.plot_length = 200

        # Set up plot (using pretty much all the possible options)
        self.plots_l = ['filament_current', 'emission_current']
        self.plots_r = ['sputter_current']
        self.plotter = DataPlotter(self.plots_l,
                                   right_plotlist=self.plots_r,
                                   parent=self,
                                   left_log=False,
                                   title='Ion Gun Data',
                                   yaxis_left_label='Currents',
                                   yaxis_right_label='Noisy line',
                                   xaxis_label='Time since start [s]',
                                   legend='right',
                                   left_thickness=[2, 8],
                                   right_thickness=6,
                                   left_colors=['firebrick', 'darkolivegreen'],
                                   right_colors=['darksalmon'])
        self.gui.horizontalLayout.removeWidget(self.gui.place_holder_qwt)
        self.gui.place_holder_qwt.setParent(None)
        self.gui.horizontalLayout.addWidget(self.plotter.plot)

        # Connect signals
        QtCore.QObject.connect(self.gui.operate_button,
                               QtCore.SIGNAL('clicked()'), self.on_operate)
        QtCore.QObject.connect(self.gui.standby_button,
                               QtCore.SIGNAL('clicked()'), self.on_standby)
        QtCore.QObject.connect(self.gui.start_button,
                               QtCore.SIGNAL('clicked()'), self.on_start)
        QtCore.QObject.connect(self.gui.stop_button,
                               QtCore.SIGNAL('clicked()'), self.on_stop)
        QtCore.QObject.connect(self.gui.quit_button,
                               QtCore.SIGNAL('clicked()'),
                               QtCore.QCoreApplication.instance().quit)
Exemplo n.º 4
0
    def __init__(self):
        super(SimplePlot, self).__init__()

        # Set up the user interface from Designer.
        self.gui = Ui_PlotTest()
        self.gui.setupUi(self)

        # Init local variables
        self.scale = 1E-8
        self.active = False
        self.start = None
        self.plot_length = 20

        # Set up plot (using pretty much all the possible options)
        self.plots_l = ['signal1', 'signal2']
        self.plots_r = ['aux_signal1']
        self.plotter = DataPlotter(
            self.plots_l, right_plotlist=self.plots_r, parent=self,
            left_log=True, title='Awesome plots',
            yaxis_left_label='Log sine, cos', yaxis_right_label='Noisy line',
            xaxis_label='Time since start [s]',
            legend='right', left_thickness=[2, 8], right_thickness=6,
            left_colors=['firebrick', 'darkolivegreen'],
            right_colors=['darksalmon'])
        self.gui.horizontalLayout.addWidget(self.plotter.plot)
        # Make the content scale with the Window
        self.setLayout(self.gui.horizontalLayout)

        # Connect signals
        QtCore.QObject.connect(self.gui.start_button,
                               QtCore.SIGNAL('clicked()'),
                               self.on_start)
        QtCore.QObject.connect(self.gui.stop_button,
                               QtCore.SIGNAL('clicked()'),
                               self.on_stop)
        QtCore.QObject.connect(self.gui.scale_spinbutton,
                               QtCore.SIGNAL('valueChanged(int)'),
                               self.on_scale)
        QtCore.QObject.connect(self.gui.quit_button,
                               QtCore.SIGNAL('clicked()'),
                               QtCore.QCoreApplication.instance().quit)