Example #1
0
def start():
    """Starts the GUI for the experiment using the config file specified as system argument.
    """
    args = sys.argv[1:]
    if len(args) != 1:
        print(help_message)
        return

    from PythonForTheLab.Model.experiment.IV_measurement import Experiment
    from PythonForTheLab.View.start import start_gui

    experiment = Experiment()
    experiment.load_config(args[0])
    experiment.load_daq()
    start_gui(experiment)
Example #2
0
        self.portLine.setText('{}'.format(experiment.properties['Monitor']['channel']))
        self.timeResolutionLine.setText(experiment.properties['Monitor']['time_resolution'])
        self.refreshTimeLine.setText(experiment.properties['Monitor']['refresh_time'])
        self.totalTimeLine.setText(experiment.properties['Monitor']['total_time'])

    def apply_new_values(self):
        """Formats the values in the form and emits a custom signal *propertiesChanged* including a
        dictionary of the values that are provided (changed or not).
        """
        new_values = {'port_monitor': int(self.portLine.text()),
                      'time_resolution': Q_(self.timeResolutionLine.text()),
                      'refresh_time': Q_(self.refreshTimeLine.text()),
                      'total_time': Q_(self.totalTimeLine.text()),}
        self.propertiesChanged.emit(new_values)

if __name__ == "__main__":
    import sys
    from PyQt5.Qt import QApplication
    ap = QApplication(sys.argv)
    from PythonForTheLab.Model.experiment.IV_measurement import Experiment
    e = Experiment()
    session = {'port_monitor': 1,
               'time_resolution': Q_('1ms'),
               'refresh_time': Q_('20ms'),
               'total_time': Q_('15s')}
    e.properties = session

    m = ConfigWindow(e)
    m.show()
    ap.exit(ap.exec_())