Commit ddefe971 authored by lm's avatar lm

Improved visual style of waypoint editing component, freed up space

parent a92acac1
......@@ -41,14 +41,13 @@ SerialConfigurationWindow::SerialConfigurationWindow(LinkInterface* link, QWidge
{
SerialLinkInterface* serialLink = dynamic_cast<SerialLinkInterface*>(link);
if(serialLink != 0) {
if(serialLink != 0)
{
serialLink->loadSettings();
this->link = serialLink;
// Setup the user interface according to link type
ui.setupUi(this);
//this->setVisible(false);
//this->hide();
// Create action to open this menu
// Create configuration action for this link
......@@ -154,10 +153,10 @@ SerialConfigurationWindow::SerialConfigurationWindow(LinkInterface* link, QWidge
// Display the widget
this->window()->setWindowTitle(tr("Serial Communication Settings"));
//this->show();
} else {
}
else
{
qDebug() << "Link is NOT a serial link, can't open configuration window";
}
}
......@@ -220,9 +219,12 @@ void SerialConfigurationWindow::setupPortList()
void SerialConfigurationWindow::enableFlowControl(bool flow)
{
if(flow) {
if(flow)
{
link->setFlowType(1);
} else {
}
else
{
link->setFlowType(0);
}
}
......
......@@ -63,7 +63,8 @@ WaypointEditableView::WaypointEditableView(Waypoint* wp, QWidget* parent) :
updateValues();
// Check for mission frame
if (wp->getFrame() == MAV_FRAME_MISSION) {
if (wp->getFrame() == MAV_FRAME_MISSION)
{
m_ui->comboBox_action->setCurrentIndex(m_ui->comboBox_action->count()-1);
}
......
......@@ -89,7 +89,7 @@ WaypointList::WaypointList(QWidget *parent, UASInterface* uas) :
// REFRESH VIEW TAB
connect(m_ui->refreshButton, SIGNAL(clicked()), this, SLOT(refresh()));
connect(m_ui->refreshButton, SIGNAL(clicked()), this, SLOT(refresh()));
// SET UAS AFTER ALL SIGNALS/SLOTS ARE CONNECTED
......@@ -289,7 +289,10 @@ void WaypointList::addCurrentPositionWaypoint()
void WaypointList::updateStatusLabel(const QString &string)
{
// Status label in write widget
m_ui->statusLabel->setText(string);
// Status label in read only widget
m_ui->viewStatusLabel->setText(string);
}
void WaypointList::changeCurrentWaypoint(quint16 seq)
......
......@@ -20,16 +20,46 @@
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>8</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="editTab">
<attribute name="title">
<string>Tab 1</string>
<string>Edit Waypoints</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<property name="horizontalSpacing">
<number>12</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="0" column="0" colspan="9">
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
......@@ -40,15 +70,24 @@
<rect>
<x>0</x>
<y>0</y>
<width>812</width>
<height>271</height>
<width>834</width>
<height>325</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>8</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<item>
......@@ -213,14 +252,48 @@
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="statusLabel">
<property name="toolTip">
<string>The current waypoint transmission status</string>
</property>
<property name="statusTip">
<string>The current waypoint transmission status</string>
</property>
<property name="whatsThis">
<string>The current waypoint transmission status</string>
</property>
<property name="text">
<string>Please add first waypoint.</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="viewTab">
<attribute name="title">
<string>Tab 2</string>
<string>Onboard Waypoints</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0" colspan="2">
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<property name="horizontalSpacing">
<number>12</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="0" column="0" colspan="3">
<widget class="QScrollArea" name="readOnlyScrollArea">
<property name="widgetResizable">
<bool>true</bool>
......@@ -230,14 +303,26 @@
<rect>
<x>0</x>
<y>0</y>
<width>812</width>
<height>271</height>
<width>834</width>
<height>331</height>
</rect>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>8</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<item>
<widget class="QWidget" name="viewOnlyListWidget" native="true">
<property name="enabled">
......@@ -249,7 +334,7 @@
</widget>
</widget>
</item>
<item row="1" column="0">
<item row="1" column="1">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
......@@ -262,7 +347,7 @@
</property>
</spacer>
</item>
<item row="1" column="1">
<item row="1" column="2">
<widget class="QPushButton" name="refreshButton">
<property name="toolTip">
<string>Read all waypoints from the MAV and display in View tab..</string>
......@@ -282,26 +367,17 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="viewStatusLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="statusLabel">
<property name="toolTip">
<string>The current waypoint transmission status</string>
</property>
<property name="statusTip">
<string>The current waypoint transmission status</string>
</property>
<property name="whatsThis">
<string>The current waypoint transmission status</string>
</property>
<property name="text">
<string>Please add first waypoint.</string>
</property>
</widget>
</item>
</layout>
<action name="actionAddWaypoint">
<property name="icon">
......
......@@ -26,7 +26,7 @@ void WaypointViewOnlyView::changedAutoContinue(int state)
m_ui->autoContinue->blockSignals(false);
wp->setAutocontinue(new_value);
emit changeAutoContinue(wp->getId(),new_value);
}
}
void WaypointViewOnlyView::changedCurrent(int state)
{
......@@ -87,24 +87,61 @@ void WaypointViewOnlyView::updateValues()
deleteLater();
return;
}
// Deactivate signals from the WP
wp->blockSignals(true);
// Update style
QColor backGroundColor = QGC::colorBackground;
static int lastId = -1;
int currId = wp->getId() % 2;
if (currId != lastId)
{
// qDebug() << "COLOR ID: " << currId;
if (currId == 1)
{
backGroundColor = QColor("#252528").lighter(150);
}
else
{
backGroundColor = QColor("#252528").lighter(250);
}
// Update color based on id
QString groupBoxStyle = QString("QGroupBox {padding: 0px; margin: 0px; border: 0px; background-color: %1; min-height: 12px; }").arg(backGroundColor.name());
QString labelStyle = QString("QWidget {background-color: %1; color: #DDDDDF; border-color: #EEEEEE; }").arg(backGroundColor.name());
QString displayBarStyle = QString("QWidget {background-color: %1; color: #DDDDDF; border: none; }").arg(backGroundColor.name());
QString checkBoxStyle = QString("QCheckBox {background-color: %1; color: #454545; border-color: #EEEEEE; }").arg(backGroundColor.name());
m_ui->autoContinue->setStyleSheet(checkBoxStyle);
m_ui->current->setStyleSheet(checkBoxStyle);
m_ui->idLabel->setStyleSheet(labelStyle);
m_ui->displayBar->setStyleSheet(displayBarStyle);
m_ui->groupBox->setStyleSheet(groupBoxStyle);
lastId = currId;
}
// update frame
m_ui->idLabel->setText(QString("%1").arg(wp->getId()));
if (m_ui->current->isChecked() != wp->getCurrent())
{
m_ui->current->blockSignals(true);
m_ui->current->setChecked(wp->getCurrent());
m_ui->current->blockSignals(false);
}
if (m_ui->autoContinue->isChecked() != wp->getAutoContinue())
{
m_ui->autoContinue->blockSignals(true);
m_ui->autoContinue->setChecked(wp->getAutoContinue());
m_ui->autoContinue->blockSignals(false);
}
switch (wp->getAction())
{
case MAV_CMD_NAV_WAYPOINT:
switch (wp->getAction())
{
case MAV_CMD_NAV_WAYPOINT:
{
if (wp->getParam1()>0)
{
......@@ -116,17 +153,17 @@ case MAV_CMD_NAV_WAYPOINT:
}
break;
}
case MAV_CMD_NAV_LAND:
case MAV_CMD_NAV_LAND:
{
m_ui->displayBar->setText(QString("LAND. Go to (%1, %2, %3) and descent; yaw: %4").arg(wp->getX()).arg(wp->getY()).arg(wp->getZ()).arg(wp->getParam4()));
break;
}
case MAV_CMD_NAV_TAKEOFF:
case MAV_CMD_NAV_TAKEOFF:
{
m_ui->displayBar->setText(QString("TAKEOFF. Go to (%1, %2, %3); yaw: %4").arg(wp->getX()).arg(wp->getY()).arg(wp->getZ()).arg(wp->getParam4()));
break;
}
case MAV_CMD_DO_JUMP:
case MAV_CMD_DO_JUMP:
{
if (wp->getParam2()>0)
{
......@@ -138,35 +175,32 @@ case MAV_CMD_DO_JUMP:
}
break;
}
case MAV_CMD_CONDITION_DELAY:
case MAV_CMD_CONDITION_DELAY:
{
m_ui->displayBar->setText(QString("Delay: %1 sec").arg(wp->getParam1()));
break;
}
case 237: //MAV_CMD_DO_START_SEARCH
case 237: //MAV_CMD_DO_START_SEARCH
{
m_ui->displayBar->setText(QString("Start searching for pattern. Success when got more than %2 detections with confidence %1").arg(wp->getParam1()).arg(wp->getParam2()));
break;
}
case 238: //MAV_CMD_DO_FINISH_SEARCH
case 238: //MAV_CMD_DO_FINISH_SEARCH
{
m_ui->displayBar->setText(QString("Check if search was successful. yes -> jump to %1, no -> jump to %2. Jumps left: %3").arg(wp->getParam1()).arg(wp->getParam2()).arg(wp->getParam3()));
break;
}
case 240: //MAV_CMD_DO_SWEEP
case 240: //MAV_CMD_DO_SWEEP
{
m_ui->displayBar->setText(QString("Sweep. Corners: (%1,%2) and (%3,%4); z: %5; scan radius: %6").arg(wp->getParam3()).arg(wp->getParam4()).arg(wp->getParam5()).arg(wp->getParam6()).arg(wp->getParam7()).arg(wp->getParam1()));
break;
}
default:
default:
{
m_ui->displayBar->setText(QString("Unknown Command ID (%1) : %2, %3, %4, %5, %6, %7, %8").arg(wp->getAction()).arg(wp->getParam1()).arg(wp->getParam2()).arg(wp->getParam3()).arg(wp->getParam4()).arg(wp->getParam5()).arg(wp->getParam6()).arg(wp->getParam7()));
break;
}
}
wp->blockSignals(false);
}
}
WaypointViewOnlyView::~WaypointViewOnlyView()
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>381</width>
<height>55</height>
<height>40</height>
</rect>
</property>
<property name="sizePolicy">
......@@ -20,124 +20,12 @@
<string>Form</string>
</property>
<property name="styleSheet">
<string notr="true">QWidget#colorIcon {}
QWidget {
background-color: #252528;
color: #DDDDDF;
border-color: #EEEEEE;
background-clip: border;
}
QCheckBox {
background-color: #252528;
color: #454545;
}
QGroupBox {
border: 1px solid #EEEEEE;
border-radius: 5px;
padding: 0px 0px 0px 0px;
margin-top: 1ex; /* leave space at the top for the title */
margin: 0px;
}
QGroupBox::title {
subcontrol-origin: margin;
subcontrol-position: top center; /* position at the top center */
margin: 0 3px 0px 3px;
padding: 0 3px 0px 0px;
font: bold 8px;
}
QGroupBox#heartbeatIcon {
background-color: red;
}
QDockWidget {
font: bold;
border: 1px solid #32345E;
}
QPushButton {
font-weight: bold;
font-size: 12px;
border: 1px solid #999999;
border-radius: 10px;
min-width:22px;
max-width: 36px;
min-height: 16px;
max-height: 16px;
padding: 2px;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #777777, stop: 1 #555555);
}
QPushButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #444444, stop: 1 #555555);
}
QPushButton#landButton {
color: #000000;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #ffee01, stop:1 #ae8f00) url(&quot;ICONDIR/control/emergency-button.png&quot;);
}
QPushButton:pressed#landButton {
color: #000000;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #bbaa00, stop:1 #a05b00) url(&quot;ICONDIR/control/emergency-button.png&quot;);
}
QPushButton#killButton {
color: #000000;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #ffb917, stop:1 #b37300) url(&quot;ICONDIR/control/emergency-button.png&quot;);
}
QPushButton:pressed#killButton {
color: #000000;
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #bb8500, stop:1 #903000) url(&quot;ICONDIR/control/emergency-button.png&quot;);
}
QProgressBar {
border: 1px solid white;
border-radius: 4px;
text-align: center;
padding: 2px;
color: white;
background-color: #111111;
}
QProgressBar:horizontal {
height: 12px;
}
QProgressBar QLabel {
font-size: 8px;
}
QProgressBar:vertical {
width: 12px;
}
QProgressBar::chunk {
background-color: #656565;
}
QProgressBar::chunk#batteryBar {
background-color: green;
}
QProgressBar::chunk#speedBar {
background-color: yellow;
}
QProgressBar::chunk#thrustBar {
background-color: orange;
}</string>
<string notr="true"/>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>2</number>
</property>
......@@ -167,13 +55,22 @@ QProgressBar::chunk#thrustBar {
<property name="checkable">
<bool>false</bool>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1,100,1">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>2</number>
</property>
<property name="margin">
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="current">
<property name="toolTip">
......
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