1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-30 08:24:11 +01:00

OP-52 Ground/GPS Gadget : make it resizable, within reasonable limits. Should behave much better now on smaller screens.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1540 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
edouard 2010-09-05 20:23:25 +00:00 committed by edouard
parent 0c884ed14d
commit 1690e500e9
6 changed files with 511 additions and 540 deletions

View File

@ -93,6 +93,11 @@ void GpsConstellationWidget::showEvent(QShowEvent *event)
}
void GpsConstellationWidget::resizeEvent(QResizeEvent* event)
{
Q_UNUSED(event);
fitInView(world, Qt::KeepAspectRatio);
}
void GpsConstellationWidget::updateSat(int index, int prn, int elevation, int azimuth, int snr)
{

View File

@ -56,6 +56,7 @@ private:
protected:
void showEvent(QShowEvent *event);
void resizeEvent(QResizeEvent *event);
};

View File

@ -94,6 +94,7 @@ void GpsDisplayGadget::loadConfiguration(IUAVGadgetConfiguration* config)
parser = new TelemetryParser();
m_widget->connectButton->setEnabled(false);
m_widget->disconnectButton->setEnabled(false);
m_widget->dataStreamGroupBox->hide();
} else if (gpsDisplayConfig->connectionMode() == "Network") {
// Not implemented for now...
m_widget->connectButton->setEnabled(false);

View File

@ -94,7 +94,7 @@ void GpsDisplayWidget::dumpPacket(char *packet)
void GpsDisplayWidget::setSVs(int sv)
{
QString temp = "Sats: ";
QString temp;
temp.append(QString::number(sv));
status_value->setText(temp);
status_value->adjustSize();

View File

@ -6,10 +6,323 @@
<rect>
<x>0</x>
<y>0</y>
<width>592</width>
<height>417</height>
<width>533</width>
<height>424</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QFrame" name="frame_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>300</width>
<height>120</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>400</width>
<height>200</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="lat_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Coord:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="coord_value">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Unknown</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="coord_value_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Unknown</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="coord_value_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Unknown</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="speed_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Speed:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="speed_value">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Unknown</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="bear_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Heading:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="bear_value">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Unknown</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>H / V / P DOP:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="dop_value">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>0 / 0 / 0</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="fix_label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Sats Used:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="fix_value">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Unknown</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLabel" name="fix_label">
<property name="text">
<string>Fix Type:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="status_value">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Unknown</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QLabel" name="time_value">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Unknown</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="GpsConstellationWidget" name="gpsSky">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
@ -18,24 +331,76 @@
</property>
<property name="minimumSize">
<size>
<width>500</width>
<height>300</height>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
<property name="maximumSize">
<size>
<width>250</width>
<height>250</height>
</size>
</property>
<widget class="QGroupBox" name="dataStreamGroupBox">
<property name="geometry">
<rect>
<x>10</x>
<y>270</y>
<width>571</width>
<height>138</height>
</rect>
<property name="sizeIncrement">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
<property name="baseSize">
<size>
<width>120</width>
<height>120</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>60</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QPushButton" name="connectButton">
<property name="text">
<string>Connect</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="disconnectButton">
<property name="text">
<string>Disconnect</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGraphicsView" name="flatEarth">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -46,17 +411,84 @@
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>191</width>
<height>95</height>
</size>
</property>
<property name="baseSize">
<size>
<width>191</width>
<height>95</height>
</size>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="toolTip">
<string extracomment="Location of GCS on the Earth"/>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="optimizationFlags">
<set>QGraphicsView::DontAdjustForAntialiasing</set>
</property>
</widget>
</item>
<item>
<widget class="QGraphicsView" name="graphicsView">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>250</width>
<height>95</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="dataStreamGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>250</height>
</size>
</property>
<property name="title">
<string>GPS Data Stream</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3" stretch="0">
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="0">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QTextBrowser" name="textBrowser">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<sizepolicy hsizetype="Minimum" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -80,476 +512,8 @@
</item>
</layout>
</widget>
<widget class="QGraphicsView" name="flatEarth">
<property name="geometry">
<rect>
<x>200</x>
<y>170</y>
<width>191</width>
<height>95</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>191</width>
<height>95</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>191</width>
<height>95</height>
</size>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="toolTip">
<string extracomment="Location of GCS on the Earth"/>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="optimizationFlags">
<set>QGraphicsView::DontAdjustForAntialiasing</set>
</property>
</widget>
<widget class="QGraphicsView" name="graphicsView">
<property name="geometry">
<rect>
<x>400</x>
<y>200</y>
<width>181</width>
<height>71</height>
</rect>
</property>
</widget>
<widget class="QFrame" name="frame">
<property name="geometry">
<rect>
<x>10</x>
<y>170</y>
<width>171</width>
<height>91</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="QPushButton" name="connectButton">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>85</width>
<height>27</height>
</rect>
</property>
<property name="text">
<string>Connect</string>
</property>
</widget>
<widget class="QPushButton" name="disconnectButton">
<property name="geometry">
<rect>
<x>10</x>
<y>50</y>
<width>91</width>
<height>27</height>
</rect>
</property>
<property name="text">
<string>Disconnect</string>
</property>
</widget>
</widget>
<widget class="QFrame" name="frame_2">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>381</width>
<height>151</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="QLabel" name="lat_label">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>57</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Coord:</string>
</property>
</widget>
<widget class="QLabel" name="coord_value">
<property name="geometry">
<rect>
<x>60</x>
<y>10</y>
<width>91</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Unknown</string>
</property>
</widget>
<widget class="QLabel" name="speed_label">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>51</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Speed:</string>
</property>
</widget>
<widget class="QLabel" name="speed_value">
<property name="geometry">
<rect>
<x>60</x>
<y>30</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Unknown</string>
</property>
</widget>
<widget class="QLabel" name="bear_label">
<property name="geometry">
<rect>
<x>210</x>
<y>30</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Heading:</string>
</property>
</widget>
<widget class="QLabel" name="bear_value">
<property name="geometry">
<rect>
<x>280</x>
<y>30</y>
<width>91</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Unknown</string>
</property>
</widget>
<widget class="Line" name="line">
<property name="geometry">
<rect>
<x>10</x>
<y>50</y>
<width>361</width>
<height>20</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QLabel" name="fix_label">
<property name="geometry">
<rect>
<x>10</x>
<y>120</y>
<width>57</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Fix Type:</string>
</property>
</widget>
<widget class="QLabel" name="fix_value">
<property name="geometry">
<rect>
<x>80</x>
<y>120</y>
<width>91</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Unknown</string>
</property>
</widget>
<widget class="QLabel" name="time_value">
<property name="geometry">
<rect>
<x>180</x>
<y>100</y>
<width>191</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Unknown</string>
</property>
</widget>
<widget class="QLabel" name="status_value">
<property name="geometry">
<rect>
<x>80</x>
<y>100</y>
<width>91</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Unknown</string>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>10</x>
<y>70</y>
<width>101</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>H / V / P DOP:</string>
</property>
</widget>
<widget class="QLabel" name="dop_value">
<property name="geometry">
<rect>
<x>130</x>
<y>70</y>
<width>231</width>
<height>17</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>0 / 0 / 0</string>
</property>
</widget>
<widget class="Line" name="line_2">
<property name="geometry">
<rect>
<x>10</x>
<y>80</y>
<width>361</width>
<height>20</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="Line" name="line_3">
<property name="geometry">
<rect>
<x>190</x>
<y>30</y>
<width>20</width>
<height>21</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<widget class="Line" name="line_5">
<property name="geometry">
<rect>
<x>160</x>
<y>100</y>
<width>20</width>
<height>41</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<widget class="Line" name="line_6">
<property name="geometry">
<rect>
<x>270</x>
<y>10</y>
<width>20</width>
<height>21</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<widget class="Line" name="line_7">
<property name="geometry">
<rect>
<x>150</x>
<y>10</y>
<width>20</width>
<height>21</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<widget class="QLabel" name="coord_value_2">
<property name="geometry">
<rect>
<x>170</x>
<y>10</y>
<width>101</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Unknown</string>
</property>
</widget>
<widget class="QLabel" name="coord_value_3">
<property name="geometry">
<rect>
<x>290</x>
<y>10</y>
<width>81</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Unknown</string>
</property>
</widget>
<widget class="QLabel" name="fix_label_2">
<property name="geometry">
<rect>
<x>10</x>
<y>100</y>
<width>71</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Sats Used:</string>
</property>
</widget>
</widget>
<widget class="QFrame" name="frame_3">
<property name="geometry">
<rect>
<x>400</x>
<y>10</y>
<width>181</width>
<height>181</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="GpsConstellationWidget" name="gpsSky">
<property name="geometry">
<rect>
<x>3</x>
<y>3</y>
<width>175</width>
<height>175</height>
</rect>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>

View File

@ -50,7 +50,7 @@
// Debugging
//#define GPSDEBUG
#define NMEA_DEBUG_PKT ///< define to enable debug of all NMEA messages
//#define NMEA_DEBUG_PKT ///< define to enable debug of all NMEA messages
#ifdef GPSDEBUG
#define NMEA_DEBUG_PKT ///< define to enable debug of all NMEA messages