diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b061d2e7f8a0dc8d6bbea32a706741c8a11a5b3..85faba047362759a890fefe2ae472bcb5d430640 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,6 +84,7 @@ add_executable(skywardhub src/shared/Modules/MainStateViewer/MainStateViewer.cpp src/shared/Modules/PayloadStateViewer/PayloadStateViewer.cpp src/shared/Modules/RigStateViewer/RigStateViewer.cpp + src/shared/Modules/ARPStateViewer/ARPStateViewer.cpp src/shared/Modules/Tabs/TabsModule.cpp src/shared/Modules/Test/TestModule.cpp src/shared/Modules/TimerController/TimerControllerModule.cpp diff --git a/SkywardHub.pro b/SkywardHub.pro index 97a8c79b4df4e46bfc718c5424d863d5bc98c1b2..4ca7a7b384fb4944fe989b282be4e28932679f1a 100644 --- a/SkywardHub.pro +++ b/SkywardHub.pro @@ -25,6 +25,7 @@ SOURCES += \ src/shared/Modules/MainStateViewer/MainStateViewer.cpp \ src/shared/Modules/PayloadStateViewer/PayloadStateViewer.cpp \ src/shared/Modules/RigStateViewer/RigStateViewer.cpp \ + src/shared/Modules/ARPStateViewer/ARPStateViewer.cpp \ src/shared/Modules/FileStream/FileStreamModule.cpp \ src/shared/Modules/Graph/Graph.cpp \ src/shared/Modules/Test/TestModule.cpp \ @@ -80,6 +81,7 @@ HEADERS += \ src/shared/Modules/PayloadStateViewer/PayloadStateViewer.h \ src/shared/Modules/RigStateViewer/RigStatesList.h \ src/shared/Modules/RigStateViewer/RigStateViewer.h \ + src/shared/Modules/ARPStateViewer/ARPStateViewer.h \ src/shared/Modules/FileStream/FileStreamModule.h \ src/shared/Modules/Graph/Graph.h \ src/shared/Modules/Test/TestModule.h \ diff --git a/src/shared/Modules/ARPStateViewer/ARPStateViewer.cpp b/src/shared/Modules/ARPStateViewer/ARPStateViewer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..533107d22370885c84c40f972cf62fae3c8a8118 --- /dev/null +++ b/src/shared/Modules/ARPStateViewer/ARPStateViewer.cpp @@ -0,0 +1,156 @@ +/* + * This file is part of Skyward Hub. + * + * Skyward Hub is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. + * + * Skyward Hub is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * Skyward Hub. If not, see <https://www.gnu.org/licenses/>. + * + */ + +#include "ARPStateViewer.h" + +#include <Components/FilterSelector/FilterSelector.h> +#include <Core/MessageBroker/MessageBroker.h> + +ARPStateViewerModule::ARPStateViewerModule() + : Module(ModuleId::ARP_STATE_VIEWER) +{ + setupUi(); + customContextMenuActionSetup(); +} + +ARPStateViewerModule::~ARPStateViewerModule() +{ + MessageBroker::getInstance().unsubscribe(filter, this); +} + +XmlObject ARPStateViewerModule::toXmlObject() +{ + XmlObject obj = Module::toXmlObject(); + + obj.addAttribute("filter", filter.toString()); + + return obj; +} + +void ARPStateViewerModule::fromXmlObject(const XmlObject& xmlObject) +{ + auto filter = Filter::fromString(xmlObject.getAttribute("filter")); + setFilter(filter); +} + +void ARPStateViewerModule::setupUi() +{ + outerLayout = new QHBoxLayout; + outerLayout->setContentsMargins(0, 0, 0, 0); + outerLayout->setSpacing(0); + + for (auto labelText : ARPStatesList::statesLabels) + { + QLabel* label = new QLabel; + label->setText(labelText); + label->setAlignment(Qt::AlignCenter); + label->setContentsMargins(4, 4, 4, 4); + outerLayout->addWidget(label); + } + + setLayout(outerLayout); +} + +void ARPStateViewerModule::customContextMenuActionSetup() +{ + QAction* action = new QAction("Choose topic and field"); + connect(action, &QAction::triggered, this, + &ARPStateViewerModule::onConfigureClicked); + + customContextMenuActions.append(action); +} + +void ARPStateViewerModule::onConfigureClicked() +{ + FilterSelector::selectFilter( + filter, [this](const Filter& newFilter) { setFilter(newFilter); }); +} + +void ARPStateViewerModule::setFilter(const Filter& newFilter) +{ + MessageBroker::getInstance().unsubscribe(filter, this); + MessageBroker::getInstance().subscribe( + newFilter, this, + [this](const Message& message, const Filter& filter) + { onMsgReceived(message); }); + filter = newFilter; +} + +void ARPStateViewerModule::onMsgReceived(const Message& msg) +{ + Field field = msg.getField("state"); + + ARPStatesList::State state = + static_cast<ARPStatesList::State>(field.getUnsignedInteger()); + + // Skip invalid and macro states + if (state == ARPStatesList::State::INVALID || + state == ARPStatesList::State::CONFIG || + state == ARPStatesList::State::FEEDBACK || + state == ARPStatesList::State::NO_FEEDBACK) + return; + + if (state != currentState) + { + currentState = static_cast<ARPStatesList::State>(state); + + QString baseStyle = + "border-bottom-width:1px;border-left-width:1px;border-top-width:" + "1px;border-radius:0;"; + QString currentStateStyle = + "background-color:yellow; color:black;" + baseStyle; + QString completedStyle = "background-color:green;" + baseStyle; + QString errorStyle = "background-color:red;" + baseStyle; + QString nfStyle = + "background-color:yellow;" + "border-bottom-width:4px;border-left-width:4px;" + "border-right-width:4px; border-top-width:4px;" + "border-radius:0; border-style: dashed;" + "border-color:red;"; + + int index = ARPStatesList::statesIndexes[currentState]; + auto label = outerLayout->itemAt(index)->widget(); + + if (currentState == ARPStatesList::State::INIT_ERROR) + label->setStyleSheet(errorStyle); + else if (currentState == ARPStatesList::State::ACTIVE_NF || + currentState == ARPStatesList::State::ARM_READY || + currentState == ARPStatesList::State::ARMED_NF || + currentState == ARPStatesList::State::FIX_ROCKET_NF || + currentState == ARPStatesList::State::INSERT_INFO || + currentState == ARPStatesList::State::TEST_NF) + label->setStyleSheet(nfStyle); + else + label->setStyleSheet(currentStateStyle); + + // Set as completed every state before the current + for (int i = index - 1; i >= 0; i--) + outerLayout->itemAt(i)->widget()->setStyleSheet(completedStyle); + + // Reset every state after the current + for (int i = index + 1; i < ARPStatesList::statesLabels.count(); i++) + outerLayout->itemAt(i)->widget()->setStyleSheet(baseStyle); + + auto tmp = outerLayout->itemAt(ARPStatesList::statesLabels.count() - 1) + ->widget() + ->styleSheet(); + outerLayout->itemAt(ARPStatesList::statesLabels.count() - 1) + ->widget() + ->setStyleSheet(tmp + "border-right-width:1px;"); + } +} diff --git a/src/shared/Modules/ARPStateViewer/ARPStateViewer.h b/src/shared/Modules/ARPStateViewer/ARPStateViewer.h new file mode 100644 index 0000000000000000000000000000000000000000..a6733bfc9f4b9760f4aa99084291dc0bb95ffa77 --- /dev/null +++ b/src/shared/Modules/ARPStateViewer/ARPStateViewer.h @@ -0,0 +1,52 @@ +/* + * This file is part of Skyward Hub. + * + * Skyward Hub is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. + * + * Skyward Hub is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * Skyward Hub. If not, see <https://www.gnu.org/licenses/>. + * + */ + +#pragma once + +#include <Core/Message/Filter.h> +#include <Core/Message/Message.h> +#include <Modules/Module.h> + +#include <QLabel> +#include <QWidget> + +#include "ARPStatesList.h" + +class ARPStateViewerModule : public Module +{ + Q_OBJECT + +public: + ARPStateViewerModule(); + ~ARPStateViewerModule(); + + XmlObject toXmlObject() override; + void fromXmlObject(const XmlObject& xmlObject) override; + +private: + void setupUi(); + void customContextMenuActionSetup(); + void onConfigureClicked(); + void setFilter(const Filter& filter); + void onMsgReceived(const Message& msg); + + QHBoxLayout* outerLayout; + + Filter filter; + ARPStatesList::State currentState; +}; diff --git a/src/shared/Modules/ARPStateViewer/ARPStatesList.h b/src/shared/Modules/ARPStateViewer/ARPStatesList.h new file mode 100644 index 0000000000000000000000000000000000000000..a01608ae359feeb254f76c21f77cc9338a180cb3 --- /dev/null +++ b/src/shared/Modules/ARPStateViewer/ARPStatesList.h @@ -0,0 +1,71 @@ +/* + * This file is part of Skyward Hub. + * + * Skyward Hub is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. + * + * Skyward Hub is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * Skyward Hub. If not, see <https://www.gnu.org/licenses/>. + * + */ + +#pragma once + +#include <QList> +#include <QMap> +#include <QString> + +namespace ARPStatesList +{ + +// SMA states +enum class State : uint8_t +{ + INIT = 0, + INIT_ERROR, + INIT_DONE, + INSERT_INFO, + ARMED, + ARMED_NF, + TEST, + TEST_NF, + CALIBRATE, + FIX_ANTENNAS, + FIX_ROCKET, + FIX_ROCKET_NF, + ARM_READY, + ACTIVE, + ACTIVE_NF, + CONFIG, + FEEDBACK, + NO_FEEDBACK, + INVALID, +}; + +// Groundstation labels +static const QList<QString> statesLabels{ + "INIT", "INIT ERROR", "INIT DONE", "INSERT\nINFO", "ARM READY", "ARMED", + "TEST", "CALIBRATE", "FIX ANTENNAS", "FIX ROCKET", "ACTIVE", +}; + +// Map from ARP states to groundstation labels +static const QMap<State, int> statesIndexes{ + {State::INVALID, -1}, {State::CONFIG, -1}, + {State::FEEDBACK, -1}, {State::NO_FEEDBACK, -1}, + {State::INIT, 0}, {State::INIT_ERROR, 1}, + {State::INIT_DONE, 2}, {State::INSERT_INFO, 3}, + {State::ARM_READY, 4}, {State::ARMED, 5}, + {State::ARMED_NF, 5}, {State::TEST, 6}, + {State::TEST_NF, 6}, {State::CALIBRATE, 7}, + {State::FIX_ANTENNAS, 8}, {State::FIX_ROCKET, 9}, + {State::FIX_ROCKET_NF, 9}, {State::ACTIVE, 10}, + {State::ACTIVE_NF, 10}}; + +} // namespace ARPStatesList diff --git a/src/shared/Modules/CommandPad/MessagesList.h b/src/shared/Modules/CommandPad/MessagesList.h index b8708946a48129e949c9841da3023cb0608baff7..9c5f6dc7b6015a92d94d6bc2f0cc8f0080086d31 100644 --- a/src/shared/Modules/CommandPad/MessagesList.h +++ b/src/shared/Modules/CommandPad/MessagesList.h @@ -28,11 +28,15 @@ namespace MessagesList { static const QStringList messagesList{"PING_TC", + "ARP_COMMAND_TC", "COMMAND_TC", "SYSTEM_TM_REQUEST_TC", "SENSOR_TM_REQUEST_TC", "SERVO_TM_REQUEST_TC", "SET_SERVO_ANGLE_TC", + "SET_STEPPER_ANGLE_TC", + "SET_STEPPER_STEPS_TC", + "SET_STEPPER_MULTIPLIER_TC", "WIGGLE_SERVO_TC", "RESET_SERVO_TC", "SET_REFERENCE_ALTITUDE_TC", @@ -43,6 +47,8 @@ static const QStringList messagesList{"PING_TC", "RAW_EVENT_TC", "SET_DEPLOYMENT_ALTITUDE_TC", "SET_TARGET_COORDINATES_TC", + "SET_ANTENNA_COORDINATES_ARP_TC", + "SET_ROCKET_COORDINATES_ARP_TC", "SET_ALGORITHM_TC", "SET_ATOMIC_VALVE_TIMING_TC", "SET_VALVE_MAXIMUM_APERTURE_TC", @@ -77,6 +83,21 @@ static const QMap<QString, int> sensorsList{ {"MAV_MS5803_ID", MAV_MS5803_ID}, {"MAV_BME280_ID", MAV_BME280_ID}, {"MAV_LIS3MDL_ID", MAV_LIS3MDL_ID}, + {"MAV_DPL_PRESS_ID", MAV_DPL_PRESS_ID}, + {"MAV_STATIC_PRESS_ID", MAV_STATIC_PRESS_ID}, + {"MAV_STATIC_PITOT_PRESS_ID", MAV_STATIC_PITOT_PRESS_ID}, + {"MAV_TOTAL_PITOT_PRESS_ID", MAV_TOTAL_PITOT_PRESS_ID}, + {"MAV_DYNAMIC_PITOT_PRESS_ID", MAV_DYNAMIC_PITOT_PRESS_ID}, + {"MAV_BATTERY_VOLTAGE_ID", MAV_BATTERY_VOLTAGE_ID}, + {"MAV_LOAD_CELL_ID", MAV_LOAD_CELL_ID}, + {"MAV_FILLING_PRESS_ID", MAV_FILLING_PRESS_ID}, + {"MAV_VESSEL_PRESS_ID", MAV_VESSEL_PRESS_ID}, + {"MAV_TANK_TOP_PRESS_ID", MAV_TANK_TOP_PRESS_ID}, + {"MAV_TANK_BOTTOM_PRESS_ID", MAV_TANK_BOTTOM_PRESS_ID}, + {"MAV_TANK_TEMP_ID", MAV_TANK_TEMP_ID}, + {"MAV_COMBUSTION_PRESS_ID", MAV_COMBUSTION_PRESS_ID}, + {"MAV_LOAD_CELL_VESSEL_ID", MAV_LOAD_CELL_VESSEL_ID}, + {"MAV_LOAD_CELL_TANK_ID", MAV_LOAD_CELL_TANK_ID}, {"MAV_LIS2MDL_ID", MAV_LIS2MDL_ID}, {"MAV_LPS28DFW_ID", MAV_LPS28DFW_ID}, {"MAV_LSM6DSRX_ID", MAV_LSM6DSRX_ID}, @@ -125,7 +146,22 @@ static const QMap<QString, int> commandsList{ {"MAV_CMD_REGISTRY_SAVE", MAV_CMD_REGISTRY_SAVE}, {"MAV_CMD_REGISTRY_CLEAR", MAV_CMD_REGISTRY_CLEAR}, {"MAV_CMD_ENTER_HIL", MAV_CMD_ENTER_HIL}, - {"MAV_CMD_EXIT_HIL", MAV_CMD_EXIT_HIL}}; + {"MAV_CMD_EXIT_HIL", MAV_CMD_EXIT_HIL}, + {"MAV_CMD_ARP_FOLLOW", MAV_CMD_ARP_FOLLOW}, + {"MAV_CMD_ARP_FORCE_NO_FEEDBACK", MAV_CMD_ARP_FORCE_NO_FEEDBACK}, + {"MAV_CMD_RESET_ALGORITHM", MAV_CMD_RESET_ALGORITHM}}; + +static const QMap<QString, int> arpCommandsList{ + {"MAV_CMD_ARM", MAV_CMD_ARM}, + {"MAV_CMD_DISARM", MAV_CMD_DISARM}, + {"MAV_CMD_CALIBRATE", MAV_CMD_CALIBRATE}, + {"MAV_CMD_FORCE_INIT", MAV_CMD_FORCE_INIT}, + {"MAV_CMD_FORCE_REBOOT", MAV_CMD_FORCE_REBOOT}, + {"MAV_CMD_ENTER_TEST_MODE", MAV_CMD_ENTER_TEST_MODE}, + {"MAV_CMD_EXIT_TEST_MODE", MAV_CMD_EXIT_TEST_MODE}, + {"MAV_CMD_ARP_FOLLOW", MAV_CMD_ARP_FOLLOW}, + {"MAV_CMD_ARP_FORCE_NO_FEEDBACK", MAV_CMD_ARP_FORCE_NO_FEEDBACK}, + {"MAV_CMD_RESET_ALGORITHM", MAV_CMD_RESET_ALGORITHM}}; const QMap<QString, int> servosList{ {"AIR_BRAKES_SERVO", AIR_BRAKES_SERVO}, @@ -138,6 +174,9 @@ const QMap<QString, int> servosList{ {"FILLING_VALVE", FILLING_VALVE}, {"DISCONNECT_SERVO", DISCONNECT_SERVO}}; +const QMap<QString, int> stepperList{{"STEPPER_X", STEPPER_X}, + {"STEPPER_Y", STEPPER_Y}}; + inline void fillMessagesMap(QMap<QString, MessageFormElement *> &formElements) { MessageFormElement *element; @@ -149,6 +188,10 @@ inline void fillMessagesMap(QMap<QString, MessageFormElement *> &formElements) element->addComboBox("command_id", "Command:", commandsList); formElements["COMMAND_TC"] = element; + element = new MessageFormElement(); + element->addComboBox("command_id", "Command:", arpCommandsList); + formElements["ARP_COMMAND_TC"] = element; + element = new MessageFormElement(); element->addComboBox("tm_id", "Telemetry:", systemTmList); formElements["SYSTEM_TM_REQUEST_TC"] = element; @@ -249,6 +292,33 @@ inline void fillMessagesMap(QMap<QString, MessageFormElement *> &formElements) element->addInteger("start_tars_btn", "Tars:", 0, 1); element->addInteger("arm_switch", "Arm:", 0, 1); formElements["CONRIG_STATE_TC"] = element; + + element = new MessageFormElement(); + element->addComboBox("stepper_id", "Stepper:", stepperList); + element->addFloat("angle", "Aperture in degrees:", -360, +360); + formElements["SET_STEPPER_ANGLE_TC"] = element; + + element = new MessageFormElement(); + element->addComboBox("stepper_id", "Stepper:", stepperList); + element->addFloat("steps", "Steps:", -3200, +3200); + formElements["SET_STEPPER_STEPS_TC"] = element; + + element = new MessageFormElement(); + element->addComboBox("stepper_id", "Stepper:", stepperList); + element->addFloat("multiplier", "Multiplier:", 0, 5, 2); + formElements["SET_STEPPER_MULTIPLIER_TC"] = element; + + element = new MessageFormElement(); + element->addFloat("latitude", "Latitude:", -90, 90, 6); + element->addFloat("longitude", "Longitude:", -90, 90, 6); + element->addFloat("height", "Height:", 0, 9999, 6); + formElements["SET_ANTENNA_COORDINATES_ARP_TC"] = element; + + element = new MessageFormElement(); + element->addFloat("latitude", "Latitude:", -90, 90, 6); + element->addFloat("longitude", "Longitude:", -90, 90, 6); + element->addFloat("height", "Height:", 0, 9999, 6); + formElements["SET_ROCKET_COORDINATES_ARP_TC"] = element; } } // namespace MessagesList diff --git a/src/shared/Modules/Mavlink/BaseMavlinkModule.cpp b/src/shared/Modules/Mavlink/BaseMavlinkModule.cpp index b9e9bcfaaf75e76e6d5863b91936bbcac95336d9..6215ce223ea868a341a12aa0f0dd86a64e358ff2 100644 --- a/src/shared/Modules/Mavlink/BaseMavlinkModule.cpp +++ b/src/shared/Modules/Mavlink/BaseMavlinkModule.cpp @@ -219,7 +219,8 @@ void BaseMavlinkModule::setupUi() sysIdComboBox->addItem("Main", MavlinkCodec::SysIdMain); sysIdComboBox->addItem("Payload", MavlinkCodec::SysIdPayload); sysIdComboBox->addItem("Rig", MavlinkCodec::SysIdRig); - sysIdComboBox->addItem("Gs Receiver", MavlinkCodec::SysIdGsReceiver); + sysIdComboBox->addItem("Gs Receiver", MavlinkCodec::SysIdGS); + sysIdComboBox->addItem("ARP Receiver", MavlinkCodec::SysIdARP); outerLayout->addWidget(sysIdComboBox); childLayout = new QHBoxLayout; diff --git a/src/shared/Modules/Mavlink/MavlinkCodec.cpp b/src/shared/Modules/Mavlink/MavlinkCodec.cpp index ae6b181bb6fba4200dabe8e1bd7588e91b6468db..33e3980f59ac01f10781b9e141ca5ec50b76e799 100644 --- a/src/shared/Modules/Mavlink/MavlinkCodec.cpp +++ b/src/shared/Modules/Mavlink/MavlinkCodec.cpp @@ -264,6 +264,13 @@ bool MavlinkCodec::encodeMessage(const Message& msg, SysId sysId, CompId compId, msg.getField("command_id").getUnsignedInteger()); return true; } + else if (messageName == "ARP_COMMAND_TC") + { + mavlink_msg_arp_command_tc_pack( + sysId, compId, &output, + msg.getField("command_id").getUnsignedInteger()); + return true; + } else if (messageName == "SYSTEM_TM_REQUEST_TC") { mavlink_msg_system_tm_request_tc_pack( @@ -420,6 +427,46 @@ bool MavlinkCodec::encodeMessage(const Message& msg, SysId sysId, CompId compId, msg.getField("arm_switch").getUnsignedInteger()); return true; } + else if (messageName == "SET_ANTENNA_COORDINATES_ARP_TC") + { + mavlink_msg_set_antenna_coordinates_arp_tc_pack( + sysId, compId, &output, msg.getField("latitude").getDouble(), + msg.getField("longitude").getDouble(), + msg.getField("height").getDouble()); + return true; + } + else if (messageName == "SET_ROCKET_COORDINATES_ARP_TC") + { + mavlink_msg_set_rocket_coordinates_arp_tc_pack( + sysId, compId, &output, msg.getField("latitude").getDouble(), + msg.getField("longitude").getDouble(), + msg.getField("height").getDouble()); + return true; + } + else if (messageName == "SET_STEPPER_ANGLE_TC") + { + mavlink_msg_set_stepper_angle_tc_pack( + sysId, compId, &output, + msg.getField("stepper_id").getUnsignedInteger(), + msg.getField("angle").getDouble()); + return true; + } + else if (messageName == "SET_STEPPER_STEPS_TC") + { + mavlink_msg_set_stepper_steps_tc_pack( + sysId, compId, &output, + msg.getField("stepper_id").getUnsignedInteger(), + msg.getField("steps").getDouble()); + return true; + } + else if (messageName == "SET_STEPPER_MULTIPLIER_TC") + { + mavlink_msg_set_stepper_multiplier_tc_pack( + sysId, compId, &output, + msg.getField("stepper_id").getUnsignedInteger(), + msg.getField("multiplier").getDouble()); + return true; + } return false; } diff --git a/src/shared/Modules/Mavlink/MavlinkCodec.h b/src/shared/Modules/Mavlink/MavlinkCodec.h index 2d794d50adddab7f88a4c519a673ca8758f3f3db..c79a62622b2b5f918252eab322d96e435c1f6ec4 100644 --- a/src/shared/Modules/Mavlink/MavlinkCodec.h +++ b/src/shared/Modules/Mavlink/MavlinkCodec.h @@ -34,10 +34,11 @@ class MavlinkCodec : public QObject public: enum SysId { - SysIdMain = MAV_SYSID_MAIN, - SysIdPayload = MAV_SYSID_PAYLOAD, - SysIdRig = MAV_SYSID_RIG, - SysIdGsReceiver = MAV_SYSID_GS, + SysIdMain = MAV_SYSID_MAIN, + SysIdPayload = MAV_SYSID_PAYLOAD, + SysIdRig = MAV_SYSID_RIG, + SysIdGS = MAV_SYSID_GS, + SysIdARP = MAV_SYSID_ARP, }; enum CompId @@ -88,4 +89,4 @@ private: QFile logFile; QMap<QString, int> msgNameIdMap; -}; \ No newline at end of file +}; diff --git a/src/shared/Modules/ModuleInfo.h b/src/shared/Modules/ModuleInfo.h index 588ad4bb36ffec5efc7888c9c357514a34529351..9ed6700fe57322b8eec55371c1c52d66c3174379 100644 --- a/src/shared/Modules/ModuleInfo.h +++ b/src/shared/Modules/ModuleInfo.h @@ -33,6 +33,7 @@ enum ModuleId MAIN_STATE_VIEWER, PAYLOAD_STATE_VIEWER, RIG_STATE_VIEWER, + ARP_STATE_VIEWER, ORIENTATION_VISUALIZER, VALVES_VIEWER, diff --git a/src/shared/Modules/ModulesList.cpp b/src/shared/Modules/ModulesList.cpp index e6f3edea9689bb602ab4b45095b802218bee0453..c0ebbb75d01fefa0dfb5d3963d2d31a88a5ddc02 100644 --- a/src/shared/Modules/ModulesList.cpp +++ b/src/shared/Modules/ModulesList.cpp @@ -20,6 +20,7 @@ #include <Components/FilterSelector/FilterSelector.h> #include <Components/ModulesPicker/ModulesPicker.h> +#include <Modules/ARPStateViewer/ARPStateViewer.h> #include <Modules/CommandPad/CommandPad.h> #include <Modules/CompactCommandPad/CompactCommandPad.h> #include <Modules/Empty/EmptyModule.h> @@ -102,6 +103,13 @@ ModulesList::ModulesList() { return new RigStateViewerModule(); }); modulesInfo.append(rigStateViewer); + ModuleInfo ARPStateViewer(ModuleId::ARP_STATE_VIEWER, + "ARP State Viewer", + ModuleCategory::DATA_VISUALIZATION); + ARPStateViewer.setFactoryMethod([]() + { return new ARPStateViewerModule(); }); + modulesInfo.append(ARPStateViewer); + ModuleInfo orientationVisualizer(ModuleId::ORIENTATION_VISUALIZER, "Orientation Visualizer", ModuleCategory::DATA_VISUALIZATION);