Browse Source

Added watchdog views

QGC4.4
pixhawk 15 years ago
parent
commit
c7c59937f0
  1. 12
      qgroundcontrol.pro
  2. 2
      src/uas/PxQuadMAV.h
  3. 3
      src/ui/linechart/LinechartWidget.cc
  4. 2
      src/ui/uas/UASView.cc
  5. 10
      src/ui/watchdog/WatchdogControl.cc
  6. 2
      src/ui/watchdog/WatchdogControl.h
  7. 26
      src/ui/watchdog/WatchdogProcessView.cc
  8. 23
      src/ui/watchdog/WatchdogProcessView.h
  9. 56
      src/ui/watchdog/WatchdogProcessView.ui
  10. 26
      src/ui/watchdog/WatchdogView.cc
  11. 23
      src/ui/watchdog/WatchdogView.h
  12. 31
      src/ui/watchdog/WatchdogView.ui

12
qgroundcontrol.pro

@ -50,7 +50,9 @@ FORMS += src/ui/MainWindow.ui \ @@ -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 \ @@ -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 \ @@ -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

2
src/uas/PxQuadMAV.h

@ -14,7 +14,7 @@ public slots: @@ -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);
};

3
src/ui/linechart/LinechartWidget.cc

@ -174,7 +174,8 @@ void LinechartWidget::createLayout() @@ -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)));

2
src/ui/uas/UASView.cc

@ -53,7 +53,7 @@ UASView::UASView(UASInterface* uas, QWidget *parent) : @@ -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)));

10
src/ui/watchdog/WatchdogControl.cc

@ -12,6 +12,14 @@ WatchdogControl::WatchdogControl(QWidget *parent) : @@ -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) @@ -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)));
}
}

2
src/ui/watchdog/WatchdogControl.h

@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
#include <QWidget>
#include <QTimer>
#include <QHBoxLayout>
#include <map>
#include <string>
@ -114,6 +115,7 @@ protected: @@ -114,6 +115,7 @@ protected:
void changeEvent(QEvent *e);
UASInterface* mav;
QHBoxLayout* mainWidgetLayout;
private:
Ui::WatchdogControl *ui;

26
src/ui/watchdog/WatchdogProcessView.cc

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
#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;
}
}

23
src/ui/watchdog/WatchdogProcessView.h

@ -0,0 +1,23 @@ @@ -0,0 +1,23 @@
#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

56
src/ui/watchdog/WatchdogProcessView.ui

@ -0,0 +1,56 @@ @@ -0,0 +1,56 @@
<?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>

26
src/ui/watchdog/WatchdogView.cc

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
#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;
}
}

23
src/ui/watchdog/WatchdogView.h

@ -0,0 +1,23 @@ @@ -0,0 +1,23 @@
#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

31
src/ui/watchdog/WatchdogView.ui

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
<?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>
Loading…
Cancel
Save