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
86c7e134
Commit
86c7e134
authored
Sep 10, 2011
by
lm
Browse files
Options
Browse Files
Download
Plain Diff
Merged with 0.9 dev branches
parents
5d57365a
7f9de5e1
Changes
32
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
747 additions
and
1381 deletions
+747
-1381
parameters-bravo.txt
...tor/mav_autopilot_pixhawk/parameters/parameters-bravo.txt
+119
-0
pixhawk-widget.qgw
...uadrotor/mav_autopilot_pixhawk/widgets/pixhawk-widget.qgw
+14
-0
qgroundcontrol.pri
qgroundcontrol.pri
+9
-0
GAudioOutput.cc
src/GAudioOutput.cc
+6
-6
GAudioOutput.h
src/GAudioOutput.h
+1
-1
QGC.cc
src/QGC.cc
+15
-15
QGCCore.cc
src/QGCCore.cc
+1
-1
XMLCommProtocolWidget.h
src/apps/mavlinkgen/ui/XMLCommProtocolWidget.h
+16
-0
PxQuadMAV.cc
src/uas/PxQuadMAV.cc
+0
-1
UAS.cc
src/uas/UAS.cc
+18
-168
UAS.h
src/uas/UAS.h
+18
-8
UASInterface.h
src/uas/UASInterface.h
+7
-5
CommConfigurationWindow.cc
src/ui/CommConfigurationWindow.cc
+1
-1
HSIDisplay.cc
src/ui/HSIDisplay.cc
+6
-7
HUD.cc
src/ui/HUD.cc
+7
-5
HUD.h
src/ui/HUD.h
+3
-0
MainWindow.cc
src/ui/MainWindow.cc
+281
-949
MainWindow.h
src/ui/MainWindow.h
+24
-123
MainWindow.ui
src/ui/MainWindow.ui
+1
-1
QGCDataPlot2D.h
src/ui/QGCDataPlot2D.h
+15
-0
WaypointList.cc
src/ui/WaypointList.cc
+59
-32
QGCToolWidget.cc
src/ui/designer/QGCToolWidget.cc
+33
-12
QGCToolWidget.h
src/ui/designer/QGCToolWidget.h
+3
-1
LinechartPlot.cc
src/ui/linechart/LinechartPlot.cc
+9
-6
LinechartPlot.h
src/ui/linechart/LinechartPlot.h
+1
-1
LinechartWidget.cc
src/ui/linechart/LinechartWidget.cc
+29
-17
LinechartWidget.h
src/ui/linechart/LinechartWidget.h
+2
-1
Linecharts.cc
src/ui/linechart/Linecharts.cc
+19
-16
Linecharts.h
src/ui/linechart/Linecharts.h
+2
-0
QGCMapTool.h
src/ui/map/QGCMapTool.h
+16
-0
QGCGoogleEarthView.cc
src/ui/map3D/QGCGoogleEarthView.cc
+9
-4
QGCGoogleEarthView.h
src/ui/map3D/QGCGoogleEarthView.h
+3
-0
No files found.
files/mav_type_quadrotor/mav_autopilot_pixhawk/parameters/parameters-bravo.txt
0 → 100644
View file @
86c7e134
# Onboard parameters for system MAV 042
#
# MAV ID COMPONENT ID PARAM NAME VALUE (FLOAT)
42 1 HANDLEWPDELAY 0.20000000298
42 1 POSFILTER 1
42 1 PROTDELAY 40
42 1 PROTTIMEOUT 2
42 1 SETPOINTDELAY 1
42 1 YAWTOLERANCE 0.174500003457
42 200 ACC_NAV_OFFS_X 0
42 200 ACC_NAV_OFFS_Y 0
42 200 ACC_NAV_OFFS_Z -1000
42 200 ATT_KAL_KACC 0.00329999998212
42 200 ATT_KAL_YAWMOD 3
42 200 ATT_OFFSET_X 0
42 200 ATT_OFFSET_Y 0
42 200 ATT_OFFSET_Z -0.0799999982119
42 200 CAL_ACC_X 0
42 200 CAL_ACC_Y 0
42 200 CAL_ACC_Z 0
42 200 CAL_FIT_ACTIVE 0
42 200 CAL_FIT_GYRO_X 31496.8007812
42 200 CAL_FIT_GYRO_Y 29383.4003906
42 200 CAL_FIT_GYRO_Z 30151.0996094
42 200 CAL_GYRO_X 29767
42 200 CAL_GYRO_Y 29654
42 200 CAL_GYRO_Z 29570
42 200 CAL_MAG_X 375
42 200 CAL_MAG_Y -25
42 200 CAL_MAG_Z -1000
42 200 CAL_PRES_DIFF 10000
42 200 CAL_TEMP 29051
42 200 CAM_ANG_X_FAC 0
42 200 CAM_ANG_X_OFF 0
42 200 CAM_ANG_Y_FAC 0
42 200 CAM_ANG_Y_OFF 0.428000003099
42 200 CAM_EXP 1000
42 200 CAM_INTERVAL 200000
42 200 DEBUG_1 0
42 200 DEBUG_2 0
42 200 DEBUG_3 0
42 200 DEBUG_4 0
42 200 DEBUG_5 1
42 200 DEBUG_6 0
42 200 GPS_MODE 0
42 200 KAL_VEL_AX 1
42 200 KAL_VEL_AY 1
42 200 KAL_VEL_BX 0
42 200 KAL_VEL_BY 0
42 200 MIX_OFFSET 0
42 200 MIX_POSITION 0
42 200 MIX_POS_YAW 0
42 200 MIX_REMOTE 0
42 200 MIX_Z_POSITION 0
42 200 PID_ATT_AWU 0.300000011921
42 200 PID_ATT_D 30
42 200 PID_ATT_I 60
42 200 PID_ATT_LIM 100
42 200 PID_ATT_P 90
42 200 PID_POS_AWU 5
42 200 PID_POS_D 2
42 200 PID_POS_I 0.20000000298
42 200 PID_POS_LIM 0.20000000298
42 200 PID_POS_P 1.79999995232
42 200 PID_POS_Z_AWU 3
42 200 PID_POS_Z_D 0.20000000298
42 200 PID_POS_Z_I 0.300000011921
42 200 PID_POS_Z_LIM 0.300000011921
42 200 PID_POS_Z_P 0.25
42 200 PID_YAWPOS_AWU 1
42 200 PID_YAWPOS_D 1
42 200 PID_YAWPOS_I 0.10000000149
42 200 PID_YAWPOS_LIM 3
42 200 PID_YAWPOS_P 5
42 200 PID_YAWSPEED_D 0
42 200 PID_YAWSPEED_I 5
42 200 PID_YAWSPEED_P 15
42 200 PID_YAWSPE_AWU 1
42 200 PID_YAWSPE_LIM 50
42 200 POS_HOV_TRUST 0.300000011921
42 200 POS_SON_MODE 0
42 200 POS_SON_SCALE 1
42 200 POS_SP_ACCEPT 1
42 200 POS_SP_X 0
42 200 POS_SP_Y 0
42 200 POS_SP_YAW 0
42 200 POS_SP_Z -0.213201999664
42 200 POS_TIMEOUT 2000000
42 200 POS_YAW_TRACK 0
42 200 RC_NICK_CHAN 1
42 200 RC_ROLL_CHAN 2
42 200 RC_SAFETY_CHAN 5
42 200 RC_THRUST_CHAN 3
42 200 RC_TRIM_CHAN 0
42 200 RC_TUNE_CHAN1 5
42 200 RC_TUNE_CHAN2 6
42 200 RC_TUNE_CHAN3 7
42 200 RC_TUNE_CHAN4 8
42 200 RC_YAW_CHAN 4
42 200 SEND_DEBUGCHAN 0
42 200 SLOT_ATTITUDE 1
42 200 SLOT_CONTROL 0
42 200 SLOT_RAW_IMU 0
42 200 SLOT_RC 0
42 200 SYS_COMP_ID 200
42 200 SYS_ID 42
42 200 SYS_IMU_RESET 0
42 200 SYS_SW_VER 2000
42 200 SYS_TYPE 2
42 200 UART_0_BAUD 115200
42 200 UART_1_BAUD 115200
42 200 VEL_DAMP 0.949999988079
42 200 VEL_OFFSET_X 0
42 200 VEL_OFFSET_Y 0
42 200 VEL_OFFSET_Z 0
42 200 VICON_MODE 0
42 200 VICON_TKO_DIST 0.5
42 200 VICON_TKO_TIME 2
42 200 VIS_OUTL_TRESH 0.20000000298
files/mav_type_quadrotor/mav_autopilot_pixhawk/widgets/pixhawk-widget.qgw
0 → 100644
View file @
86c7e134
[PIXHAWK%20Quadrotor%20Commands]
QGC_TOOL_WIDGET_ITEMS\1\TYPE=BUTTON
QGC_TOOL_WIDGET_ITEMS\1\QGC_ACTION_BUTTON_DESCRIPTION=CALIBRATE GYRO
QGC_TOOL_WIDGET_ITEMS\1\QGC_ACTION_BUTTON_BUTTONTEXT=Calibrate
QGC_TOOL_WIDGET_ITEMS\1\QGC_ACTION_BUTTON_ACTIONID=17
QGC_TOOL_WIDGET_ITEMS\2\TYPE=BUTTON
QGC_TOOL_WIDGET_ITEMS\2\QGC_ACTION_BUTTON_DESCRIPTION=Record logfile and images
QGC_TOOL_WIDGET_ITEMS\2\QGC_ACTION_BUTTON_BUTTONTEXT=Start
QGC_TOOL_WIDGET_ITEMS\2\QGC_ACTION_BUTTON_ACTIONID=21
QGC_TOOL_WIDGET_ITEMS\3\TYPE=BUTTON
QGC_TOOL_WIDGET_ITEMS\3\QGC_ACTION_BUTTON_DESCRIPTION=Stop recording
QGC_TOOL_WIDGET_ITEMS\3\QGC_ACTION_BUTTON_BUTTONTEXT=Stop
QGC_TOOL_WIDGET_ITEMS\3\QGC_ACTION_BUTTON_ACTIONID=23
QGC_TOOL_WIDGET_ITEMS\size=3
qgroundcontrol.pri
View file @
86c7e134
...
...
@@ -84,6 +84,8 @@ macx {
# Copy audio files if needed
QMAKE_POST_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/qgroundcontrol.app/Contents/MacOS
# Copy contributed files
QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$TARGETDIR/qgroundcontrol.app/Contents/MacOS
# Copy google earth starter file
QMAKE_POST_LINK += && cp -f $$BASEDIR/images/earth.html $$TARGETDIR/qgroundcontrol.app/Contents/MacOS
# Copy CSS stylesheets
...
...
@@ -221,7 +223,10 @@ message("Compiling for linux 32")
DEFINES += QGC_LIBFREENECT_ENABLED
}
# Validated copy commands
QMAKE_POST_LINK += && cp -rf $$BASEDIR/audio $$DESTDIR
QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$DESTDIR
QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$DESTDIR
QMAKE_POST_LINK += && mkdir -p $$DESTDIR/images
QMAKE_POST_LINK += && cp -rf $$BASEDIR/images/Vera.ttf $$DESTDIR/images/Vera.ttf
...
...
@@ -295,6 +300,8 @@ linux-g++-64 {
DEFINES += QGC_LIBFREENECT_ENABLED
}
# Validated copy commands
QMAKE_POST_LINK += && cp -rf $$BASEDIR/audio $$DESTDIR
QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$DESTDIR
QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$DESTDIR
QMAKE_POST_LINK += && mkdir -p $$DESTDIR/images
...
...
@@ -371,6 +378,7 @@ DEFINES += QGC_OSG_ENABLED
exists($$TARGETDIR/debug) {
QMAKE_POST_LINK += $$quote(copy /Y "$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /Y "$$BASEDIR_WIN\\audio" "$$TARGETDIR_WIN\\debug\\audio" /E /I $$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /Y "$$BASEDIR_WIN\\files" "$$TARGETDIR_WIN\\debug\\files" /E /I $$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /Y "$$BASEDIR_WIN\\models" "$$TARGETDIR_WIN\\debug\\models" /E /I $$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(copy /Y "$$BASEDIR_WIN\\images\\earth.html" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(copy /Y "$$BASEDIR_WIN\\thirdParty\\libxbee\\lib\\libxbee.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
...
...
@@ -391,6 +399,7 @@ DEFINES += QGC_OSG_ENABLED
exists($$TARGETDIR/release) {
QMAKE_POST_LINK += $$quote(copy /Y "$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /Y "$$BASEDIR_WIN\\audio" "$$TARGETDIR_WIN\\release\\audio" /E /I $$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /Y "$$BASEDIR_WIN\\files" "$$TARGETDIR_WIN\\release\\files" /E /I $$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /Y "$$BASEDIR_WIN\\models" "$$TARGETDIR_WIN\\release\\models" /E /I $$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(copy /Y "$$BASEDIR_WIN\\images\\earth.html" "$$TARGETDIR_WIN\\release\\earth.html" $$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(copy /Y "$$BASEDIR_WIN\\thirdParty\\libxbee\\lib\\libxbee.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n))
...
...
src/GAudioOutput.cc
View file @
86c7e134
...
...
@@ -137,12 +137,12 @@ GAudioOutput::GAudioOutput(QObject* parent) : QObject(parent),
}
}
GAudioOutput
::~
GAudioOutput
()
{
#ifdef _MSC_VER2
::
CoUninitialize
();
#endif
}
//
GAudioOutput::~GAudioOutput()
//
{
//
#ifdef _MSC_VER2
//
::CoUninitialize();
//
#endif
//
}
void
GAudioOutput
::
mute
(
bool
mute
)
{
...
...
src/GAudioOutput.h
View file @
86c7e134
...
...
@@ -124,7 +124,7 @@ protected:
bool
muted
;
private:
GAudioOutput
(
QObject
*
parent
=
NULL
);
~
GAudioOutput
();
//
~GAudioOutput();
};
#endif // AUDIOOUTPUT_H
src/QGC.cc
View file @
86c7e134
...
...
@@ -49,28 +49,28 @@ quint64 groundTimeMilliseconds()
float
limitAngleToPMPIf
(
float
angle
)
{
while
(
angle
>
((
float
)
M_PI
+
FLT_EPSILON
))
{
angle
-=
2.0
f
*
(
float
)
M_PI
;
}
//
while (angle > ((float)M_PI+FLT_EPSILON)) {
//
angle -= 2.0f * (float)M_PI;
//
}
while
(
angle
<=
-
((
float
)
M_PI
+
FLT_EPSILON
))
{
angle
+=
2.0
f
*
(
float
)
M_PI
;
}
//
while (angle <= -((float)M_PI+FLT_EPSILON)) {
//
angle += 2.0f * (float)M_PI;
//
}
return
angle
;
}
double
limitAngleToPMPId
(
double
angle
)
{
if
(
angle
<
-
M_PI
)
{
while
(
angle
<
-
M_PI
)
{
angle
+=
M_PI
;
}
}
else
if
(
angle
>
M_PI
)
{
while
(
angle
>
M_PI
)
{
angle
-=
M_PI
;
}
}
//
if (angle < -M_PI) {
//
while (angle < -M_PI) {
//
angle += M_PI;
//
}
//
} else if (angle > M_PI) {
//
while (angle > M_PI) {
//
angle -= M_PI;
//
}
//
}
return
angle
;
}
...
...
src/QGCCore.cc
View file @
86c7e134
...
...
@@ -203,7 +203,7 @@ QGCCore::QGCCore(int &argc, char* argv[]) : QApplication(argc, argv)
QGCCore
::~
QGCCore
()
{
//mainWindow->storeSettings();
mainWindow
->
hid
e
();
mainWindow
->
clos
e
();
mainWindow
->
deleteLater
();
// Delete singletons
delete
LinkManager
::
instance
();
...
...
src/apps/mavlinkgen/ui/XMLCommProtocolWidget.h
View file @
86c7e134
...
...
@@ -66,6 +66,22 @@ protected:
DomModel
*
model
;
void
changeEvent
(
QEvent
*
e
);
signals:
void
visibilityChanged
(
bool
visible
);
protected:
void
showEvent
(
QShowEvent
*
event
)
{
QWidget
::
showEvent
(
event
);
emit
visibilityChanged
(
true
);
}
void
hideEvent
(
QHideEvent
*
event
)
{
QWidget
::
hideEvent
(
event
);
emit
visibilityChanged
(
false
);
}
private:
Ui
::
XMLCommProtocolWidget
*
m_ui
;
};
...
...
src/uas/PxQuadMAV.cc
View file @
86c7e134
...
...
@@ -56,7 +56,6 @@ void PxQuadMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
// FIXME Kind of a hack to load data from disk
mavlink_image_triggered_t
img
;
mavlink_msg_image_triggered_decode
(
&
message
,
&
img
);
qDebug
()
<<
"IMAGE AVAILABLE:"
<<
img
.
timestamp
;
emit
imageStarted
(
img
.
timestamp
);
}
break
;
...
...
src/uas/UAS.cc
View file @
86c7e134
This diff is collapsed.
Click to expand it.
src/uas/UAS.h
View file @
86c7e134
...
...
@@ -108,6 +108,14 @@ public:
double
getAltitude
()
const
{
return
altitude
;
}
virtual
bool
localPositionKnown
()
const
{
return
isLocalPositionKnown
;
}
virtual
bool
globalPositionKnown
()
const
{
return
isGlobalPositionKnown
;
}
double
getRoll
()
const
{
return
roll
;
...
...
@@ -201,15 +209,17 @@ protected: //COMMENTS FOR TEST UNIT
quint64
imageStart
;
QMap
<
int
,
QMap
<
QString
,
QVariant
>*
>
parameters
;
///< All parameters
bool
paramsOnceRequested
;
///< If the parameter list has been read at least once
int
airframe
;
///< The airframe type
bool
attitudeKnown
;
///< True if attitude was received, false else
bool
paramsOnceRequested
;
///< If the parameter list has been read at least once
int
airframe
;
///< The airframe type
bool
attitudeKnown
;
///< True if attitude was received, false else
QGCUASParamManager
*
paramManager
;
///< Parameter manager class
QString
shortStateText
;
///< Short textual state description
QString
shortModeText
;
///< Short textual mode description
bool
attitudeStamped
;
///< Should arriving data be timestamped with the last attitude? This helps with broken system time clocks on the MAV
quint64
lastAttitude
;
///< Timestamp of last attitude measurement
QGCFlightGearLink
*
simulation
;
///< Hardware in the loop simulation link
QString
shortStateText
;
///< Short textual state description
QString
shortModeText
;
///< Short textual mode description
bool
attitudeStamped
;
///< Should arriving data be timestamped with the last attitude? This helps with broken system time clocks on the MAV
quint64
lastAttitude
;
///< Timestamp of last attitude measurement
QGCFlightGearLink
*
simulation
;
///< Hardware in the loop simulation link
bool
isLocalPositionKnown
;
///< If the local position has been received for this MAV
bool
isGlobalPositionKnown
;
///< If the global position has been received for this MAV
public:
/** @brief Set the current battery type */
...
...
src/uas/UASInterface.h
View file @
86c7e134
...
...
@@ -76,10 +76,12 @@ public:
virtual
double
getLocalX
()
const
=
0
;
virtual
double
getLocalY
()
const
=
0
;
virtual
double
getLocalZ
()
const
=
0
;
virtual
bool
localPositionKnown
()
const
=
0
;
virtual
double
getLatitude
()
const
=
0
;
virtual
double
getLongitude
()
const
=
0
;
virtual
double
getAltitude
()
const
=
0
;
virtual
bool
globalPositionKnown
()
const
=
0
;
virtual
double
getRoll
()
const
=
0
;
virtual
double
getPitch
()
const
=
0
;
...
...
@@ -181,15 +183,15 @@ public:
/** @brief Get the type of the system (airplane, quadrotor, helicopter,..)*/
virtual
int
getSystemType
()
=
0
;
virtual
QString
getSystemTypeName
()
=
0
;
/** @brief Get the type of the autopilot (PIXHAWK, APM, UDB, PPZ,..) */
virtual
int
getAutopilotType
()
=
0
;
virtual
QString
getAutopilotTypeName
()
=
0
;
virtual
void
setAutopilotType
(
int
apType
)
=
0
;
QColor
getColor
()
{
return
color
;
}
virtual
int
getAutopilotType
()
=
0
;
virtual
QString
getAutopilotTypeName
()
=
0
;
virtual
void
setAutopilotType
(
int
apType
)
=
0
;
public
slots
:
/** @brief Set a new name for the system */
...
...
@@ -490,6 +492,6 @@ protected:
};
Q_DECLARE_INTERFACE
(
UASInterface
,
"org.qgroundcontrol/1.0"
)
;
Q_DECLARE_INTERFACE
(
UASInterface
,
"org.qgroundcontrol/1.0"
)
#endif // _UASINTERFACE_H_
src/ui/CommConfigurationWindow.cc
View file @
86c7e134
...
...
@@ -267,7 +267,7 @@ void CommConfigurationWindow::setLinkType(int linktype)
foreach
(
QAction
*
act
,
actions
)
{
if
(
act
->
data
().
toInt
()
==
LinkManager
::
instance
()
->
getLinks
().
indexOf
(
tmpLink
))
{
{
act
->
trigger
();
break
;
}
...
...
src/ui/HSIDisplay.cc
View file @
86c7e134
...
...
@@ -58,8 +58,8 @@ HSIDisplay::HSIDisplay(QWidget *parent) :
posXSet
(
0.0
f
),
posYSet
(
0.0
f
),
posZSet
(
0.0
f
),
attXSaturation
(
0.
5
f
),
attYSaturation
(
0.
5
f
),
attXSaturation
(
0.
2
f
),
attYSaturation
(
0.
2
f
),
attYawSaturation
(
0.5
f
),
posXSaturation
(
0.05
f
),
posYSaturation
(
0.05
f
),
...
...
@@ -474,7 +474,7 @@ QPointF HSIDisplay::metricWorldToBody(QPointF world)
{
// First translate to body-centered coordinates
// Rotate around -yaw
float
angle
=
yaw
+
M_PI
;
float
angle
=
-
yaw
-
M_PI
;
QPointF
result
(
cos
(
angle
)
*
(
x
-
world
.
x
())
-
sin
(
angle
)
*
(
y
-
world
.
y
()),
sin
(
angle
)
*
(
x
-
world
.
x
())
+
cos
(
angle
)
*
(
y
-
world
.
y
()));
return
result
;
}
...
...
@@ -945,7 +945,7 @@ void HSIDisplay::drawPositionDirection(float xRef, float yRef, float radius, con
{
if
(
xyControlKnown
&&
xyControlEnabled
)
{
// Draw the needle
const
float
maxWidth
=
radius
/
10
.0
f
;
const
float
maxWidth
=
radius
/
5
.0
f
;
const
float
minWidth
=
maxWidth
*
0.3
f
;
float
angle
=
atan2
(
posXSet
,
-
posYSet
);
...
...
@@ -985,10 +985,9 @@ void HSIDisplay::drawAttitudeDirection(float xRef, float yRef, float radius, con
const
float
maxWidth
=
radius
/
10.0
f
;
const
float
minWidth
=
maxWidth
*
0.3
f
;
float
angle
=
atan2
(
attXSet
,
attYSet
);
angle
-=
(
float
)
M_PI
/
2.0
f
;
float
angle
=
atan2
(
attYSet
,
-
attXSet
);
radius
*=
sqrt
(
pow
(
attXSet
,
2
)
+
pow
(
attYSet
,
2
))
/
sqrt
(
attXSaturation
+
attYSaturation
);
radius
*=
sqrt
(
attXSet
*
attXSet
+
attYSet
*
attYSet
)
/
sqrt
(
attXSaturation
*
attXSaturation
+
attYSaturation
*
attYSaturation
);
QPolygonF
p
(
6
);
...
...
src/ui/HUD.cc
View file @
86c7e134
...
...
@@ -200,14 +200,16 @@ void HUD::showEvent(QShowEvent* event)
// events
QGLWidget
::
showEvent
(
event
);
refreshTimer
->
start
(
updateInterval
);
emit
visibilityChanged
(
true
);
}
void
HUD
::
hideEvent
(
QHideEvent
*
event
)
{
// React only to internal (pre-display)
// events
QGLWidget
::
hideEvent
(
event
);
refreshTimer
->
stop
();
QGLWidget
::
hideEvent
(
event
);
emit
visibilityChanged
(
false
);
}
void
HUD
::
contextMenuEvent
(
QContextMenuEvent
*
event
)
...
...
@@ -1047,10 +1049,10 @@ void HUD::paintPitchLines(float pitch, QPainter* painter)
float
offset
=
pitch
;
if
(
offset
<
0
)
offset
=
-
offset
;
int
offsetCount
=
0
;
while
(
offset
>
lineDistance
)
{
offset
-=
lineDistance
;
offsetCount
++
;
}
//
while (offset > lineDistance) {
//
offset -= lineDistance;
//
offsetCount++;
//
}
int
iPos
=
(
int
)(
0.5
f
+
lineDistance
);
///< The first line
int
iNeg
=
(
int
)(
-
0.5
f
-
lineDistance
);
///< The first line
...
...
src/ui/HUD.h
View file @
86c7e134
...
...
@@ -113,6 +113,9 @@ protected slots:
void
drawPolygon
(
QPolygonF
refPolygon
,
QPainter
*
painter
);
signals:
void
visibilityChanged
(
bool
visible
);
protected:
void
commitRawDataToGL
();
/** @brief Convert reference coordinates to screen coordinates */
...
...
src/ui/MainWindow.cc
View file @
86c7e134
This diff is collapsed.
Click to expand it.
src/ui/MainWindow.h
View file @
86c7e134
...
...
@@ -113,9 +113,9 @@ public:
return
lowPowerMode
;
}
QList
<
QAction
*>
listLinkMenuActions
(
void
);
public
slots
:
// /** @brief Store the mainwindow settings */
// void storeSettings();
/** @brief Shows a status message on the bottom status bar */
void
showStatusMessage
(
const
QString
&
status
,
int
timeout
);
...
...
@@ -161,9 +161,6 @@ public slots:
/** @brief Show the project roadmap */
void
showRoadMap
();
/** @brief Shows the widgets based on configuration and current view and autopilot */
void
presentView
();
/** @brief Reload the CSS style sheet */
void
reloadStylesheet
();
/** @brief Let the user select the CSS style sheet */
...
...
@@ -184,9 +181,15 @@ public slots:
/** @brief Add a custom tool widget */
void
createCustomWidget
();
/** @brief Load a custom tool widget from a file */
/** @brief Load a custom tool widget from a file
chosen by user (QFileDialog)
*/
void
loadCustomWidget
();
/** @brief Load a custom tool widget from a file */
void
loadCustomWidget
(
const
QString
&
fileName
,
bool
singleinstance
=
false
);
/** @brief Load custom widgets from default file */
void
loadCustomWidgetsFromDefaults
(
const
QString
&
systemType
,
const
QString
&
autopilotType
);
void
closeEvent
(
QCloseEvent
*
event
);
/** @brief Load data view, allowing to plot flight data */
...
...
@@ -195,100 +198,37 @@ public slots:
/**
* @brief Shows a Docked Widget based on the action sender
*
* This slot is written to be used in conjunction with the addTo
ToolsMenu
function
* This slot is written to be used in conjunction with the addTo
ol()
function
* It shows the QDockedWidget based on the action sender
*
*/
void
showTool
Widget
(
bool
visible
);
void
showTool
(
bool
visible
);
/**
* @brief Shows a Widget from the center stack based on the action sender
*
* This slot is written to be used in conjunction with the add
ToCentralWidgetsMenu
function
* This slot is written to be used in conjunction with the add
CentralWidget()
function
* It shows the Widget based on the action sender
*
*/
void
showCentralWidget
();
/** @brief Change actively a QDockWidgets visibility by an action */
void
showDockWidget
(
bool
vis
);
/** @brief Updates a QDockWidget's checked status based on its visibility */
void
updateVisibilitySettings
(
bool
vis
);
/** @brief Updates a QDockWidget's location */
void
updateLocationSettings
(
Qt
::
DockWidgetArea
location
);
public:
QList
<
QAction
*>
listLinkMenuActions
(
void
);
protected:
MainWindow
(
QWidget
*
parent
=
0
);
/** @brief Set default window settings for the current autopilot type */
void
setDefaultSettingsForAp
();
// These defines are used to save the settings when selecting with
// which widgets populate the views
// FIXME: DO NOT PUT CUSTOM VALUES IN THIS ENUM since it is iterated over
// this will be fixed in a future release.
typedef
enum
_TOOLS_WIDGET_NAMES
{
MENU_UAS_CONTROL_PARAM
,
MENU_UAS_CONTROL
,
MENU_UAS_INFO
,
MENU_CAMERA
,
MENU_UAS_LIST
,
MENU_WAYPOINTS
,
MENU_STATUS
,
MENU_DETECTION
,
MENU_DEBUG_CONSOLE
,
MENU_PARAMETERS
,
MENU_HDD_1
,
MENU_HDD_2
,
MENU_WATCHDOG
,
MENU_HUD
,
MENU_HSI
,
MENU_RC_VIEW
,
MENU_SLUGS_DATA
,
MENU_SLUGS_PID
,
MENU_SLUGS_HIL
,
MENU_SLUGS_CAMERA
,
MENU_MAVLINK_LOG_PLAYER
,
MENU_VIDEO_STREAM_1
,
MENU_VIDEO_STREAM_2
,
MENU_MAVLINK_INSPECTOR
,
CENTRAL_SEPARATOR
=
255
,
// do not change
CENTRAL_LINECHART
,
CENTRAL_PROTOCOL
,
CENTRAL_MAP
,
CENTRAL_3D_LOCAL
,
CENTRAL_3D_MAP
,
CENTRAL_OSGEARTH
,
CENTRAL_GOOGLE_EARTH
,
CENTRAL_HUD
,
CENTRAL_DATA_PLOT
,
}
TOOLS_WIDGET_NAMES
;
typedef
enum
_SETTINGS_SECTIONS
{
SECTION_MENU
,
SUB_SECTION_CHECKED
,
SUB_SECTION_LOCATION
}
SETTINGS_SECTIONS
;
typedef
enum
_VIEW_SECTIONS
{
typedef
enum
_VIEW_SECTIONS
{
VIEW_ENGINEER
,
VIEW_OPERATOR
,
VIEW_PILOT
,
VIEW_MAVLINK
,
VIEW_UNCONNECTED
,
///< View in unconnected mode, when no UAS is available
VIEW_FULL
///< All widgets
, mostly intended for multi-screen setups
VIEW_FULL
///< All widgets
shown at once
}
VIEW_SECTIONS
;
QHash
<
int
,
QAction
*>
toolsMenuActions
;
// Holds ptr to the Menu Actions
QHash
<
int
,
QWidget
*>
dockWidgets
;
// Holds ptr to the Actual Dock widget
QHash
<
int
,
Qt
::
DockWidgetArea
>
dockWidgetLocations
;
// Holds the location
// QHash<int, QAction*> toolsMenuActions; // Holds ptr to the Menu Actions
// QHash<int, QWidget*> dockWidgets; // Holds ptr to the Actual Dock widget
/**
* @brief Adds an already instantiated QDockedWidget to the Tools Menu
...
...
@@ -297,24 +237,11 @@ protected:
* tools menu and connects the QMenuAction to a slot that shows the widget and
* checks/unchecks the tools menu item
*
* @param widget The QDock
ed
Widget being added
* @param widget The QDockWidget being added
* @param title The entry that will appear in the Menu and in the QDockedWidget title bar
* @param slotName The slot to which the triggered() signal of the menu action will be connected.
* @param tool The ENUM defined in MainWindow.h that is associated to the widget
* @param location The default location for the QDockedWidget in case there is no previous key in the settings
*/
void
addToToolsMenu
(
QWidget
*
widget
,
const
QString
title
,
const
char
*
slotName
,
TOOLS_WIDGET_NAMES
tool
,
Qt
::
DockWidgetArea
location
=
Qt
::
RightDockWidgetArea
);
/**
* @brief Determines if a QDockWidget needs to be show and if so, shows it
*
* Based on the the autopilot and the current view it queries the settings and shows the
* widget if necessary
*
* @param widget The QDockWidget requested to be shown
* @param view The view for which the QDockWidget is requested
*/
void
showTheWidget
(
TOOLS_WIDGET_NAMES
widget
,
VIEW_SECTIONS
view
=
VIEW_MAVLINK
);
void
addTool
(
QDockWidget
*
widget
,
const
QString
&
title
,
Qt
::
DockWidgetArea
location
=
Qt
::
RightDockWidgetArea
);
/**
* @brief Adds an already instantiated QWidget to the center stack
...
...
@@ -326,21 +253,8 @@ protected:
*
* @param widget The QWidget being added
* @param title The entry that will appear in the Menu
* @param slotName The slot to which the triggered() signal of the menu action will be connected.
* @param centralWidget The ENUM defined in MainWindow.h that is associated to the widget
*/
void
addToCentralWidgetsMenu
(
QWidget
*
widget
,
const
QString
title
,
const
char
*
slotName
,
TOOLS_WIDGET_NAMES
centralWidget
);
/**
* @brief Determines if a QWidget needs to be show and if so, shows it
*
* Based on the the autopilot and the current view it queries the settings and shows the
* widget if necessary
*
* @param centralWidget The QWidget requested to be shown
* @param view The view for which the QWidget is requested
*/
void
showTheCentralWidget
(
TOOLS_WIDGET_NAMES
centralWidget
,
VIEW_SECTIONS
view
);
void
addCentralWidget
(
QWidget
*
widget
,
const
QString
&
title
);
/** @brief Catch window resize events */
void
resizeEvent
(
QResizeEvent
*
event
);
...
...
@@ -350,25 +264,13 @@ protected:
bool
aboutToCloseFlag
;
bool
changingViewsFlag
;
void
clearView
();
void
storeViewState
();
void
loadViewState
();
void
buildCustomWidget
();
void
buildCommonWidgets
();
void
buildPxWidgets
();
void
buildSlugsWidgets
();
void
connectCommonWidgets
();
void
connectPxWidgets
();
void
connectSlugsWidgets
();
void
arrangeCommonCenterStack
();
void
arrangePxCenterStack
();
void
arrangeSlugsCenterStack
();
void
connectCommonActions
();
void
connectPxActions
();
void
connectSlugsActions
();
void
configureWindowName
();
void
loadSettings
();
...
...
@@ -382,12 +284,11 @@ protected:
QSettings
settings
;
QStackedWidget
*
centerStack
;
QActionGroup
centerStackActionGroup
;
// Center widgets
QPointer
<
Linecharts
>
linechartWidget
;
QPointer
<
HUD
>
hudWidget
;
QPointer
<
QGCMapTool
>
mapWidget
;
QPointer
<
XMLCommProtocolWidget
>
protocolWidget
;
QPointer
<
QGCDataPlot2D
>
dataplotWidget
;
...
...
@@ -400,6 +301,7 @@ protected:
#if (defined _MSC_VER) || (defined Q_OS_MAC)
QPointer
<
QGCGoogleEarthView
>
gEarthWidget
;
#endif
// Dock widgets
QPointer
<
QDockWidget
>
controlDockWidget
;
QPointer
<
QDockWidget
>
controlParameterWidget
;
...
...
@@ -460,7 +362,6 @@ protected:
private:
Ui
::
MainWindow
ui
;
QString
buildMenuKey
(
SETTINGS_SECTIONS
section
,
TOOLS_WIDGET_NAMES
tool
,
VIEW_SECTIONS
view
);
QString
getWindowStateKey
();
QString
getWindowGeometryKey
();
...
...
src/ui/MainWindow.ui
View file @
86c7e134
...
...
@@ -51,7 +51,7 @@
<x>
0
</x>
<y>
0
</y>
<width>
800
</width>
<height>
2
2
</height>
<height>
2
5
</height>
</rect>
</property>
<widget
class=
"QMenu"
name=
"menuMGround"
>
...
...
src/ui/QGCDataPlot2D.h
View file @
86c7e134
...
...
@@ -46,7 +46,22 @@