From 889e1f5da2b4793c7f8297afeca0f078d2cb693d Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Tue, 16 May 2023 18:21:25 -0700 Subject: [PATCH] Finish wiring up SAM orientation control. The UI works beautifully, but that's not worth much if it doesn't actually change the data... Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2479. --- qt_ui/windows/groundobject/QGroundObjectMenu.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qt_ui/windows/groundobject/QGroundObjectMenu.py b/qt_ui/windows/groundobject/QGroundObjectMenu.py index bd94de27..3aea880a 100644 --- a/qt_ui/windows/groundobject/QGroundObjectMenu.py +++ b/qt_ui/windows/groundobject/QGroundObjectMenu.py @@ -163,8 +163,8 @@ class QGroundObjectMenu(QDialog): self.orientationBox = QGroupBox("Orientation :") self.orientationBoxLayout = QHBoxLayout() - heading_image = HeadingIndicator(self.ground_object.heading, self) - self.orientationBoxLayout.addWidget(heading_image) + self.heading_image = HeadingIndicator(self.ground_object.heading, self) + self.orientationBoxLayout.addWidget(self.heading_image) self.headingLabel = QLabel("Heading:") self.orientationBoxLayout.addWidget(self.headingLabel) self.headingSelector = QSpinBox() @@ -174,7 +174,7 @@ class QGroundObjectMenu(QDialog): self.headingSelector.setSingleStep(5) self.headingSelector.setValue(self.ground_object.heading.degrees) self.headingSelector.valueChanged.connect( - lambda degrees: heading_image.set_heading(Heading(degrees)) + lambda degrees: self.rotate_tgo(Heading(degrees)) ) self.orientationBoxLayout.addWidget(self.headingSelector) if self.cp.captured: @@ -184,7 +184,7 @@ class QGroundObjectMenu(QDialog): or self.ground_object.heading ) self.head_to_conflict_button.clicked.connect( - lambda: self.rotate_tgo(heading) + lambda: self.headingSelector.setValue(heading.degrees) ) self.orientationBoxLayout.addWidget(self.head_to_conflict_button) else: @@ -250,7 +250,7 @@ class QGroundObjectMenu(QDialog): def rotate_tgo(self, heading: Heading) -> None: self.ground_object.rotate(heading) - self.do_refresh_layout() + self.heading_image.set_heading(heading) def sell_all(self): self.update_total_value()