Commit 4decb8d6 authored by Michael Carpenter's avatar Michael Carpenter

Implementation of OSD Configuration

parent d440a4d6
...@@ -114,6 +114,7 @@ ...@@ -114,6 +114,7 @@
<file>files/images/devices/AC-0004-11-2.jpg</file> <file>files/images/devices/AC-0004-11-2.jpg</file>
<file>files/images/devices/BR-0004-03-2.jpg</file> <file>files/images/devices/BR-0004-03-2.jpg</file>
<file>files/images/devices/BR-0016-01-3T.jpg</file> <file>files/images/devices/BR-0016-01-3T.jpg</file>
<file>files/images/devices/MinimOSD.jpg</file>
</qresource> </qresource>
<qresource prefix="/general"> <qresource prefix="/general">
<file alias="vera.ttf">files/styles/Vera.ttf</file> <file alias="vera.ttf">files/styles/Vera.ttf</file>
......
#include "OsdConfig.h" #include "OsdConfig.h"
#include <QMessageBox>
OsdConfig::OsdConfig(QWidget *parent) : AP2ConfigWidget(parent)
OsdConfig::OsdConfig(QWidget *parent) : QWidget(parent)
{ {
ui.setupUi(this); ui.setupUi(this);
connect(ui.enablePushButton,SIGNAL(clicked()),this,SLOT(enableButtonClicked()));
} }
OsdConfig::~OsdConfig() OsdConfig::~OsdConfig()
{ {
} }
void OsdConfig::enableButtonClicked()
{
if (!m_uas)
{
QMessageBox::information(0,tr("Error"),tr("Please connect to a MAV before attempting to set configuration"));
return;
}
m_uas->setParameter(0,"SR0_EXT_STAT",2);
m_uas->setParameter(0,"SR0_EXTRA1",10);
m_uas->setParameter(0,"SR0_EXTRA2",10);
m_uas->setParameter(0,"SR0_EXTRA3",2);
m_uas->setParameter(0,"SR0_POSITION",3);
m_uas->setParameter(0,"SR0_RAW_CTRL",2);
m_uas->setParameter(0,"SR0_RAW_SENS",2);
m_uas->setParameter(0,"SR0_RC_CHAN",2);
m_uas->setParameter(0,"SR3_EXT_STAT",2);
m_uas->setParameter(0,"SR3_EXTRA1",10);
m_uas->setParameter(0,"SR3_EXTRA2",10);
m_uas->setParameter(0,"SR3_EXTRA3",2);
m_uas->setParameter(0,"SR3_POSITION",3);
m_uas->setParameter(0,"SR3_RAW_CTRL",2);
m_uas->setParameter(0,"SR3_RAW_SENS",2);
m_uas->setParameter(0,"SR3_RC_CHAN",2);
}
...@@ -2,16 +2,18 @@ ...@@ -2,16 +2,18 @@
#define OSDCONFIG_H #define OSDCONFIG_H
#include <QWidget> #include <QWidget>
#include "AP2ConfigWidget.h"
#include "ui_OsdConfig.h" #include "ui_OsdConfig.h"
class OsdConfig : public QWidget class OsdConfig : public AP2ConfigWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit OsdConfig(QWidget *parent = 0); explicit OsdConfig(QWidget *parent = 0);
~OsdConfig(); ~OsdConfig();
private slots:
void enableButtonClicked();
private: private:
Ui::OsdConfig ui; Ui::OsdConfig ui;
}; };
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>400</width> <width>499</width>
<height>300</height> <height>243</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
...@@ -29,7 +29,57 @@ ...@@ -29,7 +29,57 @@
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>10</x>
<y>60</y>
<width>101</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../../qgroundcontrol.qrc">:/files/images/devices/MinimOSD.jpg</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>230</x>
<y>60</y>
<width>191</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>You only need to use this if you are
having issue with your OSD not
updating</string>
</property>
</widget>
<widget class="QPushButton" name="enablePushButton">
<property name="geometry">
<rect>
<x>120</x>
<y>60</y>
<width>91</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>Enable
Telemetry</string>
</property>
</widget>
</widget> </widget>
<resources/> <resources>
<include location="../../../qgroundcontrol.qrc"/>
</resources>
<connections/> <connections/>
</ui> </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