From 5f6bc76399c92ac9b57bb3e72ef56d3763f07b2d Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Tue, 19 Nov 2019 19:23:07 -0800 Subject: [PATCH] Fix gimbal pitch/yaw signalling --- src/MissionManager/CameraSection.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/MissionManager/CameraSection.cc b/src/MissionManager/CameraSection.cc index 6a1c55134..55c6bc05d 100644 --- a/src/MissionManager/CameraSection.cc +++ b/src/MissionManager/CameraSection.cc @@ -67,8 +67,6 @@ CameraSection::CameraSection(Vehicle* vehicle, QObject* parent) connect(this, &CameraSection::specifyGimbalChanged, this, &CameraSection::_setDirty); connect(this, &CameraSection::specifyCameraModeChanged, this, &CameraSection::_setDirty); - connect(this, &CameraSection::specifyGimbalChanged, this, &CameraSection::_updateSpecifiedGimbalYaw); - connect(this, &CameraSection::specifyGimbalChanged, this, &CameraSection::_updateSpecifiedGimbalPitch); connect(&_gimbalYawFact, &Fact::valueChanged, this, &CameraSection::_updateSpecifiedGimbalYaw); connect(&_gimbalPitchFact, &Fact::valueChanged, this, &CameraSection::_updateSpecifiedGimbalPitch); } @@ -78,6 +76,8 @@ void CameraSection::setSpecifyGimbal(bool specifyGimbal) if (specifyGimbal != _specifyGimbal) { _specifyGimbal = specifyGimbal; emit specifyGimbalChanged(specifyGimbal); + emit specifiedGimbalYawChanged(specifiedGimbalYaw()); + emit specifiedGimbalPitchChanged(specifiedGimbalPitch()); } } @@ -543,7 +543,9 @@ double CameraSection::specifiedGimbalPitch(void) const void CameraSection::_updateSpecifiedGimbalYaw(void) { - emit specifiedGimbalYawChanged(specifiedGimbalYaw()); + if (_specifyGimbal) { + emit specifiedGimbalYawChanged(specifiedGimbalYaw()); + } } void CameraSection::_updateSpecifiedGimbalPitch(void) -- 2.22.0