mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
OP-1122 OP-1158 renamed FlightPlanInfo uavobject to FlightPlan
This commit is contained in:
parent
c8a81f88a4
commit
aa24f2193a
flight
modules/PathPlanner
targets/boards
ground/openpilotgcs/src/plugins
shared/uavobjectdefinition
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
#include "openpilot.h"
|
#include "openpilot.h"
|
||||||
|
|
||||||
#include "flightplaninfo.h"
|
#include "flightplan.h"
|
||||||
#include "flightstatus.h"
|
#include "flightstatus.h"
|
||||||
#include "airspeedstate.h"
|
#include "airspeedstate.h"
|
||||||
#include "pathaction.h"
|
#include "pathaction.h"
|
||||||
@ -100,7 +100,7 @@ int32_t PathPlannerInitialize()
|
|||||||
{
|
{
|
||||||
taskHandle = NULL;
|
taskHandle = NULL;
|
||||||
|
|
||||||
FlightPlanInfoInitialize();
|
FlightPlanInitialize();
|
||||||
PathActionInitialize();
|
PathActionInitialize();
|
||||||
PathStatusInitialize();
|
PathStatusInitialize();
|
||||||
PathDesiredInitialize();
|
PathDesiredInitialize();
|
||||||
@ -269,6 +269,8 @@ void updatePathDesired(__attribute__((unused)) UAVObjEvent *ev)
|
|||||||
static void setWaypoint(uint16_t num)
|
static void setWaypoint(uint16_t num)
|
||||||
{
|
{
|
||||||
// path plans wrap around
|
// path plans wrap around
|
||||||
|
|
||||||
|
// TODO change to FlightPlan.WaypointCount
|
||||||
if (num >= UAVObjGetNumInstances(WaypointHandle())) {
|
if (num >= UAVObjGetNumInstances(WaypointHandle())) {
|
||||||
num = 0;
|
num = 0;
|
||||||
}
|
}
|
||||||
@ -277,10 +279,10 @@ static void setWaypoint(uint16_t num)
|
|||||||
WaypointActiveSet(&waypointActive);
|
WaypointActiveSet(&waypointActive);
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute the apropriate condition and report result
|
// execute the appropriate condition and report result
|
||||||
static uint8_t pathConditionCheck()
|
static uint8_t pathConditionCheck()
|
||||||
{
|
{
|
||||||
// i thought about a lookup table, but a switch is saver considering there could be invalid EndCondition ID's
|
// i thought about a lookup table, but a switch is safer considering there could be invalid EndCondition ID's
|
||||||
switch (pathAction.EndCondition) {
|
switch (pathAction.EndCondition) {
|
||||||
case PATHACTION_ENDCONDITION_NONE:
|
case PATHACTION_ENDCONDITION_NONE:
|
||||||
return conditionNone();
|
return conditionNone();
|
||||||
|
@ -43,7 +43,7 @@ UAVOBJSRCFILENAMES += debuglogentry
|
|||||||
UAVOBJSRCFILENAMES += flightbatterysettings
|
UAVOBJSRCFILENAMES += flightbatterysettings
|
||||||
UAVOBJSRCFILENAMES += firmwareiapobj
|
UAVOBJSRCFILENAMES += firmwareiapobj
|
||||||
UAVOBJSRCFILENAMES += flightbatterystate
|
UAVOBJSRCFILENAMES += flightbatterystate
|
||||||
UAVOBJSRCFILENAMES += flightplaninfo
|
UAVOBJSRCFILENAMES += flightplan
|
||||||
UAVOBJSRCFILENAMES += flightplancontrol
|
UAVOBJSRCFILENAMES += flightplancontrol
|
||||||
UAVOBJSRCFILENAMES += flightplansettings
|
UAVOBJSRCFILENAMES += flightplansettings
|
||||||
UAVOBJSRCFILENAMES += flightplanstatus
|
UAVOBJSRCFILENAMES += flightplanstatus
|
||||||
|
@ -44,7 +44,7 @@ UAVOBJSRCFILENAMES += airspeedstate
|
|||||||
UAVOBJSRCFILENAMES += flightbatterysettings
|
UAVOBJSRCFILENAMES += flightbatterysettings
|
||||||
UAVOBJSRCFILENAMES += firmwareiapobj
|
UAVOBJSRCFILENAMES += firmwareiapobj
|
||||||
UAVOBJSRCFILENAMES += flightbatterystate
|
UAVOBJSRCFILENAMES += flightbatterystate
|
||||||
UAVOBJSRCFILENAMES += flightplaninfo
|
UAVOBJSRCFILENAMES += flightplan
|
||||||
UAVOBJSRCFILENAMES += flightplancontrol
|
UAVOBJSRCFILENAMES += flightplancontrol
|
||||||
UAVOBJSRCFILENAMES += flightplansettings
|
UAVOBJSRCFILENAMES += flightplansettings
|
||||||
UAVOBJSRCFILENAMES += flightplanstatus
|
UAVOBJSRCFILENAMES += flightplanstatus
|
||||||
|
@ -42,7 +42,7 @@ void ModelUavoProxy::sendFlightPlan()
|
|||||||
{
|
{
|
||||||
modelToObjects();
|
modelToObjects();
|
||||||
|
|
||||||
FlightPlanInfo *flightPlan = FlightPlanInfo::GetInstance(objMngr, 0);
|
FlightPlan *flightPlan = FlightPlan::GetInstance(objMngr, 0);
|
||||||
connect(flightPlan, SIGNAL(transactionCompleted(UAVObject *, bool)), this, SLOT(flightPlanElementSent(UAVObject *, bool)));
|
connect(flightPlan, SIGNAL(transactionCompleted(UAVObject *, bool)), this, SLOT(flightPlanElementSent(UAVObject *, bool)));
|
||||||
|
|
||||||
Waypoint *waypoint = Waypoint::GetInstance(objMngr, 0);
|
Waypoint *waypoint = Waypoint::GetInstance(objMngr, 0);
|
||||||
@ -81,7 +81,7 @@ void ModelUavoProxy::flightPlanElementSent(UAVObject *obj, bool success)
|
|||||||
|
|
||||||
void ModelUavoProxy::receiveFlightPlan()
|
void ModelUavoProxy::receiveFlightPlan()
|
||||||
{
|
{
|
||||||
FlightPlanInfo *flightPlan = FlightPlanInfo::GetInstance(objMngr, 0);
|
FlightPlan *flightPlan = FlightPlan::GetInstance(objMngr, 0);
|
||||||
connect(flightPlan, SIGNAL(transactionCompleted(UAVObject *, bool)), this, SLOT(flightPlanElementReceived(UAVObject *, bool)));
|
connect(flightPlan, SIGNAL(transactionCompleted(UAVObject *, bool)), this, SLOT(flightPlanElementReceived(UAVObject *, bool)));
|
||||||
|
|
||||||
Waypoint *waypoint = Waypoint::GetInstance(objMngr, 0);
|
Waypoint *waypoint = Waypoint::GetInstance(objMngr, 0);
|
||||||
@ -199,9 +199,9 @@ void ModelUavoProxy::modelToObjects()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update FlightPlanInfo
|
// Update FlightPlan
|
||||||
FlightPlanInfo *flightPlan = FlightPlanInfo::GetInstance(objMngr);
|
FlightPlan *flightPlan = FlightPlan::GetInstance(objMngr);
|
||||||
FlightPlanInfo::DataFields flightPlanData = flightPlan->getData();
|
FlightPlan::DataFields flightPlanData = flightPlan->getData();
|
||||||
|
|
||||||
flightPlanData.WaypointCount = waypointCount;
|
flightPlanData.WaypointCount = waypointCount;
|
||||||
flightPlanData.PathActionCount = actionCount;
|
flightPlanData.PathActionCount = actionCount;
|
||||||
@ -293,8 +293,8 @@ void ModelUavoProxy::objectsToModel()
|
|||||||
// the list of objects can end with "garbage" instances due to previous flightpath
|
// the list of objects can end with "garbage" instances due to previous flightpath
|
||||||
// they need to be ignored
|
// they need to be ignored
|
||||||
|
|
||||||
FlightPlanInfo *flightPlan = FlightPlanInfo::GetInstance(objMngr);
|
FlightPlan *flightPlan = FlightPlan::GetInstance(objMngr);
|
||||||
FlightPlanInfo::DataFields flightPlanData = flightPlan->getData();
|
FlightPlan::DataFields flightPlanData = flightPlan->getData();
|
||||||
|
|
||||||
int waypointCount = flightPlanData.WaypointCount;
|
int waypointCount = flightPlanData.WaypointCount;
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include "flightdatamodel.h"
|
#include "flightdatamodel.h"
|
||||||
|
|
||||||
#include "flightplaninfo.h"
|
#include "flightplan.h"
|
||||||
#include "pathaction.h"
|
#include "pathaction.h"
|
||||||
#include "waypoint.h"
|
#include "waypoint.h"
|
||||||
|
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
TARGET = UAVObjects
|
TARGET = UAVObjects
|
||||||
|
|
||||||
DEFINES += UAVOBJECTS_LIBRARY
|
DEFINES += UAVOBJECTS_LIBRARY
|
||||||
|
|
||||||
include(../../openpilotgcsplugin.pri)
|
include(../../openpilotgcsplugin.pri)
|
||||||
include(uavobjects_dependencies.pri)
|
include(uavobjects_dependencies.pri)
|
||||||
|
|
||||||
HEADERS += uavobjects_global.h \
|
HEADERS += \
|
||||||
|
uavobjects_global.h \
|
||||||
uavobject.h \
|
uavobject.h \
|
||||||
uavmetaobject.h \
|
uavmetaobject.h \
|
||||||
uavobjectmanager.h \
|
uavobjectmanager.h \
|
||||||
@ -14,7 +17,8 @@ HEADERS += uavobjects_global.h \
|
|||||||
uavobjectsplugin.h \
|
uavobjectsplugin.h \
|
||||||
uavobjecthelper.h
|
uavobjecthelper.h
|
||||||
|
|
||||||
SOURCES += uavobject.cpp \
|
SOURCES += \
|
||||||
|
uavobject.cpp \
|
||||||
uavmetaobject.cpp \
|
uavmetaobject.cpp \
|
||||||
uavobjectmanager.cpp \
|
uavobjectmanager.cpp \
|
||||||
uavdataobject.cpp \
|
uavdataobject.cpp \
|
||||||
@ -25,7 +29,8 @@ SOURCES += uavobject.cpp \
|
|||||||
OTHER_FILES += UAVObjects.pluginspec
|
OTHER_FILES += UAVObjects.pluginspec
|
||||||
|
|
||||||
# Add in all of the synthetic/generated uavobject files
|
# Add in all of the synthetic/generated uavobject files
|
||||||
HEADERS += $$UAVOBJECT_SYNTHETICS/accessorydesired.h \
|
HEADERS += \
|
||||||
|
$$UAVOBJECT_SYNTHETICS/accessorydesired.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/barosensor.h \
|
$$UAVOBJECT_SYNTHETICS/barosensor.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/airspeedsensor.h \
|
$$UAVOBJECT_SYNTHETICS/airspeedsensor.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/airspeedsettings.h \
|
$$UAVOBJECT_SYNTHETICS/airspeedsettings.h \
|
||||||
@ -92,7 +97,7 @@ HEADERS += $$UAVOBJECT_SYNTHETICS/accessorydesired.h \
|
|||||||
$$UAVOBJECT_SYNTHETICS/i2cstats.h \
|
$$UAVOBJECT_SYNTHETICS/i2cstats.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/flightbatterysettings.h \
|
$$UAVOBJECT_SYNTHETICS/flightbatterysettings.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/taskinfo.h \
|
$$UAVOBJECT_SYNTHETICS/taskinfo.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/flightplaninfo.h \
|
$$UAVOBJECT_SYNTHETICS/flightplan.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/flightplanstatus.h \
|
$$UAVOBJECT_SYNTHETICS/flightplanstatus.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/flightplansettings.h \
|
$$UAVOBJECT_SYNTHETICS/flightplansettings.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/flightplancontrol.h \
|
$$UAVOBJECT_SYNTHETICS/flightplancontrol.h \
|
||||||
@ -118,7 +123,8 @@ HEADERS += $$UAVOBJECT_SYNTHETICS/accessorydesired.h \
|
|||||||
$$UAVOBJECT_SYNTHETICS/waypointactive.h \
|
$$UAVOBJECT_SYNTHETICS/waypointactive.h \
|
||||||
$$UAVOBJECT_SYNTHETICS/mpu6000settings.h
|
$$UAVOBJECT_SYNTHETICS/mpu6000settings.h
|
||||||
|
|
||||||
SOURCES += $$UAVOBJECT_SYNTHETICS/accessorydesired.cpp \
|
SOURCES += \
|
||||||
|
$$UAVOBJECT_SYNTHETICS/accessorydesired.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/barosensor.cpp \
|
$$UAVOBJECT_SYNTHETICS/barosensor.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/airspeedsensor.cpp \
|
$$UAVOBJECT_SYNTHETICS/airspeedsensor.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/airspeedsettings.cpp \
|
$$UAVOBJECT_SYNTHETICS/airspeedsettings.cpp \
|
||||||
@ -185,7 +191,7 @@ SOURCES += $$UAVOBJECT_SYNTHETICS/accessorydesired.cpp \
|
|||||||
$$UAVOBJECT_SYNTHETICS/i2cstats.cpp \
|
$$UAVOBJECT_SYNTHETICS/i2cstats.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/flightbatterysettings.cpp \
|
$$UAVOBJECT_SYNTHETICS/flightbatterysettings.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/taskinfo.cpp \
|
$$UAVOBJECT_SYNTHETICS/taskinfo.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/flightplaninfo.cpp \
|
$$UAVOBJECT_SYNTHETICS/flightplan.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/flightplanstatus.cpp \
|
$$UAVOBJECT_SYNTHETICS/flightplanstatus.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/flightplansettings.cpp \
|
$$UAVOBJECT_SYNTHETICS/flightplansettings.cpp \
|
||||||
$$UAVOBJECT_SYNTHETICS/flightplancontrol.cpp \
|
$$UAVOBJECT_SYNTHETICS/flightplancontrol.cpp \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<xml>
|
<xml>
|
||||||
<object name="FlightPlanInfo" singleinstance="true" settings="false" category="Navigation">
|
<object name="FlightPlan" singleinstance="true" settings="false" category="Navigation">
|
||||||
<description>Flight plan informations</description>
|
<description>Flight plan informations</description>
|
||||||
|
|
||||||
<field name="WaypointCount" units="" type="uint16" elements="1" default="0" />
|
<field name="WaypointCount" units="" type="uint16" elements="1" default="0" />
|
Loading…
x
Reference in New Issue
Block a user