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
4cd86dec
Commit
4cd86dec
authored
Jul 16, 2013
by
Bill Bonney
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'new_menus' of
https://github.com/diydrones/apm_planner
into new_menus
Conflicts: qgroundcontrol.pro
parents
75def93b
98dc9dfc
Changes
41
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
5339 additions
and
319 deletions
+5339
-319
qgroundcontrol.pro
qgroundcontrol.pro
+18
-3
QGCCore.cc
src/QGCCore.cc
+1
-1
AccelCalibrationConfig.ui
src/ui/configuration/AccelCalibrationConfig.ui
+4
-4
AdvParameterList.cc
src/ui/configuration/AdvParameterList.cc
+55
-0
AdvParameterList.h
src/ui/configuration/AdvParameterList.h
+25
-0
AdvParameterList.ui
src/ui/configuration/AdvParameterList.ui
+31
-0
AdvancedParamConfig.cc
src/ui/configuration/AdvancedParamConfig.cc
+25
-1
AdvancedParamConfig.h
src/ui/configuration/AdvancedParamConfig.h
+8
-3
AdvancedParamConfig.ui
src/ui/configuration/AdvancedParamConfig.ui
+33
-15
ApmHardwareConfig.cc
src/ui/configuration/ApmHardwareConfig.cc
+34
-16
ApmHardwareConfig.h
src/ui/configuration/ApmHardwareConfig.h
+2
-0
ApmHardwareConfig.ui
src/ui/configuration/ApmHardwareConfig.ui
+20
-1
ApmPlaneLevel.cc
src/ui/configuration/ApmPlaneLevel.cc
+59
-0
ApmPlaneLevel.h
src/ui/configuration/ApmPlaneLevel.h
+23
-0
ApmPlaneLevel.ui
src/ui/configuration/ApmPlaneLevel.ui
+99
-0
ApmSoftwareConfig.cc
src/ui/configuration/ApmSoftwareConfig.cc
+398
-20
ApmSoftwareConfig.h
src/ui/configuration/ApmSoftwareConfig.h
+7
-2
ApmSoftwareConfig.ui
src/ui/configuration/ApmSoftwareConfig.ui
+190
-207
ArduCopterPidConfig.cc
src/ui/configuration/ArduCopterPidConfig.cc
+188
-6
ArduCopterPidConfig.h
src/ui/configuration/ArduCopterPidConfig.h
+12
-6
ArduCopterPidConfig.ui
src/ui/configuration/ArduCopterPidConfig.ui
+1031
-2
ArduPlanePidConfig.cc
src/ui/configuration/ArduPlanePidConfig.cc
+97
-0
ArduPlanePidConfig.h
src/ui/configuration/ArduPlanePidConfig.h
+24
-0
ArduPlanePidConfig.ui
src/ui/configuration/ArduPlanePidConfig.ui
+963
-0
ArduRoverPidConfig.cc
src/ui/configuration/ArduRoverPidConfig.cc
+78
-0
ArduRoverPidConfig.h
src/ui/configuration/ArduRoverPidConfig.h
+23
-0
ArduRoverPidConfig.ui
src/ui/configuration/ArduRoverPidConfig.ui
+732
-0
BatteryMonitorConfig.cc
src/ui/configuration/BatteryMonitorConfig.cc
+18
-0
BatteryMonitorConfig.h
src/ui/configuration/BatteryMonitorConfig.h
+2
-0
CompassConfig.cc
src/ui/configuration/CompassConfig.cc
+41
-0
CompassConfig.ui
src/ui/configuration/CompassConfig.ui
+4
-4
FailSafeConfig.cc
src/ui/configuration/FailSafeConfig.cc
+390
-1
FailSafeConfig.h
src/ui/configuration/FailSafeConfig.h
+16
-3
FailSafeConfig.ui
src/ui/configuration/FailSafeConfig.ui
+422
-2
ParamWidget.cc
src/ui/configuration/ParamWidget.cc
+79
-0
ParamWidget.h
src/ui/configuration/ParamWidget.h
+34
-0
ParamWidget.ui
src/ui/configuration/ParamWidget.ui
+78
-0
SonarConfig.ui
src/ui/configuration/SonarConfig.ui
+1
-1
StandardParamConfig.cc
src/ui/configuration/StandardParamConfig.cc
+32
-3
StandardParamConfig.h
src/ui/configuration/StandardParamConfig.h
+9
-3
StandardParamConfig.ui
src/ui/configuration/StandardParamConfig.ui
+33
-15
No files found.
qgroundcontrol.pro
View file @
4cd86dec
...
...
@@ -255,7 +255,12 @@ FORMS += src/ui/MainWindow.ui \
src
/
ui
/
configuration
/
GeoFenceConfig
.
ui
\
src
/
ui
/
configuration
/
FailSafeConfig
.
ui
\
src
/
ui
/
configuration
/
AdvancedParamConfig
.
ui
\
src
/
ui
/
configuration
/
ArduCopterPidConfig
.
ui
src
/
ui
/
configuration
/
ArduCopterPidConfig
.
ui
\
src
/
ui
/
configuration
/
ApmPlaneLevel
.
ui
\
src
/
ui
/
configuration
/
ParamWidget
.
ui
\
src
/
ui
/
configuration
/
ArduPlanePidConfig
.
ui
\
src
/
ui
/
configuration
/
AdvParameterList
.
ui
\
src
/
ui
/
configuration
/
ArduRoverPidConfig
.
ui
INCLUDEPATH
+=
src
\
src
/
ui
\
src
/
ui
/
linechart
\
...
...
@@ -437,7 +442,12 @@ HEADERS += src/MG.h \
src
/
ui
/
configuration
/
FailSafeConfig
.
h
\
src
/
ui
/
configuration
/
AdvancedParamConfig
.
h
\
src
/
ui
/
configuration
/
ArduCopterPidConfig
.
h
\
src
/
ui
/
apmtoolbar
.
h
src
/
ui
/
apmtoolbar
.
h
\
src
/
ui
/
configuration
/
ApmPlaneLevel
.
h
\
src
/
ui
/
configuration
/
ParamWidget
.
h
\
src
/
ui
/
configuration
/
ArduPlanePidConfig
.
h
\
src
/
ui
/
configuration
/
AdvParameterList
.
h
\
src
/
ui
/
configuration
/
ArduRoverPidConfig
.
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
|
win32
-
msvc2012
::
HEADERS
+=
src
/
ui
/
map3D
/
QGCGoogleEarthView
.
h
...
...
@@ -637,7 +647,12 @@ SOURCES += src/main.cc \
src
/
ui
/
configuration
/
FailSafeConfig
.
cc
\
src
/
ui
/
configuration
/
AdvancedParamConfig
.
cc
\
src
/
ui
/
configuration
/
ArduCopterPidConfig
.
cc
\
src
/
ui
/
apmtoolbar
.
cpp
src
/
ui
/
apmtoolbar
.
cpp
\
src
/
ui
/
configuration
/
ApmPlaneLevel
.
cc
\
src
/
ui
/
configuration
/
ParamWidget
.
cc
\
src
/
ui
/
configuration
/
ArduPlanePidConfig
.
cc
\
src
/
ui
/
configuration
/
AdvParameterList
.
cc
\
src
/
ui
/
configuration
/
ArduRoverPidConfig
.
cc
#
Enable
Google
Earth
only
on
Mac
OS
and
Windows
with
Visual
Studio
compiler
macx
|
macx
-
g
++
|
macx
-
g
++
42
|
win32
-
msvc2008
|
win32
-
msvc2010
|
win32
-
msvc2012
::
SOURCES
+=
src
/
ui
/
map3D
/
QGCGoogleEarthView
.
cc
...
...
src/QGCCore.cc
View file @
4cd86dec
...
...
@@ -72,7 +72,7 @@ QGCCore::QGCCore(int &argc, char* argv[]) : QApplication(argc, argv)
this
->
setApplicationName
(
QGC_APPLICATION_NAME
);
this
->
setApplicationVersion
(
QGC_APPLICATION_VERSION
);
this
->
setOrganizationName
(
QLatin1String
(
"diydrones"
));
this
->
setOrganizationDomain
(
"
org
.diydrones"
);
this
->
setOrganizationDomain
(
"
com
.diydrones"
);
// Set settings format
QSettings
::
setDefaultFormat
(
QSettings
::
IniFormat
);
...
...
src/ui/configuration/AccelCalibrationConfig.ui
View file @
4cd86dec
...
...
@@ -34,8 +34,8 @@
<rect>
<x>
70
</x>
<y>
160
</y>
<width>
8
1
</width>
<height>
3
1
</height>
<width>
11
1
</width>
<height>
4
1
</height>
</rect>
</property>
<property
name=
"text"
>
...
...
@@ -48,8 +48,8 @@ Accelerometer</string>
<rect>
<x>
20
</x>
<y>
50
</y>
<width>
2
11
</width>
<height>
9
1
</height>
<width>
3
11
</width>
<height>
10
1
</height>
</rect>
</property>
<property
name=
"text"
>
...
...
src/ui/configuration/AdvParameterList.cc
0 → 100644
View file @
4cd86dec
#include "AdvParameterList.h"
AdvParameterList
::
AdvParameterList
(
QWidget
*
parent
)
:
AP2ConfigWidget
(
parent
)
{
ui
.
setupUi
(
this
);
ui
.
tableWidget
->
setColumnCount
(
4
);
ui
.
tableWidget
->
horizontalHeader
()
->
hide
();
ui
.
tableWidget
->
verticalHeader
()
->
hide
();
//ui.tableWidget->setHorizontalHeader(0);
//ui.tableWidget->setVerticalHeader(0);
ui
.
tableWidget
->
setColumnWidth
(
0
,
200
);
ui
.
tableWidget
->
setColumnWidth
(
1
,
100
);
ui
.
tableWidget
->
setColumnWidth
(
2
,
200
);
ui
.
tableWidget
->
setColumnWidth
(
3
,
800
);
}
AdvParameterList
::~
AdvParameterList
()
{
}
void
AdvParameterList
::
setParameterMetaData
(
QString
name
,
QString
humanname
,
QString
description
)
{
paramToNameMap
[
name
]
=
humanname
;
paramToDescriptionMap
[
name
]
=
description
;
}
void
AdvParameterList
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
{
if
(
!
paramValueMap
.
contains
(
parameterName
))
{
ui
.
tableWidget
->
setRowCount
(
ui
.
tableWidget
->
rowCount
()
+
1
);
if
(
paramToNameMap
.
contains
(
parameterName
))
{
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
0
,
new
QTableWidgetItem
(
paramToNameMap
[
parameterName
]));
}
else
{
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
0
,
new
QTableWidgetItem
(
"Unknown"
));
}
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
1
,
new
QTableWidgetItem
(
QString
::
number
(
value
.
toFloat
(),
'f'
,
2
)));
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
2
,
new
QTableWidgetItem
(
parameterName
));
if
(
paramToDescriptionMap
.
contains
(
parameterName
))
{
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
3
,
new
QTableWidgetItem
(
paramToDescriptionMap
[
parameterName
]));
}
else
{
ui
.
tableWidget
->
setItem
(
ui
.
tableWidget
->
rowCount
()
-
1
,
3
,
new
QTableWidgetItem
(
"Unknown"
));
}
paramValueMap
[
parameterName
]
=
ui
.
tableWidget
->
item
(
ui
.
tableWidget
->
rowCount
()
-
1
,
1
);
}
paramValueMap
[
parameterName
]
->
setText
(
QString
::
number
(
value
.
toFloat
(),
'f'
,
2
));
}
src/ui/configuration/AdvParameterList.h
0 → 100644
View file @
4cd86dec
#ifndef ADVPARAMETERLIST_H
#define ADVPARAMETERLIST_H
#include <QWidget>
#include "ui_AdvParameterList.h"
#include "AP2ConfigWidget.h"
class
AdvParameterList
:
public
AP2ConfigWidget
{
Q_OBJECT
public:
explicit
AdvParameterList
(
QWidget
*
parent
=
0
);
void
setParameterMetaData
(
QString
name
,
QString
humanname
,
QString
description
);
~
AdvParameterList
();
private
slots
:
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
private:
QMap
<
QString
,
QTableWidgetItem
*>
paramValueMap
;
QMap
<
QString
,
QString
>
paramToNameMap
;
QMap
<
QString
,
QString
>
paramToDescriptionMap
;
Ui
::
AdvParameterList
ui
;
};
#endif // ADVPARAMETERLIST_H
src/ui/configuration/AdvParameterList.ui
0 → 100644
View file @
4cd86dec
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
AdvParameterList
</class>
<widget
class=
"QWidget"
name=
"AdvParameterList"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
666
</width>
<height>
497
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
<
h2
>
Advanced Parameter List
<
/h2
>
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QTableWidget"
name=
"tableWidget"
/>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
src/ui/configuration/AdvancedParamConfig.cc
View file @
4cd86dec
#include "AdvancedParamConfig.h"
AdvancedParamConfig
::
AdvancedParamConfig
(
QWidget
*
parent
)
:
Q
Widget
(
parent
)
AdvancedParamConfig
::
AdvancedParamConfig
(
QWidget
*
parent
)
:
AP2Config
Widget
(
parent
)
{
ui
.
setupUi
(
this
);
}
...
...
@@ -9,3 +9,27 @@ AdvancedParamConfig::AdvancedParamConfig(QWidget *parent) : QWidget(parent)
AdvancedParamConfig
::~
AdvancedParamConfig
()
{
}
void
AdvancedParamConfig
::
addRange
(
QString
title
,
QString
description
,
QString
param
,
double
min
,
double
max
)
{
ParamWidget
*
widget
=
new
ParamWidget
(
ui
.
scrollAreaWidgetContents
);
paramToWidgetMap
[
param
]
=
widget
;
widget
->
setupDouble
(
title
+
"("
+
param
+
")"
,
description
,
0
,
min
,
max
);
ui
.
verticalLayout
->
addWidget
(
widget
);
widget
->
show
();
}
void
AdvancedParamConfig
::
addCombo
(
QString
title
,
QString
description
,
QString
param
,
QList
<
QPair
<
int
,
QString
>
>
valuelist
)
{
ParamWidget
*
widget
=
new
ParamWidget
(
ui
.
scrollAreaWidgetContents
);
paramToWidgetMap
[
param
]
=
widget
;
widget
->
setupCombo
(
title
+
"("
+
param
+
")"
,
description
,
valuelist
);
ui
.
verticalLayout
->
addWidget
(
widget
);
widget
->
show
();
}
void
AdvancedParamConfig
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
{
if
(
paramToWidgetMap
.
contains
(
parameterName
))
{
paramToWidgetMap
[
parameterName
]
->
setValue
(
value
.
toDouble
());
}
}
src/ui/configuration/AdvancedParamConfig.h
View file @
4cd86dec
...
...
@@ -3,16 +3,21 @@
#include <QWidget>
#include "ui_AdvancedParamConfig.h"
class
AdvancedParamConfig
:
public
QWidget
#include "AP2ConfigWidget.h"
#include "ParamWidget.h"
class
AdvancedParamConfig
:
public
AP2ConfigWidget
{
Q_OBJECT
public:
explicit
AdvancedParamConfig
(
QWidget
*
parent
=
0
);
~
AdvancedParamConfig
();
void
addRange
(
QString
title
,
QString
description
,
QString
param
,
double
min
,
double
max
);
void
addCombo
(
QString
title
,
QString
description
,
QString
param
,
QList
<
QPair
<
int
,
QString
>
>
valuelist
);
private
slots
:
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
private:
QMap
<
QString
,
ParamWidget
*>
paramToWidgetMap
;
Ui
::
AdvancedParamConfig
ui
;
};
...
...
src/ui/configuration/AdvancedParamConfig.ui
View file @
4cd86dec
...
...
@@ -6,26 +6,44 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
400
</width>
<height>
300
</height>
<width>
725
</width>
<height>
632
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"geometry"
>
<rect>
<x>
10
</x>
<y>
10
</y>
<width>
181
</width>
<height>
31
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
<
h2
>
Advanced Params
<
/h2
>
</string>
</property>
</widget>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_3"
>
<item>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
<
h2
>
Advanced Params
<
/h2
>
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QScrollArea"
name=
"scrollArea"
>
<property
name=
"widgetResizable"
>
<bool>
true
</bool>
</property>
<widget
class=
"QWidget"
name=
"scrollAreaWidgetContents"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
705
</width>
<height>
585
</height>
</rect>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_2"
>
<item>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
...
...
src/ui/configuration/ApmHardwareConfig.cc
View file @
4cd86dec
...
...
@@ -30,35 +30,28 @@ This file is part of the QGROUNDCONTROL project
*/
#include "ApmHardwareConfig.h"
ApmHardwareConfig
::
ApmHardwareConfig
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
ui
.
setupUi
(
this
);
//ui.firmwareButton->setVisible(valse);
ui
.
manditoryHardware
->
setVisible
(
false
);
ui
.
frameTypeButton
->
setVisible
(
false
);
ui
.
compassButton
->
setVisible
(
false
);
ui
.
accelCalibrateButton
->
setVisible
(
false
);
ui
.
arduPlaneLevelButton
->
setVisible
(
false
);
ui
.
radioCalibrateButton
->
setVisible
(
false
);
ui
.
optionalHardwareButton
->
setVisible
(
false
);
//ui.radio3DRButton->setVisible(false);
ui
.
batteryMonitorButton
->
setVisible
(
false
);
ui
.
sonarButton
->
setVisible
(
false
);
ui
.
airspeedButton
->
setVisible
(
false
);
ui
.
opticalFlowButton
->
setVisible
(
false
);
ui
.
osdButton
->
setVisible
(
false
);
ui
.
cameraGimbalButton
->
setVisible
(
false
);
//ui.antennaTrackerButton->setVisible(false);
connect
(
ui
.
manditoryHardware
,
SIGNAL
(
toggled
(
bool
)),
ui
.
frameTypeButton
,
SLOT
(
setShown
(
bool
)));
connect
(
ui
.
manditoryHardware
,
SIGNAL
(
toggled
(
bool
)),
ui
.
compassButton
,
SLOT
(
setShown
(
bool
)));
connect
(
ui
.
manditoryHardware
,
SIGNAL
(
toggled
(
bool
)),
ui
.
accelCalibrateButton
,
SLOT
(
setShown
(
bool
)));
connect
(
ui
.
manditoryHardware
,
SIGNAL
(
toggled
(
bool
)),
ui
.
radioCalibrateButton
,
SLOT
(
setShown
(
bool
)));
connect
(
ui
.
optionalHardwareButton
,
SIGNAL
(
toggled
(
bool
)),
ui
.
radio3DRButton
,
SLOT
(
setShown
(
bool
)));
connect
(
ui
.
optionalHardwareButton
,
SIGNAL
(
toggled
(
bool
)),
ui
.
batteryMonitorButton
,
SLOT
(
setShown
(
bool
)));
connect
(
ui
.
optionalHardwareButton
,
SIGNAL
(
toggled
(
bool
)),
ui
.
sonarButton
,
SLOT
(
setShown
(
bool
)));
connect
(
ui
.
optionalHardwareButton
,
SIGNAL
(
toggled
(
bool
)),
ui
.
airspeedButton
,
SLOT
(
setShown
(
bool
)));
connect
(
ui
.
optionalHardwareButton
,
SIGNAL
(
toggled
(
bool
)),
ui
.
opticalFlowButton
,
SLOT
(
setShown
(
bool
)));
connect
(
ui
.
optionalHardwareButton
,
SIGNAL
(
toggled
(
bool
)),
ui
.
osdButton
,
SLOT
(
setShown
(
bool
)));
connect
(
ui
.
optionalHardwareButton
,
SIGNAL
(
toggled
(
bool
)),
ui
.
cameraGimbalButton
,
SLOT
(
setShown
(
bool
)));
...
...
@@ -87,6 +80,11 @@ ApmHardwareConfig::ApmHardwareConfig(QWidget *parent) : QWidget(parent)
buttonToConfigWidgetMap
[
ui
.
accelCalibrateButton
]
=
accelConfig
;
connect
(
ui
.
accelCalibrateButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
planeLevel
=
new
ApmPlaneLevel
(
this
);
ui
.
stackedWidget
->
addWidget
(
planeLevel
);
buttonToConfigWidgetMap
[
ui
.
arduPlaneLevelButton
]
=
planeLevel
;
connect
(
ui
.
arduPlaneLevelButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
radioConfig
=
new
RadioCalibrationConfig
(
this
);
ui
.
stackedWidget
->
addWidget
(
radioConfig
);
buttonToConfigWidgetMap
[
ui
.
radioCalibrateButton
]
=
radioConfig
;
...
...
@@ -133,8 +131,6 @@ ApmHardwareConfig::ApmHardwareConfig(QWidget *parent) : QWidget(parent)
buttonToConfigWidgetMap
[
ui
.
antennaTrackerButton
]
=
antennaTrackerConfig
;
connect
(
ui
.
antennaTrackerButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
activateStackedWidget
()));
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
activeUASSet
(
UASInterface
*
)));
if
(
UASManager
::
instance
()
->
getActiveUAS
())
{
...
...
@@ -159,11 +155,33 @@ void ApmHardwareConfig::activeUASSet(UASInterface *uas)
{
return
;
}
if
(
uas
->
getSystemType
()
==
MAV_TYPE_FIXED_WING
)
{
connect
(
ui
.
manditoryHardware
,
SIGNAL
(
toggled
(
bool
)),
ui
.
compassButton
,
SLOT
(
setShown
(
bool
)));
connect
(
ui
.
manditoryHardware
,
SIGNAL
(
toggled
(
bool
)),
ui
.
arduPlaneLevelButton
,
SLOT
(
setShown
(
bool
)));
connect
(
ui
.
manditoryHardware
,
SIGNAL
(
toggled
(
bool
)),
ui
.
radioCalibrateButton
,
SLOT
(
setShown
(
bool
)));
connect
(
ui
.
optionalHardwareButton
,
SIGNAL
(
toggled
(
bool
)),
ui
.
airspeedButton
,
SLOT
(
setShown
(
bool
)));
}
else
if
(
uas
->
getSystemType
()
==
MAV_TYPE_QUADROTOR
)
{
connect
(
ui
.
manditoryHardware
,
SIGNAL
(
toggled
(
bool
)),
ui
.
frameTypeButton
,
SLOT
(
setShown
(
bool
)));
connect
(
ui
.
manditoryHardware
,
SIGNAL
(
toggled
(
bool
)),
ui
.
compassButton
,
SLOT
(
setShown
(
bool
)));
connect
(
ui
.
manditoryHardware
,
SIGNAL
(
toggled
(
bool
)),
ui
.
accelCalibrateButton
,
SLOT
(
setShown
(
bool
)));
connect
(
ui
.
manditoryHardware
,
SIGNAL
(
toggled
(
bool
)),
ui
.
radioCalibrateButton
,
SLOT
(
setShown
(
bool
)));
}
else
if
(
uas
->
getSystemType
()
==
MAV_TYPE_GROUND_ROVER
)
{
connect
(
ui
.
manditoryHardware
,
SIGNAL
(
toggled
(
bool
)),
ui
.
compassButton
,
SLOT
(
setShown
(
bool
)));
connect
(
ui
.
manditoryHardware
,
SIGNAL
(
toggled
(
bool
)),
ui
.
radioCalibrateButton
,
SLOT
(
setShown
(
bool
)));
}
else
{
connect
(
ui
.
manditoryHardware
,
SIGNAL
(
toggled
(
bool
)),
ui
.
compassButton
,
SLOT
(
setShown
(
bool
)));
connect
(
ui
.
manditoryHardware
,
SIGNAL
(
toggled
(
bool
)),
ui
.
radioCalibrateButton
,
SLOT
(
setShown
(
bool
)));
}
ui
.
firmwareButton
->
setVisible
(
true
);
ui
.
manditoryHardware
->
setVisible
(
true
);
ui
.
manditoryHardware
->
setChecked
(
fals
e
);
ui
.
manditoryHardware
->
setChecked
(
tru
e
);
ui
.
optionalHardwareButton
->
setVisible
(
true
);
ui
.
optionalHardwareButton
->
setChecked
(
false
);
ui
.
radio3DRButton
->
setVisible
(
false
);
ui
.
antennaTrackerButton
->
setVisible
(
false
);
ui
.
optionalHardwareButton
->
setChecked
(
true
);
}
src/ui/configuration/ApmHardwareConfig.h
View file @
4cd86dec
...
...
@@ -48,6 +48,7 @@ This file is part of the QGROUNDCONTROL project
#include "OsdConfig.h"
#include "CameraGimbalConfig.h"
#include "AntennaTrackerConfig.h"
#include "ApmPlaneLevel.h"
class
ApmHardwareConfig
:
public
QWidget
{
...
...
@@ -70,6 +71,7 @@ private:
OsdConfig
*
osdConfig
;
CameraGimbalConfig
*
cameraGimbalConfig
;
AntennaTrackerConfig
*
antennaTrackerConfig
;
ApmPlaneLevel
*
planeLevel
;
private
slots
:
void
activeUASSet
(
UASInterface
*
uas
);
void
activateStackedWidget
();
...
...
src/ui/configuration/ApmHardwareConfig.ui
View file @
4cd86dec
...
...
@@ -43,7 +43,7 @@
<x>
0
</x>
<y>
0
</y>
<width>
156
</width>
<height>
6
35
</height>
<height>
6
76
</height>
</rect>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_12"
>
...
...
@@ -129,6 +129,25 @@
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"arduPlaneLevelButton"
>
<property
name=
"minimumSize"
>
<size>
<width>
0
</width>
<height>
35
</height>
</size>
</property>
<property
name=
"layoutDirection"
>
<enum>
Qt::LeftToRight
</enum>
</property>
<property
name=
"autoFillBackground"
>
<bool>
false
</bool>
</property>
<property
name=
"text"
>
<string>
ArduPlane Level
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"radioCalibrateButton"
>
<property
name=
"minimumSize"
>
...
...
src/ui/configuration/ApmPlaneLevel.cc
0 → 100644
View file @
4cd86dec
#include "ApmPlaneLevel.h"
#include <QMessageBox>
ApmPlaneLevel
::
ApmPlaneLevel
(
QWidget
*
parent
)
:
AP2ConfigWidget
(
parent
)
{
ui
.
setupUi
(
this
);
connect
(
ui
.
levelPushButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
levelClicked
()));
connect
(
ui
.
manualLevelCheckBox
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
manualCheckBoxToggled
(
bool
)));
}
ApmPlaneLevel
::~
ApmPlaneLevel
()
{
}
void
ApmPlaneLevel
::
levelClicked
()
{
QMessageBox
::
information
(
0
,
"Warning"
,
"Be sure the plane is completly level, then click ok"
);
MAV_CMD
command
=
MAV_CMD_PREFLIGHT_CALIBRATION
;
int
confirm
=
0
;
float
param1
=
1
;
float
param2
=
0
;
float
param3
=
1
;
float
param4
=
0
;
float
param5
=
0
;
float
param6
=
0
;
float
param7
=
0
;
int
component
=
1
;
m_uas
->
executeCommand
(
command
,
confirm
,
param1
,
param2
,
param3
,
param4
,
param5
,
param6
,
param7
,
component
);
QMessageBox
::
information
(
0
,
"Warning"
,
"Leveling completed"
);
}
void
ApmPlaneLevel
::
manualCheckBoxToggled
(
bool
checked
)
{
if
(
!
m_uas
)
{
return
;
}
if
(
checked
)
{
m_uas
->
getParamManager
()
->
setParameter
(
1
,
"MANUAL_LEVEL"
,
1
);
}
else
{
m_uas
->
getParamManager
()
->
setParameter
(
1
,
"MANUAL_LEVEL"
,
0
);
}
}
void
ApmPlaneLevel
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
{
if
(
parameterName
==
"MANUAL_LEVEL"
)
{
if
(
value
.
toInt
()
==
1
)
{
ui
.
manualLevelCheckBox
->
setChecked
(
true
);
}
else
{
ui
.
manualLevelCheckBox
->
setChecked
(
false
);
}
}
}
src/ui/configuration/ApmPlaneLevel.h
0 → 100644
View file @
4cd86dec
#ifndef APMPLANELEVEL_H
#define APMPLANELEVEL_H
#include <QWidget>
#include "ui_ApmPlaneLevel.h"
#include "AP2ConfigWidget.h"
class
ApmPlaneLevel
:
public
AP2ConfigWidget
{
Q_OBJECT
public:
explicit
ApmPlaneLevel
(
QWidget
*
parent
=
0
);
~
ApmPlaneLevel
();
private
slots
:
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
void
levelClicked
();
void
manualCheckBoxToggled
(
bool
checked
);
private:
Ui
::
ApmPlaneLevel
ui
;
};
#endif // APMPLANELEVEL_H
src/ui/configuration/ApmPlaneLevel.ui
0 → 100644
View file @
4cd86dec
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
ApmPlaneLevel
</class>
<widget
class=
"QWidget"
name=
"ApmPlaneLevel"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
400
</width>
<height>
300
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"geometry"
>
<rect>
<x>
10
</x>
<y>
10
</y>
<width>
141
</width>
<height>
31
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
<
h2
>
ArduPlane Level
<
/h2
>
</string>
</property>
</widget>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"geometry"
>
<rect>
<x>
50
</x>
<y>
70
</y>
<width>
271
</width>
<height>
41
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
By Default your plane will autolevel on every boot.
To disable this action you need to turn on manual
level and perform a level to calibrate the accel offsets.
</string>
</property>
</widget>
<widget
class=
"QLabel"
name=
"label_3"
>
<property
name=
"geometry"
>
<rect>
<x>
50
</x>
<y>
150
</y>
<width>
291
</width>
<height>
16
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
Level your plane and click Level to set default accel offsets
</string>
</property>
</widget>
<widget
class=
"QPushButton"
name=
"levelPushButton"
>
<property
name=
"geometry"
>
<rect>
<x>
160
</x>
<y>
180
</y>
<width>
75
</width>
<height>
23
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
Level
</string>
</property>
</widget>
<widget
class=
"QGroupBox"
name=
"groupBox"
>
<property
name=
"geometry"
>
<rect>
<x>
120
</x>
<y>
230
</y>
<width>
151
</width>
<height>
51
</height>
</rect>
</property>
<property
name=
"title"
>
<string>
For advanced users ONLY
</string>
</property>
<widget
class=
"QCheckBox"
name=
"manualLevelCheckBox"
>
<property
name=
"geometry"
>
<rect>
<x>
30
</x>
<y>
20
</y>
<width>
91
</width>
<height>
17
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
Manual Level
</string>
</property>
</widget>
</widget>
</widget>
<resources/>
<connections/>
</ui>
src/ui/configuration/ApmSoftwareConfig.cc
View file @
4cd86dec
This diff is collapsed.
Click to expand it.
src/ui/configuration/ApmSoftwareConfig.h
View file @
4cd86dec
...
...
@@ -10,7 +10,9 @@
#include "FailSafeConfig.h"
#include "AdvancedParamConfig.h"
#include "ArduCopterPidConfig.h"
#include "ArduPlanePidConfig.h"
#include "ArduRoverPidConfig.h"
#include "AdvParameterList.h"
#include "UASInterface.h"
#include "UASManager.h"
...
...
@@ -32,7 +34,10 @@ private:
GeoFenceConfig
*
geoFenceConfig
;
FailSafeConfig
*
failSafeConfig
;
AdvancedParamConfig
*
advancedParamConfig
;
ArduCopterPidConfig
*
arduCoperPidConfig
;
ArduCopterPidConfig
*
arduCopterPidConfig
;
ArduPlanePidConfig
*
arduPlanePidConfig
;
ArduRoverPidConfig
*
arduRoverPidConfig
;
AdvParameterList
*
advParameterList
;
QMap
<
QObject
*
,
QWidget
*>
buttonToConfigWidgetMap
;
};
...
...
src/ui/configuration/ApmSoftwareConfig.ui
View file @
4cd86dec
This diff is collapsed.
Click to expand it.
src/ui/configuration/ArduCopterPidConfig.cc
View file @
4cd86dec
#include "ArduCopterPidConfig.h"
#include "ui_ArduCopterPidConfig.h"
ArduCopterPidConfig
::
ArduCopterPidConfig
(
QWidget
*
parent
)
:
QWidget
(
parent
),
ui
(
new
Ui
::
ArduCopterPidConfig
)
ArduCopterPidConfig
::
ArduCopterPidConfig
(
QWidget
*
parent
)
:
AP2ConfigWidget
(
parent
)
{
ui
->
setupUi
(
this
);
ui
.
setupUi
(
this
);
nameToBoxMap
[
"STB_RLL_P"
]
=
ui
.
stabilPitchPSpinBox
;
nameToBoxMap
[
"STB_PIT_P"
]
=
ui
.
stabilRollPSpinBox
;
nameToBoxMap
[
"STB_YAW_P"
]
=
ui
.
stabilYawPSpinBox
;
nameToBoxMap
[
"HLD_LAT_P"
]
=
ui
.
loiterPidPSpinBox
;
nameToBoxMap
[
"RATE_RLL_P"
]
=
ui
.
rateRollPSpinBox
;
nameToBoxMap
[
"RATE_RLL_I"
]
=
ui
.
rateRollISpinBox
;
nameToBoxMap
[
"RATE_RLL_D"
]
=
ui
.
rateRollDSpinBox
;
nameToBoxMap
[
"RATE_RLL_IMAX"
]
=
ui
.
rateRollIMAXSpinBox
;
nameToBoxMap
[
"RATE_PIT_P"
]
=
ui
.
ratePitchPSpinBox
;
nameToBoxMap
[
"RATE_PIT_I"
]
=
ui
.
ratePitchISpinBox
;
nameToBoxMap
[
"RATE_PIT_D"
]
=
ui
.
ratePitchDSpinBox
;
nameToBoxMap
[
"RATE_PIT_IMAX"
]
=
ui
.
ratePitchIMAXSpinBox
;