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
5e211bb9
Commit
5e211bb9
authored
Aug 06, 2013
by
tstellanova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug multiple parameter widgets creation
parent
9bcd3ed3
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
27 deletions
+31
-27
QGCUASParamManager.cc
src/uas/QGCUASParamManager.cc
+2
-11
QGCUASParamManager.h
src/uas/QGCUASParamManager.h
+0
-2
UAS.cc
src/uas/UAS.cc
+1
-1
ParameterInterface.cc
src/ui/ParameterInterface.cc
+11
-1
QGCParamWidget.cc
src/ui/QGCParamWidget.cc
+15
-10
QGCParamWidget.h
src/ui/QGCParamWidget.h
+2
-2
No files found.
src/uas/QGCUASParamManager.cc
View file @
5e211bb9
...
...
@@ -16,22 +16,13 @@ QGCUASParamManager::QGCUASParamManager(UASInterface* uas, QWidget *parent) :
}
/**
* The .. signal is emitted
*/
void
QGCUASParamManager
::
requestParameterListUpdate
(
int
component
)
{
Q_UNUSED
(
component
);
}
bool
QGCUASParamManager
::
getParameterValue
(
int
component
,
const
QString
&
parameter
,
QVariant
&
value
)
const
{
return
paramDataModel
->
getOnboardParameterValue
(
component
,
parameter
,
value
);
}
/**
* Send a request to deliver the list of onboard parameters
* to the MAV.
...
...
@@ -69,7 +60,7 @@ void QGCUASParamManager::requestParameterList()
*/
void
QGCUASParamManager
::
setRetransmissionGuardEnabled
(
bool
enabled
)
{
qDebug
()
<<
"setRetransmissionGuardEnabled: "
<<
enabled
;
//
qDebug() << "setRetransmissionGuardEnabled: " << enabled;
if
(
enabled
)
{
retransmissionTimer
.
start
(
retransmissionTimeout
);
...
...
src/uas/QGCUASParamManager.h
View file @
5e211bb9
...
...
@@ -17,8 +17,6 @@ public:
virtual
bool
getParameterValue
(
int
component
,
const
QString
&
parameter
,
QVariant
&
value
)
const
;
/** @brief Request an update for the parameter list */
void
requestParameterListUpdate
(
int
component
=
0
);
/** @brief Request an update for this specific parameter */
virtual
void
requestParameterUpdate
(
int
component
,
const
QString
&
parameter
)
=
0
;
...
...
src/uas/UAS.cc
View file @
5e211bb9
...
...
@@ -1995,7 +1995,7 @@ void UAS::sendMessage(mavlink_message_t message)
if
(
LinkManager
::
instance
()
->
getLinks
().
contains
(
link
))
{
sendMessage
(
link
,
message
);
qDebug
()
<<
"SENT MESSAGE
!"
;
qDebug
()
<<
"SENT MESSAGE
id"
<<
message
.
msgid
;
}
else
{
...
...
src/ui/ParameterInterface.cc
View file @
5e211bb9
...
...
@@ -89,8 +89,18 @@ void ParameterInterface::selectUAS(int index)
*/
void
ParameterInterface
::
addUAS
(
UASInterface
*
uas
)
{
int
uasId
=
uas
->
getUASID
();
if
(
paramWidgets
->
contains
(
uasId
)
)
{
qDebug
()
<<
"Already have QGCParamWidget for: "
<<
uasId
;
return
;
}
QGCParamWidget
*
param
=
new
QGCParamWidget
(
uas
,
this
);
paramWidgets
->
insert
(
uas
->
getUASID
(),
param
);
QString
ptrStr
;
ptrStr
.
sprintf
(
"%8p"
,
param
);
qDebug
()
<<
"Created QGCParamWidget "
<<
ptrStr
<<
"for UAS id: "
<<
uasId
<<
" count: "
<<
paramWidgets
->
count
();
paramWidgets
->
insert
(
uasId
,
param
);
m_ui
->
stackedWidget
->
addWidget
(
param
);
QGCSensorSettingsWidget
*
sensor
=
NULL
;
...
...
src/ui/QGCParamWidget.cc
View file @
5e211bb9
...
...
@@ -87,7 +87,7 @@ QGCParamWidget::QGCParamWidget(UASInterface* uas, QWidget *parent) :
QPushButton
*
refreshButton
=
new
QPushButton
(
tr
(
"Get"
));
refreshButton
->
setToolTip
(
tr
(
"Load parameters currently in non-permanent memory of aircraft."
));
refreshButton
->
setWhatsThis
(
tr
(
"Load parameters currently in non-permanent memory of aircraft."
));
connect
(
refreshButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
request
ParameterList
Update
()));
connect
(
refreshButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
request
AllParams
Update
()));
horizontalLayout
->
addWidget
(
refreshButton
,
2
,
0
);
QPushButton
*
setButton
=
new
QPushButton
(
tr
(
"Set"
));
...
...
@@ -151,7 +151,7 @@ QGCParamWidget::QGCParamWidget(UASInterface* uas, QWidget *parent) :
// Get parameters
if
(
uas
)
{
request
ParameterList
Update
();
request
AllParams
Update
();
}
}
...
...
@@ -245,7 +245,8 @@ void QGCParamWidget::addComponent(int uas, int component, QString componentName)
*/
void
QGCParamWidget
::
receivedParameterUpdate
(
int
uas
,
int
component
,
int
paramCount
,
int
paramId
,
QString
parameterName
,
QVariant
value
)
{
receivedParameterUpdate
(
uas
,
component
,
parameterName
,
value
);
updateParameterDisplay
(
uas
,
component
,
parameterName
,
value
);
// Missing packets list has to be instantiated for all components
if
(
!
transmissionMissingPackets
.
contains
(
component
))
{
...
...
@@ -390,10 +391,15 @@ void QGCParamWidget::receivedParameterUpdate(int uas, int component, int paramCo
* @param component id of the component
* @param parameterName human friendly name of the parameter
*/
void
QGCParamWidget
::
receivedParameterUpdate
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
void
QGCParamWidget
::
updateParameterDisplay
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
)
{
qDebug
()
<<
"PARAM WIDGET GOT PARAM:"
<<
parameterName
;
Q_UNUSED
(
uas
);
QString
ptrStr
;
ptrStr
.
sprintf
(
"%8p"
,
this
);
qDebug
()
<<
"QGCParamWidget "
<<
ptrStr
<<
" got param"
<<
parameterName
;
// Reference to item in tree
QTreeWidgetItem
*
parameterItem
=
NULL
;
...
...
@@ -417,9 +423,8 @@ void QGCParamWidget::receivedParameterUpdate(int uas, int component, QString par
addComponent
(
uas
,
component
,
componentName
);
}
// Replace value in map
paramDataModel
->
setOnboardParameter
(
component
,
parameterName
,
value
);
// Replace value in data model
paramDataModel
->
handleParameterUpdate
(
component
,
parameterName
,
value
);
QString
splitToken
=
"_"
;
...
...
@@ -564,7 +569,7 @@ void QGCParamWidget::parameterItemChanged(QTreeWidgetItem* current, int column)
current
->
setBackground
(
1
,
QBrush
(
QColor
(
QGC
::
colorOrange
)));
//TODO this seems incorrect-- we're pre-updating the onboard value before we've received confirmation
paramDataModel
->
setOnboardParameterWithType
(
componentId
,
key
,
value
);
//
paramDataModel->setOnboardParameterWithType(componentId,key,value);
}
}
...
...
@@ -608,7 +613,7 @@ void QGCParamWidget::setParameterStatusMsg(const QString& msg)
void
QGCParamWidget
::
request
ParameterList
Update
()
void
QGCParamWidget
::
request
AllParams
Update
()
{
if
(
!
mav
)
{
return
;
...
...
src/ui/QGCParamWidget.h
View file @
5e211bb9
...
...
@@ -65,9 +65,9 @@ public slots:
/** @brief Add a parameter to the list with retransmission / safety checks */
void
receivedParameterUpdate
(
int
uas
,
int
component
,
int
paramCount
,
int
paramId
,
QString
parameterName
,
QVariant
value
);
/** @brief Add a parameter to the list */
void
receivedParameterUpdate
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
void
updateParameterDisplay
(
int
uas
,
int
component
,
QString
parameterName
,
QVariant
value
);
/** @brief Request list of parameters from MAV */
void
request
ParameterList
Update
();
void
request
AllParams
Update
();
/** @brief Request one single parameter */
void
requestParameterUpdate
(
int
component
,
const
QString
&
parameter
);
/** @brief Set one parameter, changes value in RAM of MAV */
...
...
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