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
174962a1
Commit
174962a1
authored
Jul 31, 2013
by
tstellanova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing rc calibration and realtime display
parent
00b6d2fc
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
477 additions
and
543 deletions
+477
-543
QGCPX4VehicleConfig.cc
src/ui/QGCPX4VehicleConfig.cc
+254
-365
QGCPX4VehicleConfig.h
src/ui/QGCPX4VehicleConfig.h
+2
-2
QGCPX4VehicleConfig.ui
src/ui/QGCPX4VehicleConfig.ui
+195
-170
QGCRadioChannelDisplay.cpp
src/ui/designer/QGCRadioChannelDisplay.cpp
+24
-6
QGCRadioChannelDisplay.h
src/ui/designer/QGCRadioChannelDisplay.h
+2
-0
No files found.
src/ui/QGCPX4VehicleConfig.cc
View file @
174962a1
This diff is collapsed.
Click to expand it.
src/ui/QGCPX4VehicleConfig.h
View file @
174962a1
...
...
@@ -57,8 +57,8 @@ public slots:
/** Render the data updated */
void
updateView
();
void
updateRcWidgetValues
();
void
handleRcParameterChange
(
QString
parameterName
,
QVariant
value
);
void
updateMinMax
();
/** Set the RC channel */
void
setRollChan
(
int
channel
)
{
...
...
@@ -180,7 +180,7 @@ protected:
float
rcAux2
;
///< PPM input channel used as aux 2 input
float
rcAux3
;
///< PPM input channel used as aux 3 input
bool
rcCalChanged
;
///< Set if the calibration changes (and needs to be written)
bool
changed
;
///< Set if any of the input data changed
bool
dataModelChanged
;
///< Set if any of the input data changed
QTimer
updateTimer
;
///< Controls update intervals
enum
RC_MODE
rc_mode
;
///< Mode of the remote control, according to usual convention
QList
<
QGCToolWidget
*>
toolWidgets
;
///< Configurable widgets
...
...
src/ui/QGCPX4VehicleConfig.ui
View file @
174962a1
This diff is collapsed.
Click to expand it.
src/ui/designer/QGCRadioChannelDisplay.cpp
View file @
174962a1
#include "QGCRadioChannelDisplay.h"
#include <QPainter>
#define DIMMEST_COLOR QColor::fromRgb(0,100,0)
#define MIDBRIGHT_COLOR QColor::fromRgb(0,180,0)
#define BRIGHTEST_COLOR QColor::fromRgb(64,255,0)
QGCRadioChannelDisplay
::
QGCRadioChannelDisplay
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
m_showMinMax
=
false
;
...
...
@@ -53,9 +58,9 @@ void QGCRadioChannelDisplay::paintEvent(QPaintEvent *event)
if
(
m_orientation
==
Qt
::
Vertical
)
{
QLinearGradient
gradientBrush
(
0
,
0
,
this
->
width
(),
this
->
height
());
gradientBrush
.
setColorAt
(
1.0
,
QColor
::
fromRgb
(
0
,
128
,
0
)
);
gradientBrush
.
setColorAt
(
0.5
,
QColor
::
fromRgb
(
0
,
200
,
0
)
);
gradientBrush
.
setColorAt
(
0.0
,
QColor
::
fromRgb
(
64
,
255
,
0
)
);
gradientBrush
.
setColorAt
(
1.0
,
DIMMEST_COLOR
);
gradientBrush
.
setColorAt
(
0.5
,
MIDBRIGHT_COLOR
);
gradientBrush
.
setColorAt
(
0.0
,
BRIGHTEST_COLOR
);
//draw border
painter
.
drawRect
(
0
,
0
,
width
()
-
1
,(
height
()
-
1
)
-
twiceFontHeight
);
...
...
@@ -105,9 +110,9 @@ void QGCRadioChannelDisplay::paintEvent(QPaintEvent *event)
else
//horizontal orientation
{
QLinearGradient
hGradientBrush
(
0
,
0
,
this
->
width
(),
this
->
height
());
hGradientBrush
.
setColorAt
(
0.0
,
QColor
::
fromRgb
(
0
,
128
,
0
)
);
hGradientBrush
.
setColorAt
(
0.5
,
QColor
::
fromRgb
(
0
,
200
,
0
)
);
hGradientBrush
.
setColorAt
(
1.0
,
QColor
::
fromRgb
(
64
,
255
,
0
)
);
hGradientBrush
.
setColorAt
(
0.0
,
DIMMEST_COLOR
);
hGradientBrush
.
setColorAt
(
0.5
,
MIDBRIGHT_COLOR
);
hGradientBrush
.
setColorAt
(
1.0
,
BRIGHTEST_COLOR
);
//draw the value
painter
.
drawRect
(
0
,
0
,
width
()
-
1
,(
height
()
-
1
)
-
twiceFontHeight
);
...
...
@@ -178,6 +183,19 @@ void QGCRadioChannelDisplay::hideMinMax()
update
();
}
void
QGCRadioChannelDisplay
::
setValueAndRange
(
int
val
,
int
min
,
int
max
)
{
setValue
(
val
);
setMinMax
(
min
,
max
);
}
void
QGCRadioChannelDisplay
::
setMinMax
(
int
min
,
int
max
)
{
setMin
(
min
);
setMax
(
max
);
}
void
QGCRadioChannelDisplay
::
setMin
(
int
value
)
{
m_min
=
value
;
...
...
src/ui/designer/QGCRadioChannelDisplay.h
View file @
174962a1
...
...
@@ -12,6 +12,8 @@ public:
void
setValue
(
int
value
);
void
showMinMax
();
void
hideMinMax
();
void
setValueAndRange
(
int
val
,
int
min
,
int
max
);
void
setMinMax
(
int
min
,
int
max
);
void
setMin
(
int
value
);
void
setMax
(
int
value
);
void
setName
(
QString
name
);
...
...
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