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
ef51e33a
Commit
ef51e33a
authored
Feb 24, 2011
by
Alejandro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add widget UASControlParameters
parent
bf89851b
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
957 additions
and
553 deletions
+957
-553
qgroundcontrol.pro
qgroundcontrol.pro
+466
-463
MainWindow.cc
src/ui/MainWindow.cc
+20
-4
MainWindow.h
src/ui/MainWindow.h
+3
-1
QGCRemoteControlView.cc
src/ui/QGCRemoteControlView.cc
+5
-1
SlugsDataSensorView.ui
src/ui/SlugsDataSensorView.ui
+1
-1
UASControlParameters.ui
src/ui/UASControlParameters.ui
+192
-0
UASControlParameters.cpp
src/ui/uas/UASControlParameters.cpp
+138
-0
UASControlParameters.h
src/ui/uas/UASControlParameters.h
+43
-0
UASControlWidget.cc
src/ui/uas/UASControlWidget.cc
+2
-0
UASControlWidget.h
src/ui/uas/UASControlWidget.h
+87
-83
No files found.
qgroundcontrol.pro
View file @
ef51e33a
...
...
@@ -157,7 +157,8 @@ FORMS += src/ui/MainWindow.ui \
src
/
ui
/
QGCWaypointListMulti
.
ui
\
src
/
ui
/
mission
/
QGCCustomWaypointAction
.
ui
\
src
/
ui
/
QGCUDPLinkConfiguration
.
ui
\
src
/
ui
/
QGCSettingsWidget
.
ui
src
/
ui
/
QGCSettingsWidget
.
ui
\
src
/
ui
/
UASControlParameters
.
ui
INCLUDEPATH
+=
src
\
src
/
ui
\
...
...
@@ -269,7 +270,8 @@ HEADERS += src/MG.h \
src
/
uas
/
QGCMAVLinkUASFactory
.
h
\
src
/
ui
/
QGCWaypointListMulti
.
h
\
src
/
ui
/
QGCUDPLinkConfiguration
.
h
\
src
/
ui
/
QGCSettingsWidget
.
h
src
/
ui
/
QGCSettingsWidget
.
h
\
src
/
ui
/
uas
/
UASControlParameters
.
h
#
Google
Earth
is
only
supported
on
Mac
OS
and
Windows
with
Visual
Studio
Compiler
macx
|
win32
-
msvc2008
:
{
...
...
@@ -396,7 +398,8 @@ SOURCES += src/main.cc \
src
/
uas
/
QGCMAVLinkUASFactory
.
cc
\
src
/
ui
/
QGCWaypointListMulti
.
cc
\
src
/
ui
/
QGCUDPLinkConfiguration
.
cc
\
src
/
ui
/
QGCSettingsWidget
.
cc
src
/
ui
/
QGCSettingsWidget
.
cc
\
src
/
ui
/
uas
/
UASControlParameters
.
cpp
macx
|
win32
-
msvc2008
:
{
SOURCES
+=
src
/
ui
/
map3D
/
QGCGoogleEarthView
.
cc
...
...
src/ui/MainWindow.cc
View file @
ef51e33a
...
...
@@ -335,6 +335,14 @@ void MainWindow::buildCommonWidgets()
addToToolsMenu
(
controlDockWidget
,
tr
(
"Control"
),
SLOT
(
showToolWidget
(
bool
)),
MENU_UAS_CONTROL
,
Qt
::
LeftDockWidgetArea
);
}
if
(
!
controlParameterWidget
)
{
controlParameterWidget
=
new
QDockWidget
(
tr
(
"Control Parameters"
),
this
);
controlParameterWidget
->
setObjectName
(
"UNMANNED_SYSTEM_CONTROL_PARAMETERWIDGET"
);
controlParameterWidget
->
setWidget
(
new
UASControlParameters
(
this
)
);
addToToolsMenu
(
controlParameterWidget
,
tr
(
"Control Parameters"
),
SLOT
(
showToolWidget
(
bool
)),
MENU_UAS_CONTROL_PARAM
,
Qt
::
LeftDockWidgetArea
);
}
if
(
!
listDockWidget
)
{
listDockWidget
=
new
QDockWidget
(
tr
(
"Unmanned Systems"
),
this
);
...
...
@@ -1007,10 +1015,11 @@ void MainWindow::connectCommonWidgets()
//
connect
(
waypointsDockWidget
->
widget
(),
SIGNAL
(
changePointList
()),
mapWidget
,
SLOT
(
clearWaypoints
()));
}
if
(
controlDockWidget
&&
controlParameterWidget
)
{
connect
(
controlDockWidget
->
widget
(),
SIGNAL
(
changedMode
(
int
)),
controlParameterWidget
->
widget
(),
SLOT
(
changedMode
(
int
)));
}
//TODO temporaly debug
...
...
@@ -1018,6 +1027,11 @@ void MainWindow::connectCommonWidgets()
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
slugsHilSimWidget
->
widget
(),
SLOT
(
activeUasSet
(
UASInterface
*
)));
}
if
(
controlParameterWidget
&&
controlParameterWidget
->
widget
()){
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
controlParameterWidget
->
widget
(),
SLOT
(
activeUasSet
(
UASInterface
*
)));
}
}
void
MainWindow
::
createCustomWidget
()
...
...
@@ -1064,6 +1078,8 @@ void MainWindow::connectSlugsWidgets()
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
slugsPIDControlWidget
->
widget
(),
SLOT
(
activeUasSet
(
UASInterface
*
)));
}
}
void
MainWindow
::
arrangeCommonCenterStack
()
...
...
src/ui/MainWindow.h
View file @
ef51e33a
...
...
@@ -75,7 +75,7 @@ This file is part of the QGROUNDCONTROL project
#include "SlugsHilSim.h"
#include "SlugsVideoCamControl.h"
#include "UASControlParameters.h"
/**
* @brief Main Application Window
...
...
@@ -212,6 +212,7 @@ protected:
// 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
,
...
...
@@ -381,6 +382,7 @@ protected:
#endif
// Dock widgets
QPointer
<
QDockWidget
>
controlDockWidget
;
QPointer
<
QDockWidget
>
controlParameterWidget
;
QPointer
<
QDockWidget
>
infoDockWidget
;
QPointer
<
QDockWidget
>
cameraDockWidget
;
QPointer
<
QDockWidget
>
listDockWidget
;
...
...
src/ui/QGCRemoteControlView.cc
View file @
ef51e33a
...
...
@@ -191,7 +191,11 @@ void QGCRemoteControlView::redraw()
progressBars
.
at
(
i
)
->
setValue
(
vv
);
}
// Update RSSI
if
(
rssi
>
0
)
{
rssiBar
->
setValue
(
rssi
*
100
);
}
updated
=
false
;
}
}
...
...
src/ui/SlugsDataSensorView.ui
View file @
ef51e33a
...
...
@@ -6,7 +6,7 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
392
</width>
<width>
495
</width>
<height>
671
</height>
</rect>
</property>
...
...
src/ui/UASControlParameters.ui
0 → 100644
View file @
ef51e33a
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
UASControlParameters
</class>
<widget
class=
"QWidget"
name=
"UASControlParameters"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
200
</width>
<height>
228
</height>
</rect>
</property>
<property
name=
"minimumSize"
>
<size>
<width>
200
</width>
<height>
150
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
267
</width>
<height>
16777215
</height>
</size>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QTabWidget"
name=
"tabWidget"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
/>
</property>
<property
name=
"currentIndex"
>
<number>
0
</number>
</property>
<widget
class=
"QWidget"
name=
"tab"
>
<attribute
name=
"title"
>
<string>
Tab 1
</string>
</attribute>
<layout
class=
"QGridLayout"
name=
"gridLayout_2"
>
<item
row=
"0"
column=
"0"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_5"
>
<item>
<spacer
name=
"horizontalSpacer_2"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QLabel"
name=
"lbMode"
>
<property
name=
"minimumSize"
>
<size>
<width>
100
</width>
<height>
0
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
16777215
</width>
<height>
16777215
</height>
</size>
</property>
<property
name=
"text"
>
<string>
----
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item
row=
"1"
column=
"0"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
<string>
Height (m)
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QDoubleSpinBox"
name=
"sbHeight"
>
<property
name=
"maximum"
>
<double>
1500.000000000000000
</double>
</property>
</widget>
</item>
</layout>
</item>
<item
row=
"2"
column=
"0"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_3"
>
<item>
<widget
class=
"QLabel"
name=
"label_3"
>
<property
name=
"text"
>
<string>
Airspeed (m/s)
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QDoubleSpinBox"
name=
"sbAirSpeed"
>
<property
name=
"maximum"
>
<double>
500.000000000000000
</double>
</property>
</widget>
</item>
</layout>
</item>
<item
row=
"3"
column=
"0"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_2"
>
<item>
<widget
class=
"QLabel"
name=
"label_4"
>
<property
name=
"text"
>
<string>
Turn Rate (rad/s)
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QDoubleSpinBox"
name=
"sbTurnRate"
>
<property
name=
"maximum"
>
<double>
180.000000000000000
</double>
</property>
</widget>
</item>
</layout>
</item>
<item
row=
"4"
column=
"0"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_4"
>
<item>
<widget
class=
"QPushButton"
name=
"btSetCommands"
>
<property
name=
"text"
>
<string>
Set
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"btGetCommands"
>
<property
name=
"text"
>
<string>
Get
</string>
</property>
</widget>
</item>
</layout>
</item>
<item
row=
"5"
column=
"0"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
27
</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget
class=
"QWidget"
name=
"tab_2"
>
<attribute
name=
"title"
>
<string>
Tab 2
</string>
</attribute>
</widget>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
src/ui/uas/UASControlParameters.cpp
0 → 100644
View file @
ef51e33a
#include "src\ui\uas\UASControlParameters.h"
#include "ui_UASControlParameters.h"
#define CONTROL_MODE_LOCKED "MODE LOCKED"
#define CONTROL_MODE_MANUAL "MODE MANUAL"
#define CONTROL_MODE_GUIDED "MODE GUIDED"
#define CONTROL_MODE_AUTO "MODE AUTO"
#define CONTROL_MODE_TEST1 "MODE TEST1"
#define CONTROL_MODE_TEST2 "MODE TEST2"
#define CONTROL_MODE_TEST3 "MODE TEST3"
#define CONTROL_MODE_READY "MODE TEST3"
#define CONTROL_MODE_RC_TRAINING "RC SIMULATION"
#define CONTROL_MODE_LOCKED_INDEX 1
#define CONTROL_MODE_MANUAL_INDEX 2
#define CONTROL_MODE_GUIDED_INDEX 3
#define CONTROL_MODE_AUTO_INDEX 4
#define CONTROL_MODE_TEST1_INDEX 5
#define CONTROL_MODE_TEST2_INDEX 6
#define CONTROL_MODE_TEST3_INDEX 7
#define CONTROL_MODE_READY_INDEX 8
#define CONTROL_MODE_RC_TRAINING_INDEX 9
UASControlParameters
::
UASControlParameters
(
QWidget
*
parent
)
:
QWidget
(
parent
),
ui
(
new
Ui
::
UASControlParameters
)
{
ui
->
setupUi
(
this
);
//this->mode = "MAV_MODE_UNKNOWN";
//connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(activeUasSet(UASInterface*)));
connect
(
ui
->
btGetCommands
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
getCommands
()));
//QColor groupColor = QColor(231,72,28);
//QString borderColor = "#FA4A4F";
//groupColor = groupColor.darker(475);
}
UASControlParameters
::~
UASControlParameters
()
{
delete
ui
;
}
void
UASControlParameters
::
changedMode
(
int
mode
)
{
QString
modeTemp
;
if
(
mode
==
CONTROL_MODE_LOCKED_INDEX
)
{
modeTemp
=
CONTROL_MODE_LOCKED
;
}
else
if
(
mode
==
CONTROL_MODE_MANUAL_INDEX
)
{
modeTemp
=
CONTROL_MODE_MANUAL
;
}
else
if
(
mode
==
CONTROL_MODE_GUIDED_INDEX
)
{
modeTemp
=
CONTROL_MODE_GUIDED
;
}
else
if
(
mode
==
CONTROL_MODE_AUTO_INDEX
)
{
modeTemp
=
CONTROL_MODE_AUTO
;
}
else
if
(
mode
==
CONTROL_MODE_TEST1_INDEX
)
{
modeTemp
=
CONTROL_MODE_TEST1
;
}
else
if
(
mode
==
CONTROL_MODE_TEST2_INDEX
)
{
modeTemp
=
CONTROL_MODE_TEST2
;
}
else
if
(
mode
==
CONTROL_MODE_TEST3_INDEX
)
{
modeTemp
=
CONTROL_MODE_TEST3
;
}
else
if
(
mode
==
CONTROL_MODE_RC_TRAINING_INDEX
)
{
modeTemp
=
CONTROL_MODE_RC_TRAINING
;
}
if
(
static_cast
<
QString
>
(
modeTemp
)
!=
this
->
mode
)
{
ui
->
lbMode
->
setStyleSheet
(
"background-color: rgb(255, 0, 0)"
);
}
else
{
ui
->
lbMode
->
setStyleSheet
(
""
);
}
}
void
UASControlParameters
::
activeUasSet
(
UASInterface
*
uas
)
{
connect
(
uas
,
SIGNAL
(
globalPositionChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
updateGlobalPosition
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
connect
(
uas
,
SIGNAL
(
speedChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
speedChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
connect
(
uas
,
SIGNAL
(
attitudeChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
updateAttitude
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
connect
(
uas
,
SIGNAL
(
modeChanged
(
int
,
QString
,
QString
)),
this
,
SLOT
(
updateMode
(
int
,
QString
,
QString
)));
activeUAS
=
uas
;
}
void
UASControlParameters
::
updateGlobalPosition
(
UASInterface
*
a
,
double
b
,
double
c
,
double
aa
,
quint64
ab
)
{
//ui->sbHeight->setValue(aa);
this
->
altitude
=
aa
;
}
void
UASControlParameters
::
speedChanged
(
UASInterface
*
uas
,
double
vx
,
double
vy
,
double
vz
,
quint64
time
)
{
this
->
speed
=
sqrt
(
pow
(
vx
,
2.0
)
+
pow
(
vy
,
2.0
)
+
pow
(
vz
,
2.0
));
//ui->sbAirSpeed->setValue(speed);
}
void
UASControlParameters
::
updateAttitude
(
UASInterface
*
uas
,
double
roll
,
double
pitch
,
double
yaw
,
quint64
time
)
{
Q_UNUSED
(
uas
);
Q_UNUSED
(
time
);
//ui->sbTurnRate->setValue(roll);
this
->
roll
=
roll
;
}
void
UASControlParameters
::
setCommands
()
{}
void
UASControlParameters
::
getCommands
()
{
ui
->
sbAirSpeed
->
setValue
(
this
->
speed
);
ui
->
sbHeight
->
setValue
(
this
->
altitude
);
ui
->
sbTurnRate
->
setValue
(
this
->
roll
);
}
void
UASControlParameters
::
updateMode
(
int
uas
,
QString
mode
,
QString
description
)
{
Q_UNUSED
(
uas
);
Q_UNUSED
(
description
);
this
->
mode
=
mode
;
ui
->
lbMode
->
setText
(
this
->
mode
);
}
src/ui/uas/UASControlParameters.h
0 → 100644
View file @
ef51e33a
#ifndef UASCONTROLPARAMETERS_H
#define UASCONTROLPARAMETERS_H
#include <QWidget>
#include "UASManager.h"
#include "SlugsMAV.h"
#include <QTimer>
#include <QTabWidget>
namespace
Ui
{
class
UASControlParameters
;
}
class
UASControlParameters
:
public
QWidget
{
Q_OBJECT
public:
explicit
UASControlParameters
(
QWidget
*
parent
=
0
);
~
UASControlParameters
();
public
slots
:
void
changedMode
(
int
mode
);
void
activeUasSet
(
UASInterface
*
uas
);
void
updateGlobalPosition
(
UASInterface
*
,
double
,
double
,
double
,
quint64
);
void
speedChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
);
void
updateAttitude
(
UASInterface
*
uas
,
double
roll
,
double
pitch
,
double
yaw
,
quint64
time
);
void
setCommands
();
void
getCommands
();
void
updateMode
(
int
uas
,
QString
mode
,
QString
description
);
private:
Ui
::
UASControlParameters
*
ui
;
QTimer
*
refreshTimerGet
;
UASInterface
*
activeUAS
;
double
speed
;
double
roll
;
double
altitude
;
QString
mode
;
QString
REDcolorStyle
;
};
#endif // UASCONTROLPARAMETERS_H
src/ui/uas/UASControlWidget.cc
View file @
ef51e33a
...
...
@@ -249,6 +249,8 @@ void UASControlWidget::setMode(int mode)
qDebug
()
<<
"SET MODE REQUESTED"
<<
uasMode
;
emit
changedMode
(
mode
);
}
void
UASControlWidget
::
transmitMode
()
...
...
src/ui/uas/UASControlWidget.h
View file @
ef51e33a
...
...
@@ -66,6 +66,10 @@ public slots:
/** @brief Update internal state machine */
void
updateStatemachine
();
signals:
void
changedMode
(
int
);
protected
slots
:
/** @brief Set the background color for the widget */
void
setBackgroundColor
(
QColor
color
);
...
...
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