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
fbd8d66b
Commit
fbd8d66b
authored
Apr 07, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Progress bar for parameter load
parent
0e492f00
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
66 additions
and
45 deletions
+66
-45
QGCUASParamManager.cc
src/uas/QGCUASParamManager.cc
+2
-0
QGCUASParamManager.h
src/uas/QGCUASParamManager.h
+1
-0
QGCUASParamManagerInterface.h
src/uas/QGCUASParamManagerInterface.h
+1
-0
UASParameterCommsMgr.cc
src/uas/UASParameterCommsMgr.cc
+10
-0
UASParameterCommsMgr.h
src/uas/UASParameterCommsMgr.h
+2
-0
MainToolBar.cc
src/ui/toolbar/MainToolBar.cc
+13
-0
MainToolBar.h
src/ui/toolbar/MainToolBar.h
+27
-45
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+10
-0
No files found.
src/uas/QGCUASParamManager.cc
View file @
fbd8d66b
...
...
@@ -39,6 +39,8 @@ void QGCUASParamManager::connectToModelAndComms()
this
,
SIGNAL
(
parameterStatusMsgUpdated
(
QString
,
int
)));
connect
(
&
paramCommsMgr
,
SIGNAL
(
parameterListUpToDate
()),
this
,
SLOT
(
_parameterListUpToDate
()));
connect
(
&
paramCommsMgr
,
SIGNAL
(
parameterListProgress
(
float
)),
this
,
SIGNAL
(
parameterListProgress
(
float
)));
// Pass along data model updates
connect
(
&
paramDataModel
,
SIGNAL
(
parameterUpdated
(
int
,
QString
,
QVariant
)),
...
...
src/uas/QGCUASParamManager.h
View file @
fbd8d66b
...
...
@@ -78,6 +78,7 @@ signals:
void
parameterStatusMsgUpdated
(
QString
msg
,
int
level
);
/** @brief We have received a complete list of all parameters onboard the MAV */
void
parameterListUpToDate
();
void
parameterListProgress
(
float
percentComplete
);
/** @brief We've received an update of a parameter's value */
void
parameterUpdated
(
int
compId
,
QString
paramName
,
QVariant
value
);
...
...
src/uas/QGCUASParamManagerInterface.h
View file @
fbd8d66b
...
...
@@ -52,6 +52,7 @@ public slots:
signals:
void
parameterStatusMsgUpdated
(
QString
msg
,
int
level
);
void
parameterListUpToDate
();
void
parameterListProgress
(
float
percentComplete
);
void
parameterUpdated
(
int
compId
,
QString
paramName
,
QVariant
value
);
void
pendingParamUpdate
(
int
compId
,
const
QString
&
paramName
,
QVariant
value
,
bool
isPending
);
};
...
...
src/uas/UASParameterCommsMgr.cc
View file @
fbd8d66b
...
...
@@ -447,6 +447,16 @@ void UASParameterCommsMgr::receivedParameterUpdate(int uas, int compId, int para
compMissingReads
->
insert
(
i
);
}
}
int
progDiv
=
paramCount
/
100
;
if
((
paramId
%
progDiv
)
==
0
)
{
qDebug
()
<<
paramId
<<
paramCount
;
emit
parameterListProgress
((
float
)
paramId
/
(
float
)
paramCount
);
}
if
(
paramId
==
paramCount
)
{
qDebug
()
<<
"List complete"
;
emit
parameterListProgress
(
0.0
f
);
}
}
...
...
src/uas/UASParameterCommsMgr.h
View file @
fbd8d66b
...
...
@@ -63,6 +63,8 @@ signals:
/** @brief We have received a complete list of all parameters onboard the MAV */
void
parameterListUpToDate
();
void
parameterListProgress
(
float
percentComplete
);
void
parameterUpdateRequested
(
int
component
,
const
QString
&
parameter
);
void
parameterUpdateRequestedById
(
int
componentId
,
int
paramId
);
...
...
src/ui/toolbar/MainToolBar.cc
View file @
fbd8d66b
...
...
@@ -60,6 +60,7 @@ MainToolBar::MainToolBar(QWidget* parent)
,
_showMav
(
true
)
,
_showMessages
(
true
)
,
_showBattery
(
true
)
,
_progressBarValue
(
0.0
f
)
,
_rollDownMessages
(
0
)
{
setSizePolicy
(
QSizePolicy
::
MinimumExpanding
,
QSizePolicy
::
MinimumExpanding
);
...
...
@@ -312,6 +313,9 @@ void MainToolBar::_setActiveUAS(UASInterface* active)
if
(
pUas
)
{
disconnect
(
pUas
,
&
UAS
::
satelliteCountChanged
,
this
,
&
MainToolBar
::
_setSatelliteCount
);
}
QGCUASParamManagerInterface
*
paramMgr
=
_mav
->
getParamManager
();
Q_ASSERT
(
paramMgr
);
disconnect
(
paramMgr
,
SIGNAL
(
parameterListProgress
(
float
)),
this
,
SLOT
(
_setProgressBarValue
(
float
)));
}
// Connect new system
_mav
=
active
;
...
...
@@ -338,6 +342,9 @@ void MainToolBar::_setActiveUAS(UASInterface* active)
_setSatelliteCount
(
pUas
->
getSatelliteCount
(),
QString
(
""
));
connect
(
pUas
,
&
UAS
::
satelliteCountChanged
,
this
,
&
MainToolBar
::
_setSatelliteCount
);
}
QGCUASParamManagerInterface
*
paramMgr
=
_mav
->
getParamManager
();
Q_ASSERT
(
paramMgr
);
connect
(
paramMgr
,
SIGNAL
(
parameterListProgress
(
float
)),
this
,
SLOT
(
_setProgressBarValue
(
float
)));
}
// Let toolbar know about it
emit
mavPresentChanged
(
_mav
!=
NULL
);
...
...
@@ -645,3 +652,9 @@ void MainToolBar::_setSatLoc(UASInterface*, int fix)
emit
satelliteLockChanged
(
_satelliteLock
);
}
}
void
MainToolBar
::
_setProgressBarValue
(
float
value
)
{
_progressBarValue
=
value
;
emit
progressBarValueChanged
(
value
);
}
src/ui/toolbar/MainToolBar.h
View file @
fbd8d66b
...
...
@@ -75,51 +75,31 @@ public:
Q_INVOKABLE
void
onEnterMessageArea
(
int
x
,
int
y
);
Q_INVOKABLE
QString
getMavIconColor
();
Q_PROPERTY
(
int
connectionCount
READ
connectionCount
NOTIFY
connectionCountChanged
)
Q_PROPERTY
(
double
batteryVoltage
READ
batteryVoltage
NOTIFY
batteryVoltageChanged
)
Q_PROPERTY
(
double
batteryPercent
READ
batteryPercent
NOTIFY
batteryPercentChanged
)
Q_PROPERTY
(
ViewType_t
currentView
READ
currentView
NOTIFY
currentViewChanged
)
Q_PROPERTY
(
QStringList
configList
READ
configList
NOTIFY
configListChanged
)
Q_PROPERTY
(
bool
systemArmed
READ
systemArmed
NOTIFY
systemArmedChanged
)
Q_PROPERTY
(
unsigned
int
heartbeatTimeout
READ
heartbeatTimeout
NOTIFY
heartbeatTimeoutChanged
)
Q_PROPERTY
(
QString
currentMode
READ
currentMode
NOTIFY
currentModeChanged
)
Q_PROPERTY
(
MessageType_t
messageType
READ
messageType
NOTIFY
messageTypeChanged
)
Q_PROPERTY
(
int
newMessageCount
READ
newMessageCount
NOTIFY
newMessageCountChanged
)
Q_PROPERTY
(
int
messageCount
READ
messageCount
NOTIFY
messageCountChanged
)
Q_PROPERTY
(
QString
currentConfig
READ
currentConfig
NOTIFY
currentConfigChanged
)
Q_PROPERTY
(
QString
systemPixmap
READ
systemPixmap
NOTIFY
systemPixmapChanged
)
Q_PROPERTY
(
int
satelliteCount
READ
satelliteCount
NOTIFY
satelliteCountChanged
)
Q_PROPERTY
(
QStringList
connectedList
READ
connectedList
NOTIFY
connectedListChanged
)
Q_PROPERTY
(
bool
mavPresent
READ
mavPresent
NOTIFY
mavPresentChanged
)
Q_PROPERTY
(
QString
currentState
READ
currentState
NOTIFY
currentStateChanged
)
Q_PROPERTY
(
int
satelliteLock
READ
satelliteLock
NOTIFY
satelliteLockChanged
)
Q_PROPERTY
(
bool
showGPS
READ
showGPS
NOTIFY
showGPSChanged
)
Q_PROPERTY
(
bool
showMav
READ
showMav
NOTIFY
showMavChanged
)
Q_PROPERTY
(
bool
showMessages
READ
showMessages
NOTIFY
showMessagesChanged
)
Q_PROPERTY
(
bool
showBattery
READ
showBattery
NOTIFY
showBatteryChanged
)
int
connectionCount
()
{
return
_connectionCount
;
}
double
batteryVoltage
()
{
return
_batteryVoltage
;
}
double
batteryPercent
()
{
return
_batteryPercent
;
}
ViewType_t
currentView
()
{
return
_currentView
;
}
QStringList
configList
()
{
return
_linkConfigurations
;
}
bool
systemArmed
()
{
return
_systemArmed
;
}
unsigned
int
heartbeatTimeout
()
{
return
_currentHeartbeatTimeout
;
}
QString
currentMode
()
{
return
_currentMode
;
}
MessageType_t
messageType
()
{
return
_currentMessageType
;
}
int
newMessageCount
()
{
return
_currentMessageCount
;
}
int
messageCount
()
{
return
_messageCount
;
}
QString
currentConfig
()
{
return
_currentConfig
;
}
QString
systemPixmap
()
{
return
_systemPixmap
;
}
int
satelliteCount
()
{
return
_satelliteCount
;
}
QStringList
connectedList
()
{
return
_connectedList
;
}
Q_PROPERTY
(
int
connectionCount
MEMBER
_connectionCount
NOTIFY
connectionCountChanged
)
Q_PROPERTY
(
double
batteryVoltage
MEMBER
_batteryVoltage
NOTIFY
batteryVoltageChanged
)
Q_PROPERTY
(
double
batteryPercent
MEMBER
_batteryPercent
NOTIFY
batteryPercentChanged
)
Q_PROPERTY
(
ViewType_t
currentView
MEMBER
_currentView
NOTIFY
currentViewChanged
)
Q_PROPERTY
(
QStringList
configList
MEMBER
_linkConfigurations
NOTIFY
configListChanged
)
Q_PROPERTY
(
bool
systemArmed
MEMBER
_systemArmed
NOTIFY
systemArmedChanged
)
Q_PROPERTY
(
unsigned
int
heartbeatTimeout
MEMBER
_currentHeartbeatTimeout
NOTIFY
heartbeatTimeoutChanged
)
Q_PROPERTY
(
QString
currentMode
MEMBER
_currentMode
NOTIFY
currentModeChanged
)
Q_PROPERTY
(
MessageType_t
messageType
MEMBER
_currentMessageType
NOTIFY
messageTypeChanged
)
Q_PROPERTY
(
int
newMessageCount
MEMBER
_currentMessageCount
NOTIFY
newMessageCountChanged
)
Q_PROPERTY
(
int
messageCount
MEMBER
_messageCount
NOTIFY
messageCountChanged
)
Q_PROPERTY
(
QString
currentConfig
MEMBER
_currentConfig
NOTIFY
currentConfigChanged
)
Q_PROPERTY
(
QString
systemPixmap
MEMBER
_systemPixmap
NOTIFY
systemPixmapChanged
)
Q_PROPERTY
(
int
satelliteCount
MEMBER
_satelliteCount
NOTIFY
satelliteCountChanged
)
Q_PROPERTY
(
QStringList
connectedList
MEMBER
_connectedList
NOTIFY
connectedListChanged
)
Q_PROPERTY
(
bool
mavPresent
READ
mavPresent
NOTIFY
mavPresentChanged
)
Q_PROPERTY
(
QString
currentState
MEMBER
_currentState
NOTIFY
currentStateChanged
)
Q_PROPERTY
(
int
satelliteLock
MEMBER
_satelliteLock
NOTIFY
satelliteLockChanged
)
Q_PROPERTY
(
bool
showGPS
MEMBER
_showGPS
NOTIFY
showGPSChanged
)
Q_PROPERTY
(
bool
showMav
MEMBER
_showMav
NOTIFY
showMavChanged
)
Q_PROPERTY
(
bool
showMessages
MEMBER
_showMessages
NOTIFY
showMessagesChanged
)
Q_PROPERTY
(
bool
showBattery
MEMBER
_showBattery
NOTIFY
showBatteryChanged
)
Q_PROPERTY
(
float
progressBarValue
MEMBER
_progressBarValue
NOTIFY
progressBarValueChanged
)
bool
mavPresent
()
{
return
_mav
!=
NULL
;
}
QString
currentState
()
{
return
_currentState
;
}
int
satelliteLock
()
{
return
_satelliteLock
;
}
bool
showGPS
()
{
return
_showGPS
;
}
bool
showMav
()
{
return
_showMav
;
}
bool
showMessages
()
{
return
_showMessages
;
}
bool
showBattery
()
{
return
_showBattery
;
}
void
setCurrentView
(
int
currentView
);
void
viewStateChanged
(
const
QString
&
key
,
bool
value
);
...
...
@@ -147,6 +127,7 @@ signals:
void
showMavChanged
(
bool
value
);
void
showMessagesChanged
(
bool
value
);
void
showBatteryChanged
(
bool
value
);
void
progressBarValueChanged
(
float
value
);
private
slots
:
void
_setActiveUAS
(
UASInterface
*
active
);
...
...
@@ -166,7 +147,7 @@ private slots:
void
_setSatelliteCount
(
double
val
,
QString
name
);
void
_leaveMessageView
();
void
_setSatLoc
(
UASInterface
*
uas
,
int
fix
);
void
_setProgressBarValue
(
float
value
);
private:
void
_updateConnection
(
LinkInterface
*
disconnectedLink
=
NULL
);
...
...
@@ -203,6 +184,7 @@ private:
bool
_showMav
;
bool
_showMessages
;
bool
_showBattery
;
float
_progressBarValue
;
UASMessageViewRollDown
*
_rollDownMessages
;
};
...
...
src/ui/toolbar/MainToolBar.qml
View file @
fbd8d66b
...
...
@@ -526,5 +526,15 @@ Rectangle {
}
}
// Progress bar
Rectangle
{
readonly
property
int
progressBarHeight
:
3
y
:
parent
.
height
-
progressBarHeight
height
:
progressBarHeight
width
:
parent
.
width
*
mainToolBar
.
progressBarValue
color
:
qgcPal
.
text
}
}
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