diff --git a/flight/modules/PathPlanner/pathplanner.c b/flight/modules/PathPlanner/pathplanner.c index ab2716d99..f62e0e2af 100644 --- a/flight/modules/PathPlanner/pathplanner.c +++ b/flight/modules/PathPlanner/pathplanner.c @@ -31,7 +31,7 @@ #include "openpilot.h" -#include "flightplaninfo.h" +#include "flightplan.h" #include "flightstatus.h" #include "airspeedstate.h" #include "pathaction.h" @@ -100,7 +100,7 @@ int32_t PathPlannerInitialize() { taskHandle = NULL; - FlightPlanInfoInitialize(); + FlightPlanInitialize(); PathActionInitialize(); PathStatusInitialize(); PathDesiredInitialize(); @@ -269,6 +269,8 @@ void updatePathDesired(__attribute__((unused)) UAVObjEvent *ev) static void setWaypoint(uint16_t num) { // path plans wrap around + + // TODO change to FlightPlan.WaypointCount if (num >= UAVObjGetNumInstances(WaypointHandle())) { num = 0; } @@ -277,10 +279,10 @@ static void setWaypoint(uint16_t num) WaypointActiveSet(&waypointActive); } -// execute the apropriate condition and report result +// execute the appropriate condition and report result 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) { case PATHACTION_ENDCONDITION_NONE: return conditionNone(); diff --git a/flight/targets/boards/revolution/firmware/UAVObjects.inc b/flight/targets/boards/revolution/firmware/UAVObjects.inc index 153525147..337a2123a 100644 --- a/flight/targets/boards/revolution/firmware/UAVObjects.inc +++ b/flight/targets/boards/revolution/firmware/UAVObjects.inc @@ -43,7 +43,7 @@ UAVOBJSRCFILENAMES += debuglogentry UAVOBJSRCFILENAMES += flightbatterysettings UAVOBJSRCFILENAMES += firmwareiapobj UAVOBJSRCFILENAMES += flightbatterystate -UAVOBJSRCFILENAMES += flightplaninfo +UAVOBJSRCFILENAMES += flightplan UAVOBJSRCFILENAMES += flightplancontrol UAVOBJSRCFILENAMES += flightplansettings UAVOBJSRCFILENAMES += flightplanstatus diff --git a/flight/targets/boards/revoproto/firmware/UAVObjects.inc b/flight/targets/boards/revoproto/firmware/UAVObjects.inc index ad22cf2a7..d0480fa26 100644 --- a/flight/targets/boards/revoproto/firmware/UAVObjects.inc +++ b/flight/targets/boards/revoproto/firmware/UAVObjects.inc @@ -44,7 +44,7 @@ UAVOBJSRCFILENAMES += airspeedstate UAVOBJSRCFILENAMES += flightbatterysettings UAVOBJSRCFILENAMES += firmwareiapobj UAVOBJSRCFILENAMES += flightbatterystate -UAVOBJSRCFILENAMES += flightplaninfo +UAVOBJSRCFILENAMES += flightplan UAVOBJSRCFILENAMES += flightplancontrol UAVOBJSRCFILENAMES += flightplansettings UAVOBJSRCFILENAMES += flightplanstatus diff --git a/ground/openpilotgcs/src/plugins/opmap/modeluavoproxy.cpp b/ground/openpilotgcs/src/plugins/opmap/modeluavoproxy.cpp index 6d19d2248..d6e9945f1 100644 --- a/ground/openpilotgcs/src/plugins/opmap/modeluavoproxy.cpp +++ b/ground/openpilotgcs/src/plugins/opmap/modeluavoproxy.cpp @@ -42,7 +42,7 @@ void ModelUavoProxy::sendFlightPlan() { modelToObjects(); - FlightPlanInfo *flightPlan = FlightPlanInfo::GetInstance(objMngr, 0); + FlightPlan *flightPlan = FlightPlan::GetInstance(objMngr, 0); connect(flightPlan, SIGNAL(transactionCompleted(UAVObject *, bool)), this, SLOT(flightPlanElementSent(UAVObject *, bool))); Waypoint *waypoint = Waypoint::GetInstance(objMngr, 0); @@ -81,7 +81,7 @@ void ModelUavoProxy::flightPlanElementSent(UAVObject *obj, bool success) 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))); Waypoint *waypoint = Waypoint::GetInstance(objMngr, 0); @@ -199,9 +199,9 @@ void ModelUavoProxy::modelToObjects() } } - // Update FlightPlanInfo - FlightPlanInfo *flightPlan = FlightPlanInfo::GetInstance(objMngr); - FlightPlanInfo::DataFields flightPlanData = flightPlan->getData(); + // Update FlightPlan + FlightPlan *flightPlan = FlightPlan::GetInstance(objMngr); + FlightPlan::DataFields flightPlanData = flightPlan->getData(); flightPlanData.WaypointCount = waypointCount; flightPlanData.PathActionCount = actionCount; @@ -293,8 +293,8 @@ void ModelUavoProxy::objectsToModel() // the list of objects can end with "garbage" instances due to previous flightpath // they need to be ignored - FlightPlanInfo *flightPlan = FlightPlanInfo::GetInstance(objMngr); - FlightPlanInfo::DataFields flightPlanData = flightPlan->getData(); + FlightPlan *flightPlan = FlightPlan::GetInstance(objMngr); + FlightPlan::DataFields flightPlanData = flightPlan->getData(); int waypointCount = flightPlanData.WaypointCount; diff --git a/ground/openpilotgcs/src/plugins/opmap/modeluavoproxy.h b/ground/openpilotgcs/src/plugins/opmap/modeluavoproxy.h index 5d1d5b942..23e81557b 100644 --- a/ground/openpilotgcs/src/plugins/opmap/modeluavoproxy.h +++ b/ground/openpilotgcs/src/plugins/opmap/modeluavoproxy.h @@ -29,7 +29,7 @@ #include "flightdatamodel.h" -#include "flightplaninfo.h" +#include "flightplan.h" #include "pathaction.h" #include "waypoint.h" diff --git a/ground/openpilotgcs/src/plugins/uavobjects/uavobjects.pro b/ground/openpilotgcs/src/plugins/uavobjects/uavobjects.pro index 04be9ca02..4e0153d11 100644 --- a/ground/openpilotgcs/src/plugins/uavobjects/uavobjects.pro +++ b/ground/openpilotgcs/src/plugins/uavobjects/uavobjects.pro @@ -1,10 +1,13 @@ TEMPLATE = lib TARGET = UAVObjects + DEFINES += UAVOBJECTS_LIBRARY + include(../../openpilotgcsplugin.pri) include(uavobjects_dependencies.pri) -HEADERS += uavobjects_global.h \ +HEADERS += \ + uavobjects_global.h \ uavobject.h \ uavmetaobject.h \ uavobjectmanager.h \ @@ -14,7 +17,8 @@ HEADERS += uavobjects_global.h \ uavobjectsplugin.h \ uavobjecthelper.h -SOURCES += uavobject.cpp \ +SOURCES += \ + uavobject.cpp \ uavmetaobject.cpp \ uavobjectmanager.cpp \ uavdataobject.cpp \ @@ -25,7 +29,8 @@ SOURCES += uavobject.cpp \ OTHER_FILES += UAVObjects.pluginspec # 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/airspeedsensor.h \ $$UAVOBJECT_SYNTHETICS/airspeedsettings.h \ @@ -92,7 +97,7 @@ HEADERS += $$UAVOBJECT_SYNTHETICS/accessorydesired.h \ $$UAVOBJECT_SYNTHETICS/i2cstats.h \ $$UAVOBJECT_SYNTHETICS/flightbatterysettings.h \ $$UAVOBJECT_SYNTHETICS/taskinfo.h \ - $$UAVOBJECT_SYNTHETICS/flightplaninfo.h \ + $$UAVOBJECT_SYNTHETICS/flightplan.h \ $$UAVOBJECT_SYNTHETICS/flightplanstatus.h \ $$UAVOBJECT_SYNTHETICS/flightplansettings.h \ $$UAVOBJECT_SYNTHETICS/flightplancontrol.h \ @@ -118,7 +123,8 @@ HEADERS += $$UAVOBJECT_SYNTHETICS/accessorydesired.h \ $$UAVOBJECT_SYNTHETICS/waypointactive.h \ $$UAVOBJECT_SYNTHETICS/mpu6000settings.h -SOURCES += $$UAVOBJECT_SYNTHETICS/accessorydesired.cpp \ +SOURCES += \ + $$UAVOBJECT_SYNTHETICS/accessorydesired.cpp \ $$UAVOBJECT_SYNTHETICS/barosensor.cpp \ $$UAVOBJECT_SYNTHETICS/airspeedsensor.cpp \ $$UAVOBJECT_SYNTHETICS/airspeedsettings.cpp \ @@ -185,7 +191,7 @@ SOURCES += $$UAVOBJECT_SYNTHETICS/accessorydesired.cpp \ $$UAVOBJECT_SYNTHETICS/i2cstats.cpp \ $$UAVOBJECT_SYNTHETICS/flightbatterysettings.cpp \ $$UAVOBJECT_SYNTHETICS/taskinfo.cpp \ - $$UAVOBJECT_SYNTHETICS/flightplaninfo.cpp \ + $$UAVOBJECT_SYNTHETICS/flightplan.cpp \ $$UAVOBJECT_SYNTHETICS/flightplanstatus.cpp \ $$UAVOBJECT_SYNTHETICS/flightplansettings.cpp \ $$UAVOBJECT_SYNTHETICS/flightplancontrol.cpp \ diff --git a/shared/uavobjectdefinition/flightplaninfo.xml b/shared/uavobjectdefinition/flightplan.xml similarity index 85% rename from shared/uavobjectdefinition/flightplaninfo.xml rename to shared/uavobjectdefinition/flightplan.xml index 05727e50f..e8c7b61c9 100644 --- a/shared/uavobjectdefinition/flightplaninfo.xml +++ b/shared/uavobjectdefinition/flightplan.xml @@ -1,5 +1,5 @@ <xml> - <object name="FlightPlanInfo" singleinstance="true" settings="false" category="Navigation"> + <object name="FlightPlan" singleinstance="true" settings="false" category="Navigation"> <description>Flight plan informations</description> <field name="WaypointCount" units="" type="uint16" elements="1" default="0" />