diff --git a/signage.repos b/signage.repos index 5cfc7b1..d54faf1 100644 --- a/signage.repos +++ b/signage.repos @@ -19,4 +19,3 @@ repositories: type: git url: https://github.com/tier4/boot_shutdown_tools.git version: main - \ No newline at end of file diff --git a/src/signage/resource/page/SlowStopView.qml b/src/signage/resource/page/SlowStopView.qml new file mode 100644 index 0000000..ce11ace --- /dev/null +++ b/src/signage/resource/page/SlowStopView.qml @@ -0,0 +1,41 @@ +import QtQuick 2.9 +import QtQuick.Controls 2.2 + +import "Common" + +Rectangle { + id: slowStopView + width: viewController.monitor_width + height: viewController.monitor_height + color: "#ffffff" + + CurrentTime { + id: displayCurrentTime + } + + Text { + id: slowStopText + color: "#000000" + text: qsTr("安全確認のため停車中です") + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.verticalCenter + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + font.pointSize: 80*viewController.size_ratio + font.bold: true + elide: Text.ElideMiddle + } + + Text { + id: slowStopEnText + color: "#000000" + text: qsTr("Stop for safety check") + anchors.top: slowStopText.bottom + anchors.horizontalCenter: parent.horizontalCenter + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + font.pointSize: 80*viewController.size_ratio + font.bold: true + elide: Text.ElideMiddle + } +} diff --git a/src/signage/resource/page/SlowingView.qml b/src/signage/resource/page/SlowingView.qml new file mode 100644 index 0000000..b5193fc --- /dev/null +++ b/src/signage/resource/page/SlowingView.qml @@ -0,0 +1,41 @@ +import QtQuick 2.9 +import QtQuick.Controls 2.2 + +import "Common" + +Rectangle { + id: slowingView + width: viewController.monitor_width + height: viewController.monitor_height + color: "#ffffff" + + CurrentTime { + id: displayCurrentTime + } + + Text { + id: slowingText + color: "#000000" + text: qsTr("減速します") + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.verticalCenter + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + font.pointSize: 80*viewController.size_ratio + font.bold: true + elide: Text.ElideMiddle + } + + Text { + id: slowingEnText + color: "#000000" + text: qsTr("Slowing Down") + anchors.top: slowingText.bottom + anchors.horizontalCenter: parent.horizontalCenter + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + font.pointSize: 80*viewController.size_ratio + font.bold: true + elide: Text.ElideMiddle + } +} diff --git a/src/signage/resource/page/main.qml b/src/signage/resource/page/main.qml index 8331ef3..5249bb5 100644 --- a/src/signage/resource/page/main.qml +++ b/src/signage/resource/page/main.qml @@ -19,6 +19,16 @@ Window { visible: viewController.view_mode === "emergency_stopped" } + SlowStopView { + id: slowStopView + visible: viewController.view_mode === "slow_stop" + } + + SlowingView { + id: slowingView + visible: viewController.view_mode === "slowing" + } + ManualDriving { id: manualDriving visible: viewController.view_mode === "manual_driving" diff --git a/src/signage/src/signage/route_handler.py b/src/signage/src/signage/route_handler.py index d740bd3..1aa7260 100644 --- a/src/signage/src/signage/route_handler.py +++ b/src/signage/src/signage/route_handler.py @@ -58,6 +58,8 @@ def __init__( self._prev_route_state = 0 self._skip_announce = False self._announce_engage = False + self._in_slow_stop_state = False + self._in_slowing_state = False self.process_station_list_from_fms() @@ -72,10 +74,17 @@ def emergency_checker_callback(self): if self._parameter.ignore_emergency: in_emergency = False else: - in_emergency = ( - self._autoware.information.mrm_behavior == MrmState.EMERGENCY_STOP - or self._autoware.information.mrm_behavior == MrmState.COMFORTABLE_STOP - ) + in_emergency = self._autoware.information.mrm_behavior == MrmState.EMERGENCY_STOP + + self._in_slowing_state = ( + self._autoware.information.mrm_behavior == MrmState.COMFORTABLE_STOP + and self._autoware.information.motion_state == MotionState.MOVING + ) + + self._in_slow_stop_state = ( + self._autoware.information.mrm_behavior == MrmState.COMFORTABLE_STOP + and self._autoware.information.motion_state == MotionState.STOPPED + ) if in_emergency and not self._in_emergency_state: self._announce_interface.announce_emergency("emergency") @@ -175,7 +184,7 @@ def process_station_list_from_fms(self, force_update=False): data.get("tags", []), ) - self.task_list = utils.seperate_task_list(data.get("tasks", [])) + self.task_list = utils.separate_task_list(data.get("tasks", [])) if not self.task_list.doing_list and not self.task_list.todo_list: self._schedule_details = utils.init_ScheduleDetails() @@ -192,11 +201,11 @@ def process_station_list_from_fms(self, force_update=False): self._display_details.previous_station = ["", ""] else: self._display_details.previous_station = ( - utils.get_prevous_station_name_from_fms(self.task_list.done_list) + utils.get_previous_station_name_from_fms(self.task_list.done_list) ) if self._display_details.previous_station == ["", ""] and self.task_list.done_list: - self._display_details.previous_station = utils.get_prevous_station_name_from_fms( + self._display_details.previous_station = utils.get_previous_station_name_from_fms( self.task_list.done_list ) @@ -360,6 +369,10 @@ def view_mode_callback(self): view_mode = "manual_driving" elif self._in_emergency_state: view_mode = "emergency_stopped" + elif self._in_slowing_state: + view_mode = "slowing" + elif self._in_slow_stop_state: + view_mode = "slow_stop" elif self._is_stopping and self._current_task_details.departure_station != ["", ""]: view_mode = "stopping" elif self._is_driving and self._current_task_details.arrival_station != ["", ""]: diff --git a/src/signage/src/signage/signage_utils.py b/src/signage/src/signage/signage_utils.py index fc1be90..2b95615 100644 --- a/src/signage/src/signage/signage_utils.py +++ b/src/signage/src/signage/signage_utils.py @@ -91,7 +91,7 @@ def get_route_name(tag_list): return split_name(route_name) -def seperate_task_list(task_list): +def separate_task_list(task_list): doing_list = [] todo_list = [] done_list = [] @@ -126,7 +126,7 @@ def process_current_task(task): return CurrentTask(departure_station, arrival_station, depart_time) -def get_prevous_station_name_from_fms(done_list): +def get_previous_station_name_from_fms(done_list): previous_station_task = done_list[PREVIOUS_STATION_INDEX] return split_name(previous_station_task.get("origin", "").get("name", DEFAULT_DEPARTURE_NAME))