fix: Обработка параметров с учетом локали, позиционирование детали
This commit is contained in:
parent
64ced613dd
commit
9bac31c865
@ -1,306 +1,82 @@
|
|||||||
{
|
{
|
||||||
"distance_h_start_1": [
|
"distance_h_start_1": [
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
0.003,
|
||||||
0.003
|
0.003
|
||||||
],
|
],
|
||||||
"distance_h_start_2": [
|
"distance_h_start_2": [
|
||||||
0.005,
|
0.003,
|
||||||
0.005,
|
0.003
|
||||||
0.005,
|
|
||||||
0.005,
|
|
||||||
0.005,
|
|
||||||
0.005,
|
|
||||||
0.005,
|
|
||||||
0.005,
|
|
||||||
0.005,
|
|
||||||
0.005,
|
|
||||||
0.005,
|
|
||||||
0.005,
|
|
||||||
0.005,
|
|
||||||
0.005
|
|
||||||
],
|
],
|
||||||
"distance_s_1": [
|
"distance_s_1": [
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
0.001,
|
||||||
0.001
|
0.001
|
||||||
],
|
],
|
||||||
"distance_s_2": [
|
"distance_s_2": [
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
|
||||||
0.001,
|
0.001,
|
||||||
0.001
|
0.001
|
||||||
],
|
],
|
||||||
"distance_l_1": [
|
"distance_l_1": [
|
||||||
0.02,
|
|
||||||
0.02,
|
|
||||||
0.02,
|
|
||||||
0.02,
|
|
||||||
0.02,
|
|
||||||
0.02,
|
|
||||||
0.02,
|
|
||||||
0.02,
|
|
||||||
0.02,
|
|
||||||
0.02,
|
|
||||||
0.02,
|
|
||||||
0.02,
|
|
||||||
0.02,
|
0.02,
|
||||||
0.02
|
0.02
|
||||||
],
|
],
|
||||||
"distance_l_2": [
|
"distance_l_2": [
|
||||||
0.0275,
|
0.02,
|
||||||
0.0255,
|
0.02
|
||||||
0.0242,
|
|
||||||
0.0245,
|
|
||||||
0.0228,
|
|
||||||
0.0236,
|
|
||||||
0.0229,
|
|
||||||
0.0248,
|
|
||||||
0.024,
|
|
||||||
0.0235,
|
|
||||||
0.025,
|
|
||||||
0.0276,
|
|
||||||
0.0234,
|
|
||||||
0.0215
|
|
||||||
],
|
],
|
||||||
"distance_h_end1": [
|
"distance_h_end1": [
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
|
||||||
0.003,
|
0.003,
|
||||||
0.003
|
0.003
|
||||||
],
|
],
|
||||||
"distance_h_end2": [
|
"distance_h_end2": [
|
||||||
0.005,
|
0.003,
|
||||||
0.005,
|
0.003
|
||||||
0.005,
|
],
|
||||||
0.005,
|
"object_position": [
|
||||||
0.005,
|
0.03,
|
||||||
0.005,
|
0.03
|
||||||
0.005,
|
|
||||||
0.005,
|
|
||||||
0.005,
|
|
||||||
0.005,
|
|
||||||
0.005,
|
|
||||||
0.005,
|
|
||||||
0.005,
|
|
||||||
0.005
|
|
||||||
],
|
],
|
||||||
"time_wielding": [
|
"time_wielding": [
|
||||||
1.332,
|
1.332,
|
||||||
1.644,
|
1.644
|
||||||
1.644,
|
|
||||||
1.428,
|
|
||||||
1.284,
|
|
||||||
1.308,
|
|
||||||
1.272,
|
|
||||||
1.38,
|
|
||||||
1.416,
|
|
||||||
1.392,
|
|
||||||
1.38,
|
|
||||||
1.404,
|
|
||||||
1.452,
|
|
||||||
1.452
|
|
||||||
],
|
],
|
||||||
"time_command": [
|
"time_command": [
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0,
|
|
||||||
0.0,
|
0.0,
|
||||||
0.0
|
0.0
|
||||||
],
|
],
|
||||||
"time_robot_movement": [
|
"time_robot_movement": [
|
||||||
0.314,
|
0.314,
|
||||||
0.331,
|
0.331
|
||||||
0.356,
|
|
||||||
0.428,
|
|
||||||
0.418,
|
|
||||||
0.454,
|
|
||||||
0.458,
|
|
||||||
0.44,
|
|
||||||
0.49,
|
|
||||||
0.47,
|
|
||||||
0.44,
|
|
||||||
0.425,
|
|
||||||
0.464,
|
|
||||||
0.5
|
|
||||||
],
|
],
|
||||||
"object_thickness": [
|
"object_thickness": [
|
||||||
0.0045,
|
|
||||||
0.0045,
|
|
||||||
0.0045,
|
|
||||||
0.0045,
|
|
||||||
0.0045,
|
|
||||||
0.0045,
|
|
||||||
0.0045,
|
|
||||||
0.0045,
|
|
||||||
0.0045,
|
|
||||||
0.0045,
|
|
||||||
0.0045,
|
|
||||||
0.0045,
|
|
||||||
0.0045,
|
0.0045,
|
||||||
0.0045
|
0.0045
|
||||||
],
|
],
|
||||||
"force_target": [
|
"force_target": [
|
||||||
5000.0,
|
|
||||||
5000.0,
|
|
||||||
5000.0,
|
|
||||||
5000.0,
|
|
||||||
5000.0,
|
|
||||||
5000.0,
|
|
||||||
5000.0,
|
|
||||||
5000.0,
|
|
||||||
5000.0,
|
|
||||||
5000.0,
|
|
||||||
5000.0,
|
|
||||||
5000.0,
|
|
||||||
5000.0,
|
5000.0,
|
||||||
5000.0
|
5000.0
|
||||||
],
|
],
|
||||||
"force_capture": [
|
"force_capture": [
|
||||||
500.0,
|
|
||||||
500.0,
|
|
||||||
500.0,
|
|
||||||
500.0,
|
|
||||||
500.0,
|
|
||||||
500.0,
|
|
||||||
500.0,
|
|
||||||
500.0,
|
|
||||||
500.0,
|
|
||||||
500.0,
|
|
||||||
500.0,
|
|
||||||
500.0,
|
|
||||||
500.0,
|
500.0,
|
||||||
500.0
|
500.0
|
||||||
],
|
],
|
||||||
"Tesla closing": [
|
"Tesla closing": [
|
||||||
0.216,
|
0.216,
|
||||||
0.228,
|
0.228
|
||||||
0.252,
|
|
||||||
0.216,
|
|
||||||
0.228,
|
|
||||||
0.216,
|
|
||||||
0.228,
|
|
||||||
0.228,
|
|
||||||
0.228,
|
|
||||||
0.216,
|
|
||||||
0.228,
|
|
||||||
0.216,
|
|
||||||
0.216,
|
|
||||||
0.216
|
|
||||||
],
|
],
|
||||||
"Tesla squeeze": [
|
"Tesla squeeze": [
|
||||||
0.276,
|
0.276,
|
||||||
0.288,
|
0.288
|
||||||
0.264,
|
|
||||||
0.264,
|
|
||||||
0.276,
|
|
||||||
0.276,
|
|
||||||
0.312,
|
|
||||||
0.276,
|
|
||||||
0.24,
|
|
||||||
0.24,
|
|
||||||
0.24,
|
|
||||||
0.24,
|
|
||||||
0.24,
|
|
||||||
0.24
|
|
||||||
],
|
],
|
||||||
"Tesla welding": [
|
"Tesla welding": [
|
||||||
1.332,
|
1.332,
|
||||||
1.644,
|
1.644
|
||||||
1.644,
|
|
||||||
1.428,
|
|
||||||
1.284,
|
|
||||||
1.308,
|
|
||||||
1.272,
|
|
||||||
1.38,
|
|
||||||
1.416,
|
|
||||||
1.392,
|
|
||||||
1.38,
|
|
||||||
1.404,
|
|
||||||
1.452,
|
|
||||||
1.452
|
|
||||||
],
|
],
|
||||||
"Tesla oncomming_relief": [
|
"Tesla oncomming_relief": [
|
||||||
0.528,
|
0.528,
|
||||||
0.528,
|
0.528
|
||||||
0.54,
|
|
||||||
0.636,
|
|
||||||
0.504,
|
|
||||||
0.468,
|
|
||||||
0.492,
|
|
||||||
0.54,
|
|
||||||
0.563,
|
|
||||||
0.588,
|
|
||||||
0.541,
|
|
||||||
0.564,
|
|
||||||
0.576,
|
|
||||||
0.507
|
|
||||||
],
|
],
|
||||||
"Tesla summary time": [
|
"Tesla summary time": [
|
||||||
2.34,
|
2.34,
|
||||||
2.652,
|
2.652
|
||||||
2.796,
|
|
||||||
2.4,
|
|
||||||
2.208,
|
|
||||||
2.34,
|
|
||||||
2.256,
|
|
||||||
2.544,
|
|
||||||
2.405,
|
|
||||||
2.405,
|
|
||||||
2.358,
|
|
||||||
2.37,
|
|
||||||
2.442,
|
|
||||||
1.908
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -6,22 +6,22 @@
|
|||||||
1000.0
|
1000.0
|
||||||
],
|
],
|
||||||
"a_max_1": [
|
"a_max_1": [
|
||||||
7.96
|
10.0
|
||||||
],
|
],
|
||||||
"v_max_1": [
|
"v_max_1": [
|
||||||
0.499
|
0.3
|
||||||
],
|
],
|
||||||
"a_max_2": [
|
"a_max_2": [
|
||||||
35.81
|
10.0
|
||||||
],
|
],
|
||||||
"v_max_2": [
|
"v_max_2": [
|
||||||
0.75
|
0.3
|
||||||
],
|
],
|
||||||
"mass_1": [
|
"mass_1": [
|
||||||
270.0
|
270.0
|
||||||
],
|
],
|
||||||
"mass_2": [
|
"mass_2": [
|
||||||
1.0
|
270.0
|
||||||
],
|
],
|
||||||
"k_hardness_1": [
|
"k_hardness_1": [
|
||||||
2148570.0
|
2148570.0
|
||||||
@ -33,22 +33,22 @@
|
|||||||
13.8
|
13.8
|
||||||
],
|
],
|
||||||
"torque_max_2": [
|
"torque_max_2": [
|
||||||
0.0
|
13.8
|
||||||
],
|
],
|
||||||
"transmission_ratio_1": [
|
"transmission_ratio_1": [
|
||||||
0.00125
|
0.00125
|
||||||
],
|
],
|
||||||
"transmission_ratio_2": [
|
"transmission_ratio_2": [
|
||||||
1.0
|
0.00125
|
||||||
],
|
],
|
||||||
"contact_distance_1": [
|
"contact_distance_1": [
|
||||||
0.02
|
0.0
|
||||||
],
|
],
|
||||||
"contact_distance_2": [
|
"contact_distance_2": [
|
||||||
0.081
|
0.0
|
||||||
],
|
],
|
||||||
"k_prop": [
|
"k_prop": [
|
||||||
0.075
|
0.005
|
||||||
],
|
],
|
||||||
"time_capture": [
|
"time_capture": [
|
||||||
1000.0
|
1000.0
|
||||||
@ -57,6 +57,6 @@
|
|||||||
1000.0
|
1000.0
|
||||||
],
|
],
|
||||||
"Range ME, mm": [
|
"Range ME, mm": [
|
||||||
115.0
|
100.0
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ class PassportFormer(BasePointPassportFormer):
|
|||||||
}
|
}
|
||||||
params_list = [operator_settings, system_settings]
|
params_list = [operator_settings, system_settings]
|
||||||
cache_key = self._generate_cache_key(params_list)
|
cache_key = self._generate_cache_key(params_list)
|
||||||
if cache_key in self._ideal_data_cashe :
|
if cache_key in self._ideal_data_cashe and False:
|
||||||
ideal_data = self._ideal_data_cashe[cache_key]
|
ideal_data = self._ideal_data_cashe[cache_key]
|
||||||
else:
|
else:
|
||||||
ideal_data = self._build_ideal_data(idealDataBuilder=idealDataBuilder, params=params_list)
|
ideal_data = self._build_ideal_data(idealDataBuilder=idealDataBuilder, params=params_list)
|
||||||
@ -86,7 +86,7 @@ class PassportFormer(BasePointPassportFormer):
|
|||||||
else:
|
else:
|
||||||
point_timeframe, point_events = None, None
|
point_timeframe, point_events = None, None
|
||||||
useful_p_data = {"thickness": operator_settings["object_thickness"],
|
useful_p_data = {"thickness": operator_settings["object_thickness"],
|
||||||
"L2": operator_settings["distance_l_2"],
|
"L2": operator_settings["object_position"],
|
||||||
"force": operator_settings["force_target"]}
|
"force": operator_settings["force_target"]}
|
||||||
|
|
||||||
points_pocket.append([point_timeframe, ideal_data, point_events, useful_p_data])
|
points_pocket.append([point_timeframe, ideal_data, point_events, useful_p_data])
|
||||||
|
|||||||
@ -19,6 +19,7 @@ class MainWindow(BaseMainWindow):
|
|||||||
self._init_startUI()
|
self._init_startUI()
|
||||||
self._init_dock_widgets()
|
self._init_dock_widgets()
|
||||||
self._init_menu()
|
self._init_menu()
|
||||||
|
# self.setLocale()
|
||||||
|
|
||||||
|
|
||||||
def _init_TabWidget(self) -> None:
|
def _init_TabWidget(self) -> None:
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import locale
|
||||||
from typing import Callable, Optional, Any
|
from typing import Callable, Optional, Any
|
||||||
from PyQt5.QtWidgets import (QWidget, QPushButton,
|
from PyQt5.QtWidgets import (QWidget, QPushButton,
|
||||||
QLineEdit, QHBoxLayout,
|
QLineEdit, QHBoxLayout,
|
||||||
@ -5,6 +6,7 @@ from PyQt5.QtWidgets import (QWidget, QPushButton,
|
|||||||
QTableWidget, QTableWidgetItem,
|
QTableWidget, QTableWidgetItem,
|
||||||
QStyledItemDelegate)
|
QStyledItemDelegate)
|
||||||
from PyQt5.QtGui import QIntValidator, QDoubleValidator
|
from PyQt5.QtGui import QIntValidator, QDoubleValidator
|
||||||
|
from PyQt5 import QtCore
|
||||||
|
|
||||||
from utils.json_tools import read_json, write_json
|
from utils.json_tools import read_json, write_json
|
||||||
from utils import qt_settings as qts
|
from utils import qt_settings as qts
|
||||||
@ -185,14 +187,14 @@ class SystemSettings(settingsWindow):
|
|||||||
assosiated_names = {
|
assosiated_names = {
|
||||||
"trace_storage_path": "Trace path",
|
"trace_storage_path": "Trace path",
|
||||||
"monitor_update_period": "Monitoring period",
|
"monitor_update_period": "Monitoring period",
|
||||||
"a_max_1": "Max lin accel FE, m/s^2",
|
"a_max_1": "Max linear acceleration FE, m/s^2",
|
||||||
"v_max_1": "Max lin speed FE, m/s",
|
"v_max_1": "Max linear speed FE, m/s",
|
||||||
"a_max_2":"Max lin accel ME, m/s^2",
|
"a_max_2":"Max linear acceleration ME, m/s^2",
|
||||||
"v_max_2": "Max lin speed FE, m/s",
|
"v_max_2": "Max linear speed ME, m/s",
|
||||||
"mass_1": "Mass FE, kg",
|
"mass_1": "Mass FE, kg",
|
||||||
"mass_2": "Mass ME, kg",
|
"mass_2": "Mass ME, kg",
|
||||||
"k_hardness_1": "Hardness coef FE, N/m",
|
"k_hardness_1": "Hardness coefficient FE, N/m",
|
||||||
"k_hardness_2": "Hardness coef ME, N/m",
|
"k_hardness_2": "Hardness coefficient ME, N/m",
|
||||||
"torque_max_1": "Max torque FE, N*m",
|
"torque_max_1": "Max torque FE, N*m",
|
||||||
"torque_max_2": "Max torque ME, N*m",
|
"torque_max_2": "Max torque ME, N*m",
|
||||||
"transmission_ratio_1": "Transmission ratio FE",
|
"transmission_ratio_1": "Transmission ratio FE",
|
||||||
@ -215,8 +217,8 @@ class OperatorSettings(settingsWindow):
|
|||||||
assosiated_names = {
|
assosiated_names = {
|
||||||
"distance_h_start_1": "Closing start dist FE, m" ,
|
"distance_h_start_1": "Closing start dist FE, m" ,
|
||||||
"distance_h_start_2": "Closing start dist ME, m",
|
"distance_h_start_2": "Closing start dist ME, m",
|
||||||
"distance_s_1": "Rob movement start dist FE, m",
|
"distance_s_1": "Robot movement start dist FE, m",
|
||||||
"distance_s_2": "Rob movement start dist ME, m",
|
"distance_s_2": "Robot movement start dist ME, m",
|
||||||
"distance_l_1": "Max oncoming dist FE, m",
|
"distance_l_1": "Max oncoming dist FE, m",
|
||||||
"distance_l_2": "Max oncoming dist ME, m",
|
"distance_l_2": "Max oncoming dist ME, m",
|
||||||
"distance_h_end1": "Oncoming end dist FE, m",
|
"distance_h_end1": "Oncoming end dist FE, m",
|
||||||
@ -225,6 +227,7 @@ class OperatorSettings(settingsWindow):
|
|||||||
"time_command": "Communication time compensator, sec",
|
"time_command": "Communication time compensator, sec",
|
||||||
"time_robot_movement": "Rob movement time, sec",
|
"time_robot_movement": "Rob movement time, sec",
|
||||||
"object_thickness": "Workpiece thickness, m",
|
"object_thickness": "Workpiece thickness, m",
|
||||||
|
"object_position": "Workpiece position, m",
|
||||||
"force_target": "Target force, N",
|
"force_target": "Target force, N",
|
||||||
"force_capture": "Capture force, N",
|
"force_capture": "Capture force, N",
|
||||||
"Tesla closing": "Client closing time, sec",
|
"Tesla closing": "Client closing time, sec",
|
||||||
@ -246,6 +249,8 @@ class ValidatorDelegate(QStyledItemDelegate):
|
|||||||
elif self.data_type == 'float':
|
elif self.data_type == 'float':
|
||||||
self.validator = QDoubleValidator()
|
self.validator = QDoubleValidator()
|
||||||
self.validator.setNotation(QDoubleValidator.StandardNotation)
|
self.validator.setNotation(QDoubleValidator.StandardNotation)
|
||||||
|
self.validator.setLocale(QtCore.QLocale("en_US"))
|
||||||
|
# locale
|
||||||
else:
|
else:
|
||||||
self.validator = None
|
self.validator = None
|
||||||
|
|
||||||
@ -253,9 +258,16 @@ class ValidatorDelegate(QStyledItemDelegate):
|
|||||||
editor = QLineEdit(parent)
|
editor = QLineEdit(parent)
|
||||||
if self.validator:
|
if self.validator:
|
||||||
editor.setValidator(self.validator)
|
editor.setValidator(self.validator)
|
||||||
|
# Добавляем обработчик для замены запятой на точку
|
||||||
|
editor.textChanged.connect(self.replace_comma_with_dot)
|
||||||
return editor
|
return editor
|
||||||
|
|
||||||
|
def replace_comma_with_dot(self, text):
|
||||||
|
# Заменяем запятую на точку
|
||||||
|
if ',' in text:
|
||||||
|
text = text.replace(',', '.')
|
||||||
|
# Устанавливаем измененный текст обратно в редактор
|
||||||
|
self.sender().setText(text)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import pyqtgraph as pg
|
import pyqtgraph as pg
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user