Commit 09cc683c authored by Michael Carpenter's avatar Michael Carpenter

More changes for a better looking and functioning ApmFirmwareConfig screen

parent 56efe884
......@@ -263,8 +263,7 @@ FORMS += src/ui/MainWindow.ui \
src/ui/configuration/ArduRoverPidConfig.ui \
src/ui/configuration/terminalconsole.ui \
src/ui/configuration/SerialSettingsDialog.ui \
src/ui/configuration/ApmFirmwareConfig.ui \
src/ui/configuration/ApmFirmwareStatus.ui
src/ui/configuration/ApmFirmwareConfig.ui
INCLUDEPATH += src \
src/ui \
src/ui/linechart \
......@@ -455,8 +454,7 @@ HEADERS += src/MG.h \
src/ui/configuration/SerialSettingsDialog.h \
src/ui/configuration/terminalconsole.h \
src/ui/configuration/ApmHighlighter.h \
src/ui/configuration/ApmFirmwareConfig.h \
src/ui/configuration/ApmFirmwareStatus.h
src/ui/configuration/ApmFirmwareConfig.h
# Google Earth is only supported on Mac OS and Windows with Visual Studio Compiler
macx|macx-g++|macx-g++42|win32-msvc2008|win32-msvc2010|win32-msvc2012::HEADERS += src/ui/map3D/QGCGoogleEarthView.h
......@@ -666,8 +664,7 @@ SOURCES += src/main.cc \
src/ui/configuration/console.cpp \
src/ui/configuration/SerialSettingsDialog.cc \
src/ui/configuration/ApmHighlighter.cc \
src/ui/configuration/ApmFirmwareConfig.cc \
src/ui/configuration/ApmFirmwareStatus.cc
src/ui/configuration/ApmFirmwareConfig.cc
# Enable Google Earth only on Mac OS and Windows with Visual Studio compiler
macx|macx-g++|macx-g++42|win32-msvc2008|win32-msvc2010|win32-msvc2012::SOURCES += src/ui/map3D/QGCGoogleEarthView.cc
......
This diff is collapsed.
......@@ -8,6 +8,9 @@
#include <QDebug>
#include <QTemporaryFile>
#include <QProcess>
#include <QXmlStreamReader>
#include <QMessageBox>
#include <QProcess>
#include "qserialport.h"
#include "ui_ApmFirmwareConfig.h"
#include "ApmFirmwareStatus.h"
......@@ -23,16 +26,19 @@ private slots:
void firmwareListFinished();
void firmwareListError(QNetworkReply::NetworkError error);
void burnButtonClicked();
void betaFirmwareButtonClicked();
void betaFirmwareButtonClicked(bool betafirmwareenabled);
void downloadFinished();
void firmwareProcessFinished(int status);
void firmwareProcessReadyRead();
void firmwareProcessError(QProcess::ProcessError error);
void firmwareDownloadProgress(qint64 received,qint64 total);
private:
ApmFirmwareStatus *firmwareStatus;
//ApmFirmwareStatus *firmwareStatus;
QString m_detectedComPort;
QTemporaryFile *m_tempFirmwareFile;
QNetworkAccessManager *m_networkManager;
void requestFirmwares(bool beta);
void requestFirmwares();
void requestBetaFirmwares();
bool stripVersionFromGitReply(QString url,QString reply,QString type,QString stable,QString *out);
bool m_betaFirmwareChecked;
QMap<QPushButton*,QString> m_buttonToUrlMap;
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>958</width>
<height>497</height>
<width>868</width>
<height>661</height>
</rect>
</property>
<property name="windowTitle">
......@@ -18,7 +18,7 @@
<rect>
<x>10</x>
<y>20</y>
<width>91</width>
<width>211</width>
<height>31</height>
</rect>
</property>
......@@ -428,14 +428,69 @@
<widget class="QPushButton" name="betaFirmwareButton">
<property name="geometry">
<rect>
<x>760</x>
<x>700</x>
<y>440</y>
<width>91</width>
<width>131</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Beta firmwares</string>
<string>Beta firmware</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
<widget class="QProgressBar" name="progressBar">
<property name="geometry">
<rect>
<x>50</x>
<y>470</y>
<width>791</width>
<height>23</height>
</rect>
</property>
<property name="value">
<number>24</number>
</property>
</widget>
<widget class="QTextBrowser" name="textBrowser">
<property name="geometry">
<rect>
<x>60</x>
<y>500</y>
<width>741</width>
<height>151</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="showOutputCheckBox">
<property name="geometry">
<rect>
<x>600</x>
<y>440</y>
<width>101</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Show Output</string>
</property>
</widget>
<widget class="QLabel" name="statusLabel">
<property name="geometry">
<rect>
<x>60</x>
<y>440</y>
<width>141</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Status</string>
</property>
</widget>
</widget>
......
#include "ApmFirmwareStatus.h"
ApmFirmwareStatus::ApmFirmwareStatus(QWidget *parent) : QWidget(parent)
{
ui.setupUi(this);
ui.progressBar->setMaximum(50);
}
ApmFirmwareStatus::~ApmFirmwareStatus()
{
}
void ApmFirmwareStatus::passMessage(QString msg)
{
ui.textBrowser->append(msg);
}
void ApmFirmwareStatus::setStatus(QString message)
{
ui.label->setText("<h2>" + message + "</h2>");
}
void ApmFirmwareStatus::resetProgress()
{
ui.progressBar->setValue(0);
}
void ApmFirmwareStatus::progressTick()
{
ui.progressBar->setValue(ui.progressBar->value()+1);
}
#ifndef APMFIRMWARESTATUS_H
#define APMFIRMWARESTATUS_H
#include <QWidget>
#include "ui_ApmFirmwareStatus.h"
class ApmFirmwareStatus : public QWidget
{
Q_OBJECT
public:
explicit ApmFirmwareStatus(QWidget *parent = 0);
~ApmFirmwareStatus();
void passMessage(QString msg);
void setStatus(QString message);
void resetProgress();
void progressTick();
private:
Ui::ApmFirmwareStatus ui;
};
#endif // APMFIRMWARESTATUS_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ApmFirmwareStatus</class>
<widget class="QWidget" name="ApmFirmwareStatus">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>889</width>
<height>313</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QPushButton" name="closePushButton">
<property name="geometry">
<rect>
<x>390</x>
<y>110</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Close</string>
</property>
</widget>
<widget class="QTextBrowser" name="textBrowser">
<property name="geometry">
<rect>
<x>10</x>
<y>150</y>
<width>871</width>
<height>141</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<width>291</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>&lt;h2&gt;Status&lt;/h2&gt;</string>
</property>
</widget>
<widget class="QProgressBar" name="progressBar">
<property name="geometry">
<rect>
<x>10</x>
<y>70</y>
<width>851</width>
<height>23</height>
</rect>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</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