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
0daae906
Commit
0daae906
authored
Nov 24, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Per-Vehicle parameter load progess
Also removed intermediate param load retry message
parent
b1867b20
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
28 deletions
+20
-28
ParameterManager.cc
src/FactSystem/ParameterManager.cc
+13
-11
ParameterManager.h
src/FactSystem/ParameterManager.h
+6
-3
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+1
-1
MainToolBarController.cc
src/ui/toolbar/MainToolBarController.cc
+0
-9
MainToolBarController.h
src/ui/toolbar/MainToolBarController.h
+0
-4
No files found.
src/FactSystem/ParameterManager.cc
View file @
0daae906
...
...
@@ -47,6 +47,7 @@ ParameterManager::ParameterManager(Vehicle* vehicle)
:
QObject
(
vehicle
)
,
_vehicle
(
vehicle
)
,
_mavlink
(
NULL
)
,
_loadProgress
(
0.0
)
,
_parametersReady
(
false
)
,
_missingParameters
(
false
)
,
_initialLoadComplete
(
false
)
...
...
@@ -247,10 +248,10 @@ void ParameterManager::_parameterUpdate(int vehicleId, int componentId, QString
// We are no longer waiting for any reads to complete
if
(
_prevWaitingReadParamIndexCount
+
_prevWaitingReadParamNameCount
!=
0
)
{
// Set progress to 0 if not already there
emit
parameterListProgress
(
0
);
_setLoadProgress
(
0.
0
);
}
}
else
{
emit
parameterListProgress
((
float
)(
_totalParamCount
-
readWaitingParamCount
)
/
(
float
)
_totalParamCount
);
_setLoadProgress
((
double
)(
_totalParamCount
-
readWaitingParamCount
)
/
(
double
)
_totalParamCount
);
}
// Get parameter set version
...
...
@@ -801,13 +802,13 @@ void ParameterManager::_tryCacheHashLoad(int vehicleId, int componentId, QVarian
ani
->
setDuration
(
750
);
connect
(
ani
,
&
QVariantAnimation
::
valueChanged
,
[
this
](
const
QVariant
&
value
)
{
emit
parameterListProgress
(
value
.
toFloat
());
_setLoadProgress
(
value
.
toDouble
());
});
// Hide 500ms after animation finishes
connect
(
ani
,
&
QVariantAnimation
::
finished
,
[
this
](){
QTimer
::
singleShot
(
500
,
[
this
]()
{
emit
parameterList
Progress
(
0
);
_setLoad
Progress
(
0
);
});
});
...
...
@@ -1070,18 +1071,13 @@ void ParameterManager::_checkInitialLoadComplete(bool failIfNoDefaultComponent)
void
ParameterManager
::
_initialRequestTimeout
(
void
)
{
if
(
!
_disableAllRetries
&&
++
_initialRequestRetryCount
<=
_maxInitialRequestListRetry
)
{
if
(
!
_vehicle
->
genericFirmware
())
{
// Generic vehicles (like BeBop) may not have any parameters, so don't annoy the user
QString
errorMsg
=
tr
(
"Vehicle %1 did not respond to request for parameters, retrying"
).
arg
(
_vehicle
->
id
());
qCDebug
(
ParameterManagerLog
)
<<
errorMsg
;
qgcApp
()
->
showMessage
(
errorMsg
);
}
refreshAllParameters
();
_initialRequestTimeoutTimer
.
start
();
}
else
{
if
(
!
_vehicle
->
genericFirmware
())
{
// Generic vehicles (like BeBop) may not have any parameters, so don't annoy the user
QString
errorMsg
=
tr
(
"Vehicle %1 did not respond to request for parameters, failing after maximum number of retries"
).
arg
(
_vehicle
->
id
());
QString
errorMsg
=
tr
(
"Vehicle %1 did not respond to request for parameters"
"This will cause QGroundControl to be unable to display its full user interface."
).
arg
(
_vehicle
->
id
());
qCDebug
(
ParameterManagerLog
)
<<
errorMsg
;
qgcApp
()
->
showMessage
(
errorMsg
);
}
...
...
@@ -1482,3 +1478,9 @@ QString ParameterManager::_logVehiclePrefix(int componentId)
return
QString
(
"V:%1 C:%2"
).
arg
(
_vehicle
->
id
()).
arg
(
componentId
);
}
}
void
ParameterManager
::
_setLoadProgress
(
double
loadProgress
)
{
_loadProgress
=
loadProgress
;
emit
loadProgressChanged
(
loadProgress
);
}
src/FactSystem/ParameterManager.h
View file @
0daae906
...
...
@@ -49,6 +49,9 @@ public:
Q_PROPERTY
(
bool
missingParameters
READ
missingParameters
NOTIFY
missingParametersChanged
)
bool
missingParameters
(
void
)
{
return
_missingParameters
;
}
Q_PROPERTY
(
double
loadProgress
READ
loadProgress
NOTIFY
loadProgressChanged
)
double
loadProgress
(
void
)
const
{
return
_loadProgress
;
}
/// @return Directory of parameter caches
static
QDir
parameterCacheDir
();
...
...
@@ -121,9 +124,7 @@ public:
signals:
void
parametersReadyChanged
(
bool
parametersReady
);
void
missingParametersChanged
(
bool
missingParameters
);
/// Signalled to update progress of full parameter list request
void
parameterListProgress
(
float
value
);
void
loadProgressChanged
(
float
value
);
protected:
Vehicle
*
_vehicle
;
...
...
@@ -148,6 +149,7 @@ private:
QString
_remapParamNameToVersion
(
const
QString
&
paramName
);
void
_loadOfflineEditingParams
(
void
);
QString
_logVehiclePrefix
(
int
componentId
=
-
1
);
void
_setLoadProgress
(
double
loadProgress
);
MAV_PARAM_TYPE
_factTypeToMavType
(
FactMetaData
::
ValueType_t
factType
);
FactMetaData
::
ValueType_t
_mavTypeToFactType
(
MAV_PARAM_TYPE
mavType
);
...
...
@@ -164,6 +166,7 @@ private:
/// Second mapping is group name, to Fact
QMap
<
int
,
QMap
<
QString
,
QStringList
>
>
_mapGroup2ParameterName
;
double
_loadProgress
;
///< Parameter load progess, [0.0,1.0]
bool
_parametersReady
;
///< true: parameter load complete
bool
_missingParameters
;
///< true: parameter missing from initial load
bool
_initialLoadComplete
;
///< true: Initial load of all parameters complete, whether successful or not
...
...
src/ui/toolbar/MainToolBar.qml
View file @
0daae906
...
...
@@ -439,7 +439,7 @@ Rectangle {
id
:
progressBar
anchors.bottom
:
parent
.
bottom
height
:
toolBar
.
height
*
0.05
width
:
parent
.
width
*
_controller
.
progressBarValue
width
:
activeVehicle
?
activeVehicle
.
parameterManager
.
loadProgress
*
parent
.
width
:
0
color
:
colorGreen
}
...
...
src/ui/toolbar/MainToolBarController.cc
View file @
0daae906
...
...
@@ -30,7 +30,6 @@ MainToolBarController::MainToolBarController(QObject* parent)
:
QObject
(
parent
)
,
_vehicle
(
NULL
)
,
_mav
(
NULL
)
,
_progressBarValue
(
0.0
f
)
,
_telemetryRRSSI
(
0
)
,
_telemetryLRSSI
(
0
)
{
...
...
@@ -48,7 +47,6 @@ void MainToolBarController::_activeVehicleChanged(Vehicle* vehicle)
{
// Disconnect the previous one (if any)
if
(
_vehicle
)
{
disconnect
(
_vehicle
->
parameterManager
(),
&
ParameterManager
::
parameterListProgress
,
this
,
&
MainToolBarController
::
_setProgressBarValue
);
_mav
=
NULL
;
_vehicle
=
NULL
;
}
...
...
@@ -58,7 +56,6 @@ void MainToolBarController::_activeVehicleChanged(Vehicle* vehicle)
{
_vehicle
=
vehicle
;
_mav
=
vehicle
->
uas
();
connect
(
_vehicle
->
parameterManager
(),
&
ParameterManager
::
parameterListProgress
,
this
,
&
MainToolBarController
::
_setProgressBarValue
);
}
}
...
...
@@ -93,9 +90,3 @@ void MainToolBarController::_telemetryChanged(LinkInterface*, unsigned rxerrors,
emit
telemetryRNoiseChanged
(
_telemetryRNoise
);
}
}
void
MainToolBarController
::
_setProgressBarValue
(
float
value
)
{
_progressBarValue
=
value
;
emit
progressBarValueChanged
(
value
);
}
src/ui/toolbar/MainToolBarController.h
View file @
0daae906
...
...
@@ -38,7 +38,6 @@ public:
~
MainToolBarController
();
Q_PROPERTY
(
double
height
MEMBER
_toolbarHeight
NOTIFY
heightChanged
)
Q_PROPERTY
(
float
progressBarValue
MEMBER
_progressBarValue
NOTIFY
progressBarValueChanged
)
Q_PROPERTY
(
int
telemetryRRSSI
READ
telemetryRRSSI
NOTIFY
telemetryRRSSIChanged
)
Q_PROPERTY
(
int
telemetryLRSSI
READ
telemetryLRSSI
NOTIFY
telemetryLRSSIChanged
)
Q_PROPERTY
(
unsigned
int
telemetryRXErrors
READ
telemetryRXErrors
NOTIFY
telemetryRXErrorsChanged
)
...
...
@@ -58,7 +57,6 @@ public:
unsigned
int
telemetryRNoise
()
{
return
_telemetryRNoise
;
}
signals:
void
progressBarValueChanged
(
float
value
);
void
telemetryRRSSIChanged
(
int
value
);
void
telemetryLRSSIChanged
(
int
value
);
void
heightChanged
(
double
height
);
...
...
@@ -70,13 +68,11 @@ signals:
private
slots
:
void
_activeVehicleChanged
(
Vehicle
*
vehicle
);
void
_setProgressBarValue
(
float
value
);
void
_telemetryChanged
(
LinkInterface
*
link
,
unsigned
rxerrors
,
unsigned
fixed
,
int
rssi
,
int
remrssi
,
unsigned
txbuf
,
unsigned
noise
,
unsigned
remnoise
);
private:
Vehicle
*
_vehicle
;
UASInterface
*
_mav
;
float
_progressBarValue
;
double
_remoteRSSIstore
;
int
_telemetryRRSSI
;
int
_telemetryLRSSI
;
...
...
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