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