diff --git a/safety_user_plugin/launch/user_plugin.launch b/safety_user_plugin/launch/user_plugin.launch index c22fd76..4a14bf8 100644 --- a/safety_user_plugin/launch/user_plugin.launch +++ b/safety_user_plugin/launch/user_plugin.launch @@ -4,4 +4,12 @@ name="$(anon user_plugin)" args="--standalone safety_user_plugin" /> + + + + \ No newline at end of file diff --git a/safety_user_plugin/scripts/english.py b/safety_user_plugin/scripts/english.py index dee100f..e8af3d3 100644 --- a/safety_user_plugin/scripts/english.py +++ b/safety_user_plugin/scripts/english.py @@ -48,6 +48,18 @@ class EnglishTexts(LanguageTexts): connection_to_master_lost_text = 'Connection lost with masterSTOP. Ask the teacher to run it' + # Description labels + linear_text = '

Linear velocity

' + angular_text = '

Angular velocity

' + id_text = '

Robot ID

' + battery_text = '

Battery state

' + masterstop_text = '

Master Stop

' + obstacle_text = '

Obstacle Stop

' + robot_text = '

Robot state

' + restrictions_text = '

Restrictions

' + history_text = '

Message history

' + + def __init__(self): pass \ No newline at end of file diff --git a/safety_user_plugin/scripts/language.py b/safety_user_plugin/scripts/language.py index 199053a..63aceb6 100644 --- a/safety_user_plugin/scripts/language.py +++ b/safety_user_plugin/scripts/language.py @@ -44,5 +44,18 @@ class LanguageTexts: connection_to_master_lost_text = "Text not reimplemented!" + # Description labels + angular_text = "Text not reimplemented!" + linear_text = "Text not reimplemented!" + id_text = "Text not reimplemented!" + battery_text = "Text not reimplemented!" + masterstop_text = "Text not reimplemented!" + obstacle_text = "Text not reimplemented!" + robot_text = "Text not reimplemented!" + restrictions_text = "Text not reimplemented!" + history_text = "Text not reimplemented!" + + + def __init__(self): pass \ No newline at end of file diff --git a/safety_user_plugin/scripts/polish.py b/safety_user_plugin/scripts/polish.py index 39ba4ee..2348d57 100644 --- a/safety_user_plugin/scripts/polish.py +++ b/safety_user_plugin/scripts/polish.py @@ -38,7 +38,7 @@ class PolishTexts(LanguageTexts): obstacle_detected_text = 'Przeszkoda wykryta. Zatrzymuję robota' obstacle_removed_text = 'Przeszkoda usunięta' - + # Logger error/problem messages selection_error_text = 'Najpierw wybierz PIONIERA z listy robotów' cannot_start_masterstop_text = 'Nie można wystartować robota. MasterSTOP wciśnięty!' @@ -48,6 +48,16 @@ class PolishTexts(LanguageTexts): connection_to_master_lost_text = 'Utrata połączenia z masterstopem. Poproś prowadzącego o jego uruchomienie' + # Description labels + linear_text = '

Prędkość liniowa

' + angular_text = '

Prędkość obrotowa

' + id_text = '

ID robota

' + battery_text = '

Stan baterii

' + masterstop_text = '

Stop mastera

' + obstacle_text = '

Stop przeszkody

' + robot_text = '

Stan robota

' + restrictions_text = '

Ograniczenia

' + history_text = '

Historia komunikatów

' def __init__(self): pass \ No newline at end of file diff --git a/safety_user_plugin/scripts/qt_wrapper.py b/safety_user_plugin/scripts/qt_wrapper.py index 069115a..99bdc54 100644 --- a/safety_user_plugin/scripts/qt_wrapper.py +++ b/safety_user_plugin/scripts/qt_wrapper.py @@ -24,7 +24,16 @@ class QtWrapper: self.widget = widget self.displayed_robots_id_list = [] - self.language = ET + lang = rospy.get_param('lang') + + if lang == 'eng': + self.language = ET + self.log_info('Started english version of plugin') + elif lang == 'pol': + self.language = PT + self.log_info('Polska wersja pluginu uruchomiona') + else: + raise ValueError('language parameter has value different than "eng" or "pol"') self.clear_robot_info() @@ -67,6 +76,7 @@ class QtWrapper: else: method_with_argument = 'self.{0}({1})'.format(method_name,argument[0]) exec(method_with_argument) + def handle_stopButton_clicked(self): if self.robot_state == SS.RUNNING: @@ -300,7 +310,6 @@ class QtWrapper: scrollbar = self.widget.logsBrowser.verticalScrollBar() scrollbar.setValue(scrollbar.maximum()) - def clear_robot_info(self): self.widget.idLabel.setText('-') self.widget.batteryLabel.setText('-') @@ -317,3 +326,13 @@ class QtWrapper: self.widget.clutchButton.setText('-') self.widget.clutchButton.setStyleSheet("") + + self.widget.angularText.setText(self.language.angular_text) + self.widget.batteryText.setText(self.language.battery_text) + self.widget.idText.setText(self.language.id_text) + self.widget.linearText.setText(self.language.linear_text) + self.widget.masterStopText.setText(self.language.masterstop_text) + self.widget.obstacleText.setText(self.language.obstacle_text) + self.widget.robotText.setText(self.language.robot_text) + self.widget.historyLabel.setText(self.language.history_text) + self.widget.restrictionsLabel.setText(self.language.restrictions_text) \ No newline at end of file diff --git a/safety_user_plugin/ui/user_view.ui b/safety_user_plugin/ui/user_view.ui index a2fa262..fd526e6 100644 --- a/safety_user_plugin/ui/user_view.ui +++ b/safety_user_plugin/ui/user_view.ui @@ -80,49 +80,49 @@ QLayout::SetDefaultConstraint - + <html><head/><body><p align="center"><span style=" font-weight:600;">ID robota</span></p></body></html> - + <html><head/><body><p align="center"><span style=" font-weight:600;">Stan baterii</span></p></body></html> - + <html><head/><body><p align="center"><span style=" font-weight:600;">Predkosc liniowa</span></p></body></html> - + <html><head/><body><p align="center"><span style=" font-weight:600;">Predkosc obrotowa</span></p></body></html> - + <html><head/><body><p align="center"><span style=" font-weight:600;">Stan robota</span></p></body></html> - + <html><head/><body><p align="center"><span style=" font-weight:600;">Stop mastera</span></p></body></html> - + <html><head/><body><p align="center"><span style=" font-weight:600;">Stop przeszkody</span></p></body></html> @@ -258,7 +258,7 @@ - + <html><head/><body><p align="center"><span style=" font-weight:600;">Ograniczenia</span></p></body></html> @@ -338,7 +338,7 @@ - Zatrzymaj robota + - @@ -351,7 +351,7 @@ - Sprzeglo ON + - @@ -371,7 +371,7 @@ - + <html><head/><body><p align="center"><span style=" font-weight:600;">Histora komunikatów</span></p></body></html>