Browse Source

merged

QGC4.4
dongfang 12 years ago
parent
commit
ccd2ba2f24
  1. 4
      files/styles/style-indoor.css
  2. 4
      files/styles/style-outdoor.css
  3. 2
      src/configuration.h
  4. 7
      src/uas/UAS.cc
  5. 23
      src/ui/DebugConsole.cc
  6. 4
      src/ui/DebugConsole.h
  7. 6
      src/ui/HDDisplay.cc
  8. 2
      src/ui/HSIDisplay.cc
  9. 49
      src/ui/MainWindow.cc
  10. 1
      src/ui/MainWindow.ui
  11. 23
      src/ui/PrimaryFlightDisplay.cpp
  12. 68
      src/ui/QGCVehicleConfig.cc
  13. 9
      src/ui/QGCVehicleConfig.h
  14. 628
      src/ui/QGCVehicleConfig.ui
  15. 6
      src/ui/QGCWaypointListMulti.cc
  16. 17
      src/ui/uas/UASInfoWidget.cc
  17. 5
      src/ui/uas/UASListWidget.cc

4
files/styles/style-indoor.css

@ -178,8 +178,8 @@ QDoubleSpinBox::down-button {
} }
QPushButton { QPushButton {
min-height: 20px; /*min-height: 20px;*/
max-height: 20px; /*max-height: 20px;*/
border: 1px solid #465158; border: 1px solid #465158;
margin: 1px; margin: 1px;
border-radius: 2px; border-radius: 2px;

4
files/styles/style-outdoor.css

@ -184,8 +184,8 @@ QDoubleSpinBox::down-button {
QPushButton { QPushButton {
font-weight: bold; font-weight: bold;
min-height: 18px; /*min-height: 18px;*/
max-height: 18px; /*max-height: 18px;*/
border: 2px solid #4A4A4F; border: 2px solid #4A4A4F;
border-radius: 5px; border-radius: 5px;
padding-left: 10px; padding-left: 10px;

2
src/configuration.h

@ -11,7 +11,7 @@
#define WITH_TEXT_TO_SPEECH 1 #define WITH_TEXT_TO_SPEECH 1
#define QGC_APPLICATION_NAME "QGroundControl" #define QGC_APPLICATION_NAME "QGroundControl"
#define QGC_APPLICATION_VERSION "v. 1.0.9 (beta)" #define QGC_APPLICATION_VERSION "v. 1.0.10 (beta)"
namespace QGC namespace QGC

7
src/uas/UAS.cc

@ -1148,13 +1148,12 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
case MAVLINK_MSG_ID_STATUSTEXT: case MAVLINK_MSG_ID_STATUSTEXT:
{ {
QByteArray b; QByteArray b;
b.resize(MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN); b.resize(MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN+1);
mavlink_msg_statustext_get_text(&message, b.data()); mavlink_msg_statustext_get_text(&message, b.data());
//b.append('\0'); // Ensure NUL-termination
b[b.length()-1] = '\0';
QString text = QString(b); QString text = QString(b);
int severity = mavlink_msg_statustext_get_severity(&message); int severity = mavlink_msg_statustext_get_severity(&message);
//qDebug() << "RECEIVED STATUS:" << text;false
//emit statusTextReceived(severity, text);
if (text.startsWith("#audio:")) if (text.startsWith("#audio:"))
{ {

23
src/ui/DebugConsole.cc

@ -93,14 +93,23 @@ DebugConsole::DebugConsole(QWidget *parent) :
// Update measurements the first time // Update measurements the first time
updateTrafficMeasurements(); updateTrafficMeasurements();
// First connect management slots, then make sure to add all existing objects
// Connect to link manager to get notified about new links
connect(LinkManager::instance(), SIGNAL(newLink(LinkInterface*)), this, SLOT(addLink(LinkInterface*)));
// Connect to UAS manager to get notified about new UAS
connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)), this, SLOT(uasCreated(UASInterface*)));
// Get a list of all existing links // Get a list of all existing links
links = QList<LinkInterface*>(); links = QList<LinkInterface*>();
foreach (LinkInterface* link, LinkManager::instance()->getLinks()) { foreach (LinkInterface* link, LinkManager::instance()->getLinks()) {
addLink(link); addLink(link);
} }
// Connect to link manager to get notified about new links // Get a list of all existing UAS
connect(LinkManager::instance(), SIGNAL(newLink(LinkInterface*)), this, SLOT(addLink(LinkInterface*))); foreach (UASInterface* uas, UASManager::instance()->getUASList()) {
uasCreated(uas);
}
// Connect link combo box // Connect link combo box
connect(m_ui->linkComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(linkSelected(int))); connect(m_ui->linkComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(linkSelected(int)));
// Connect send button // Connect send button
@ -169,6 +178,12 @@ void DebugConsole::storeSettings()
//qDebug() << "Storing settings!"; //qDebug() << "Storing settings!";
} }
void DebugConsole::uasCreated(UASInterface* uas)
{
connect(uas, SIGNAL(textMessageReceived(int,int,int,QString)),
this, SLOT(receiveTextMessage(int,int,int,QString)), Qt::UniqueConnection);
}
/** /**
* Add a link to the debug console output * Add a link to the debug console output
*/ */
@ -183,8 +198,8 @@ void DebugConsole::addLink(LinkInterface* link)
linkSelected(m_ui->linkComboBox->currentIndex()); linkSelected(m_ui->linkComboBox->currentIndex());
// Register for name changes // Register for name changes
connect(link, SIGNAL(nameChanged(QString)), this, SLOT(updateLinkName(QString))); connect(link, SIGNAL(nameChanged(QString)), this, SLOT(updateLinkName(QString)), Qt::UniqueConnection);
connect(link, SIGNAL(deleteLink(LinkInterface* const)), this, SLOT(removeLink(LinkInterface* const))); connect(link, SIGNAL(deleteLink(LinkInterface* const)), this, SLOT(removeLink(LinkInterface* const)), Qt::UniqueConnection);
} }
void DebugConsole::removeLink(LinkInterface* const linkInterface) void DebugConsole::removeLink(LinkInterface* const linkInterface)

4
src/ui/DebugConsole.h

@ -45,6 +45,8 @@ namespace Ui
class DebugConsole; class DebugConsole;
} }
class UASInterface;
/** /**
* @brief Shows a debug console * @brief Shows a debug console
* *
@ -61,6 +63,8 @@ public:
public slots: public slots:
/** @brief Add a link to the list of monitored links */ /** @brief Add a link to the list of monitored links */
void addLink(LinkInterface* link); void addLink(LinkInterface* link);
/** @brief Add a UAS to the list of monitored UAS */
void uasCreated(UASInterface* uas);
/** @brief Remove a link from the list */ /** @brief Remove a link from the list */
void removeLink(LinkInterface* const link); void removeLink(LinkInterface* const link);
/** @brief Update a link name */ /** @brief Update a link name */

6
src/ui/HDDisplay.cc

@ -128,8 +128,8 @@ HDDisplay::HDDisplay(QStringList* plotList, QString title, QWidget *parent) :
if (font.family() != fontFamilyName) qDebug() << "ERROR! Font not loaded: " << fontFamilyName; if (font.family() != fontFamilyName) qDebug() << "ERROR! Font not loaded: " << fontFamilyName;
// Connect with UAS // Connect with UAS
connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*))); connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*)), Qt::UniqueConnection);
//start(); setActiveUAS(UASManager::instance()->getActiveUAS());
} }
HDDisplay::~HDDisplay() HDDisplay::~HDDisplay()
@ -476,6 +476,8 @@ void HDDisplay::renderOverlay()
*/ */
void HDDisplay::setActiveUAS(UASInterface* uas) void HDDisplay::setActiveUAS(UASInterface* uas)
{ {
if (!uas)
return;
// Disconnect any previously connected active UAS // Disconnect any previously connected active UAS
if (this->uas != NULL) { if (this->uas != NULL) {
removeSource(this->uas); removeSource(this->uas);

2
src/ui/HSIDisplay.cc

@ -178,6 +178,8 @@ HSIDisplay::HSIDisplay(QWidget *parent) :
connect(&statusClearTimer, SIGNAL(timeout()), this, SLOT(clearStatusMessage())); connect(&statusClearTimer, SIGNAL(timeout()), this, SLOT(clearStatusMessage()));
statusClearTimer.start(3000); statusClearTimer.start(3000);
setActiveUAS(UASManager::instance()->getActiveUAS());
setFocusPolicy(Qt::StrongFocus); setFocusPolicy(Qt::StrongFocus);
} }

49
src/ui/MainWindow.cc

@ -1730,43 +1730,17 @@ void MainWindow::UASCreated(UASInterface* uas)
break; break;
} }
// XXX The multi-UAS selection menu has been disabled for now,
// its redundant with right-clicking the UAS in the list.
// this code piece might be removed later if this is the final
// conclusion (May 2013)
// QAction* uasAction = new QAction(icon, tr("Select %1 for control").arg(uas->getUASName()), ui.menuConnected_Systems); // QAction* uasAction = new QAction(icon, tr("Select %1 for control").arg(uas->getUASName()), ui.menuConnected_Systems);
// connect(uas, SIGNAL(systemRemoved()), uasAction, SLOT(deleteLater())); // connect(uas, SIGNAL(systemRemoved()), uasAction, SLOT(deleteLater()));
// connect(uasAction, SIGNAL(triggered()), uas, SLOT(setSelected())); // connect(uasAction, SIGNAL(triggered()), uas, SLOT(setSelected()));
connect(uas, SIGNAL(systemSpecsChanged(int)), this, SLOT(UASSpecsChanged(int)));
// ui.menuConnected_Systems->addAction(uasAction); // ui.menuConnected_Systems->addAction(uasAction);
// FIXME Should be not inside the mainwindow
if (debugConsoleDockWidget)
{
DebugConsole *debugConsole = dynamic_cast<DebugConsole*>(debugConsoleDockWidget->widget());
if (debugConsole)
{
connect(uas, SIGNAL(textMessageReceived(int,int,int,QString)),
debugConsole, SLOT(receiveTextMessage(int,int,int,QString)));
}
}
// Health / System status indicator
if (infoDockWidget)
{
UASInfoWidget *infoWidget = dynamic_cast<UASInfoWidget*>(infoDockWidget->widget());
if (infoWidget)
{
infoWidget->addUAS(uas);
}
}
// UAS List connect(uas, SIGNAL(systemSpecsChanged(int)), this, SLOT(UASSpecsChanged(int)));
if (listDockWidget)
{
UASListWidget *listWidget = dynamic_cast<UASListWidget*>(listDockWidget->widget());
if (listWidget)
{
listWidget->addUAS(uas);
}
}
// HIL // HIL
showHILConfigurationWidget(uas); showHILConfigurationWidget(uas);
@ -1778,25 +1752,12 @@ void MainWindow::UASCreated(UASInterface* uas)
} }
// Line chart
//if (!linechartWidget)
//{
// Center widgets
//linechartWidget->addSystem(uas);
linechartWidget->addSource(mavlinkDecoder); linechartWidget->addSource(mavlinkDecoder);
//addCentralWidget(linechartWidget, tr("Realtime Plot"));
if (dataView->centralWidget() != linechartWidget) if (dataView->centralWidget() != linechartWidget)
{ {
dataView->setCentralWidget(linechartWidget); dataView->setCentralWidget(linechartWidget);
linechartWidget->show(); linechartWidget->show();
} }
//dataView->setCentralWidget(linechartWidget);
//linechartWidget->show();
//}
// Load default custom widgets for this autopilot type // Load default custom widgets for this autopilot type
loadCustomWidgetsFromDefaults(uas->getSystemTypeName(), uas->getAutopilotTypeName()); loadCustomWidgetsFromDefaults(uas->getSystemTypeName(), uas->getAutopilotTypeName());

1
src/ui/MainWindow.ui

@ -89,6 +89,7 @@
</property> </property>
<addaction name="actionNewCustomWidget"/> <addaction name="actionNewCustomWidget"/>
<addaction name="actionLoadCustomWidgetFile"/> <addaction name="actionLoadCustomWidgetFile"/>
<addaction name="separator"/>
</widget> </widget>
<widget class="QMenu" name="menuHelp"> <widget class="QMenu" name="menuHelp">
<property name="title"> <property name="title">

23
src/ui/PrimaryFlightDisplay.cpp

@ -9,7 +9,8 @@
#include <QPainter> #include <QPainter>
#include <QPainterPath> #include <QPainterPath>
#include <QResizeEvent> #include <QResizeEvent>
#include <math.h> //#include <math.h>
#include <cmath>
/* /*
*@TODO: *@TODO:
@ -17,6 +18,10 @@
* repaint on demand multiple canvases * repaint on demand multiple canvases
* multi implementation with shared model class * multi implementation with shared model class
*/ */
double round(double value, int digits=0)
{
return floor(value * pow(10, digits) + 0.5) / pow(10, digits);
}
const int PrimaryFlightDisplay::tickValues[] = {10, 20, 30, 45, 60}; const int PrimaryFlightDisplay::tickValues[] = {10, 20, 30, 45, 60};
const QString PrimaryFlightDisplay::compassWindNames[] = { const QString PrimaryFlightDisplay::compassWindNames[] = {
@ -35,7 +40,8 @@ PrimaryFlightDisplay::PrimaryFlightDisplay(int width, int height, QWidget *paren
roll(0), roll(0),
pitch(0), pitch(0),
heading(NAN), // heading(NAN),
heading(0),
aboveASLAltitude(0), aboveASLAltitude(0),
GPSAltitude(0), GPSAltitude(0),
aboveHomeAltitude(0), aboveHomeAltitude(0),
@ -80,7 +86,8 @@ PrimaryFlightDisplay::PrimaryFlightDisplay(int width, int height, QWidget *paren
// Refresh timer // Refresh timer
refreshTimer->setInterval(updateInterval); refreshTimer->setInterval(updateInterval);
connect(refreshTimer, SIGNAL(timeout()), this, SLOT(paintHUD())); // connect(refreshTimer, SIGNAL(timeout()), this, SLOT(paintHUD()));
connect(refreshTimer, SIGNAL(timeout()), this, SLOT(update()));
} }
PrimaryFlightDisplay::~PrimaryFlightDisplay() PrimaryFlightDisplay::~PrimaryFlightDisplay()
@ -165,9 +172,9 @@ void PrimaryFlightDisplay::updateAttitude(UASInterface* uas, double roll, double
if (!isnan(roll) && !isinf(roll) && !isnan(pitch) && !isinf(pitch) && !isnan(yaw) && !isinf(yaw)) if (!isnan(roll) && !isinf(roll) && !isnan(pitch) && !isinf(pitch) && !isnan(yaw) && !isinf(yaw))
{ {
// TODO: Units conversion? // TODO: Units conversion?
this->roll = roll; this->roll = roll * (180.0 / M_PI);
this->pitch = pitch; this->pitch = pitch * (180.0 / M_PI);
this->heading = yaw; this->heading = yaw * (180.0 / M_PI);
} }
// TODO: Else-part. We really should have an "attitude bad or unknown" indication instead of just freezing. // TODO: Else-part. We really should have an "attitude bad or unknown" indication instead of just freezing.
@ -309,7 +316,7 @@ void PrimaryFlightDisplay::paintEvent(QPaintEvent *event)
// the event is ignored as this widget // the event is ignored as this widget
// is refreshed automatically // is refreshed automatically
Q_UNUSED(event); Q_UNUSED(event);
makeDummyData(); //makeDummyData();
doPaint(); doPaint();
} }
@ -319,7 +326,7 @@ void PrimaryFlightDisplay::paintOnTimer() {
*The whole tainted-flag shebang. *The whole tainted-flag shebang.
*well not really so critical. Worst problem is deletion? *well not really so critical. Worst problem is deletion?
*/ */
makeDummyData(); //makeDummyData();
doPaint(); doPaint();
} }

68
src/ui/QGCVehicleConfig.cc

@ -44,6 +44,12 @@ QGCVehicleConfig::QGCVehicleConfig(QWidget *parent) :
setObjectName("QGC_VEHICLECONFIG"); setObjectName("QGC_VEHICLECONFIG");
ui->setupUi(this); ui->setupUi(this);
connect(ui->rcMenuButton,SIGNAL(clicked()),this,SLOT(rcMenuButtonClicked()));
connect(ui->sensorMenuButton,SIGNAL(clicked()),this,SLOT(sensorMenuButtonClicked()));
connect(ui->generalMenuButton,SIGNAL(clicked()),this,SLOT(generalMenuButtonClicked()));
connect(ui->advancedMenuButton,SIGNAL(clicked()),this,SLOT(advancedMenuButtonClicked()));
requestCalibrationRC(); requestCalibrationRC();
if (mav) mav->requestParameter(0, "RC_TYPE"); if (mav) mav->requestParameter(0, "RC_TYPE");
@ -89,6 +95,25 @@ QGCVehicleConfig::QGCVehicleConfig(QWidget *parent) :
connect(&updateTimer, SIGNAL(timeout()), this, SLOT(updateView())); connect(&updateTimer, SIGNAL(timeout()), this, SLOT(updateView()));
updateTimer.start(); updateTimer.start();
} }
void QGCVehicleConfig::rcMenuButtonClicked()
{
ui->stackedWidget->setCurrentIndex(0);
}
void QGCVehicleConfig::sensorMenuButtonClicked()
{
ui->stackedWidget->setCurrentIndex(1);
}
void QGCVehicleConfig::generalMenuButtonClicked()
{
ui->stackedWidget->setCurrentIndex(ui->stackedWidget->count()-2);
}
void QGCVehicleConfig::advancedMenuButtonClicked()
{
ui->stackedWidget->setCurrentIndex(ui->stackedWidget->count()-1);
}
QGCVehicleConfig::~QGCVehicleConfig() QGCVehicleConfig::~QGCVehicleConfig()
{ {
@ -247,8 +272,18 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
//Load tabs for general configuration //Load tabs for general configuration
foreach (QString dir,generaldir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) foreach (QString dir,generaldir.entryList(QDir::Dirs | QDir::NoDotAndDotDot))
{ {
QWidget *tab = new QWidget(ui->tabWidget); QPushButton *button = new QPushButton(ui->scrollAreaWidgetContents_3);
ui->tabWidget->insertTab(2,tab,dir); connect(button,SIGNAL(clicked()),this,SLOT(menuButtonClicked()));
ui->navBarLayout->insertWidget(2,button);
button->setMinimumHeight(100);
button->setMinimumWidth(100);
button->show();
button->setText(dir);
//QWidget *tab = new QWidget(ui->tabWidget);
//ui->tabWidget->insertTab(2,tab,dir);
QWidget *tab = new QWidget(ui->stackedWidget);
ui->stackedWidget->insertWidget(2,tab);
buttonToWidgetMap[button] = tab;
tab->setLayout(new QVBoxLayout()); tab->setLayout(new QVBoxLayout());
tab->show(); tab->show();
QScrollArea *area = new QScrollArea(); QScrollArea *area = new QScrollArea();
@ -283,8 +318,20 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
//Load tabs for vehicle specific configuration //Load tabs for vehicle specific configuration
foreach (QString dir,vehicledir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) foreach (QString dir,vehicledir.entryList(QDir::Dirs | QDir::NoDotAndDotDot))
{ {
QWidget *tab = new QWidget(ui->tabWidget); //QWidget *tab = new QWidget(ui->tabWidget);
ui->tabWidget->insertTab(2,tab,dir); //ui->tabWidget->insertTab(2,tab,dir);
QPushButton *button = new QPushButton(ui->scrollAreaWidgetContents_3);
connect(button,SIGNAL(clicked()),this,SLOT(menuButtonClicked()));
ui->navBarLayout->insertWidget(2,button);
QWidget *tab = new QWidget(ui->stackedWidget);
ui->stackedWidget->insertWidget(2,tab);
buttonToWidgetMap[button] = tab;
button->setMinimumHeight(100);
button->setMinimumWidth(100);
button->show();
button->setText(dir);
tab->setLayout(new QVBoxLayout()); tab->setLayout(new QVBoxLayout());
tab->show(); tab->show();
QScrollArea *area = new QScrollArea(); QScrollArea *area = new QScrollArea();
@ -362,6 +409,19 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
} }
void QGCVehicleConfig::menuButtonClicked()
{
QPushButton *button = qobject_cast<QPushButton*>(sender());
if (!button)
{
return;
}
if (buttonToWidgetMap.contains(button))
{
ui->stackedWidget->setCurrentWidget(buttonToWidgetMap[button]);
}
}
void QGCVehicleConfig::loadConfig() void QGCVehicleConfig::loadConfig()
{ {

9
src/ui/QGCVehicleConfig.h

@ -5,6 +5,7 @@
#include <QTimer> #include <QTimer>
#include <QList> #include <QList>
#include <QGroupBox> #include <QGroupBox>
#include <QPushButton>
#include "QGCToolWidget.h" #include "QGCToolWidget.h"
#include "UASInterface.h" #include "UASInterface.h"
@ -29,6 +30,11 @@ public:
}; };
public slots: public slots:
void rcMenuButtonClicked();
void sensorMenuButtonClicked();
void generalMenuButtonClicked();
void advancedMenuButtonClicked();
/** Set the MAV currently being calibrated */ /** Set the MAV currently being calibrated */
void setActiveUAS(UASInterface* active); void setActiveUAS(UASInterface* active);
/** Fallback function, automatically called by loadConfig() upon failure to find and xml file*/ /** Fallback function, automatically called by loadConfig() upon failure to find and xml file*/
@ -125,6 +131,7 @@ public slots:
} }
protected slots: protected slots:
void menuButtonClicked();
/** Reset the RC calibration */ /** Reset the RC calibration */
void resetCalibrationRC(); void resetCalibrationRC();
/** Write the RC calibration */ /** Write the RC calibration */
@ -183,7 +190,7 @@ protected:
private: private:
Ui::QGCVehicleConfig *ui; Ui::QGCVehicleConfig *ui;
QMap<QPushButton*,QWidget*> buttonToWidgetMap;
signals: signals:
void visibilityChanged(bool visible); void visibilityChanged(bool visible);
}; };

628
src/ui/QGCVehicleConfig.ui

@ -6,83 +6,149 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>760</width> <width>1151</width>
<height>541</height> <height>602</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QHBoxLayout" name="horizontalLayout_11" stretch="1,2,1">
<property name="horizontalSpacing"> <item>
<number>6</number> <widget class="QScrollArea" name="scrollArea_6">
<property name="minimumSize">
<size>
<width>125</width>
<height>0</height>
</size>
</property> </property>
<property name="verticalSpacing"> <property name="maximumSize">
<number>8</number> <size>
<width>125</width>
<height>16777215</height>
</size>
</property> </property>
<property name="margin"> <property name="widgetResizable">
<number>6</number> <bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_3">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>123</width>
<height>582</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_12">
<item>
<layout class="QVBoxLayout" name="navBarLayout">
<property name="sizeConstraint">
<enum>QLayout::SetMinAndMaxSize</enum>
</property>
<item>
<widget class="QPushButton" name="rcMenuButton">
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property> </property>
<item row="2" column="1">
<widget class="QPushButton" name="storeButton">
<property name="text"> <property name="text">
<string>Store to EEPROM</string> <string>RC
Calibration</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item>
<widget class="QLabel" name="statusLabel"> <widget class="QPushButton" name="sensorMenuButton">
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text"> <property name="text">
<string>No pending changes</string> <string>Sensor
Calibration</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0" colspan="2"> <item>
<widget class="QTabWidget" name="tabWidget"> <widget class="QPushButton" name="generalMenuButton">
<property name="currentIndex"> <property name="minimumSize">
<number>2</number> <size>
<width>100</width>
<height>100</height>
</size>
</property> </property>
<widget class="QWidget" name="rcTab"> <property name="maximumSize">
<attribute name="title"> <size>
<string>RC Calibration</string> <width>100</width>
</attribute> <height>100</height>
<layout class="QGridLayout" name="gridLayout_5" columnstretch="1,1,10,1,1,10,1,1,1,1,1,1,1,1,10"> </size>
<property name="topMargin">
<number>20</number>
</property> </property>
<item row="8" column="1" rowspan="3"> <property name="text">
<widget class="QSlider" name="throttleSlider"> <string>General
<property name="minimum"> Config</string>
<number>0</number>
</property> </property>
<property name="maximum"> </widget>
<number>100</number> </item>
<item>
<widget class="QPushButton" name="advancedMenuButton">
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property> </property>
<property name="value"> <property name="maximumSize">
<number>0</number> <size>
<width>100</width>
<height>100</height>
</size>
</property> </property>
<property name="orientation"> <property name="text">
<enum>Qt::Vertical</enum> <string>Advanced
Config</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="4" rowspan="3" colspan="2"> </layout>
<widget class="QSlider" name="pitchSlider"> </item>
<property name="minimum"> </layout>
<number>0</number> </widget>
</property> </widget>
<property name="maximum"> </item>
<number>100</number> <item>
</property> <layout class="QVBoxLayout" name="verticalLayout">
<property name="value"> <item>
<widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex">
<number>0</number> <number>0</number>
</property> </property>
<property name="orientation"> <widget class="QWidget" name="page">
<enum>Qt::Vertical</enum> <layout class="QVBoxLayout" name="verticalLayout_15">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>RC Calibration</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0" rowspan="2" colspan="9"> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QComboBox" name="rcTypeComboBox"> <widget class="QComboBox" name="rcTypeComboBox">
@ -128,35 +194,40 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="3" column="0" colspan="12"> <item>
<spacer name="verticalSpacer_2"> <spacer name="verticalSpacer_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>598</width> <width>20</width>
<height>5</height> <height>40</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="4" column="0"> <item>
<widget class="QLabel" name="txLabel"> <layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="1">
<widget class="QLabel" name="chanLabel_3">
<property name="text"> <property name="text">
<string/> <string>0000</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="7"> <item row="3" column="7">
<widget class="QLabel" name="instructionLabel"> <widget class="QCheckBox" name="invertCheckBox_8">
<property name="text"> <property name="text">
<string/> <string>Invert</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="10" colspan="2"> <item row="1" column="4">
<spacer name="horizontalSpacer_7"> <spacer name="horizontalSpacer_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -168,12 +239,57 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="5" column="0" colspan="13"> <item row="2" column="0">
<layout class="QGridLayout" name="gridLayout_2"> <widget class="QLabel" name="chanName_3">
<item row="3" column="5">
<widget class="QLabel" name="chanName_8">
<property name="text"> <property name="text">
<string>Aux 3</string> <string>Yaw / Rudder</string>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QLabel" name="chanLabel_5">
<property name="text">
<string>0000</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="4">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="7">
<widget class="QCheckBox" name="invertCheckBox_5">
<property name="text">
<string>Invert</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="invertCheckBox">
<property name="text">
<string>Invert</string>
</property>
</widget>
</item>
<item row="2" column="8">
<widget class="QSpinBox" name="aux2SpinBox">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>8</number>
</property> </property>
</widget> </widget>
</item> </item>
@ -251,16 +367,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="8">
<widget class="QSpinBox" name="aux2SpinBox">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>8</number>
</property>
</widget>
</item>
<item row="3" column="8"> <item row="3" column="8">
<widget class="QSpinBox" name="aux3SpinBox"> <widget class="QSpinBox" name="aux3SpinBox">
<property name="minimum"> <property name="minimum">
@ -382,27 +488,27 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="8"> <item row="3" column="5">
<widget class="QSpinBox" name="modeSpinBox"> <widget class="QLabel" name="chanName_8">
<property name="minimum"> <property name="text">
<number>1</number> <string>Aux 3</string>
</property>
<property name="maximum">
<number>8</number>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0"> <item row="1" column="7">
<widget class="QLabel" name="chanName"> <widget class="QCheckBox" name="invertCheckBox_6">
<property name="text"> <property name="text">
<string>Roll / Ailerons</string> <string>Invert</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2"> <item row="0" column="8">
<widget class="QCheckBox" name="invertCheckBox_2"> <widget class="QSpinBox" name="modeSpinBox">
<property name="text"> <property name="minimum">
<string>Invert</string> <number>1</number>
</property>
<property name="maximum">
<number>8</number>
</property> </property>
</widget> </widget>
</item> </item>
@ -413,142 +519,85 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="7"> <item row="1" column="2">
<widget class="QCheckBox" name="invertCheckBox_6"> <widget class="QCheckBox" name="invertCheckBox_2">
<property name="text"> <property name="text">
<string>Invert</string> <string>Invert</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="0" column="0">
<widget class="QLabel" name="chanLabel_3"> <widget class="QLabel" name="chanName">
<property name="text"> <property name="text">
<string>0000</string> <string>Roll / Ailerons</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="7"> </layout>
<widget class="QCheckBox" name="invertCheckBox_8">
<property name="text">
<string>Invert</string>
</property>
</widget>
</item> </item>
<item row="1" column="4"> <item>
<spacer name="horizontalSpacer_2"> <layout class="QHBoxLayout" name="horizontalLayout_14">
<property name="orientation"> <item>
<enum>Qt::Horizontal</enum> <layout class="QGridLayout" name="gridLayout_3">
</property> <item row="0" column="0">
<property name="sizeHint" stdset="0"> <widget class="QLabel" name="rightStickLabel">
<property name="maximumSize">
<size> <size>
<width>40</width> <width>200</width>
<height>20</height> <height>200</height>
</size> </size>
</property> </property>
</spacer>
</item>
<item row="2" column="0">
<widget class="QLabel" name="chanName_3">
<property name="text"> <property name="text">
<string>Yaw / Rudder</string> <string/>
</property> </property>
</widget> <property name="pixmap">
</item> <pixmap resource="../../qgroundcontrol.qrc">:/files/images/rc_stick.svg</pixmap>
<item row="0" column="6"> </property>
<widget class="QLabel" name="chanLabel_5"> <property name="scaledContents">
<property name="text"> <bool>true</bool>
<string>0000</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="4"> <item row="1" column="0">
<spacer name="horizontalSpacer"> <widget class="QSlider" name="rollSlider">
<property name="orientation"> <property name="minimum">
<enum>Qt::Horizontal</enum> <number>0</number>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property> </property>
</spacer> <property name="maximum">
</item> <number>100</number>
<item row="0" column="7">
<widget class="QCheckBox" name="invertCheckBox_5">
<property name="text">
<string>Invert</string>
</property> </property>
</widget> <property name="value">
</item> <number>0</number>
<item row="0" column="2">
<widget class="QCheckBox" name="invertCheckBox">
<property name="text">
<string>Invert</string>
</property> </property>
</widget>
</item>
</layout>
</item>
<item row="5" column="13" colspan="2">
<spacer name="horizontalSpacer_12">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> </widget>
<size>
<width>22</width>
<height>122</height>
</size>
</property>
</spacer>
</item> </item>
<item row="6" column="0" colspan="15"> <item row="0" column="1">
<spacer name="verticalSpacer"> <widget class="QSlider" name="pitchSlider">
<property name="orientation"> <property name="minimum">
<enum>Qt::Vertical</enum> <number>0</number>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>598</width>
<height>17</height>
</size>
</property> </property>
</spacer> <property name="maximum">
</item> <number>100</number>
<item row="8" column="3" rowspan="3">
<widget class="QLabel" name="rightStickLabel">
<property name="text">
<string/>
</property> </property>
<property name="pixmap"> <property name="value">
<pixmap resource="../../qgroundcontrol.qrc">:/files/images/rc_stick.svg</pixmap> <number>0</number>
</property> </property>
<property name="scaledContents"> <property name="orientation">
<bool>true</bool> <enum>Qt::Vertical</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="2" rowspan="3"> </layout>
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
<item row="8" column="0" rowspan="3"> <item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="leftStickLabel"> <widget class="QLabel" name="leftStickLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@ -556,6 +605,12 @@
<verstretch>1</verstretch> <verstretch>1</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="maximumSize">
<size>
<width>200</width>
<height>200</height>
</size>
</property>
<property name="sizeIncrement"> <property name="sizeIncrement">
<size> <size>
<width>10</width> <width>10</width>
@ -577,22 +632,12 @@
<property name="scaledContents"> <property name="scaledContents">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> <property name="alignment">
</item> <set>Qt::AlignCenter</set>
<item row="8" column="14">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property> </property>
</spacer> </widget>
</item> </item>
<item row="11" column="0"> <item row="1" column="0">
<widget class="QSlider" name="yawSlider"> <widget class="QSlider" name="yawSlider">
<property name="minimum"> <property name="minimum">
<number>0</number> <number>0</number>
@ -608,8 +653,8 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="11" column="3"> <item row="0" column="1">
<widget class="QSlider" name="rollSlider"> <widget class="QSlider" name="throttleSlider">
<property name="minimum"> <property name="minimum">
<number>0</number> <number>0</number>
</property> </property>
@ -620,35 +665,18 @@
<number>0</number> <number>0</number>
</property> </property>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="11" column="6" colspan="8">
<widget class="QPushButton" name="rcCalibrationButton">
<property name="text">
<string>Start Calibration</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0"> </layout>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item> </item>
<item row="8" column="10" rowspan="3"> <item>
<widget class="QSlider" name="aux1Slider"> <layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QSlider" name="modeSwitchSlider">
<property name="minimum"> <property name="minimum">
<number>0</number> <number>0</number>
</property> </property>
@ -660,8 +688,8 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="11" rowspan="3"> <item>
<widget class="QSlider" name="aux2Slider"> <widget class="QSlider" name="aux1Slider">
<property name="minimum"> <property name="minimum">
<number>0</number> <number>0</number>
</property> </property>
@ -673,8 +701,8 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="12" rowspan="3" colspan="2"> <item>
<widget class="QSlider" name="aux3Slider"> <widget class="QSlider" name="aux2Slider">
<property name="minimum"> <property name="minimum">
<number>0</number> <number>0</number>
</property> </property>
@ -686,8 +714,8 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="9" rowspan="3"> <item>
<widget class="QSlider" name="modeSwitchSlider"> <widget class="QSlider" name="aux3Slider">
<property name="minimum"> <property name="minimum">
<number>0</number> <number>0</number>
</property> </property>
@ -699,33 +727,54 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="5" rowspan="2" colspan="4"> </layout>
<spacer name="horizontalSpacer_5"> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_13">
<item>
<widget class="QPushButton" name="rcCalibrationButton">
<property name="text">
<string>Start Calibration</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="setTrimButton">
<property name="text">
<string>Set Trim</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>20</width>
<height>20</height> <height>40</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="11" column="14"> </layout>
<widget class="QPushButton" name="setTrimButton"> </widget>
<widget class="QWidget" name="page_2">
<layout class="QVBoxLayout" name="verticalLayout_14">
<item>
<widget class="QLabel" name="label_3">
<property name="text"> <property name="text">
<string>Set Trim</string> <string>Sensor Calibration</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout>
</widget>
<widget class="QWidget" name="sensorTab">
<attribute name="title">
<string>Sensor Calibration</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_8"> <layout class="QHBoxLayout" name="horizontalLayout_8">
<item> <item>
@ -751,8 +800,8 @@ p, li { white-space: pre-wrap; }
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>354</width> <width>314</width>
<height>448</height> <height>508</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_10"> <layout class="QVBoxLayout" name="verticalLayout_10">
@ -769,11 +818,15 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="multirotorTab"> <widget class="QWidget" name="page_3">
<attribute name="title"> <layout class="QVBoxLayout" name="verticalLayout_11">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>General Config</string> <string>General Config</string>
</attribute> </property>
<layout class="QVBoxLayout" name="verticalLayout_6"> </widget>
</item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_7"> <layout class="QHBoxLayout" name="horizontalLayout_7">
<item> <item>
@ -822,8 +875,8 @@ p, li { white-space: pre-wrap; }
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>354</width> <width>314</width>
<height>404</height> <height>434</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
@ -859,8 +912,8 @@ p, li { white-space: pre-wrap; }
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>354</width> <width>313</width>
<height>404</height> <height>434</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_5"> <layout class="QHBoxLayout" name="horizontalLayout_5">
@ -881,11 +934,15 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="fixedWingTab"> <widget class="QWidget" name="page_4">
<attribute name="title"> <layout class="QVBoxLayout" name="verticalLayout_13">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Advanced Config</string> <string>Advanced Config</string>
</attribute> </property>
<layout class="QVBoxLayout" name="verticalLayout"> </widget>
</item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
@ -934,8 +991,8 @@ p, li { white-space: pre-wrap; }
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>354</width> <width>161</width>
<height>404</height> <height>446</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_7"> <layout class="QVBoxLayout" name="verticalLayout_7">
@ -971,8 +1028,8 @@ p, li { white-space: pre-wrap; }
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>354</width> <width>160</width>
<height>404</height> <height>446</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_8"> <layout class="QVBoxLayout" name="verticalLayout_8">
@ -995,6 +1052,39 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
</widget> </widget>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QLabel" name="statusLabel">
<property name="text">
<string>No pending changes</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="storeButton">
<property name="text">
<string>Store to EEPROM</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<resources> <resources>

6
src/ui/QGCWaypointListMulti.cc

@ -15,6 +15,12 @@ QGCWaypointListMulti::QGCWaypointListMulti(QWidget *parent) :
WaypointList* list = new WaypointList(ui->stackedWidget, NULL); WaypointList* list = new WaypointList(ui->stackedWidget, NULL);
lists.insert(offline_uas_id, list); lists.insert(offline_uas_id, list);
ui->stackedWidget->addWidget(list); ui->stackedWidget->addWidget(list);
if (UASManager::instance()->getActiveUAS()) {
systemCreated(UASManager::instance()->getActiveUAS());
systemSetActive(UASManager::instance()->getActiveUAS()->getUASID());
}
} }
void QGCWaypointListMulti::systemDeleted(QObject* uas) void QGCWaypointListMulti::systemDeleted(QObject* uas)

17
src/ui/uas/UASInfoWidget.cc

@ -34,7 +34,7 @@ This file is part of the PIXHAWK project
#include <float.h> #include <float.h>
#include <UASInfoWidget.h> #include <UASInfoWidget.h>
#include <UASManager.h> #include <UASManager.h>
#include <MG.h> #include <QGC.h>
#include <QTimer> #include <QTimer>
#include <QDir> #include <QDir>
#include <cstdlib> #include <cstdlib>
@ -46,20 +46,12 @@ UASInfoWidget::UASInfoWidget(QWidget *parent, QString name) : QWidget(parent)
{ {
ui.setupUi(this); ui.setupUi(this);
this->name = name; this->name = name;
connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*)));
activeUAS = NULL; activeUAS = NULL;
//instruments = new QMap<QString, QProgressBar*>(); connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*)));
setActiveUAS(UASManager::instance()->getActiveUAS());
// Set default battery type
// setBattery(0, LIPOLY, 3);
startTime = MG::TIME::getGroundTimeNow();
// startVoltage = 0.0f;
// lastChargeLevel = 0.5f; startTime = QGC::groundTimeMilliseconds();
// lastRemainingTime = 1;
// Set default values // Set default values
/** Set two voltage decimals and zero charge level decimals **/ /** Set two voltage decimals and zero charge level decimals **/
@ -117,6 +109,7 @@ void UASInfoWidget::addUAS(UASInterface* uas)
void UASInfoWidget::setActiveUAS(UASInterface* uas) void UASInfoWidget::setActiveUAS(UASInterface* uas)
{ {
if (uas)
activeUAS = uas; activeUAS = uas;
} }

5
src/ui/uas/UASListWidget.cc

@ -67,6 +67,11 @@ UASListWidget::UASListWidget(QWidget *parent) : QWidget(parent), m_ui(new Ui::UA
this->setVisible(false); this->setVisible(false);
connect(UASManager::instance(),SIGNAL(UASCreated(UASInterface*)),this,SLOT(addUAS(UASInterface*))); connect(UASManager::instance(),SIGNAL(UASCreated(UASInterface*)),this,SLOT(addUAS(UASInterface*)));
// Get a list of all existing UAS
foreach (UASInterface* uas, UASManager::instance()->getUASList()) {
addUAS(uas);
}
} }
UASListWidget::~UASListWidget() UASListWidget::~UASListWidget()

Loading…
Cancel
Save