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
b3460589
Commit
b3460589
authored
Sep 09, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #376 from jean-m-cyr/config
Fix Spektrum pair buton such that it works every time.
parents
7e482b03
8216b137
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
44 deletions
+43
-44
qupgrade.pro
qupgrade.pro
+4
-0
QGCUASParamManager.cc
src/uas/QGCUASParamManager.cc
+4
-4
QGCUASParamManager.h
src/uas/QGCUASParamManager.h
+2
-2
UASParameterCommsMgr.cc
src/uas/UASParameterCommsMgr.cc
+13
-11
UASParameterCommsMgr.h
src/uas/UASParameterCommsMgr.h
+2
-2
UASParameterDataModel.cc
src/uas/UASParameterDataModel.cc
+10
-8
UASParameterDataModel.h
src/uas/UASParameterDataModel.h
+1
-1
QGCPX4VehicleConfig.cc
src/ui/QGCPX4VehicleConfig.cc
+7
-16
No files found.
qupgrade.pro
View file @
b3460589
...
@@ -223,6 +223,8 @@ win32-msvc2008|win32-msvc2010 {
...
@@ -223,6 +223,8 @@ win32-msvc2008|win32-msvc2010 {
QMAKE_POST_LINK
+=
$$
quote
(
xcopy
/
D
/
Y
"$$(QTDIR)\\bin\\QtWebKitd4.dll"
"$$TARGETDIR_WIN\\debug"
$$
escape_expand
(
\\
n
))
QMAKE_POST_LINK
+=
$$
quote
(
xcopy
/
D
/
Y
"$$(QTDIR)\\bin\\QtWebKitd4.dll"
"$$TARGETDIR_WIN\\debug"
$$
escape_expand
(
\\
n
))
QMAKE_POST_LINK
+=
$$
quote
(
xcopy
/
D
/
Y
"$$(QTDIR)\\bin\\QtXmld4.dll"
"$$TARGETDIR_WIN\\debug"
$$
escape_expand
(
\\
n
))
QMAKE_POST_LINK
+=
$$
quote
(
xcopy
/
D
/
Y
"$$(QTDIR)\\bin\\QtXmld4.dll"
"$$TARGETDIR_WIN\\debug"
$$
escape_expand
(
\\
n
))
QMAKE_POST_LINK
+=
$$
quote
(
xcopy
/
D
/
Y
"$$(QTDIR)\\bin\\QtXmlPatternsd4.dll"
"$$TARGETDIR_WIN\\debug"
$$
escape_expand
(
\\
n
))
QMAKE_POST_LINK
+=
$$
quote
(
xcopy
/
D
/
Y
"$$(QTDIR)\\bin\\QtXmlPatternsd4.dll"
"$$TARGETDIR_WIN\\debug"
$$
escape_expand
(
\\
n
))
QMAKE_POST_LINK
+=
$$
quote
(
xcopy
/
D
/
Y
"$$(QTDIR)\\bin\\QtDeclaratived4.dll"
"$$TARGETDIR_WIN\\debug"
$$
escape_expand
(
\\
n
))
QMAKE_POST_LINK
+=
$$
quote
(
xcopy
/
D
/
Y
"$$(QTDIR)\\bin\\QtScriptd4.dll"
"$$TARGETDIR_WIN\\debug"
$$
escape_expand
(
\\
n
))
}
}
CONFIG
(
release
,
debug
|
release
)
{
CONFIG
(
release
,
debug
|
release
)
{
...
@@ -242,6 +244,8 @@ win32-msvc2008|win32-msvc2010 {
...
@@ -242,6 +244,8 @@ win32-msvc2008|win32-msvc2010 {
QMAKE_POST_LINK
+=
$$
quote
(
xcopy
/
D
/
Y
"$$(QTDIR)\\bin\\QtWebKit4.dll"
"$$TARGETDIR_WIN\\release"
$$
escape_expand
(
\\
n
))
QMAKE_POST_LINK
+=
$$
quote
(
xcopy
/
D
/
Y
"$$(QTDIR)\\bin\\QtWebKit4.dll"
"$$TARGETDIR_WIN\\release"
$$
escape_expand
(
\\
n
))
QMAKE_POST_LINK
+=
$$
quote
(
xcopy
/
D
/
Y
"$$(QTDIR)\\bin\\QtXml4.dll"
"$$TARGETDIR_WIN\\release"
$$
escape_expand
(
\\
n
))
QMAKE_POST_LINK
+=
$$
quote
(
xcopy
/
D
/
Y
"$$(QTDIR)\\bin\\QtXml4.dll"
"$$TARGETDIR_WIN\\release"
$$
escape_expand
(
\\
n
))
QMAKE_POST_LINK
+=
$$
quote
(
xcopy
/
D
/
Y
"$$(QTDIR)\\bin\\QtXmlPatterns4.dll"
"$$TARGETDIR_WIN\\release"
$$
escape_expand
(
\\
n
))
QMAKE_POST_LINK
+=
$$
quote
(
xcopy
/
D
/
Y
"$$(QTDIR)\\bin\\QtXmlPatterns4.dll"
"$$TARGETDIR_WIN\\release"
$$
escape_expand
(
\\
n
))
QMAKE_POST_LINK
+=
$$
quote
(
xcopy
/
D
/
Y
"$$(QTDIR)\\bin\\QtDeclarative4.dll"
"$$TARGETDIR_WIN\\debug"
$$
escape_expand
(
\\
n
))
QMAKE_POST_LINK
+=
$$
quote
(
xcopy
/
D
/
Y
"$$(QTDIR)\\bin\\QtScript4.dll"
"$$TARGETDIR_WIN\\debug"
$$
escape_expand
(
\\
n
))
QMAKE_POST_LINK
+=
$$
quote
(
del
/
F
"$$TARGETDIR_WIN\\release\\qupgrade.exp"
$$
escape_expand
(
\\
n
))
QMAKE_POST_LINK
+=
$$
quote
(
del
/
F
"$$TARGETDIR_WIN\\release\\qupgrade.exp"
$$
escape_expand
(
\\
n
))
QMAKE_POST_LINK
+=
$$
quote
(
del
/
F
"$$TARGETDIR_WIN\\release\\qupgrade.lib"
$$
escape_expand
(
\\
n
))
QMAKE_POST_LINK
+=
$$
quote
(
del
/
F
"$$TARGETDIR_WIN\\release\\qupgrade.lib"
$$
escape_expand
(
\\
n
))
...
...
src/uas/QGCUASParamManager.cc
View file @
b3460589
...
@@ -124,21 +124,21 @@ void QGCUASParamManager::setParameter(int compId, QString paramName, QVariant va
...
@@ -124,21 +124,21 @@ void QGCUASParamManager::setParameter(int compId, QString paramName, QVariant va
paramDataModel
.
updatePendingParamWithValue
(
compId
,
paramName
,
value
);
paramDataModel
.
updatePendingParamWithValue
(
compId
,
paramName
,
value
);
}
}
void
QGCUASParamManager
::
sendPendingParameters
(
bool
persistAfterSend
)
void
QGCUASParamManager
::
sendPendingParameters
(
bool
persistAfterSend
,
bool
forceSend
)
{
{
paramCommsMgr
->
sendPendingParameters
(
persistAfterSend
);
paramCommsMgr
->
sendPendingParameters
(
persistAfterSend
,
forceSend
);
}
}
void
QGCUASParamManager
::
setPendingParam
(
int
compId
,
const
QString
&
paramName
,
const
QVariant
&
value
)
void
QGCUASParamManager
::
setPendingParam
(
int
compId
,
const
QString
&
paramName
,
const
QVariant
&
value
,
bool
forceSend
)
{
{
if
((
0
==
compId
)
||
(
-
1
==
compId
))
{
if
((
0
==
compId
)
||
(
-
1
==
compId
))
{
//attempt to get an actual component ID
//attempt to get an actual component ID
compId
=
paramDataModel
.
getDefaultComponentId
();
compId
=
paramDataModel
.
getDefaultComponentId
();
}
}
paramDataModel
.
updatePendingParamWithValue
(
compId
,
paramName
,
value
);
paramDataModel
.
updatePendingParamWithValue
(
compId
,
paramName
,
value
,
forceSend
);
}
}
...
...
src/uas/QGCUASParamManager.h
View file @
b3460589
...
@@ -90,7 +90,7 @@ public slots:
...
@@ -90,7 +90,7 @@ public slots:
/** @brief Send all pending parameters to the MAV, for storage in transient (RAM) memory
/** @brief Send all pending parameters to the MAV, for storage in transient (RAM) memory
* @param persistAfterSend If true, all parameters will be written to persistent storage as well
* @param persistAfterSend If true, all parameters will be written to persistent storage as well
*/
*/
virtual
void
sendPendingParameters
(
bool
persistAfterSend
=
false
);
virtual
void
sendPendingParameters
(
bool
persistAfterSend
=
false
,
bool
forceSend
=
false
);
/** @brief Request list of parameters from MAV */
/** @brief Request list of parameters from MAV */
...
@@ -100,7 +100,7 @@ public slots:
...
@@ -100,7 +100,7 @@ public slots:
virtual
void
requestParameterListIfEmpty
();
virtual
void
requestParameterListIfEmpty
();
/** @brief queue a pending parameter for sending to the MAV */
/** @brief queue a pending parameter for sending to the MAV */
virtual
void
setPendingParam
(
int
componentId
,
const
QString
&
key
,
const
QVariant
&
value
);
virtual
void
setPendingParam
(
int
componentId
,
const
QString
&
key
,
const
QVariant
&
value
,
bool
forceSend
=
false
);
/** @brief remove all params from the pending list */
/** @brief remove all params from the pending list */
virtual
void
clearAllPendingParams
();
virtual
void
clearAllPendingParams
();
...
...
src/uas/UASParameterCommsMgr.cc
View file @
b3460589
...
@@ -307,7 +307,7 @@ void UASParameterCommsMgr::requestRcCalibrationParamsUpdate()
...
@@ -307,7 +307,7 @@ void UASParameterCommsMgr::requestRcCalibrationParamsUpdate()
* @param parameterName name of the parameter, as delivered by the system
* @param parameterName name of the parameter, as delivered by the system
* @param value value of the parameter
* @param value value of the parameter
*/
*/
void
UASParameterCommsMgr
::
setParameter
(
int
compId
,
QString
paramName
,
QVariant
value
)
void
UASParameterCommsMgr
::
setParameter
(
int
compId
,
QString
paramName
,
QVariant
value
,
bool
forceSend
)
{
{
if
(
paramName
.
isEmpty
())
{
if
(
paramName
.
isEmpty
())
{
return
;
return
;
...
@@ -328,6 +328,7 @@ void UASParameterCommsMgr::setParameter(int compId, QString paramName, QVariant
...
@@ -328,6 +328,7 @@ void UASParameterCommsMgr::setParameter(int compId, QString paramName, QVariant
return
;
return
;
}
}
if
(
!
forceSend
)
{
QVariant
onboardVal
;
QVariant
onboardVal
;
paramDataModel
->
getOnboardParamValue
(
compId
,
paramName
,
onboardVal
);
paramDataModel
->
getOnboardParamValue
(
compId
,
paramName
,
onboardVal
);
if
(
onboardVal
==
value
)
{
if
(
onboardVal
==
value
)
{
...
@@ -336,6 +337,7 @@ void UASParameterCommsMgr::setParameter(int compId, QString paramName, QVariant
...
@@ -336,6 +337,7 @@ void UASParameterCommsMgr::setParameter(int compId, QString paramName, QVariant
);
);
return
;
return
;
}
}
}
emitPendingParameterCommit
(
compId
,
paramName
,
value
);
emitPendingParameterCommit
(
compId
,
paramName
,
value
);
...
@@ -501,7 +503,7 @@ void UASParameterCommsMgr::writeParamsToPersistentStorage()
...
@@ -501,7 +503,7 @@ void UASParameterCommsMgr::writeParamsToPersistentStorage()
}
}
void
UASParameterCommsMgr
::
sendPendingParameters
(
bool
copyToPersistent
)
void
UASParameterCommsMgr
::
sendPendingParameters
(
bool
copyToPersistent
,
bool
forceSend
)
{
{
persistParamsAfterSend
|=
copyToPersistent
;
persistParamsAfterSend
|=
copyToPersistent
;
...
@@ -517,7 +519,7 @@ void UASParameterCommsMgr::sendPendingParameters(bool copyToPersistent)
...
@@ -517,7 +519,7 @@ void UASParameterCommsMgr::sendPendingParameters(bool copyToPersistent)
setParameterStatusMsg
(
tr
(
"%1 pending params for component %2"
).
arg
(
paramList
->
count
()).
arg
(
compId
));
setParameterStatusMsg
(
tr
(
"%1 pending params for component %2"
).
arg
(
paramList
->
count
()).
arg
(
compId
));
for
(
j
=
paramList
->
begin
();
j
!=
paramList
->
end
();
++
j
)
{
for
(
j
=
paramList
->
begin
();
j
!=
paramList
->
end
();
++
j
)
{
setParameter
(
compId
,
j
.
key
(),
j
.
value
());
setParameter
(
compId
,
j
.
key
(),
j
.
value
()
,
forceSend
);
parametersSent
++
;
parametersSent
++
;
}
}
}
}
...
...
src/uas/UASParameterCommsMgr.h
View file @
b3460589
...
@@ -71,13 +71,13 @@ signals:
...
@@ -71,13 +71,13 @@ signals:
public
slots
:
public
slots
:
/** @brief Iterate through all components, through all pending parameters and send them to UAS */
/** @brief Iterate through all components, through all pending parameters and send them to UAS */
virtual
void
sendPendingParameters
(
bool
copyToPersistent
=
false
);
virtual
void
sendPendingParameters
(
bool
copyToPersistent
=
false
,
bool
forceSend
=
false
);
/** @brief Write the current onboard parameters from transient RAM into persistent storage, e.g. EEPROM or harddisk */
/** @brief Write the current onboard parameters from transient RAM into persistent storage, e.g. EEPROM or harddisk */
virtual
void
writeParamsToPersistentStorage
();
virtual
void
writeParamsToPersistentStorage
();
/** @brief Write one parameter to the MAV */
/** @brief Write one parameter to the MAV */
virtual
void
setParameter
(
int
component
,
QString
parameterName
,
QVariant
value
);
virtual
void
setParameter
(
int
component
,
QString
parameterName
,
QVariant
value
,
bool
forceSend
=
false
);
/** @brief Request list of parameters from MAV */
/** @brief Request list of parameters from MAV */
virtual
void
requestParameterList
();
virtual
void
requestParameterList
();
...
...
src/uas/UASParameterDataModel.cc
View file @
b3460589
...
@@ -46,12 +46,13 @@ int UASParameterDataModel::countOnboardParams()
...
@@ -46,12 +46,13 @@ int UASParameterDataModel::countOnboardParams()
}
}
bool
UASParameterDataModel
::
updatePendingParamWithValue
(
int
compId
,
const
QString
&
key
,
const
QVariant
&
value
)
bool
UASParameterDataModel
::
updatePendingParamWithValue
(
int
compId
,
const
QString
&
key
,
const
QVariant
&
value
,
bool
forceSend
)
{
{
bool
pending
=
true
;
bool
pending
=
true
;
//ensure we have this component in our onboard and pending lists already
//ensure we have this component in our onboard and pending lists already
addComponent
(
compId
);
addComponent
(
compId
);
if
(
!
forceSend
)
{
QMap
<
QString
,
QVariant
>*
existParams
=
getOnboardParamsForComponent
(
compId
);
QMap
<
QString
,
QVariant
>*
existParams
=
getOnboardParamsForComponent
(
compId
);
if
(
existParams
->
contains
(
key
))
{
if
(
existParams
->
contains
(
key
))
{
QVariant
existValue
=
existParams
->
value
(
key
);
QVariant
existValue
=
existParams
->
value
(
key
);
...
@@ -59,6 +60,7 @@ bool UASParameterDataModel::updatePendingParamWithValue(int compId, const QStrin
...
@@ -59,6 +60,7 @@ bool UASParameterDataModel::updatePendingParamWithValue(int compId, const QStrin
pending
=
false
;
pending
=
false
;
}
}
}
}
}
if
(
pending
)
{
if
(
pending
)
{
setPendingParam
(
compId
,
key
,
value
);
setPendingParam
(
compId
,
key
,
value
);
...
...
src/uas/UASParameterDataModel.h
View file @
b3460589
...
@@ -53,7 +53,7 @@ public:
...
@@ -53,7 +53,7 @@ public:
/** @brief add this parameter to pending list iff it has changed from onboard value
/** @brief add this parameter to pending list iff it has changed from onboard value
* @return true if the parameter is now pending
* @return true if the parameter is now pending
*/
*/
virtual
bool
updatePendingParamWithValue
(
int
componentId
,
const
QString
&
key
,
const
QVariant
&
value
);
virtual
bool
updatePendingParamWithValue
(
int
componentId
,
const
QString
&
key
,
const
QVariant
&
value
,
bool
forceSend
=
false
);
virtual
void
handleParamUpdate
(
int
componentId
,
const
QString
&
key
,
const
QVariant
&
value
);
virtual
void
handleParamUpdate
(
int
componentId
,
const
QString
&
key
,
const
QVariant
&
value
);
virtual
bool
getOnboardParamValue
(
int
componentId
,
const
QString
&
key
,
QVariant
&
value
)
const
;
virtual
bool
getOnboardParamValue
(
int
componentId
,
const
QString
&
key
,
QVariant
&
value
)
const
;
...
...
src/ui/QGCPX4VehicleConfig.cc
View file @
b3460589
...
@@ -156,7 +156,7 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) :
...
@@ -156,7 +156,7 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) :
ui
->
rcCalibrationButton
->
setCheckable
(
true
);
ui
->
rcCalibrationButton
->
setCheckable
(
true
);
ui
->
rcCalibrationButton
->
setEnabled
(
false
);
ui
->
rcCalibrationButton
->
setEnabled
(
false
);
connect
(
ui
->
rcCalibrationButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
toggleCalibrationRC
(
bool
)));
connect
(
ui
->
rcCalibrationButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
toggleCalibrationRC
(
bool
)));
ui
->
spektrumPairButton
->
setCheckable
(
tru
e
);
ui
->
spektrumPairButton
->
setCheckable
(
fals
e
);
ui
->
spektrumPairButton
->
setEnabled
(
false
);
ui
->
spektrumPairButton
->
setEnabled
(
false
);
connect
(
ui
->
spektrumPairButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
toggleSpektrumPairing
(
bool
)));
connect
(
ui
->
spektrumPairButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
toggleSpektrumPairing
(
bool
)));
...
@@ -345,22 +345,13 @@ void QGCPX4VehicleConfig::toggleSpektrumPairing(bool enabled)
...
@@ -345,22 +345,13 @@ void QGCPX4VehicleConfig::toggleSpektrumPairing(bool enabled)
(
void
)
warnMsgBox
.
exec
();
(
void
)
warnMsgBox
.
exec
();
}
}
if
(
enabled
)
{
int
mode
=
1
;
// DSM2
int
mode
=
1
;
// DSM2
if
(
ui
->
dsmxRadioButton
->
isChecked
())
if
(
ui
->
dsmxRadioButton
->
isChecked
())
mode
=
2
;
// DSMX
mode
=
2
;
// DSMX
mav
->
getParamManager
()
->
setPendingParam
(
0
,
"RC_DSM_BIND"
,
mod
e
);
mav
->
getParamManager
()
->
setPendingParam
(
0
,
"RC_DSM_BIND"
,
mode
,
tru
e
);
// Do not save this parameter, just set in RAM
// Do not save this parameter, just set in RAM
mav
->
getParamManager
()
->
sendPendingParameters
();
mav
->
getParamManager
()
->
sendPendingParameters
(
false
,
true
);
}
else
{
mav
->
getParamManager
()
->
setPendingParam
(
0
,
"RC_DSM_BIND"
,
(
int
)
0
);
// Do not save this parameter, just set in RAM
mav
->
getParamManager
()
->
sendPendingParameters
();
}
}
}
void
QGCPX4VehicleConfig
::
setTrimPositions
()
void
QGCPX4VehicleConfig
::
setTrimPositions
()
...
...
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