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.
This commit is contained in:
Dan Albert 2023-05-16 18:21:25 -07:00 committed by Raffson
parent 4ca150198e
commit 5f65298728
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99

View File

@ -161,8 +161,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()
@ -172,7 +172,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:
@ -182,7 +182,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:
@ -248,7 +248,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()