mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-22 08:36:33 +00:00
Prevent GimbalServer from being set available
Added check to not allow GimbalServer to become available after setting allow camera commands to false.
This commit is contained in:
@@ -92,7 +92,10 @@ void AiEngineGimbalServer::zoomToAiTargetSlot(AiEngineCameraTarget target)
|
|||||||
// Allow calls
|
// Allow calls
|
||||||
int delay4 = delay3 + 3000; // Adjust this value as needed
|
int delay4 = delay3 + 3000; // Adjust this value as needed
|
||||||
QTimer::singleShot(delay4, this, [this]() {
|
QTimer::singleShot(delay4, this, [this]() {
|
||||||
|
// Only make camera available for commands if it is allowed
|
||||||
|
if (mActions.getAllowCameraCommands() == true) {
|
||||||
mIsAvailable = true;
|
mIsAvailable = true;
|
||||||
|
}
|
||||||
qDebug() << "Is available: " << mIsAvailable;
|
qDebug() << "Is available: " << mIsAvailable;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -372,6 +372,12 @@ void AiEngineGimbalServerActions::goToInitialOrientation(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool AiEngineGimbalServerActions::getAllowCameraCommands(void)
|
||||||
|
{
|
||||||
|
return mAllowCameraCommands;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void AiEngineGimbalServerActions::setAllowCameraCommands(bool allow)
|
void AiEngineGimbalServerActions::setAllowCameraCommands(bool allow)
|
||||||
{
|
{
|
||||||
mAllowCameraCommands = allow;
|
mAllowCameraCommands = allow;
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public slots:
|
|||||||
void getLocation(AiEngineDronePosition dronePosition, int targetIndex);
|
void getLocation(AiEngineDronePosition dronePosition, int targetIndex);
|
||||||
void restoreOrientationAndZoom(AiEngineGimbalStatus gimbalStatus);
|
void restoreOrientationAndZoom(AiEngineGimbalStatus gimbalStatus);
|
||||||
void goToInitialOrientation(void);
|
void goToInitialOrientation(void);
|
||||||
|
bool getAllowCameraCommands(void);
|
||||||
void setAllowCameraCommands(bool allow);
|
void setAllowCameraCommands(bool allow);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|||||||
Reference in New Issue
Block a user