diff --git a/src/AutoPilotPlugins/APM/APMAirframeComponentController.cc b/src/AutoPilotPlugins/APM/APMAirframeComponentController.cc index 47a642230f280943159a8a0508f2026aecc0b6f0..e84640fc78db78fddbf12a1700701f7fc2675168 100644 --- a/src/AutoPilotPlugins/APM/APMAirframeComponentController.cc +++ b/src/AutoPilotPlugins/APM/APMAirframeComponentController.cc @@ -188,6 +188,11 @@ APMAirframeType *APMAirframeComponentController::currentAirframeType() const return _currentAirframeType; } +QString APMAirframeComponentController::currentAirframeTypeName() const +{ + return _vehicle->vehicleTypeName(); +} + APMAirframe *APMAirframeComponentController::currentAirframe() const { return _currentAirframe; diff --git a/src/AutoPilotPlugins/APM/APMAirframeComponentController.h b/src/AutoPilotPlugins/APM/APMAirframeComponentController.h index ef799ab5246960d144e73658ebb296ca5ddc5e6b..613f55dc2401f4d433d6332d424fe22925b9731b 100644 --- a/src/AutoPilotPlugins/APM/APMAirframeComponentController.h +++ b/src/AutoPilotPlugins/APM/APMAirframeComponentController.h @@ -70,6 +70,7 @@ signals: public slots: APMAirframeType *currentAirframeType() const; + Q_INVOKABLE QString currentAirframeTypeName() const; APMAirframe *currentAirframe() const; void setCurrentAirframeType(APMAirframeType *t); void setCurrentAirframe(APMAirframe *t); diff --git a/src/AutoPilotPlugins/APM/APMAirframeComponentSummary.qml b/src/AutoPilotPlugins/APM/APMAirframeComponentSummary.qml index effced4a01520e2554b94289211e9ee1c3cea5dd..90fed8bf7715547f3f17e78c661af4e479279d18 100644 --- a/src/AutoPilotPlugins/APM/APMAirframeComponentSummary.qml +++ b/src/AutoPilotPlugins/APM/APMAirframeComponentSummary.qml @@ -28,11 +28,11 @@ FactPanel { VehicleSummaryRow { id: nameRow; labelText: qsTr("Frame Type:") - valueText: sysIdFact.valueString === "0" ? "Plus" + valueText: controller.currentAirframeTypeName() + " " + (sysIdFact.valueString === "0" ? "Plus" : sysIdFact.valueString === "1" ? "X" : sysIdFact.valueString === "2" ? "V" : sysIdFact.valueString == "3" ? "H" - :/* Fact.value == 10 */ "New Y6"; + : /* Fact.value == 10 */ "New Y6"); } } diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index 0c062ae11dbd61a1639172a05fca22327e7612c4..bf0910082b2e0c61e9e8d22b427fbbe547c33a0b 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -1420,6 +1420,40 @@ void Vehicle::_setCoordinateValid(bool coordinateValid) } } +QString Vehicle::vehicleTypeName() const { + static QMap typeNames = { + { MAV_TYPE_GENERIC, tr("Generic micro air vehicle" )}, + { MAV_TYPE_FIXED_WING, tr("Fixed wing aircraft")}, + { MAV_TYPE_QUADROTOR, tr("Quadrotor")}, + { MAV_TYPE_COAXIAL, tr("Coaxial helicopter")}, + { MAV_TYPE_HELICOPTER, tr("Normal helicopter with tail rotor.")}, + { MAV_TYPE_ANTENNA_TRACKER, tr("Ground installation")}, + { MAV_TYPE_GCS, tr("Operator control unit / ground control station")}, + { MAV_TYPE_AIRSHIP, tr("Airship, controlled")}, + { MAV_TYPE_FREE_BALLOON, tr("Free balloon, uncontrolled")}, + { MAV_TYPE_ROCKET, tr("Rocket")}, + { MAV_TYPE_GROUND_ROVER, tr("Ground rover")}, + { MAV_TYPE_SURFACE_BOAT, tr("Surface vessel, boat, ship")}, + { MAV_TYPE_SUBMARINE, tr("Submarine")}, + { MAV_TYPE_HEXAROTOR, tr("Hexarotor")}, + { MAV_TYPE_OCTOROTOR, tr("Octorotor")}, + { MAV_TYPE_TRICOPTER, tr("Octorotor")}, + { MAV_TYPE_FLAPPING_WING, tr("Flapping wing")}, + { MAV_TYPE_KITE, tr("Flapping wing")}, + { MAV_TYPE_ONBOARD_CONTROLLER, tr("Onboard companion controller")}, + { MAV_TYPE_VTOL_DUOROTOR, tr("Two-rotor VTOL using control surfaces in vertical operation in addition. Tailsitter")}, + { MAV_TYPE_VTOL_QUADROTOR, tr("Quad-rotor VTOL using a V-shaped quad config in vertical operation. Tailsitter")}, + { MAV_TYPE_VTOL_TILTROTOR, tr("Tiltrotor VTOL")}, + { MAV_TYPE_VTOL_RESERVED2, tr("VTOL reserved 2")}, + { MAV_TYPE_VTOL_RESERVED3, tr("VTOL reserved 3")}, + { MAV_TYPE_VTOL_RESERVED4, tr("VTOL reserved 4")}, + { MAV_TYPE_VTOL_RESERVED5, tr("VTOL reserved 5")}, + { MAV_TYPE_GIMBAL, tr("Onboard gimbal")}, + { MAV_TYPE_ADSB, tr("Onboard ADSB peripheral")}, + }; + return typeNames[_vehicleType]; +} + /// Returns the string to speak to identify the vehicle QString Vehicle::_vehicleIdSpeech(void) { diff --git a/src/Vehicle/Vehicle.h b/src/Vehicle/Vehicle.h index 8880214a45a6f692d872d73ec0636cc096d23551..afcb078e0cd5af71507e8e10b5a0c0ff1a09a6d9 100644 --- a/src/Vehicle/Vehicle.h +++ b/src/Vehicle/Vehicle.h @@ -395,6 +395,7 @@ public: int id(void) { return _id; } MAV_AUTOPILOT firmwareType(void) const { return _firmwareType; } MAV_TYPE vehicleType(void) const { return _vehicleType; } + Q_INVOKABLE QString vehicleTypeName(void) const; /// Returns the highest quality link available to the Vehicle LinkInterface* priorityLink(void);