Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
501f5124
Commit
501f5124
authored
May 30, 2013
by
dongfang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PFD changes
parent
82c2f1ea
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
51 deletions
+41
-51
dongfang_notes.txt
dongfang_notes.txt
+3
-3
MainWindow.cc
src/ui/MainWindow.cc
+1
-30
PrimaryFlightDisplay.cpp
src/ui/PrimaryFlightDisplay.cpp
+30
-11
PrimaryFlightDisplay.h
src/ui/PrimaryFlightDisplay.h
+7
-7
No files found.
dongfang_notes.txt
View file @
501f5124
...
@@ -54,10 +54,10 @@ navModeChanged
...
@@ -54,10 +54,10 @@ navModeChanged
// System Status
// System Status
loadChanged
loadChanged
Do we already have these in some form? Can they be merged?
Do we already have these in some form? Can they be merged?
batteryChanged
batteryChanged
(DONE)
voltageChanged
voltageChanged
(DONE)
gpsLocalizationChanged
gpsLocalizationChanged
satelliteCountChanged
satelliteCountChanged
(DONE)
// Mission status
// Mission status
currentWaypointChanged (on WaypointManager)
currentWaypointChanged (on WaypointManager)
...
...
src/ui/MainWindow.cc
View file @
501f5124
...
@@ -345,14 +345,7 @@ QString MainWindow::getWindowStateKey()
...
@@ -345,14 +345,7 @@ QString MainWindow::getWindowStateKey()
return
QString
::
number
(
currentView
)
+
"_windowstate_"
+
UASManager
::
instance
()
->
getActiveUAS
()
->
getAutopilotTypeName
();
return
QString
::
number
(
currentView
)
+
"_windowstate_"
+
UASManager
::
instance
()
->
getActiveUAS
()
->
getAutopilotTypeName
();
}
}
else
else
<<<<<<<
HEAD
{
return
QString
::
number
(
currentView
)
+
"_windowstate"
;
}
=======
return
QString
::
number
(
currentView
)
+
"_windowstate"
;
return
QString
::
number
(
currentView
)
+
"_windowstate"
;
>>>>>>>
lorenz
/
master
}
}
QString
MainWindow
::
getWindowGeometryKey
()
QString
MainWindow
::
getWindowGeometryKey
()
...
@@ -901,22 +894,7 @@ void MainWindow::showHILConfigurationWidget(UASInterface* uas)
...
@@ -901,22 +894,7 @@ void MainWindow::showHILConfigurationWidget(UASInterface* uas)
//createDockWidget(centerStack->currentWidget(),tool,"Unnamed Tool " + QString::number(ui.menuTools->actions().size()),"UNNAMED_TOOL_" + QString::number(ui.menuTools->actions().size())+"DOCK",currentView,Qt::BottomDockWidgetArea);
//createDockWidget(centerStack->currentWidget(),tool,"Unnamed Tool " + QString::number(ui.menuTools->actions().size()),"UNNAMED_TOOL_" + QString::number(ui.menuTools->actions().size())+"DOCK",currentView,Qt::BottomDockWidgetArea);
QGCHilConfiguration
*
hconf
=
new
QGCHilConfiguration
(
mav
,
this
);
QGCHilConfiguration
*
hconf
=
new
QGCHilConfiguration
(
mav
,
this
);
<<<<<<<
HEAD
QString
hilDockName
=
tr
(
"HIL Config %1"
).
arg
(
uas
->
getUASName
());
QString
hilDockName
=
tr
(
"HIL Config (%1)"
).
arg
(
uas
->
getUASName
());
createDockWidget
(
centerStack
->
currentWidget
(),
hconf
,
hilDockName
,
QString
(
"HIL_CONFIG_%1"
).
arg
(
uas
->
getUASID
()),
currentView
,
Qt
::
LeftDockWidgetArea
);
//QDockWidget* hilDock = new QDockWidget(hilDockName, this);
//hilDock->setWidget(hconf);
//hilDock->setObjectName(QString("HIL_CONFIG_%1").arg(uas->getUASID()));
//addTool(hilDock, hilDockName, Qt::LeftDockWidgetArea);
//hilDocks.insert(mav->getUASID(), hilDock);
//if (currentView != VIEW_SIMULATION)
// hilDock->hide();
//else
// hilDock->show();
=======
QString
hilDockName
=
tr
(
"HIL Config %1"
).
arg
(
uas
->
getUASName
());
QDockWidget
*
hilDock
=
createDockWidget
(
simView
,
hconf
,
hilDockName
,
hilDockName
.
toUpper
().
replace
(
" "
,
"_"
),
VIEW_SIMULATION
,
Qt
::
LeftDockWidgetArea
);
QDockWidget
*
hilDock
=
createDockWidget
(
simView
,
hconf
,
hilDockName
,
hilDockName
.
toUpper
().
replace
(
" "
,
"_"
),
VIEW_SIMULATION
,
Qt
::
LeftDockWidgetArea
);
hilDocks
.
insert
(
mav
->
getUASID
(),
hilDock
);
hilDocks
.
insert
(
mav
->
getUASID
(),
hilDock
);
...
@@ -924,7 +902,6 @@ void MainWindow::showHILConfigurationWidget(UASInterface* uas)
...
@@ -924,7 +902,6 @@ void MainWindow::showHILConfigurationWidget(UASInterface* uas)
// hilDock->hide();
// hilDock->hide();
// else
// else
// hilDock->show();
// hilDock->show();
>>>>>>>
lorenz
/
master
}
}
}
}
...
@@ -1772,14 +1749,8 @@ void MainWindow::UASCreated(UASInterface* uas)
...
@@ -1772,14 +1749,8 @@ void MainWindow::UASCreated(UASInterface* uas)
connect
(
uas
,
SIGNAL
(
systemSpecsChanged
(
int
)),
this
,
SLOT
(
UASSpecsChanged
(
int
)));
connect
(
uas
,
SIGNAL
(
systemSpecsChanged
(
int
)),
this
,
SLOT
(
UASSpecsChanged
(
int
)));
<<<<<<<
HEAD
// HIL
//We only want to show it when it's explicitly requested. This is now handled by loadViewState()
//showHILConfigurationWidget(uas);
=======
// HIL
// HIL
showHILConfigurationWidget
(
uas
);
showHILConfigurationWidget
(
uas
);
>>>>>>>
lorenz
/
master
if
(
!
linechartWidget
)
if
(
!
linechartWidget
)
{
{
...
...
src/ui/PrimaryFlightDisplay.cpp
View file @
501f5124
...
@@ -63,6 +63,9 @@ PrimaryFlightDisplay::PrimaryFlightDisplay(int width, int height, QWidget *paren
...
@@ -63,6 +63,9 @@ PrimaryFlightDisplay::PrimaryFlightDisplay(int width, int height, QWidget *paren
batteryCurrent
(
UNKNOWN_BATTERY
),
batteryCurrent
(
UNKNOWN_BATTERY
),
batteryCharge
(
UNKNOWN_BATTERY
),
batteryCharge
(
UNKNOWN_BATTERY
),
GPSFixType
(
UNKNOWN_GPSFIXTYPE
),
satelliteCount
(
UNKNOWN_COUNT
),
layout
(
FEATUREPANELS_IN_CORNERS
),
layout
(
FEATUREPANELS_IN_CORNERS
),
style
(
OPAGUE_TAPES
),
style
(
OPAGUE_TAPES
),
...
@@ -180,6 +183,9 @@ void PrimaryFlightDisplay::setActiveUAS(UASInterface* uas)
...
@@ -180,6 +183,9 @@ void PrimaryFlightDisplay::setActiveUAS(UASInterface* uas)
disconnect
(
this
->
uas
,
SIGNAL
(
statusChanged
(
UASInterface
*
,
QString
,
QString
)),
this
,
SLOT
(
updateState
(
UASInterface
*
,
QString
)));
disconnect
(
this
->
uas
,
SIGNAL
(
statusChanged
(
UASInterface
*
,
QString
,
QString
)),
this
,
SLOT
(
updateState
(
UASInterface
*
,
QString
)));
disconnect
(
this
->
uas
,
SIGNAL
(
modeChanged
(
int
,
QString
,
QString
)),
this
,
SLOT
(
updateMode
(
int
,
QString
,
QString
)));
disconnect
(
this
->
uas
,
SIGNAL
(
modeChanged
(
int
,
QString
,
QString
)),
this
,
SLOT
(
updateMode
(
int
,
QString
,
QString
)));
disconnect
(
this
->
uas
,
SIGNAL
(
heartbeat
(
UASInterface
*
)),
this
,
SLOT
(
receiveHeartbeat
(
UASInterface
*
)));
disconnect
(
this
->
uas
,
SIGNAL
(
heartbeat
(
UASInterface
*
)),
this
,
SLOT
(
receiveHeartbeat
(
UASInterface
*
)));
disconnect
(
this
->
uas
,
SIGNAL
(
armingChanged
(
bool
)),
this
,
SLOT
(
updateArmed
(
bool
)));
disconnect
(
this
->
uas
,
SIGNAL
(
satelliteCountChanged
(
double
,
QString
)),
this
,
SLOT
(
updateSatelliteCount
(
double
,
QString
)));
disconnect
(
this
->
uas
,
SIGNAL
(
localizationChanged
(
UASInterface
*
uas
,
int
fix
)),
this
,
SLOT
(
updateGPSFixType
(
UASInterface
*
,
int
)));
//disconnect(this->uas, SIGNAL(localPositionChanged(UASInterface*,double,double,double,quint64)), this, SLOT(updateLocalPosition(UASInterface*,double,double,double,quint64)));
//disconnect(this->uas, SIGNAL(localPositionChanged(UASInterface*,double,double,double,quint64)), this, SLOT(updateLocalPosition(UASInterface*,double,double,double,quint64)));
disconnect
(
this
->
uas
,
SIGNAL
(
globalPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
updateGlobalPosition
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
disconnect
(
this
->
uas
,
SIGNAL
(
globalPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
updateGlobalPosition
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
...
@@ -198,6 +204,7 @@ void PrimaryFlightDisplay::setActiveUAS(UASInterface* uas)
...
@@ -198,6 +204,7 @@ void PrimaryFlightDisplay::setActiveUAS(UASInterface* uas)
connect
(
uas
,
SIGNAL
(
modeChanged
(
int
,
QString
,
QString
)),
this
,
SLOT
(
updateMode
(
int
,
QString
,
QString
)));
connect
(
uas
,
SIGNAL
(
modeChanged
(
int
,
QString
,
QString
)),
this
,
SLOT
(
updateMode
(
int
,
QString
,
QString
)));
connect
(
uas
,
SIGNAL
(
heartbeat
(
UASInterface
*
)),
this
,
SLOT
(
receiveHeartbeat
(
UASInterface
*
)));
connect
(
uas
,
SIGNAL
(
heartbeat
(
UASInterface
*
)),
this
,
SLOT
(
receiveHeartbeat
(
UASInterface
*
)));
connect
(
uas
,
SIGNAL
(
armingChanged
(
bool
)),
this
,
SLOT
(
updateArmed
(
bool
)));
connect
(
uas
,
SIGNAL
(
armingChanged
(
bool
)),
this
,
SLOT
(
updateArmed
(
bool
)));
connect
(
uas
,
SIGNAL
(
satelliteCountChanged
(
double
,
QString
)),
this
,
SLOT
(
updateSatelliteCount
(
double
,
QString
)));
//connect(uas, SIGNAL(localPositionChanged(UASInterface*,double,double,double,quint64)), this, SLOT(updateLocalPosition(UASInterface*,double,double,double,quint64)));
//connect(uas, SIGNAL(localPositionChanged(UASInterface*,double,double,double,quint64)), this, SLOT(updateLocalPosition(UASInterface*,double,double,double,quint64)));
connect
(
uas
,
SIGNAL
(
globalPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
updateGlobalPosition
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
connect
(
uas
,
SIGNAL
(
globalPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
updateGlobalPosition
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
...
@@ -258,6 +265,16 @@ void PrimaryFlightDisplay::updateBattery(UASInterface* uas, double voltage, doub
...
@@ -258,6 +265,16 @@ void PrimaryFlightDisplay::updateBattery(UASInterface* uas, double voltage, doub
batteryCharge
=
percent
;
batteryCharge
=
percent
;
}
}
void
PrimaryFlightDisplay
::
updateGPSFixType
(
UASInterface
*
uas
,
int
fixType
)
{
Q_UNUSED
(
uas
);
this
->
GPSFixType
=
fixType
;
}
void
PrimaryFlightDisplay
::
updateSatelliteCount
(
double
count
,
QString
name
)
{
Q_UNUSED
(
uas
)
this
->
satelliteCount
=
(
int
)
count
;
}
void
PrimaryFlightDisplay
::
receiveHeartbeat
(
UASInterface
*
)
void
PrimaryFlightDisplay
::
receiveHeartbeat
(
UASInterface
*
)
{
{
}
}
...
@@ -950,10 +967,10 @@ void PrimaryFlightDisplay::drawVelocityMeter(
...
@@ -950,10 +967,10 @@ void PrimaryFlightDisplay::drawVelocityMeter(
float
effectiveHalfHeight
=
h
*
0.45
;
float
effectiveHalfHeight
=
h
*
0.45
;
float
tickmarkLeft
=
0.6
*
w
;
float
tickmarkLeft
=
0.6
*
w
;
float
tickmarkRight
=
0.7
*
w
;
float
tickmarkRight
=
0.7
*
w
;
float
numbers
Lef
t
=
0.42
*
w
;
float
numbers
Righ
t
=
0.42
*
w
;
float
markerHalfHeight
=
0.06
*
h
;
float
markerHalfHeight
=
0.06
*
h
;
float
rightEdge
=
w
-
instrumentEdgePen
.
widthF
()
*
2
;
float
leftEdge
=
instrumentEdgePen
.
widthF
()
*
2
;
float
markerTip
=
(
tickmarkLeft
*
2
+
tickmarkRight
)
/
3
;
float
markerTip
=
(
tickmarkLeft
+
tickmarkRight
*
2
)
/
3
;
float
start
=
airspeed
-
AIRSPEED_LINEAR_SPAN
/
2
;
float
start
=
airspeed
-
AIRSPEED_LINEAR_SPAN
/
2
;
float
end
=
airspeed
+
AIRSPEED_LINEAR_SPAN
/
2
;
float
end
=
airspeed
+
AIRSPEED_LINEAR_SPAN
/
2
;
...
@@ -963,20 +980,22 @@ void PrimaryFlightDisplay::drawVelocityMeter(
...
@@ -963,20 +980,22 @@ void PrimaryFlightDisplay::drawVelocityMeter(
float
y
=
(
tickSpeed
-
airspeed
)
*
effectiveHalfHeight
/
(
AIRSPEED_LINEAR_SPAN
/
2
);
float
y
=
(
tickSpeed
-
airspeed
)
*
effectiveHalfHeight
/
(
AIRSPEED_LINEAR_SPAN
/
2
);
bool
hasText
=
tickSpeed
%
AIRSPEED_LINEAR_MAJOR_RESOLUTION
==
0
;
bool
hasText
=
tickSpeed
%
AIRSPEED_LINEAR_MAJOR_RESOLUTION
==
0
;
painter
.
resetTransform
();
painter
.
resetTransform
();
painter
.
translate
(
area
.
left
(),
area
.
center
().
y
()
-
y
);
painter
.
translate
(
area
.
left
(),
area
.
center
().
y
()
-
y
);
painter
.
drawLine
(
tickmarkLeft
,
0
,
tickmarkRight
,
0
);
painter
.
drawLine
(
tickmarkLeft
,
0
,
tickmarkRight
,
0
);
if
(
hasText
)
{
if
(
hasText
)
{
QString
s_speed
;
QString
s_speed
;
s_speed
.
sprintf
(
"%d"
,
tickSpeed
);
s_speed
.
sprintf
(
"%d"
,
tickSpeed
);
drawText
LeftCenter
(
painter
,
s_speed
,
mediumTextSize
,
numbersLef
t
,
0
);
drawText
RightCenter
(
painter
,
s_speed
,
mediumTextSize
,
numbersRigh
t
,
0
);
}
}
}
}
QPainterPath
markerPath
(
QPoint
(
markerTip
,
0
));
QPainterPath
markerPath
(
QPoint
(
markerTip
,
0
));
markerPath
.
lineTo
(
markerTip
+
markerHalfHeight
,
markerHalfHeight
);
markerPath
.
lineTo
(
markerTip
-
markerHalfHeight
,
markerHalfHeight
);
markerPath
.
lineTo
(
righ
tEdge
,
markerHalfHeight
);
markerPath
.
lineTo
(
lef
tEdge
,
markerHalfHeight
);
markerPath
.
lineTo
(
righ
tEdge
,
-
markerHalfHeight
);
markerPath
.
lineTo
(
lef
tEdge
,
-
markerHalfHeight
);
markerPath
.
lineTo
(
markerTip
+
markerHalfHeight
,
-
markerHalfHeight
);
markerPath
.
lineTo
(
markerTip
-
markerHalfHeight
,
-
markerHalfHeight
);
markerPath
.
closeSubpath
();
markerPath
.
closeSubpath
();
painter
.
resetTransform
();
painter
.
resetTransform
();
...
@@ -993,8 +1012,8 @@ void PrimaryFlightDisplay::drawVelocityMeter(
...
@@ -993,8 +1012,8 @@ void PrimaryFlightDisplay::drawVelocityMeter(
pen
.
setColor
(
Qt
::
white
);
pen
.
setColor
(
Qt
::
white
);
painter
.
setPen
(
pen
);
painter
.
setPen
(
pen
);
QString
s_alt
;
QString
s_alt
;
s_alt
.
sprintf
(
"%3.
0
f"
,
airspeed
);
s_alt
.
sprintf
(
"%3.
1
f"
,
airspeed
);
float
xCenter
=
(
markerTip
+
righ
tEdge
)
/
2
;
float
xCenter
=
(
markerTip
+
lef
tEdge
)
/
2
;
drawTextCenter
(
painter
,
s_alt
,
/* TAPES_TEXT_SIZE*width()*/
mediumTextSize
,
xCenter
,
0
);
drawTextCenter
(
painter
,
s_alt
,
/* TAPES_TEXT_SIZE*width()*/
mediumTextSize
,
xCenter
,
0
);
}
}
...
@@ -1367,7 +1386,7 @@ void PrimaryFlightDisplay::doPaint() {
...
@@ -1367,7 +1386,7 @@ void PrimaryFlightDisplay::doPaint() {
// Y: 1 single margin below above gadget.
// Y: 1 single margin below above gadget.
drawAltimeter
(
painter
,
altimeterArea
,
aboveASLAltitude
,
1000
,
0
);
drawAltimeter
(
painter
,
altimeterArea
,
aboveASLAltitude
,
1000
,
0
);
draw
Altimeter
(
painter
,
velocityMeterArea
,
aboveASLAltitude
,
1000
,
0
);
draw
VelocityMeter
(
painter
,
velocityMeterArea
);
drawSensorsStatsPanel
(
painter
,
sensorsStatsArea
);
drawSensorsStatsPanel
(
painter
,
sensorsStatsArea
);
drawLinkStatsPanel
(
painter
,
linkStatsArea
);
drawLinkStatsPanel
(
painter
,
linkStatsArea
);
...
...
src/ui/PrimaryFlightDisplay.h
View file @
501f5124
...
@@ -88,6 +88,8 @@
...
@@ -88,6 +88,8 @@
#define UNKNOWN_ATTITUDE 0
#define UNKNOWN_ATTITUDE 0
#define UNKNOWN_ALTITUDE -1000
#define UNKNOWN_ALTITUDE -1000
#define UNKNOWN_SPEED -1
#define UNKNOWN_SPEED -1
#define UNKNOWN_COUNT -1
#define UNKNOWN_GPSFIXTYPE -1
class
PrimaryFlightDisplay
:
public
QWidget
class
PrimaryFlightDisplay
:
public
QWidget
{
{
...
@@ -111,6 +113,8 @@ public slots:
...
@@ -111,6 +113,8 @@ public slots:
void
updateState
(
UASInterface
*
,
QString
);
void
updateState
(
UASInterface
*
,
QString
);
void
updateMode
(
int
id
,
QString
mode
,
QString
description
);
void
updateMode
(
int
id
,
QString
mode
,
QString
description
);
void
updateLoad
(
UASInterface
*
,
double
);
void
updateLoad
(
UASInterface
*
,
double
);
void
updateGPSFixType
(
UASInterface
*
,
int
);
void
updateSatelliteCount
(
double
count
,
QString
sth
);
void
selectWaypoint
(
int
uasId
,
int
id
);
void
selectWaypoint
(
int
uasId
,
int
id
);
protected:
protected:
...
@@ -212,16 +216,12 @@ private:
...
@@ -212,16 +216,12 @@ private:
double
batteryCurrent
;
double
batteryCurrent
;
double
batteryCharge
;
double
batteryCharge
;
int
GPSFixType
;
int
satelliteCount
;
Layout
layout
;
// The display layout.
Layout
layout
;
// The display layout.
Style
style
;
// The AI style (tapes translusent or opague)
Style
style
;
// The AI style (tapes translusent or opague)
/* This idea did not work
QPen whitePen;
QPen redPen;
QPen amberPen;
QPen greenPen;
QPen blackPen;
*/
QColor
redColor
;
QColor
redColor
;
QColor
amberColor
;
QColor
amberColor
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment