mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-11 01:54:14 +01:00
Merge branch 'nosave_while_armed' into revo
This commit is contained in:
commit
42501d6312
@ -216,8 +216,19 @@ static void objectUpdatedCb(UAVObjEvent * ev)
|
|||||||
ObjectPersistenceGet(&objper);
|
ObjectPersistenceGet(&objper);
|
||||||
|
|
||||||
int retval = 1;
|
int retval = 1;
|
||||||
// Execute action
|
FlightStatusData flightStatus;
|
||||||
if (objper.Operation == OBJECTPERSISTENCE_OPERATION_LOAD) {
|
FlightStatusGet(&flightStatus);
|
||||||
|
|
||||||
|
// When this is called because of this method don't do anything
|
||||||
|
if (objper.Operation == OBJECTPERSISTENCE_OPERATION_ERROR ||
|
||||||
|
objper.Operation == OBJECTPERSISTENCE_OPERATION_COMPLETED) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execute action if disarmed
|
||||||
|
if(flightStatus.Armed != FLIGHTSTATUS_ARMED_DISARMED) {
|
||||||
|
retval = -1;
|
||||||
|
} else if (objper.Operation == OBJECTPERSISTENCE_OPERATION_LOAD) {
|
||||||
if (objper.Selection == OBJECTPERSISTENCE_SELECTION_SINGLEOBJECT) {
|
if (objper.Selection == OBJECTPERSISTENCE_SELECTION_SINGLEOBJECT) {
|
||||||
// Get selected object
|
// Get selected object
|
||||||
obj = UAVObjGetByID(objper.ObjectID);
|
obj = UAVObjGetByID(objper.ObjectID);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user