diff --git a/src/gui/__pycache__/settings_window.cpython-310.pyc b/src/gui/__pycache__/settings_window.cpython-310.pyc index 2621f25..ee28745 100644 Binary files a/src/gui/__pycache__/settings_window.cpython-310.pyc and b/src/gui/__pycache__/settings_window.cpython-310.pyc differ diff --git a/src/gui/settings_window.py b/src/gui/settings_window.py index 30040f9..3e97925 100644 --- a/src/gui/settings_window.py +++ b/src/gui/settings_window.py @@ -10,7 +10,7 @@ from utils.json_tools import read_json, write_json from utils import qt_settings as qts class settingsWindow(QWidget): - def __init__(self, path: str, name: str, upd_func: Callable[[], None]): + def __init__(self, path: str, name: str, upd_func: Callable[[], None], names: dict): """ Окно настроек для редактирования параметров. :param path: Путь к файлу настроек (JSON). @@ -25,6 +25,7 @@ class settingsWindow(QWidget): self._num_points: Optional[QLineEdit] = None self._param_table: Optional[QTableWidget] = None + self._assosiated_names = names self.load_settings() self._init_ui() @@ -92,7 +93,8 @@ class settingsWindow(QWidget): column_count = len(self._data[first_key]) self._param_table.setRowCount(len(self._data)) self._param_table.setColumnCount(column_count) - self._param_table.setVerticalHeaderLabels(self._data.keys()) + headers = [self._assosiated_names[key] for key in self._data.keys()] + self._param_table.setVerticalHeaderLabels(headers) int_delegate = ValidatorDelegate(data_type='int', parent=self._param_table) float_delegate = ValidatorDelegate(data_type='float', parent=self._param_table) @@ -180,13 +182,58 @@ class settingsWindow(QWidget): class SystemSettings(settingsWindow): def __init__(self, path, name, upd_func): - super().__init__(path, name, upd_func) + assosiated_names = { + "trace_storage_path": "trace path", + "monitor_update_period": "Monitoring period", + "a_max_1": "Max lin accel FE, m/s^2", + "v_max_1": "Max lin speed FE, m/s", + "a_max_2":"Max lin accel ME, m/s^2", + "v_max_2": "Max lin speed FE, m/s", + "mass_1": "Mass FE, kg", + "mass_2": "Mass ME, kg", + "k_hardness_1": "Hardness coef FE, N/m", + "k_hardness_2": "Hardness coef ME, N/m", + "torque_max_1": "Max torque FE, N*m", + "torque_max_2": "Max torque ME, N*m", + "transmission_ratio_1": "Transmission ratio FE", + "transmission_ratio_2": "Transmission ratio ME", + "contact_distance_1": "Contact distance FE, m", + "contact_distance_2": "Contact distance ME, m", + "k_prop": "Proportionality factor", + "time_capture": "Calculated points per sec", + "UML_time_scaler": "UML_time_scaler", + "Range ME, mm": "Range ME, mm" + } + super().__init__(path, name, upd_func, assosiated_names) self._num_points.setVisible(False) def _expand(self): pass class OperatorSettings(settingsWindow): + def __init__(self, path, name, upd_func): + assosiated_names = { + "distance_h_start_1": "Closing start dist FE, m" , + "distance_h_start_2": "Closing start dist ME, m", + "distance_s_1": "Rob movement start dist FE, m", + "distance_s_2": "Rob movement start dist ME, m", + "distance_l_1": "Max oncoming dist FE, m", + "distance_l_2": "Max oncoming dist ME, m", + "distance_h_end1": "Oncoming end dist FE, m", + "distance_h_end2": "Oncoming end dist FE, m", + "time_wielding": "Time of welding, sec", + "time_command": "Communication time compensator, sec", + "time_robot_movement": "Rob movement time, sec", + "object_thickness": "Workpiece thickness, m", + "force_target": "Target force, N", + "force_capture": "Capture force, N", + "Tesla closing": "Client closing time, sec", + "Tesla squeeze": "Client squeeze time, sec", + "Tesla welding": "Client welding time, sec", + "Tesla oncomming_relief": "Client moving to next point time, sec", + "Tesla summary time": "Client summary time, sec" + } + super().__init__(path, name, upd_func, assosiated_names) pass