Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
d440a4d6
Commit
d440a4d6
authored
Jun 28, 2013
by
Michael Carpenter
Browse files
Implementation of Optical Flow config
parent
6b3769f4
Changes
5
Hide whitespace changes
Inline
Side-by-side
files/images/devices/BR-0016-01-3T.jpg
0 → 100644
View file @
d440a4d6
12.1 KB
qgroundcontrol.qrc
View file @
d440a4d6
...
...
@@ -113,6 +113,7 @@
<file>files/images/devices/BR-APMPWRDEAN-2.jpg</file>
<file>files/images/devices/AC-0004-11-2.jpg</file>
<file>files/images/devices/BR-0004-03-2.jpg</file>
<file>files/images/devices/BR-0016-01-3T.jpg</file>
</qresource>
<qresource prefix="/general">
<file alias="vera.ttf">files/styles/Vera.ttf</file>
...
...
src/ui/configuration/OpticalFlowConfig.cc
View file @
d440a4d6
#include
"OpticalFlowConfig.h"
#include
<QMessageBox>
OpticalFlowConfig
::
OpticalFlowConfig
(
QWidget
*
parent
)
:
QWidget
(
parent
)
OpticalFlowConfig
::
OpticalFlowConfig
(
QWidget
*
parent
)
:
AP2ConfigWidget
(
parent
)
{
ui
.
setupUi
(
this
);
connect
(
ui
.
enableCheckBox
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
enableCheckBoxClicked
(
bool
)));
}
OpticalFlowConfig
::~
OpticalFlowConfig
()
{
}
void
OpticalFlowConfig
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
{
if
(
parameterName
==
"FLOW_ENABLE"
)
{
if
(
value
.
toInt
()
==
0
)
{
ui
.
enableCheckBox
->
setChecked
(
false
);
}
else
{
ui
.
enableCheckBox
->
setChecked
(
true
);
}
}
}
void
OpticalFlowConfig
::
enableCheckBoxClicked
(
bool
checked
)
{
if
(
!
m_uas
)
{
QMessageBox
::
information
(
0
,
tr
(
"Error"
),
tr
(
"Please connect to a MAV before attempting to set configuration"
));
return
;
}
m_uas
->
setParameter
(
0
,
"FLOW_ENABLE"
,
checked
?
1
:
0
);
}
src/ui/configuration/OpticalFlowConfig.h
View file @
d440a4d6
...
...
@@ -2,16 +2,19 @@
#define OPTICALFLOWCONFIG_H
#include
<QWidget>
#include
"AP2ConfigWidget.h"
#include
"ui_OpticalFlowConfig.h"
class
OpticalFlowConfig
:
public
Q
Widget
class
OpticalFlowConfig
:
public
AP2Config
Widget
{
Q_OBJECT
public:
explicit
OpticalFlowConfig
(
QWidget
*
parent
=
0
);
~
OpticalFlowConfig
();
private
slots
:
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
void
enableCheckBoxClicked
(
bool
checked
);
private:
Ui
::
OpticalFlowConfig
ui
;
};
...
...
src/ui/configuration/OpticalFlowConfig.ui
View file @
d440a4d6
...
...
@@ -29,7 +29,41 @@
<bool>
false
</bool>
</property>
</widget>
<widget
class=
"QCheckBox"
name=
"enableCheckBox"
>
<property
name=
"geometry"
>
<rect>
<x>
100
</x>
<y>
60
</y>
<width>
70
</width>
<height>
17
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
Enable
</string>
</property>
</widget>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"geometry"
>
<rect>
<x>
10
</x>
<y>
60
</y>
<width>
81
</width>
<height>
71
</height>
</rect>
</property>
<property
name=
"text"
>
<string/>
</property>
<property
name=
"pixmap"
>
<pixmap
resource=
"../../../qgroundcontrol.qrc"
>
:/files/images/devices/BR-0016-01-3T.jpg
</pixmap>
</property>
<property
name=
"scaledContents"
>
<bool>
true
</bool>
</property>
</widget>
</widget>
<resources/>
<resources>
<include
location=
"../../../qgroundcontrol.qrc"
/>
</resources>
<connections/>
</ui>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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