diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index 9e633857beee5bcb6f6187389f194ee75f24e2f2..edc1afd7a4a493da708d7ab50fdea6eb618251fa 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -62,7 +62,8 @@ INCLUDEPATH += src \ src/input \ src/lib/qmapcontrol \ src/ui/mavlink \ - src/ui/param + src/ui/param \ + src/ui/watchdog HEADERS += src/MG.h \ src/Core.h \ src/uas/UASInterface.h \ diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index e07e037b679da7e7c71dee44658ef0fecd1c34ea..5caa3ef4b3d668b42f7213bd5b3ac51f208e6d66 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -98,6 +98,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), centerStack->addWidget(protocol); parameters = new ParameterInterface(this); parameters->setVisible(false); + watchdogControl = new WatchdogControl(this); QStringList* acceptList = new QStringList(); acceptList->append("roll IMU"); diff --git a/src/ui/MainWindow.h b/src/ui/MainWindow.h index dc8873f3654722d4b888adad49e92c92aa0d4317..2a0d62f02b5971f27485972fe3d9b8a6d3cb0be3 100644 --- a/src/ui/MainWindow.h +++ b/src/ui/MainWindow.h @@ -60,6 +60,7 @@ This file is part of the PIXHAWK project #include "ParameterInterface.h" #include "XMLCommProtocolWidget.h" #include "HDDisplay.h" +#include "WatchdogControl.h" #include "LogCompressor.h" @@ -146,6 +147,7 @@ protected: XMLCommProtocolWidget* protocol; HDDisplay* headDown1; HDDisplay* headDown2; + WatchdogControl* watchdogControl; // Popup widgets JoystickWidget* joystickWidget; diff --git a/src/ui/watchdog/WatchdogControl.cc b/src/ui/watchdog/WatchdogControl.cc index a53f956bcfda9632a46a8d8884644297eee440a6..208544877529e5004d130094f59f73ba698bd187 100644 --- a/src/ui/watchdog/WatchdogControl.cc +++ b/src/ui/watchdog/WatchdogControl.cc @@ -2,6 +2,8 @@ #include "ui_WatchdogControl.h" #include "PxQuadMAV.h" +#include "UASManager.h" + #include WatchdogControl::WatchdogControl(QWidget *parent) : @@ -10,6 +12,7 @@ WatchdogControl::WatchdogControl(QWidget *parent) : ui(new Ui::WatchdogControl) { ui->setupUi(this); + connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)), this, SLOT(setUAS(UASInterface*))); } WatchdogControl::~WatchdogControl() @@ -24,6 +27,8 @@ void WatchdogControl::setUAS(UASInterface* uas) if (qmav) { connect(qmav, SIGNAL(processReceived(int,int,int,QString,QString,int)), this, SLOT(addProcess(int,int,int,QString,QString,int))); + connect(qmav, SIGNAL(watchdogReceived(int,int,int)), this, SLOT(updateWatchdog(int,int,uint))); + connect(qmav, SIGNAL(processChanged(int,int,int,int,bool,int,int)), this, SLOT(updateProcess(int,int,int,int,bool,int,int))); } } @@ -38,6 +43,7 @@ void WatchdogControl::updateWatchdog(int systemId, int watchdogId, unsigned int // start the timeout timer //watchdog.timeoutTimer_.reset(); + qDebug() << "WATCHDOG RECEIVED"; //qDebug() << "<-- received mavlink_watchdog_heartbeat_t " << msg->sysid << " / " << payload.watchdog_id << " / " << payload.process_count << std::endl; } @@ -51,6 +57,7 @@ void WatchdogControl::addProcess(int systemId, int watchdogId, int processId, QS process.name_ = name.toStdString(); process.arguments_ = arguments.toStdString(); process.timeout_ = timeout; + qDebug() << "PROCESS RECEIVED"; //qDebug() << "<-- received mavlink_watchdog_process_info_t " << msg->sysid << " / " << (const char*)payload.name << " / " << (const char*)payload.arguments << " / " << payload.timeout << std::endl; } @@ -67,6 +74,7 @@ void WatchdogControl::updateProcess(int systemId, int watchdogId, int processId, process.crashes_ = crashes; process.pid_ = pid; + qDebug() << "PROCESS UPDATED"; //process.updateTimer_.reset(); //qDebug() << "<-- received mavlink_watchdog_process_status_t " << msg->sysid << " / " << payload.state << " / " << payload.muted << " / " << payload.crashes << " / " << payload.pid << std::endl; }