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
6b3769f4
Commit
6b3769f4
authored
Jun 27, 2013
by
Michael Carpenter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented Airspeed configuration
parent
1142b6f3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
128 additions
and
5 deletions
+128
-5
BR-0004-03-2.jpg
files/images/devices/BR-0004-03-2.jpg
+0
-0
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-0
AirspeedConfig.cc
src/ui/configuration/AirspeedConfig.cc
+73
-2
AirspeedConfig.h
src/ui/configuration/AirspeedConfig.h
+6
-2
AirspeedConfig.ui
src/ui/configuration/AirspeedConfig.ui
+48
-1
No files found.
files/images/devices/BR-0004-03-2.jpg
0 → 100644
View file @
6b3769f4
17.4 KB
qgroundcontrol.qrc
View file @
6b3769f4
...
...
@@ -112,6 +112,7 @@
<file>files/images/devices/BR-HMC5883-01-2.jpg</file>
<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>
</qresource>
<qresource prefix="/general">
<file alias="vera.ttf">files/styles/Vera.ttf</file>
...
...
src/ui/configuration/AirspeedConfig.cc
View file @
6b3769f4
#include "AirspeedConfig.h"
#include <QMessageBox>
AirspeedConfig
::
AirspeedConfig
(
QWidget
*
parent
)
:
QWidget
(
parent
)
AirspeedConfig
::
AirspeedConfig
(
QWidget
*
parent
)
:
AP2ConfigWidget
(
parent
)
{
ui
.
setupUi
(
this
);
connect
(
ui
.
enableCheckBox
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
enableCheckBoxClicked
(
bool
)));
connect
(
ui
.
useAirspeedCheckBox
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
useCheckBoxClicked
(
bool
)));
}
AirspeedConfig
::~
AirspeedConfig
()
{
}
void
AirspeedConfig
::
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
{
if
(
parameterName
==
"ARSPD_ENABLE"
)
{
if
(
value
.
toInt
()
==
0
)
{
disconnect
(
ui
.
enableCheckBox
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
enableCheckBoxClicked
(
bool
)));
ui
.
enableCheckBox
->
setChecked
(
false
);
connect
(
ui
.
enableCheckBox
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
enableCheckBoxClicked
(
bool
)));
ui
.
useAirspeedCheckBox
->
setEnabled
(
false
);
}
else
{
disconnect
(
ui
.
enableCheckBox
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
enableCheckBoxClicked
(
bool
)));
ui
.
enableCheckBox
->
setChecked
(
true
);
connect
(
ui
.
enableCheckBox
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
enableCheckBoxClicked
(
bool
)));
ui
.
useAirspeedCheckBox
->
setEnabled
(
true
);
}
}
else
if
(
parameterName
==
"ARSPD_USE"
)
{
if
(
value
.
toInt
()
==
0
)
{
disconnect
(
ui
.
useAirspeedCheckBox
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
useCheckBoxClicked
(
bool
)));
ui
.
useAirspeedCheckBox
->
setChecked
(
false
);
connect
(
ui
.
useAirspeedCheckBox
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
useCheckBoxClicked
(
bool
)));
}
else
{
disconnect
(
ui
.
useAirspeedCheckBox
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
useCheckBoxClicked
(
bool
)));
ui
.
useAirspeedCheckBox
->
setChecked
(
true
);
connect
(
ui
.
useAirspeedCheckBox
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
useCheckBoxClicked
(
bool
)));
}
}
}
void
AirspeedConfig
::
useCheckBoxClicked
(
bool
checked
)
{
if
(
!
m_uas
)
{
QMessageBox
::
information
(
0
,
tr
(
"Error"
),
tr
(
"Please connect to a MAV before attempting to set configuration"
));
return
;
}
if
(
checked
)
{
m_uas
->
setParameter
(
0
,
"ARSPD_USE"
,
1
);
}
else
{
m_uas
->
setParameter
(
0
,
"ARSPD_USE"
,
0
);
}
}
void
AirspeedConfig
::
enableCheckBoxClicked
(
bool
checked
)
{
if
(
!
m_uas
)
{
QMessageBox
::
information
(
0
,
tr
(
"Error"
),
tr
(
"Please connect to a MAV before attempting to set configuration"
));
return
;
}
if
(
checked
)
{
m_uas
->
setParameter
(
0
,
"ARSPD_ENABLE"
,
1
);
}
else
{
m_uas
->
setParameter
(
0
,
"ARSPD_ENABLE"
,
0
);
}
}
src/ui/configuration/AirspeedConfig.h
View file @
6b3769f4
...
...
@@ -2,16 +2,20 @@
#define AIRSPEEDCONFIG_H
#include <QWidget>
#include "AP2ConfigWidget.h"
#include "ui_AirspeedConfig.h"
class
AirspeedConfig
:
public
Q
Widget
class
AirspeedConfig
:
public
AP2Config
Widget
{
Q_OBJECT
public:
explicit
AirspeedConfig
(
QWidget
*
parent
=
0
);
~
AirspeedConfig
();
private
slots
:
void
parameterChanged
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
void
useCheckBoxClicked
(
bool
checked
);
void
enableCheckBoxClicked
(
bool
checked
);
private:
Ui
::
AirspeedConfig
ui
;
};
...
...
src/ui/configuration/AirspeedConfig.ui
View file @
6b3769f4
...
...
@@ -29,7 +29,54 @@
<bool>
false
</bool>
</property>
</widget>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"geometry"
>
<rect>
<x>
20
</x>
<y>
60
</y>
<width>
71
</width>
<height>
71
</height>
</rect>
</property>
<property
name=
"text"
>
<string/>
</property>
<property
name=
"pixmap"
>
<pixmap
resource=
"../../../qgroundcontrol.qrc"
>
:/files/images/devices/BR-0004-03-2.jpg
</pixmap>
</property>
<property
name=
"scaledContents"
>
<bool>
true
</bool>
</property>
</widget>
<widget
class=
"QCheckBox"
name=
"enableCheckBox"
>
<property
name=
"geometry"
>
<rect>
<x>
110
</x>
<y>
70
</y>
<width>
70
</width>
<height>
17
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
Enable
</string>
</property>
</widget>
<widget
class=
"QCheckBox"
name=
"useAirspeedCheckBox"
>
<property
name=
"geometry"
>
<rect>
<x>
110
</x>
<y>
100
</y>
<width>
91
</width>
<height>
17
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
Use Airspeed
</string>
</property>
</widget>
</widget>
<resources/>
<resources>
<include
location=
"../../../qgroundcontrol.qrc"
/>
</resources>
<connections/>
</ui>
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