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
0f035389
Commit
0f035389
authored
Sep 06, 2016
by
Bart Slinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix code style
parent
e6a125ee
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3057 additions
and
2808 deletions
+3057
-2808
QGCXPlaneLink.cc
src/comm/QGCXPlaneLink.cc
+234
-160
QGCXPlaneLink.h
src/comm/QGCXPlaneLink.h
+18
-13
UAS.cc
src/uas/UAS.cc
+2171
-2018
UAS.h
src/uas/UAS.h
+627
-613
QGCHilXPlaneConfiguration.cc
src/ui/QGCHilXPlaneConfiguration.cc
+7
-4
No files found.
src/comm/QGCXPlaneLink.cc
View file @
0f035389
This diff is collapsed.
Click to expand it.
src/comm/QGCXPlaneLink.h
View file @
0f035389
...
@@ -36,7 +36,7 @@ class QGCXPlaneLink : public QGCHilLink
...
@@ -36,7 +36,7 @@ class QGCXPlaneLink : public QGCHilLink
//Q_INTERFACES(QGCXPlaneLinkInterface:LinkInterface)
//Q_INTERFACES(QGCXPlaneLinkInterface:LinkInterface)
public:
public:
QGCXPlaneLink
(
Vehicle
*
vehicle
,
QString
remoteHost
=
QString
(
"127.0.0.1:49000"
),
QHostAddress
localHost
=
QHostAddress
::
Any
,
quint16
localPort
=
49005
);
QGCXPlaneLink
(
Vehicle
*
vehicle
,
QString
remoteHost
=
QString
(
"127.0.0.1:49000"
),
QHostAddress
localHost
=
QHostAddress
::
Any
,
quint16
localPort
=
49005
);
~
QGCXPlaneLink
();
~
QGCXPlaneLink
();
/**
/**
...
@@ -51,7 +51,8 @@ public:
...
@@ -51,7 +51,8 @@ public:
bool
isConnected
();
bool
isConnected
();
qint64
bytesAvailable
();
qint64
bytesAvailable
();
int
getPort
()
const
{
int
getPort
()
const
{
return
localPort
;
return
localPort
;
}
}
...
@@ -88,11 +89,13 @@ public:
...
@@ -88,11 +89,13 @@ public:
return
(
int
)
airframeID
;
return
(
int
)
airframeID
;
}
}
bool
sensorHilEnabled
()
{
bool
sensorHilEnabled
()
{
return
_sensorHilEnabled
;
return
_sensorHilEnabled
;
}
}
bool
useHilActuatorControls
()
{
bool
useHilActuatorControls
()
{
return
_useHilActuatorControls
;
return
_useHilActuatorControls
;
}
}
...
@@ -104,7 +107,7 @@ public slots:
...
@@ -104,7 +107,7 @@ public slots:
// void setAddress(QString address);
// void setAddress(QString address);
void
setPort
(
int
port
);
void
setPort
(
int
port
);
/** @brief Add a new host to broadcast messages to */
/** @brief Add a new host to broadcast messages to */
void
setRemoteHost
(
const
QString
&
host
);
void
setRemoteHost
(
const
QString
&
host
);
/** @brief Send new control states to the simulation */
/** @brief Send new control states to the simulation */
void
updateControls
(
quint64
time
,
float
rollAilerons
,
float
pitchElevator
,
float
yawRudder
,
float
throttle
,
quint8
systemMode
,
quint8
navMode
);
void
updateControls
(
quint64
time
,
float
rollAilerons
,
float
pitchElevator
,
float
yawRudder
,
float
throttle
,
quint8
systemMode
,
quint8
navMode
);
/** @brief Send new control commands to the simulation */
/** @brief Send new control commands to the simulation */
...
@@ -127,14 +130,16 @@ public slots:
...
@@ -127,14 +130,16 @@ public slots:
float
ctl_15
,
float
ctl_15
,
quint8
mode
);
quint8
mode
);
/** @brief Set the simulator version as text string */
/** @brief Set the simulator version as text string */
void
setVersion
(
const
QString
&
version
);
void
setVersion
(
const
QString
&
version
);
/** @brief Set the simulator version as integer */
/** @brief Set the simulator version as integer */
void
setVersion
(
unsigned
int
version
);
void
setVersion
(
unsigned
int
version
);
void
enableSensorHIL
(
bool
enable
)
{
void
enableSensorHIL
(
bool
enable
)
{
if
(
enable
!=
_sensorHilEnabled
)
if
(
enable
!=
_sensorHilEnabled
)
_sensorHilEnabled
=
enable
;
_sensorHilEnabled
=
enable
;
emit
sensorHilChanged
(
enable
);
emit
sensorHilChanged
(
enable
);
}
}
void
enableHilActuatorControls
(
bool
enable
);
void
enableHilActuatorControls
(
bool
enable
);
...
@@ -159,7 +164,7 @@ public slots:
...
@@ -159,7 +164,7 @@ public slots:
* @brief Select airplane model
* @brief Select airplane model
* @param plane the name of the airplane
* @param plane the name of the airplane
*/
*/
void
selectAirframe
(
const
QString
&
airframe
);
void
selectAirframe
(
const
QString
&
airframe
);
/**
/**
* @brief Set the airplane position and attitude
* @brief Set the airplane position and attitude
* @param lat
* @param lat
...
@@ -182,14 +187,14 @@ public slots:
...
@@ -182,14 +187,14 @@ public slots:
void
setRandomAttitude
();
void
setRandomAttitude
();
protected:
protected:
Vehicle
*
_vehicle
;
Vehicle
*
_vehicle
;
QString
name
;
QString
name
;
QHostAddress
localHost
;
QHostAddress
localHost
;
quint16
localPort
;
quint16
localPort
;
QHostAddress
remoteHost
;
QHostAddress
remoteHost
;
quint16
remotePort
;
quint16
remotePort
;
int
id
;
int
id
;
QUdpSocket
*
socket
;
QUdpSocket
*
socket
;
bool
connectState
;
bool
connectState
;
quint64
bitsSentTotal
;
quint64
bitsSentTotal
;
...
@@ -202,8 +207,8 @@ protected:
...
@@ -202,8 +207,8 @@ protected:
QMutex
statisticsMutex
;
QMutex
statisticsMutex
;
QMutex
dataMutex
;
QMutex
dataMutex
;
QTimer
refreshTimer
;
QTimer
refreshTimer
;
QProcess
*
process
;
QProcess
*
process
;
QProcess
*
terraSync
;
QProcess
*
terraSync
;
bool
gpsReceived
;
bool
gpsReceived
;
bool
attitudeReceived
;
bool
attitudeReceived
;
...
...
src/uas/UAS.cc
View file @
0f035389
This diff is collapsed.
Click to expand it.
src/uas/UAS.h
View file @
0f035389
This diff is collapsed.
Click to expand it.
src/ui/QGCHilXPlaneConfiguration.cc
View file @
0f035389
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
#include "QGCXPlaneLink.h"
#include "QGCXPlaneLink.h"
#include "QGCHilConfiguration.h"
#include "QGCHilConfiguration.h"
QGCHilXPlaneConfiguration
::
QGCHilXPlaneConfiguration
(
QGCHilLink
*
link
,
QGCHilConfiguration
*
parent
)
:
QGCHilXPlaneConfiguration
::
QGCHilXPlaneConfiguration
(
QGCHilLink
*
link
,
QGCHilConfiguration
*
parent
)
:
QWidget
(
parent
),
QWidget
(
parent
),
ui
(
new
Ui
::
QGCHilXPlaneConfiguration
)
ui
(
new
Ui
::
QGCHilXPlaneConfiguration
)
{
{
...
@@ -12,7 +12,7 @@ QGCHilXPlaneConfiguration::QGCHilXPlaneConfiguration(QGCHilLink* link, QGCHilCon
...
@@ -12,7 +12,7 @@ QGCHilXPlaneConfiguration::QGCHilXPlaneConfiguration(QGCHilLink* link, QGCHilCon
connect
(
ui
->
startButton
,
&
QPushButton
::
clicked
,
this
,
&
QGCHilXPlaneConfiguration
::
toggleSimulation
);
connect
(
ui
->
startButton
,
&
QPushButton
::
clicked
,
this
,
&
QGCHilXPlaneConfiguration
::
toggleSimulation
);
connect
(
ui
->
hostComboBox
,
static_cast
<
void
(
QComboBox
::*
)(
const
QString
&
)
>
(
&
QComboBox
::
activated
),
connect
(
ui
->
hostComboBox
,
static_cast
<
void
(
QComboBox
::*
)(
const
QString
&
)
>
(
&
QComboBox
::
activated
),
link
,
&
QGCHilLink
::
setRemoteHost
);
link
,
&
QGCHilLink
::
setRemoteHost
);
connect
(
link
,
&
QGCHilLink
::
remoteChanged
,
ui
->
hostComboBox
,
&
QComboBox
::
setEditText
);
connect
(
link
,
&
QGCHilLink
::
remoteChanged
,
ui
->
hostComboBox
,
&
QComboBox
::
setEditText
);
...
@@ -23,7 +23,7 @@ QGCHilXPlaneConfiguration::QGCHilXPlaneConfiguration(QGCHilLink* link, QGCHilCon
...
@@ -23,7 +23,7 @@ QGCHilXPlaneConfiguration::QGCHilXPlaneConfiguration(QGCHilLink* link, QGCHilCon
ui
->
startButton
->
setText
(
tr
(
"Connect"
));
ui
->
startButton
->
setText
(
tr
(
"Connect"
));
QGCXPlaneLink
*
xplane
=
dynamic_cast
<
QGCXPlaneLink
*>
(
link
);
QGCXPlaneLink
*
xplane
=
dynamic_cast
<
QGCXPlaneLink
*>
(
link
);
if
(
xplane
)
if
(
xplane
)
{
{
...
@@ -58,17 +58,20 @@ void QGCHilXPlaneConfiguration::setVersion(int version)
...
@@ -58,17 +58,20 @@ void QGCHilXPlaneConfiguration::setVersion(int version)
void
QGCHilXPlaneConfiguration
::
toggleSimulation
(
bool
connect
)
void
QGCHilXPlaneConfiguration
::
toggleSimulation
(
bool
connect
)
{
{
if
(
!
link
)
{
if
(
!
link
)
{
return
;
return
;
}
}
Q_UNUSED
(
connect
);
Q_UNUSED
(
connect
);
if
(
!
link
->
isConnected
())
if
(
!
link
->
isConnected
())
{
{
link
->
setRemoteHost
(
ui
->
hostComboBox
->
currentText
());
link
->
setRemoteHost
(
ui
->
hostComboBox
->
currentText
());
link
->
connectSimulation
();
link
->
connectSimulation
();
ui
->
startButton
->
setText
(
tr
(
"Disconnect"
));
ui
->
startButton
->
setText
(
tr
(
"Disconnect"
));
}
}
else
else
{
{
link
->
disconnectSimulation
();
link
->
disconnectSimulation
();
...
...
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