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
22658273
Commit
22658273
authored
Jan 04, 2011
by
Bryan Godbolt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addressed fixmes and some issues from cppcheck
parent
6a5c6d98
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
47 deletions
+45
-47
Parameter.h
src/comm/Parameter.h
+2
-2
ParameterList.h
src/comm/ParameterList.h
+3
-3
RadioCalibrationData.cc
src/ui/RadioCalibration/RadioCalibrationData.cc
+3
-7
RadioCalibrationData.h
src/ui/RadioCalibration/RadioCalibrationData.h
+2
-1
RadioCalibrationWindow.cc
src/ui/RadioCalibration/RadioCalibrationWindow.cc
+31
-31
RadioCalibrationWindow.h
src/ui/RadioCalibration/RadioCalibrationWindow.h
+4
-3
No files found.
src/comm/Parameter.h
View file @
22658273
...
...
@@ -61,8 +61,8 @@ namespace OpalRT
const
QGCParamID
&
getParamID
()
const
{
return
*
paramID
;}
void
setOpalID
(
unsigned
short
opalID
)
{
this
->
opalID
=
opalID
;}
const
QString
&
getSimulinkPath
()
{
return
*
simulinkPath
;}
const
QString
&
getSimulinkName
()
{
return
*
simulinkName
;}
const
QString
&
getSimulinkPath
()
const
{
return
*
simulinkPath
;}
const
QString
&
getSimulinkName
()
const
{
return
*
simulinkName
;}
uint8_t
getComponentID
()
const
{
return
componentID
;}
float
getValue
();
void
setValue
(
float
value
);
...
...
src/comm/ParameterList.h
View file @
22658273
...
...
@@ -53,11 +53,11 @@ namespace OpalRT
const_iterator
(
const
const_iterator
&
other
);
const_iterator
&
operator
+=
(
int
i
)
{
index
+=
i
;
return
*
this
;}
bool
operator
<
(
const
const_iterator
&
other
)
{
return
(
this
->
paramList
==
other
.
paramList
)
bool
operator
<
(
const
const_iterator
&
other
)
const
{
return
(
this
->
paramList
==
other
.
paramList
)
&&
(
this
->
index
<
other
.
index
);}
bool
operator
==
(
const
const_iterator
&
other
)
{
return
(
this
->
paramList
==
other
.
paramList
)
bool
operator
==
(
const
const_iterator
&
other
)
const
{
return
(
this
->
paramList
==
other
.
paramList
)
&&
(
this
->
index
==
other
.
index
);}
bool
operator
!=
(
const
const_iterator
&
other
)
{
return
!
((
*
this
)
==
other
);}
bool
operator
!=
(
const
const_iterator
&
other
)
const
{
return
!
((
*
this
)
==
other
);}
const
Parameter
&
operator
*
()
const
{
return
paramList
[
index
];}
const
Parameter
*
operator
->
()
const
{
return
&
paramList
[
index
];}
...
...
src/ui/RadioCalibration/RadioCalibrationData.cc
View file @
22658273
...
...
@@ -48,18 +48,14 @@ const float* RadioCalibrationData::operator [](int i) const
return
NULL
;
}
const
QVector
<
float
>&
RadioCalibrationData
::
operator
()(
int
i
)
const
const
QVector
<
float
>&
RadioCalibrationData
::
operator
()(
const
int
i
)
const
throw
(
std
::
out_of_range
)
{
if
(
i
<
data
->
size
(
))
if
(
(
i
<
data
->
size
())
&&
(
i
>=
0
))
{
return
(
*
data
)[
i
];
}
// FIXME Bryan
// FIXME James
// This is not good. If it is ever used after being returned it will cause a crash
// return QVector<float>();
throw
std
::
out_of_range
(
"Invalid channel index"
);
}
QString
RadioCalibrationData
::
toString
(
RadioElement
element
)
const
...
...
src/ui/RadioCalibration/RadioCalibrationData.h
View file @
22658273
...
...
@@ -34,6 +34,7 @@ This file is part of the QGROUNDCONTROL project
#include <QDebug>
#include <QVector>
#include <QString>
#include <stdexcept>
/**
...
...
@@ -66,7 +67,7 @@ public:
};
const
float
*
operator
[](
int
i
)
const
;
const
QVector
<
float
>&
operator
()(
int
i
)
const
;
const
QVector
<
float
>&
operator
()(
int
i
)
const
throw
(
std
::
out_of_range
)
;
void
set
(
int
element
,
int
index
,
float
value
)
{(
*
data
)[
element
][
index
]
=
value
;}
public
slots
:
...
...
src/ui/RadioCalibration/RadioCalibrationWindow.cc
View file @
22658273
...
...
@@ -52,38 +52,38 @@ RadioCalibrationWindow::RadioCalibrationWindow(QWidget *parent) :
setUASId
(
0
);
}
void
RadioCalibrationWindow
::
setChannelRaw
(
int
ch
,
float
raw
)
{
/** this expects a particular channel to function mapping
\todo allow run-time channel mapping
*/
switch
(
ch
)
{
case
0
:
aileron
->
channelChanged
(
raw
);
break
;
case
1
:
elevator
->
channelChanged
(
raw
);
break
;
case
2
:
throttle
->
channelChanged
(
raw
);
break
;
case
3
:
rudder
->
channelChanged
(
raw
);
break
;
case
4
:
gyro
->
channelChanged
(
raw
);
break
;
case
5
:
pitch
->
channelChanged
(
raw
);
break
;
//
void RadioCalibrationWindow::setChannelRaw(int ch, float raw)
//
{
//
/** this expects a particular channel to function mapping
//
\todo allow run-time channel mapping
//
*/
//
switch (ch)
//
{
//
case 0:
//
aileron->channelChanged(raw);
//
break;
//
case 1:
//
elevator->channelChanged(raw);
//
break;
//
case 2:
//
throttle->channelChanged(raw);
//
break;
//
case 3:
//
rudder->channelChanged(raw);
//
break;
//
case 4:
//
gyro->channelChanged(raw);
//
break;
//
case 5:
//
pitch->channelChanged(raw);
//
break;
}
}
//
}
//
}
void
RadioCalibrationWindow
::
setChannelScaled
(
int
ch
,
float
normalized
)
{
//
void RadioCalibrationWindow::setChannelScaled(int ch, float normalized)
//
{
// FIXME James
// FIXME Bryan
...
...
@@ -113,9 +113,9 @@ void RadioCalibrationWindow::setChannelScaled(int ch, float normalized)
// }
}
//
}
void
RadioCalibrationWindow
::
setChannel
(
int
ch
,
float
raw
,
float
normalized
)
void
RadioCalibrationWindow
::
setChannel
(
int
ch
,
float
raw
)
{
/** this expects a particular channel to function mapping
\todo allow run-time channel mapping
...
...
src/ui/RadioCalibration/RadioCalibrationWindow.h
View file @
22658273
...
...
@@ -66,9 +66,10 @@ public:
explicit
RadioCalibrationWindow
(
QWidget
*
parent
=
0
);
public
slots
:
void
setChannel
(
int
ch
,
float
raw
,
float
normalized
);
void
setChannelRaw
(
int
ch
,
float
raw
);
void
setChannelScaled
(
int
ch
,
float
normalized
);
void
setChannel
(
int
ch
,
float
raw
);
// @todo remove these functions if they are not needed - were added by lm on dec 14, 2010
// void setChannelRaw(int ch, float raw);
// void setChannelScaled(int ch, float normalized);
void
loadFile
();
void
saveFile
();
void
send
();
...
...
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