From accc17fc68089083a285b7ee173e216b1634b119 Mon Sep 17 00:00:00 2001
From: Olek Bojda
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 @@