Commit c7c59937 authored by pixhawk's avatar pixhawk

Added watchdog views

parent 1bf17999
......@@ -50,7 +50,9 @@ FORMS += src/ui/MainWindow.ui \
src/ui/MAVLinkSettingsWidget.ui \
src/ui/AudioOutputWidget.ui \
src/ui/QGCSensorSettingsWidget.ui \
src/ui/watchdog/WatchdogControl.ui
src/ui/watchdog/WatchdogControl.ui \
src/ui/watchdog/WatchdogProcessView.ui \
src/ui/watchdog/WatchdogView.ui
INCLUDEPATH += src \
src/ui \
src/ui/linechart \
......@@ -119,7 +121,9 @@ HEADERS += src/MG.h \
src/uas/PxQuadMAV.h \
src/uas/ArduPilotMAV.h \
src/comm/MAVLinkSyntaxHighlighter.h \
src/ui/watchdog/WatchdogControl.h
src/ui/watchdog/WatchdogControl.h \
src/ui/watchdog/WatchdogProcessView.h \
src/ui/watchdog/WatchdogView.h
SOURCES += src/main.cc \
src/Core.cc \
src/uas/UASManager.cc \
......@@ -170,5 +174,7 @@ SOURCES += src/main.cc \
src/uas/PxQuadMAV.cc \
src/uas/ArduPilotMAV.cc \
src/comm/MAVLinkSyntaxHighlighter.cc \
src/ui/watchdog/WatchdogControl.cc
src/ui/watchdog/WatchdogControl.cc \
src/ui/watchdog/WatchdogProcessView.cc \
src/ui/watchdog/WatchdogView.cc
RESOURCES = mavground.qrc
......@@ -14,7 +14,7 @@ public slots:
/** @brief Send a command to an onboard process */
void sendProcessCommand(int watchdogId, int processId, unsigned int command);
signals:
void watchdogReceived(int systemId, int watchdogId, int processCount);
void watchdogReceived(int systemId, int watchdogId, unsigned int processCount);
void processReceived(int systemId, int watchdogId, int processId, QString name, QString arguments, int timeout);
void processChanged(int systemId, int watchdogId, int processId, int state, bool muted, int crashed, int pid);
};
......
......@@ -174,7 +174,8 @@ void LinechartWidget::createLayout()
// Connect notifications from the user interface to the plot
connect(this, SIGNAL(curveRemoved(QString)), activePlot, SLOT(hideCurve(QString)));
connect(this, SIGNAL(curveSet(QString, int)), activePlot, SLOT(showCurve(QString, int)));
//connect(this, SIGNAL(curveSet(QString, int)), activePlot, SLOT(showshowCurveCurve(QString, int)));
// FIXME
// Connect notifications from the plot to the user interface
connect(activePlot, SIGNAL(curveAdded(QString)), this, SLOT(addCurve(QString)));
......
......@@ -53,7 +53,7 @@ UASView::UASView(UASInterface* uas, QWidget *parent) :
m_ui->setupUi(this);
// Setup communication
connect(uas, SIGNAL(valueChanged(int,QString,double,quint64)), this, SLOT(receiveValue(int,QString,double,quint64)));
//connect(uas, SIGNAL(valueChanged(int,QString,double,quint64)), this, SLOT(receiveValue(int,QString,double,quint64)));
connect(uas, SIGNAL(batteryChanged(UASInterface*, double, double, int)), this, SLOT(updateBattery(UASInterface*, double, double, int)));
connect(uas, SIGNAL(heartbeat(UASInterface*)), this, SLOT(receiveHeartbeat(UASInterface*)));
connect(uas, SIGNAL(thrustChanged(UASInterface*, double)), this, SLOT(updateThrust(UASInterface*, double)));
......
......@@ -12,6 +12,14 @@ WatchdogControl::WatchdogControl(QWidget *parent) :
ui(new Ui::WatchdogControl)
{
ui->setupUi(this);
// UI is initialized, setup layout
listLayout = new QVBoxLayout(m_ui->listWidget);
listLayout->setSpacing(6);
listLayout->setMargin(0);
listLayout->setAlignment(Qt::AlignTop);
m_ui->listWidget->setLayout(listLayout);
connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)), this, SLOT(setUAS(UASInterface*)));
}
......@@ -27,7 +35,7 @@ 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(watchdogReceived(int,int,uint)), 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)));
}
}
......
......@@ -5,6 +5,7 @@
#include <QWidget>
#include <QTimer>
#include <QHBoxLayout>
#include <map>
#include <string>
......@@ -114,6 +115,7 @@ protected:
void changeEvent(QEvent *e);
UASInterface* mav;
QHBoxLayout* mainWidgetLayout;
private:
Ui::WatchdogControl *ui;
......
#include "WatchdogProcessView.h"
#include "ui_WatchdogProcessView.h"
WatchdogProcessView::WatchdogProcessView(QWidget *parent) :
QWidget(parent),
m_ui(new Ui::WatchdogProcessView)
{
m_ui->setupUi(this);
}
WatchdogProcessView::~WatchdogProcessView()
{
delete m_ui;
}
void WatchdogProcessView::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
m_ui->retranslateUi(this);
break;
default:
break;
}
}
#ifndef WATCHDOGPROCESSVIEW_H
#define WATCHDOGPROCESSVIEW_H
#include <QtGui/QWidget>
namespace Ui {
class WatchdogProcessView;
}
class WatchdogProcessView : public QWidget {
Q_OBJECT
public:
WatchdogProcessView(QWidget *parent = 0);
~WatchdogProcessView();
protected:
void changeEvent(QEvent *e);
private:
Ui::WatchdogProcessView *m_ui;
};
#endif // WATCHDOGPROCESSVIEW_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>WatchdogProcessView</class>
<widget class="QWidget" name="WatchdogProcessView">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>44</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="nameLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="pidLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="argumentsLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="startButton">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="restartButton">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
#include "WatchdogView.h"
#include "ui_WatchdogView.h"
WatchdogView::WatchdogView(QWidget *parent) :
QWidget(parent),
m_ui(new Ui::WatchdogView)
{
m_ui->setupUi(this);
}
WatchdogView::~WatchdogView()
{
delete m_ui;
}
void WatchdogView::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
m_ui->retranslateUi(this);
break;
default:
break;
}
}
#ifndef WATCHDOGVIEW_H
#define WATCHDOGVIEW_H
#include <QtGui/QWidget>
namespace Ui {
class WatchdogView;
}
class WatchdogView : public QWidget {
Q_OBJECT
public:
WatchdogView(QWidget *parent = 0);
~WatchdogView();
protected:
void changeEvent(QEvent *e);
private:
Ui::WatchdogView *m_ui;
};
#endif // WATCHDOGVIEW_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>WatchdogView</class>
<widget class="QWidget" name="WatchdogView">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout" rowstretch="0,100">
<item row="0" column="0">
<widget class="QLabel" name="nameLabel">
<property name="text">
<string>Watchdog</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QWidget" name="processListWidget" native="true"/>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment