Browse Source

Minor adjustments

QGC4.4
lm 14 years ago
parent
commit
99c25b9971
  1. 2
      images/earth.html
  2. 2
      src/uas/UAS.cc
  3. 172
      src/ui/UASView.ui
  4. 5
      src/ui/uas/UASView.cc

2
images/earth.html

@ -14,7 +14,7 @@ google.load("earth", "1", { 'language': 'en'});
var ge = null; var ge = null;
var initialized = false; var initialized = false;
var currAircraft = 220; var currAircraft = 0;
var followEnabled = false; var followEnabled = false;
var lastLat = 0; var lastLat = 0;

2
src/uas/UAS.cc

@ -898,7 +898,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
imagePackets = p.packets; imagePackets = p.packets;
imagePayload = p.payload; imagePayload = p.payload;
imageQuality = p.jpg_quality; imageQuality = p.jpg_quality;
imageStart = MG::TIME::getGroundTimeNow(); imageStart = QGC::groundTimeMilliseconds();
} }
break; break;

172
src/ui/UASView.ui

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>360</width> <width>360</width>
<height>119</height> <height>121</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -111,11 +111,12 @@ QToolButton#typeButton {
font-size: 12px; font-size: 12px;
border: 0px solid #999999; border: 0px solid #999999;
border-radius: 5px; border-radius: 5px;
min-width:44px; min-width:42px;
max-width: 80px; max-width: 42px;
min-height: 44px; min-height: 42px;
max-height: 44px; max-height: 42px;
padding: 0px; padding: 0px;
margin: 0px;
background-color: none; background-color: none;
} }
@ -123,12 +124,13 @@ QPushButton {
font-weight: bold; font-weight: bold;
font-size: 12px; font-size: 12px;
border: 1px solid #999999; border: 1px solid #999999;
border-radius: 10px; border-radius: 8px;
min-width: 20px; min-width: 20px;
max-width: 80px; max-width: 32px;
min-height: 16px; min-height: 16px;
max-height: 16px; max-height: 16px;
padding: 2px; padding: 2px;
spacing: 10px;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #777777, stop: 1 #555555); background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #777777, stop: 1 #555555);
} }
@ -162,7 +164,7 @@ QProgressBar:horizontal {
border-radius: 4px; border-radius: 4px;
text-align: center; text-align: center;
padding: 2px; padding: 2px;
color: #DDDDDF; color: #111111;
background-color: #111118; background-color: #111118;
} }
@ -173,6 +175,7 @@ QProgressBar:vertical {
font-size: 7px; font-size: 7px;
padding: 2px; padding: 2px;
color: #DDDDDF; color: #DDDDDF;
min-width: 16px;
background-color: #111118; background-color: #111118;
} }
@ -182,6 +185,7 @@ QProgressBar:horizontal {
QProgressBar:horizontal QLabel { QProgressBar:horizontal QLabel {
font-size: 9px; font-size: 9px;
color: #111111;
} }
QProgressBar:vertical QLabel { QProgressBar:vertical QLabel {
@ -236,9 +240,18 @@ QMenu::separator {
<property name="spacing"> <property name="spacing">
<number>2</number> <number>2</number>
</property> </property>
<property name="margin"> <property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number> <number>2</number>
</property> </property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QGroupBox" name="uasViewFrame"> <widget class="QGroupBox" name="uasViewFrame">
<property name="sizePolicy"> <property name="sizePolicy">
@ -253,12 +266,18 @@ QMenu::separator {
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>130</height>
</size>
</property>
<property name="title"> <property name="title">
<string/> <string/>
</property> </property>
<layout class="QGridLayout" name="gridLayout" columnstretch="1,1,10,10,10,10,80"> <layout class="QGridLayout" name="gridLayout" columnstretch="1,1,10,10,10,0,90,90">
<property name="horizontalSpacing"> <property name="horizontalSpacing">
<number>4</number> <number>5</number>
</property> </property>
<property name="verticalSpacing"> <property name="verticalSpacing">
<number>2</number> <number>2</number>
@ -270,14 +289,14 @@ QMenu::separator {
<widget class="QToolButton" name="typeButton"> <widget class="QToolButton" name="typeButton">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>44</width> <width>42</width>
<height>44</height> <height>42</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>80</width> <width>42</width>
<height>44</height> <height>42</height>
</size> </size>
</property> </property>
<property name="baseSize"> <property name="baseSize">
@ -334,7 +353,7 @@ QMenu::separator {
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="5" colspan="2"> <item row="0" column="6" colspan="2">
<widget class="QLabel" name="modeLabel"> <widget class="QLabel" name="modeLabel">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
@ -353,6 +372,9 @@ QMenu::separator {
<property name="text"> <property name="text">
<string>MODE</string> <string>MODE</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget> </widget>
</item> </item>
<item row="1" column="2" rowspan="3"> <item row="1" column="2" rowspan="3">
@ -374,6 +396,9 @@ QMenu::separator {
<property name="text"> <property name="text">
<string>00:00:00</string> <string>00:00:00</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget> </widget>
</item> </item>
<item row="1" column="3" rowspan="3" colspan="2"> <item row="1" column="3" rowspan="3" colspan="2">
@ -395,9 +420,12 @@ QMenu::separator {
<property name="text"> <property name="text">
<string>00:00:00</string> <string>00:00:00</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget> </widget>
</item> </item>
<item row="3" column="5" rowspan="2" colspan="2"> <item row="3" column="6" rowspan="2" colspan="2">
<widget class="QProgressBar" name="thrustBar"> <widget class="QProgressBar" name="thrustBar">
<property name="font"> <property name="font">
<font> <font>
@ -413,6 +441,9 @@ QMenu::separator {
<property name="value"> <property name="value">
<number>0</number> <number>0</number>
</property> </property>
<property name="format">
<string>throttle %p%</string>
</property>
</widget> </widget>
</item> </item>
<item row="4" column="2"> <item row="4" column="2">
@ -434,6 +465,9 @@ QMenu::separator {
<property name="text"> <property name="text">
<string>00.00 m</string> <string>00.00 m</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget> </widget>
</item> </item>
<item row="4" column="3" colspan="2"> <item row="4" column="3" colspan="2">
@ -455,6 +489,9 @@ QMenu::separator {
<property name="text"> <property name="text">
<string>00.0 m/s</string> <string>00.0 m/s</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget> </widget>
</item> </item>
<item row="5" column="0" rowspan="3"> <item row="5" column="0" rowspan="3">
@ -545,7 +582,7 @@ QMenu::separator {
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="5" colspan="2"> <item row="2" column="6" colspan="2">
<widget class="QLabel" name="positionLabel"> <widget class="QLabel" name="positionLabel">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
@ -578,8 +615,8 @@ QMenu::separator {
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="3" colspan="4"> <item row="7" column="3" colspan="5">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1,1,1,1,1,1">
<property name="spacing"> <property name="spacing">
<number>4</number> <number>4</number>
</property> </property>
@ -594,6 +631,12 @@ QMenu::separator {
<height>22</height> <height>22</height>
</size> </size>
</property> </property>
<property name="maximumSize">
<size>
<width>38</width>
<height>22</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Liftoff / Launch</string> <string>Liftoff / Launch</string>
</property> </property>
@ -617,6 +660,12 @@ QMenu::separator {
<height>22</height> <height>22</height>
</size> </size>
</property> </property>
<property name="maximumSize">
<size>
<width>38</width>
<height>22</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Loiter / Wait at current position</string> <string>Loiter / Wait at current position</string>
</property> </property>
@ -640,6 +689,12 @@ QMenu::separator {
<height>22</height> <height>22</height>
</size> </size>
</property> </property>
<property name="maximumSize">
<size>
<width>38</width>
<height>22</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Continue flightplan</string> <string>Continue flightplan</string>
</property> </property>
@ -663,6 +718,12 @@ QMenu::separator {
<height>22</height> <height>22</height>
</size> </size>
</property> </property>
<property name="maximumSize">
<size>
<width>38</width>
<height>22</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Fly straight to landing location</string> <string>Fly straight to landing location</string>
</property> </property>
@ -680,6 +741,12 @@ QMenu::separator {
</item> </item>
<item> <item>
<widget class="QPushButton" name="shutdownButton"> <widget class="QPushButton" name="shutdownButton">
<property name="maximumSize">
<size>
<width>38</width>
<height>22</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Only in standby mode: Power off system</string> <string>Only in standby mode: Power off system</string>
</property> </property>
@ -697,12 +764,24 @@ QMenu::separator {
</item> </item>
<item> <item>
<widget class="QPushButton" name="abortButton"> <widget class="QPushButton" name="abortButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>26</width> <width>26</width>
<height>22</height> <height>22</height>
</size> </size>
</property> </property>
<property name="maximumSize">
<size>
<width>38</width>
<height>22</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Emergency land system at closest possible site</string> <string>Emergency land system at closest possible site</string>
</property> </property>
@ -726,6 +805,12 @@ QMenu::separator {
<height>22</height> <height>22</height>
</size> </size>
</property> </property>
<property name="maximumSize">
<size>
<width>38</width>
<height>22</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Kill immediately all onboard power</string> <string>Kill immediately all onboard power</string>
</property> </property>
@ -743,29 +828,14 @@ QMenu::separator {
</item> </item>
</layout> </layout>
</item> </item>
<item row="5" column="2" rowspan="2" colspan="2"> <item row="8" column="0" colspan="8">
<widget class="QLabel" name="navLabel">
<property name="font">
<font>
<pointsize>-1</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>NAV</string>
</property>
</widget>
</item>
<item row="8" column="0" colspan="7">
<widget class="QLabel" name="statusTextLabel"> <widget class="QLabel" name="statusTextLabel">
<property name="text"> <property name="text">
<string>Waiting for first status update..</string> <string>Waiting for first status update..</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="5"> <item row="6" column="6">
<widget class="QLabel" name="stateLabel"> <widget class="QLabel" name="stateLabel">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
@ -786,6 +856,34 @@ QMenu::separator {
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="2" colspan="3">
<widget class="QLabel" name="navLabel">
<property name="font">
<font>
<pointsize>-1</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>NAV</string>
</property>
</widget>
</item>
<item row="0" column="5" rowspan="7">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>8</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>

5
src/ui/uas/UASView.cc

@ -132,6 +132,7 @@ UASView::UASView(UASInterface* uas, QWidget *parent) :
// Heartbeat fade // Heartbeat fade
refreshTimer = new QTimer(this); refreshTimer = new QTimer(this);
connect(refreshTimer, SIGNAL(timeout()), this, SLOT(refresh())); connect(refreshTimer, SIGNAL(timeout()), this, SLOT(refresh()));
refreshTimer->start(updateInterval);
// Hide kill and shutdown buttons per default // Hide kill and shutdown buttons per default
m_ui->killButton->hide(); m_ui->killButton->hide();
@ -270,7 +271,7 @@ void UASView::receiveHeartbeat(UASInterface* uas)
{ {
Q_UNUSED(uas); Q_UNUSED(uas);
heartbeatColor = QColor(20, 200, 20); heartbeatColor = QColor(20, 200, 20);
QString colorstyle("QGroupBox { border-radius: 5px; padding: 2px; margin: 2px; border: 0px; background-color: %1; }"); QString colorstyle("QGroupBox { border-radius: 5px; padding: 2px; margin: 0px; border: 0px; background-color: %1; }");
m_ui->heartbeatIcon->setStyleSheet(colorstyle.arg(heartbeatColor.name())); m_ui->heartbeatIcon->setStyleSheet(colorstyle.arg(heartbeatColor.name()));
if (timeout) setBackgroundColor(); if (timeout) setBackgroundColor();
timeout = false; timeout = false;
@ -604,7 +605,7 @@ void UASView::refresh()
} }
generalUpdateCount++; generalUpdateCount++;
QString colorstyle("QGroupBox { border-radius: 5px; padding: 2px; margin: 2px; border: 0px; background-color: %1; }"); QString colorstyle("QGroupBox { border-radius: 5px; padding: 2px; margin: 0px; border: 0px; background-color: %1; }");
if (timeout) if (timeout)
{ {

Loading…
Cancel
Save