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
45eb8581
Commit
45eb8581
authored
Oct 13, 2012
by
Thomas Gubler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HIL: reorganization of UI
parent
172fd1bb
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
501 additions
and
227 deletions
+501
-227
qgroundcontrol.pro
qgroundcontrol.pro
+9
-3
QGCFlightGearLink.cc
src/comm/QGCFlightGearLink.cc
+33
-30
QGCFlightGearLink.h
src/comm/QGCFlightGearLink.h
+2
-1
UAS.cc
src/uas/UAS.cc
+6
-5
UAS.h
src/uas/UAS.h
+1
-1
MainWindow.cc
src/ui/MainWindow.cc
+21
-13
MainWindow.h
src/ui/MainWindow.h
+3
-0
QGCHilConfiguration.cc
src/ui/QGCHilConfiguration.cc
+25
-38
QGCHilConfiguration.h
src/ui/QGCHilConfiguration.h
+6
-4
QGCHilConfiguration.ui
src/ui/QGCHilConfiguration.ui
+29
-123
QGCHilFlightGearConfiguration.cc
src/ui/QGCHilFlightGearConfiguration.cc
+22
-0
QGCHilFlightGearConfiguration.h
src/ui/QGCHilFlightGearConfiguration.h
+32
-0
QGCHilFlightGearConfiguration.ui
src/ui/QGCHilFlightGearConfiguration.ui
+74
-0
QGCHilXPlaneConfiguration.cc
src/ui/QGCHilXPlaneConfiguration.cc
+53
-0
QGCHilXPlaneConfiguration.h
src/ui/QGCHilXPlaneConfiguration.h
+31
-0
QGCHilXPlaneConfiguration.ui
src/ui/QGCHilXPlaneConfiguration.ui
+145
-0
UASView.cc
src/ui/uas/UASView.cc
+8
-9
UASView.h
src/ui/uas/UASView.h
+1
-0
No files found.
qgroundcontrol.pro
View file @
45eb8581
...
...
@@ -224,7 +224,9 @@ FORMS += src/ui/MainWindow.ui \
src
/
ui
/
mission
/
QGCMissionDoStartSearch
.
ui
\
src
/
ui
/
mission
/
QGCMissionDoFinishSearch
.
ui
\
src
/
ui
/
QGCVehicleConfig
.
ui
\
src
/
ui
/
QGCHilConfiguration
.
ui
src
/
ui
/
QGCHilConfiguration
.
ui
\
src
/
ui
/
QGCHilFlightGearConfiguration
.
ui
\
src
/
ui
/
QGCHilXPlaneConfiguration
.
ui
INCLUDEPATH
+=
src
\
src
/
ui
\
src
/
ui
/
linechart
\
...
...
@@ -362,7 +364,9 @@ HEADERS += src/MG.h \
src
/
ui
/
mission
/
QGCMissionDoFinishSearch
.
h
\
src
/
ui
/
QGCVehicleConfig
.
h
\
src
/
comm
/
QGCHilLink
.
h
\
src
/
ui
/
QGCHilConfiguration
.
h
src
/
ui
/
QGCHilConfiguration
.
h
\
src
/
ui
/
QGCHilFlightGearConfiguration
.
h
\
src
/
ui
/
QGCHilXPlaneConfiguration
.
h
#
Google
Earth
is
only
supported
on
Mac
OS
and
Windows
with
Visual
Studio
Compiler
macx
|
macx
-
g
++
|
macx
-
g
++
42
|
win32
-
msvc2008
|
win32
-
msvc2010
::
HEADERS
+=
src
/
ui
/
map3D
/
QGCGoogleEarthView
.
h
...
...
@@ -520,7 +524,9 @@ SOURCES += src/main.cc \
src
/
ui
/
mission
/
QGCMissionDoFinishSearch
.
cc
\
src
/
ui
/
QGCVehicleConfig
.
cc
\
src
/
comm
/
QGCHilLink
.
cc
\
src
/
ui
/
QGCHilConfiguration
.
cc
src
/
ui
/
QGCHilConfiguration
.
cc
\
src
/
ui
/
QGCHilFlightGearConfiguration
.
cc
\
src
/
ui
/
QGCHilXPlaneConfiguration
.
cc
#
Enable
Google
Earth
only
on
Mac
OS
and
Windows
with
Visual
Studio
compiler
macx
|
macx
-
g
++
|
macx
-
g
++
42
|
win32
-
msvc2008
|
win32
-
msvc2010
::
SOURCES
+=
src
/
ui
/
map3D
/
QGCGoogleEarthView
.
cc
...
...
src/comm/QGCFlightGearLink.cc
View file @
45eb8581
...
...
@@ -39,9 +39,10 @@ This file is part of the QGROUNDCONTROL project
#include <QHostInfo>
#include "MainWindow.h"
QGCFlightGearLink
::
QGCFlightGearLink
(
UASInterface
*
mav
,
QString
remoteHost
,
QHostAddress
host
,
quint16
port
)
:
QGCFlightGearLink
::
QGCFlightGearLink
(
UASInterface
*
mav
,
QString
startupArguments
,
QString
remoteHost
,
QHostAddress
host
,
quint16
port
)
:
process
(
NULL
),
terraSync
(
NULL
),
startupArguments
(
startupArguments
),
flightGearVersion
(
0
)
{
this
->
host
=
host
;
...
...
@@ -438,35 +439,37 @@ bool QGCFlightGearLink::connectSimulation()
flightGearArguments
<<
QString
(
"--generic=socket,in,50,127.0.0.1,%1,udp,qgroundcontrol"
).
arg
(
currentPort
);
}
flightGearArguments
<<
"--atlas=socket,out,1,localhost,5505,udp"
;
flightGearArguments
<<
"--in-air"
;
flightGearArguments
<<
"--roll=0"
;
flightGearArguments
<<
"--pitch=0"
;
flightGearArguments
<<
"--vc=90"
;
flightGearArguments
<<
"--heading=300"
;
flightGearArguments
<<
"--timeofday=noon"
;
flightGearArguments
<<
"--disable-hud-3d"
;
flightGearArguments
<<
"--disable-fullscreen"
;
flightGearArguments
<<
"--geometry=400x300"
;
flightGearArguments
<<
"--disable-anti-alias-hud"
;
flightGearArguments
<<
"--wind=0@0"
;
flightGearArguments
<<
"--turbulence=0.0"
;
flightGearArguments
<<
"--prop:/sim/frame-rate-throttle-hz=30"
;
flightGearArguments
<<
"--control=mouse"
;
flightGearArguments
<<
"--disable-intro-music"
;
flightGearArguments
<<
"--disable-sound"
;
flightGearArguments
<<
"--disable-random-objects"
;
flightGearArguments
<<
"--disable-ai-models"
;
flightGearArguments
<<
"--shading-flat"
;
flightGearArguments
<<
"--fog-disable"
;
flightGearArguments
<<
"--disable-specular-highlight"
;
//flightGearArguments << "--disable-skyblend";
flightGearArguments
<<
"--disable-random-objects"
;
flightGearArguments
<<
"--disable-panel"
;
//flightGearArguments << "--disable-horizon-effect";
flightGearArguments
<<
"--disable-clouds"
;
flightGearArguments
<<
"--fdm=jsb"
;
flightGearArguments
<<
"--units-meters"
;
//XXX: check: the protocol xml has already a conversion from feet to m?
flightGearArguments
<<
"--notrim"
;
// flightGearArguments << "--in-air";
// flightGearArguments << "--roll=0";
// flightGearArguments << "--pitch=0";
// flightGearArguments << "--vc=90";
// flightGearArguments << "--heading=300";
// flightGearArguments << "--timeofday=noon";
// flightGearArguments << "--disable-hud-3d";
// flightGearArguments << "--disable-fullscreen";
// flightGearArguments << "--geometry=400x300";
// flightGearArguments << "--disable-anti-alias-hud";
// flightGearArguments << "--wind=0@0";
// flightGearArguments << "--turbulence=0.0";
// flightGearArguments << "--prop:/sim/frame-rate-throttle-hz=30";
// flightGearArguments << "--control=mouse";
// flightGearArguments << "--disable-intro-music";
// flightGearArguments << "--disable-sound";
// flightGearArguments << "--disable-random-objects";
// flightGearArguments << "--disable-ai-models";
// flightGearArguments << "--shading-flat";
// flightGearArguments << "--fog-disable";
// flightGearArguments << "--disable-specular-highlight";
// //flightGearArguments << "--disable-skyblend";
// flightGearArguments << "--disable-random-objects";
// flightGearArguments << "--disable-panel";
// //flightGearArguments << "--disable-horizon-effect";
// flightGearArguments << "--disable-clouds";
// flightGearArguments << "--fdm=jsb";
// flightGearArguments << "--units-meters"; //XXX: check: the protocol xml has already a conversion from feet to m?
// flightGearArguments << "--notrim";
flightGearArguments
+=
startupArguments
.
split
(
" "
);
if
(
mav
->
getSystemType
()
==
MAV_TYPE_QUADROTOR
)
{
// Start all engines of the quad
...
...
src/comm/QGCFlightGearLink.h
View file @
45eb8581
...
...
@@ -49,7 +49,7 @@ class QGCFlightGearLink : public QGCHilLink
//Q_INTERFACES(QGCFlightGearLinkInterface:LinkInterface)
public:
QGCFlightGearLink
(
UASInterface
*
mav
,
QString
remoteHost
=
QString
(
"127.0.0.1:49000"
),
QHostAddress
host
=
QHostAddress
::
Any
,
quint16
port
=
49005
);
QGCFlightGearLink
(
UASInterface
*
mav
,
QString
startupArguments
,
QString
remoteHost
=
QString
(
"127.0.0.1:49000"
),
QHostAddress
host
=
QHostAddress
::
Any
,
quint16
port
=
49005
);
~
QGCFlightGearLink
();
bool
isConnected
();
...
...
@@ -137,6 +137,7 @@ protected:
QProcess
*
process
;
QProcess
*
terraSync
;
unsigned
int
flightGearVersion
;
QString
startupArguments
;
void
setName
(
QString
name
);
...
...
src/uas/UAS.cc
View file @
45eb8581
...
...
@@ -2590,14 +2590,14 @@ bool UAS::emergencyKILL()
}
/**
* If enabled, connect the flig
th gear link.
* If enabled, connect the flig
ht gear link.
*/
void
UAS
::
enableHilFlightGear
(
bool
enable
)
void
UAS
::
enableHilFlightGear
(
bool
enable
,
QString
options
)
{
// Connect Flight Gear Link
if
(
enable
)
{
simulation
=
new
QGCFlightGearLink
(
this
);
simulation
=
new
QGCFlightGearLink
(
this
,
options
);
startHil
();
}
else
...
...
@@ -2607,13 +2607,14 @@ void UAS::enableHilFlightGear(bool enable)
}
/**
* If enabled, connect the
fligth
gear link.
* If enabled, connect the
X-plane
gear link.
*/
void
UAS
::
enableHilXPlane
(
bool
enable
)
{
// Connect
Flight Gear
Link
// Connect
X-Plane
Link
if
(
enable
)
{
simulation
=
new
QGCXPlaneLink
(
this
);
startHil
();
}
else
...
...
src/uas/UAS.h
View file @
45eb8581
...
...
@@ -528,7 +528,7 @@ public slots:
void
go
();
/** @brief Enable / disable HIL */
void
enableHilFlightGear
(
bool
enable
);
void
enableHilFlightGear
(
bool
enable
,
QString
options
);
void
enableHilXPlane
(
bool
enable
);
...
...
src/ui/MainWindow.cc
View file @
45eb8581
...
...
@@ -37,6 +37,7 @@ This file is part of the QGROUNDCONTROL project
#include <QSplashScreen>
#include <QGCHilLink.h>
#include <QGCHilConfiguration.h>
#include <QGCHilFlightGearConfiguration.h>
#include "QGC.h"
#include "MAVLinkSimulationLink.h"
...
...
@@ -643,6 +644,26 @@ void MainWindow::showCentralWidget()
centerStack
->
setCurrentWidget
(
widget
);
}
void
MainWindow
::
showHILConfigurationWidget
(
UASInterface
*
uas
)
{
// Add simulation configuration widget
UAS
*
mav
=
dynamic_cast
<
UAS
*>
(
uas
);
if
(
mav
)
{
QGCHilConfiguration
*
hconf
=
new
QGCHilConfiguration
(
mav
,
this
);
QString
hilDockName
=
tr
(
"HIL Config (%1)"
).
arg
(
uas
->
getUASName
());
QDockWidget
*
hilDock
=
new
QDockWidget
(
hilDockName
,
this
);
hilDock
->
setWidget
(
hconf
);
hilDock
->
setObjectName
(
QString
(
"HIL_CONFIG_%1"
).
arg
(
uas
->
getUASID
()));
addTool
(
hilDock
,
hilDockName
,
Qt
::
RightDockWidgetArea
);
}
// Reload view state in case new widgets were added
loadViewState
();
}
void
MainWindow
::
closeEvent
(
QCloseEvent
*
event
)
{
if
(
isVisible
())
storeViewState
();
...
...
@@ -1420,19 +1441,6 @@ void MainWindow::UASCreated(UASInterface* uas)
if
(
!
ui
.
menuConnected_Systems
->
isEnabled
())
ui
.
menuConnected_Systems
->
setEnabled
(
true
);
if
(
!
ui
.
menuUnmanned_System
->
isEnabled
())
ui
.
menuUnmanned_System
->
setEnabled
(
true
);
// Add simulation configuration widget
UAS
*
mav
=
dynamic_cast
<
UAS
*>
(
uas
);
if
(
mav
)
{
QGCHilConfiguration
*
hconf
=
new
QGCHilConfiguration
(
mav
->
getHILSimulation
(),
this
);
QString
hilDockName
=
tr
(
"HIL Config (%1)"
).
arg
(
uas
->
getUASName
());
QDockWidget
*
hilDock
=
new
QDockWidget
(
hilDockName
,
this
);
hilDock
->
setWidget
(
hconf
);
hilDock
->
setObjectName
(
QString
(
"HIL_CONFIG_%1"
).
arg
(
uas
->
getUASID
()));
addTool
(
hilDock
,
hilDockName
,
Qt
::
RightDockWidgetArea
);
}
// Reload view state in case new widgets were added
loadViewState
();
}
...
...
src/ui/MainWindow.h
View file @
45eb8581
...
...
@@ -201,6 +201,9 @@ public slots:
/** @brief Load custom widgets from default file */
void
loadCustomWidgetsFromDefaults
(
const
QString
&
systemType
,
const
QString
&
autopilotType
);
/** @brief Loads and shows the HIL Configuration Widget for the given UAS*/
void
showHILConfigurationWidget
(
UASInterface
*
uas
);
void
closeEvent
(
QCloseEvent
*
event
);
/** @brief Load data view, allowing to plot flight data */
...
...
src/ui/QGCHilConfiguration.cc
View file @
45eb8581
#include "QGCHilConfiguration.h"
#include "ui_QGCHilConfiguration.h"
#include "QGCXPlaneLink.h"
QGCHilConfiguration
::
QGCHilConfiguration
(
QGCHilLink
*
link
,
QWidget
*
parent
)
:
#include "QGCHilFlightGearConfiguration.h"
#include "QGCHilXPlaneConfiguration.h"
QGCHilConfiguration
::
QGCHilConfiguration
(
UAS
*
mav
,
QWidget
*
parent
)
:
QWidget
(
parent
),
link
(
link
),
mav
(
mav
),
ui
(
new
Ui
::
QGCHilConfiguration
)
{
ui
->
setupUi
(
this
);
connect
(
ui
->
startButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
toggleSimulation
(
bool
)));
connect
(
ui
->
hostComboBox
,
SIGNAL
(
activated
(
QString
)),
link
,
SLOT
(
setRemoteHost
(
QString
)));
connect
(
link
,
SIGNAL
(
remoteChanged
(
QString
)),
ui
->
hostComboBox
,
SLOT
(
setEditText
(
QString
)));
connect
(
link
,
SIGNAL
(
statusMessage
(
QString
)),
this
,
SLOT
(
receiveStatusMessage
(
QString
)));
connect
(
link
,
SIGNAL
(
versionChanged
(
QString
)),
ui
->
simComboBox
,
SLOT
(
setEditText
(
QString
)));
connect
(
ui
->
simComboBox
,
SIGNAL
(
activated
(
QString
)),
link
,
SLOT
(
setVersion
(
QString
)));
ui
->
simComboBox
->
setEditText
(
link
->
getVersion
());
ui
->
startButton
->
setText
(
tr
(
"Connect"
));
QGCXPlaneLink
*
xplane
=
dynamic_cast
<
QGCXPlaneLink
*>
(
link
);
connect
(
mav
->
getHILSimulation
(),
SIGNAL
(
statusMessage
(
QString
)),
this
,
SLOT
(
receiveStatusMessage
(
QString
)));
connect
(
ui
->
simComboBox
,
SIGNAL
(
activated
(
QString
)),
mav
->
getHILSimulation
(),
SLOT
(
setVersion
(
QString
)));
//ui->simComboBox->setEditText(mav->getHILSimulation()->getVersion());
if
(
xplane
)
{
connect
(
ui
->
randomAttitudeButton
,
SIGNAL
(
clicked
()),
link
,
SLOT
(
setRandomAttitude
()));
connect
(
ui
->
randomPositionButton
,
SIGNAL
(
clicked
()),
link
,
SLOT
(
setRandomPosition
()));
connect
(
ui
->
airframeComboBox
,
SIGNAL
(
activated
(
QString
)),
link
,
SLOT
(
setAirframe
(
QString
)));
ui
->
airframeComboBox
->
setCurrentIndex
(
link
->
getAirFrameIndex
());
}
ui
->
hostComboBox
->
clear
();
ui
->
hostComboBox
->
addItem
(
link
->
getRemoteHost
());
// connect(ui->)
}
...
...
@@ -39,23 +23,26 @@ void QGCHilConfiguration::receiveStatusMessage(const QString& message)
ui
->
statusLabel
->
setText
(
message
);
}
void
QGCHilConfiguration
::
toggleSimulation
(
bool
connect
)
QGCHilConfiguration
::~
QGCHilConfiguration
()
{
delete
ui
;
}
void
QGCHilConfiguration
::
on_simComboBox_currentIndexChanged
(
int
index
)
{
Q_UNUSED
(
connect
);
if
(
!
link
->
isConnected
()
)
//XXX make sure here that no other simulator is running
if
(
1
==
index
)
{
link
->
setRemoteHost
(
ui
->
hostComboBox
->
currentText
());
link
->
connectSimulation
();
ui
->
startButton
->
setText
(
tr
(
"Disconnect"
));
QGCHilFlightGearConfiguration
*
hfgconf
=
new
QGCHilFlightGearConfiguration
(
mav
,
this
);
hfgconf
->
show
();
ui
->
simulatorConfigurationDockWidget
->
setWidget
(
hfgconf
);
}
else
else
if
(
2
==
index
||
3
==
index
)
{
link
->
disconnectSimulation
();
ui
->
startButton
->
setText
(
tr
(
"Connect"
));
}
}
QGCHilXPlaneConfiguration
*
hxpconf
=
new
QGCHilXPlaneConfiguration
(
mav
->
getHILSimulation
(),
this
);
hxpconf
->
show
();
ui
->
simulatorConfigurationDockWidget
->
setWidget
(
hxpconf
);
QGCHilConfiguration
::~
QGCHilConfiguration
()
{
delete
ui
;
}
}
src/ui/QGCHilConfiguration.h
View file @
45eb8581
...
...
@@ -4,6 +4,7 @@
#include <QWidget>
#include "QGCHilLink.h"
#include "UAS.h"
namespace
Ui
{
class
QGCHilConfiguration
;
...
...
@@ -14,18 +15,19 @@ class QGCHilConfiguration : public QWidget
Q_OBJECT
public:
QGCHilConfiguration
(
QGCHilLink
*
link
,
QWidget
*
parent
=
0
);
QGCHilConfiguration
(
UAS
*
mav
,
QWidget
*
parent
=
0
);
~
QGCHilConfiguration
();
public
slots
:
/** @brief Start / stop simulation */
void
toggleSimulation
(
bool
connect
);
/** @brief Receive status message */
void
receiveStatusMessage
(
const
QString
&
message
);
protected:
QGCHilLink
*
link
;
UAS
*
mav
;
private
slots
:
void
on_simComboBox_currentIndexChanged
(
int
index
);
private:
Ui
::
QGCHilConfiguration
*
ui
;
};
...
...
src/ui/QGCHilConfiguration.ui
View file @
45eb8581
...
...
@@ -7,70 +7,13 @@
<x>
0
</x>
<y>
0
</y>
<width>
305
</width>
<height>
261
</height>
<height>
355
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
columnstretch=
"40,60,50,50"
>
<item
row=
"1"
column=
"1"
colspan=
"3"
>
<widget
class=
"QComboBox"
name=
"airframeComboBox"
>
<property
name=
"editable"
>
<bool>
true
</bool>
</property>
<item>
<property
name=
"text"
>
<string>
X-Plane default
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
QRO_X/MK
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
QRO_X/Ardrone
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
QRO_X/PWM
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
Unlimited
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
Twinjet
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
Early Bird
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
Reno Racer
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
Slowstick
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
Tiny
</string>
</property>
</item>
</widget>
</item>
<layout
class=
"QGridLayout"
name=
"gridLayout"
columnstretch=
"40,0,0"
>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"simLabel"
>
<property
name=
"text"
>
...
...
@@ -78,97 +21,60 @@
</property>
</widget>
</item>
<item
row=
"4"
column=
"2"
colspan=
"2"
>
<widget
class=
"QPushButton"
name=
"setHomeButton"
>
<property
name=
"text"
>
<string>
Set HOME
</string>
</property>
</widget>
</item>
<item
row=
"7"
column=
"0"
>
<widget
class=
"QLabel"
name=
"statusLabel"
>
<property
name=
"text"
>
<string>
Status
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
Airframe
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
colspan=
"3"
>
<item
row=
"0"
column=
"1"
colspan=
"2"
>
<widget
class=
"QComboBox"
name=
"simComboBox"
>
<property
name=
"editable"
>
<bool>
true
</bool>
</property>
<item>
<property
name=
"text"
>
<string
>
X-Plane 10
</string
>
<string
/
>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
X-Plane 9
</string>
<string>
Flightgear
</string>
</property>
</item>
</widget>
</item>
<item
row=
"2"
column=
"1"
colspan=
"3"
>
<widget
class=
"QComboBox"
name=
"hostComboBox"
>
<property
name=
"editable"
>
<bool>
true
</bool>
</property>
<item>
<property
name=
"text"
>
<string>
127.0.0.1:49000
</string>
<string>
X-Plane 10
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
X-Plane 9
</string>
</property>
</item>
</widget>
</item>
<item
row=
"6"
column=
"2"
colspan=
"2"
>
<widget
class=
"QPushButton"
name=
"randomPositionButton"
>
<property
name=
"text"
>
<string>
Random POS
</string>
<item
row=
"1"
column=
"0"
colspan=
"3"
>
<widget
class=
"QDockWidget"
name=
"simulatorConfigurationDockWidget"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Preferred"
vsizetype=
"Preferred"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item
row=
"6"
column=
"0"
colspan=
"2"
>
<widget
class=
"QPushButton"
name=
"randomAttitudeButton"
>
<property
name=
"text"
>
<string>
Random ATT
</string>
<property
name=
"minimumSize"
>
<size>
<width>
33
</width>
<height>
150
</height>
</size>
</property>
</widget>
</item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QLabel"
name=
"hostLabel"
>
<property
name=
"text"
>
<string>
Host
</string>
<property
name=
"features"
>
<set>
QDockWidget::NoDockWidgetFeatures
</set>
</property>
<widget
class=
"QWidget"
name=
"dockWidgetContents"
/>
</widget>
</item>
<item
row=
"
4"
column=
"0"
colspan=
"2
"
>
<widget
class=
"Q
PushButton"
name=
"startButton
"
>
<item
row=
"
2"
column=
"0
"
>
<widget
class=
"Q
Label"
name=
"statusLabel
"
>
<property
name=
"text"
>
<string>
Sta
rt
</string>
<string>
Sta
tus
</string>
</property>
</widget>
</item>
<item
row=
"8"
column=
"0"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
40
</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
...
...
src/ui/QGCHilFlightGearConfiguration.cc
0 → 100644
View file @
45eb8581
#include "QGCHilFlightGearConfiguration.h"
#include "ui_QGCHilFlightGearConfiguration.h"
#include "MainWindow.h"
QGCHilFlightGearConfiguration
::
QGCHilFlightGearConfiguration
(
UAS
*
mav
,
QWidget
*
parent
)
:
QWidget
(
parent
),
mav
(
mav
),
ui
(
new
Ui
::
QGCHilFlightGearConfiguration
)
{
ui
->
setupUi
(
this
);
}
QGCHilFlightGearConfiguration
::~
QGCHilFlightGearConfiguration
()
{
delete
ui
;
}
void
QGCHilFlightGearConfiguration
::
on_startButton_clicked
()
{
mav
->
enableHilFlightGear
(
true
,
ui
->
optionsPlainTextEdit
->
toPlainText
());
}
src/ui/QGCHilFlightGearConfiguration.h
0 → 100644
View file @
45eb8581
#ifndef QGCHILFLIGHTGEARCONFIGURATION_H
#define QGCHILFLIGHTGEARCONFIGURATION_H
#include <QWidget>
#include "QGCHilLink.h"
#include "QGCFlightGearLink.h"
#include "UAS.h"
namespace
Ui
{
class
QGCHilFlightGearConfiguration
;
}
class
QGCHilFlightGearConfiguration
:
public
QWidget
{
Q_OBJECT
public:
explicit
QGCHilFlightGearConfiguration
(
UAS
*
mav
,
QWidget
*
parent
=
0
);
~
QGCHilFlightGearConfiguration
();
protected:
UAS
*
mav
;
private
slots
:
void
on_startButton_clicked
();
private:
Ui
::
QGCHilFlightGearConfiguration
*
ui
;
};
#endif // QGCHILFLIGHTGEARCONFIGURATION_H
src/ui/QGCHilFlightGearConfiguration.ui
0 → 100644
View file @
45eb8581
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
QGCHilFlightGearConfiguration
</class>
<widget
class=
"QWidget"
name=
"QGCHilFlightGearConfiguration"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
350
</width>
<height>
261
</height>
</rect>
</property>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Expanding"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<widget
class=
"QWidget"
name=
"gridLayoutWidget"
>
<property
name=
"geometry"
>
<rect>
<x>
10
</x>
<y>
0
</y>
<width>
331
</width>
<height>
261
</height>
</rect>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<property
name=
"margin"
>
<number>
9
</number>
</property>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QPlainTextEdit"
name=
"optionsPlainTextEdit"
>
<property
name=
"plainText"
>
<string>
--in-air --roll=0 --pitch=0 --vc=90 --heading=300 --timeofday=noon --disable-hud-3d --disable-fullscreen --geometry=400x300 --disable-anti-alias-hud --wind=0@0 --turbulence=0.0 --prop:/sim/frame-rate-throttle-hz=30 --control=mouse --disable-intro-music --disable-sound --disable-random-objects --disable-ai-models --shading-flat --fog-disable --disable-specular-highlight --disable-random-objects --disable-panel --disable-clouds --fdm=jsb --units-meters --notrim --prop:/engines/engine/running=true
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"startButton"
>
<property
name=
"text"
>
<string>
Start
</string>
</property>
</widget>
</item>
<item
row=
"3"
column=
"0"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
68
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"plaintextInfoLabel"
>
<property
name=
"text"
>
<string>
Additional Options:
</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections/>
</ui>
src/ui/QGCHilXPlaneConfiguration.cc
0 → 100644
View file @
45eb8581
#include "QGCHilXPlaneConfiguration.h"
#include "ui_QGCHilXPlaneConfiguration.h"
#include "QGCXPlaneLink.h"
QGCHilXPlaneConfiguration
::
QGCHilXPlaneConfiguration
(
QGCHilLink
*
link
,
QWidget
*
parent
)
:
QWidget
(
parent
),
ui
(
new
Ui
::
QGCHilXPlaneConfiguration
)
{
ui
->
setupUi
(
this
);
connect
(
ui
->
startButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
toggleSimulation
(
bool
)));
connect
(
ui
->
hostComboBox
,
SIGNAL
(
activated
(
QString
)),
link
,
SLOT
(
setRemoteHost
(
QString
)));
connect
(
link
,
SIGNAL
(
remoteChanged
(
QString
)),
ui
->
hostComboBox
,
SLOT
(
setEditText
(
QString
)));
connect
(
link
,
SIGNAL
(
statusMessage
(
QString
)),
this
,
SLOT
(
receiveStatusMessage
(
QString
)));
ui
->
startButton
->
setText
(
tr
(
"Connect"
));
QGCXPlaneLink
*
xplane
=
dynamic_cast
<
QGCXPlaneLink
*>
(
link
);
if
(
xplane
)
{
connect
(
ui
->
randomAttitudeButton
,
SIGNAL
(
clicked
()),
link
,
SLOT
(
setRandomAttitude
()));
connect
(
ui
->
randomPositionButton
,
SIGNAL
(
clicked
()),
link
,
SLOT
(
setRandomPosition
()));
connect
(
ui
->
airframeComboBox
,
SIGNAL
(
activated
(
QString
)),
link
,
SLOT
(
setAirframe
(
QString
)));
ui
->
airframeComboBox
->
setCurrentIndex
(
link
->
getAirFrameIndex
());
}
ui
->
hostComboBox
->
clear
();
ui
->
hostComboBox
->
addItem
(
link
->
getRemoteHost
());
}
void
QGCHilXPlaneConfiguration
::
toggleSimulation
(
bool
connect
)
{
Q_UNUSED
(
connect
);
if
(
!
link
->
isConnected
())
{
link
->
setRemoteHost
(
ui
->
hostComboBox
->
currentText
());
link
->
connectSimulation
();