diff --git a/src/MissionManager/CameraSection.cc b/src/MissionManager/CameraSection.cc index 6a1c55134d4b6678ab9b1cca30bf9649b636ef32..55c6bc05d7eb94f2d57b34bc45fffcb0c28127b6 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)