Ejemplo n.º 1
0
    def __init__(self, parent=None):
        """Set up the ui."""
        uifile = _utils.get_ui_file(self)
        config = _configuration.AdvancedOptions()
        super().__init__(uifile, config, parent=parent)

        self.sb_names = [
            'motor_driver_address',
            'integrator_encoder_resolution',
            'integration_trigger',
            'integration_nr_turns',
            'coil_turns',
            'temperature_nr_readings',
        ]

        self.sbd_names = [
            'motor_velocity',
            'motor_acceleration',
            'coil_radius',
            'coil_distance_center',
            'temperature_reading_frequency',
        ]

        self.cmb_names = [
            'motor_rotation_direction',
            'motor_resolution',
            'integrator_channel',
            'integrator_encoder_direction',
            'integration_points',
        ]

        self.connect_signal_slots()
        self.load_last_db_entry()
    def __init__(self, parent=None):
        """Set up the ui."""
        super().__init__(parent)

        # setup the ui
        uifile = _utils.get_ui_file(self)
        self.ui = _uic.loadUi(uifile, self)

        self._table_object_dict = {
            self._connection_table_name: _ConnectionConfig,
            self._advanced_options_table_name: _AdvancedOptions,
            self._configuration_table_name: _MeasurementConfig,
            self._measurement_table_name: _MeasurementData,
            }

        self._table_page_dict = {}
        for key in self._table_object_dict.keys():
            self._table_page_dict[key] = None
        self._table_page_dict[
            self._measurement_table_name] = self.ui.pg_helmholtz_measurement

        self.short_version_hidden_tables = [
            self._connection_table_name,
            self._advanced_options_table_name,
            self._configuration_table_name,
        ]

        self.twg_database = _databasewidgets.DatabaseTabWidget(
            database_name=self.database_name,
            mongo=self.mongo, server=self.server, max_str_size=100)
        self.ui.lyt_database.addWidget(self.twg_database)

        self.connect_signal_slots()
        self.disable_invalid_buttons()
        self.configure_gui_visualization()
Ejemplo n.º 3
0
    def __init__(self, parent=None):
        """Set up the ui."""
        uifile = _utils.get_ui_file(self)
        config = _configuration.MeasurementConfig()
        super().__init__(uifile, config, parent=parent)

        self.le_names = [
            'block_name',
        ]

        self.te_names = [
            'comments',
        ]

        self.sbd_names = [
            'block_temperature',
            'block_volume',
            'block_dimension1',
            'block_dimension2',
            'block_dimension3',
            'block_mass_A',
            'block_mass_B',
            'density',
        ]

        self.cmb_names = [
            'gain_position_1',
            'gain_position_2',
        ]

        self.chb_names = [
            'measure_position_1',
            'measure_position_2',
        ]

        self.connect_signal_slots()
        self.load_last_db_entry()
        self.update_volume()

        self.stop = False
        self.block_volume = None
        self.offset_position_1 = None
        self.offset_position_2 = None
        self.integrated_voltage = []
        self.integrated_voltage_position_1 = []
        self.integrated_voltage_position_2 = []
        self.graph_position_1 = []
        self.graph_position_2 = []
        self.measurement_data = _measurement.MeasurementData()
        self.measurement_error_count = 0
        self.mx_list = []
        self.my_list = []
        self.mz_list = []

        self.legend = _pyqtgraph.LegendItem(offset=(70, 30))
        self.legend.setParentItem(self.ui.pw_graph.graphicsItem())
        self.legend.setAutoFillBackground(1)

        self.configure_gui_visualization()
 def __init__(self, parent=None):
     """Set up the ui."""
     super().__init__(parent)
     uifile = _utils.get_ui_file(self)
     self.ui = _uic.loadUi(uifile, self)
     self.connect_signal_slots()
     self.scan_parameter = None
     self.scan_values = []
     self.scan_count = 0
Ejemplo n.º 5
0
    def __init__(self, parent=None):
        """Set up the ui."""
        super().__init__(parent)
        uifile = _utils.get_ui_file(self)
        self.ui = _uic.loadUi(uifile, self)
        self.connect_signal_slots()
        self.stop = True
        self.stop_encoder_update = True
        self.timer = _QTimer()
        self.timer.timeout.connect(self.update_encoder_reading)

        self.configure_gui_visualization()
Ejemplo n.º 6
0
    def __init__(self, parent=None):
        """Set up the ui."""
        uifile = _utils.get_ui_file(self)
        config = _configuration.ConnectionConfig()
        super().__init__(uifile, config, parent=parent)

        self.sb_names = [
            'display_bytesize',
            'driver_bytesize',
            'multimeter_bytesize',
            'balance_bytesize',
            'integrator_address',
            'integrator_board',
        ]

        self.cmb_names = [
            'display_port',
            'display_baudrate',
            'display_parity',
            'display_stopbits',
            'driver_port',
            'driver_baudrate',
            'driver_parity',
            'driver_stopbits',
            'multimeter_port',
            'multimeter_baudrate',
            'multimeter_parity',
            'multimeter_stopbits',
            'balance_port',
            'balance_baudrate',
            'balance_parity',
            'balance_stopbits',
        ]

        self.chb_names = [
            'display_enable',
            'driver_enable',
            'multimeter_enable',
            'integrator_enable',
            'balance_enable',
        ]

        self.connect_signal_slots()
        self.update_serial_ports()
        self.load_last_db_entry()
        self.configure_gui_visualization()
    def __init__(self, parent=None):
        """Set up the ui."""
        super().__init__(parent)
        uifile = _utils.get_ui_file(self)
        self.ui = _uic.loadUi(uifile, self)

        self.graph_1 = None
        self.graph_2 = None
        self.trigger_avg = None
        self.trigger_list = []
        self.mx_list_1 = []
        self.mx_list_2 = []

        self.graph_linewidth = _utils.PLOT_LINE_WIDTH
        self.graph_symbolsize = _utils.PLOT_MARKER_SIZE
        self.graph_fontsize = _utils.PLOT_FONT_SIZE
        self.graph_label_style = {
            'font-size': '{0:d}px'.format(self.graph_fontsize)
        }
        self.graph_font = _QFont()
        self.graph_font.setPixelSize(self.graph_fontsize)

        self.connect_signal_slots()
        self.configure_gui_visualization()
Ejemplo n.º 8
0
 def __init__(self, parent=None):
     """Set up the ui."""
     super().__init__(parent)
     uifile = _utils.get_ui_file(self)
     self.ui = _uic.loadUi(uifile, self)
Ejemplo n.º 9
0
    def __init__(self, parent=None):
        """Set up the ui and create connections."""
        super().__init__(parent)

        uifile = _utils.get_ui_file(self)
        self.ui = _uic.loadUi(uifile, self)

        self.measurement_list = []
        self.measurement_idns = []
        self.integration_trigger_list = []
        self.integration_points_list = []
        self.integration_nr_turns_list = []
        self.motor_velocity_list = []
        self.motor_acceleration_list = []
        self.volume_list = []
        self.temperature_list = []
        self.mx = []
        self.my = []
        self.mz = []
        self.mnorm = []
        self.std_mx = []
        self.std_my = []
        self.std_mz = []
        self.std_mnorm = [] 
        self.graph_mx = None
        self.graph_my = None
        self.graph_mz = None
        self.graph_mnorm = None
        self.xmin_line = None
        self.xmax_line = None
        self.graph_vol = None
        self.graph_temp = None
        self.graph_iv_1 = None
        self.graph_iv_2 = None
        self.max_nr_tunrs = 10

        # Plot parameters
        self.graph_linewidth = _utils.PLOT_LINE_WIDTH
        self.graph_symbolsize = _utils.PLOT_MARKER_SIZE
        self.graph_fontsize = _utils.PLOT_FONT_SIZE
        self.graph_label_style = {
            'font-size': '{0:d}px'.format(self.graph_fontsize)}
        self.graph_font = _QFont()
        self.graph_font.setPixelSize(self.graph_fontsize)

        # Create legends
        self.legend_mag = _pyqtgraph.LegendItem(offset=(70, 30))
        self.legend_mag.setParentItem(self.ui.pw_graph_mag.graphicsItem())
        self.legend_mag.setAutoFillBackground(1)
        self.legend_mag_items = []

        self.legend_iv = _pyqtgraph.LegendItem(offset=(70, 30))
        self.legend_iv.setParentItem(self.ui.pw_graph_iv_1.graphicsItem())
        self.legend_iv.setAutoFillBackground(1)
        self.legend_iv_items = []

        # Add combo box
        self.cmb_idns = _CheckableComboBox()
        self.ui.hlt_select_ids.addWidget(self.cmb_idns)

        self.connect_signal_slots()
Ejemplo n.º 10
0
    def __init__(self,
                 parent=None,
                 width=_utils.WINDOW_WIDTH,
                 height=_utils.WINDOW_HEIGHT):
        """Set up the ui and add main tabs."""
        super().__init__(parent)

        # setup the ui
        uifile = _utils.get_ui_file(self)
        self.ui = _uic.loadUi(uifile, self)
        self.resize(width, height)

        # clear the current tabs
        self.ui.twg_main.clear()

        # define tab names and corresponding widgets
        if _utils.TRANSLATE:
            self.tab_names = [
                'conexao',
                'temperatura',
                'motor_e_integrador',
                'medida',
                'posicionamento_do_bloco',
                'banco_de_dados',
            ]

        else:
            self.tab_names = [
                'connection',
                'temperature',
                'motor_and_integrator',
                'measurement',
                'block_position',
                'database',
            ]

        self.tab_widgets = [
            _ConnectionWidget,
            _TemperatureWidget,
            _MotorIntegratorWidget,
            _MeasurementWidget,
            _BlockPositionWidget,
            _DatabaseWidget,
        ]

        # add select tabs dialog
        self.select_tabs_dialog = _SelectTabsDialog(self.tab_names)
        for tab_name in self.tab_names:
            chb = getattr(self.select_tabs_dialog, 'chb_' + tab_name)
            chb.setChecked(True)

        self.select_tabs_dialog.tab_selection_changed.connect(self.change_tabs)

        self.log_dialog = _LogDialog()

        # show database name
        self.ui.le_database.setText(self.database_name)

        # connect signals and slots
        self.select_tabs_dialog.emit_tab_selection_signal()
        self.connect_signal_slots()

        self.configure_gui_visualization()