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
081af596
Commit
081af596
authored
Feb 23, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added progress bar support back
parent
fd6b895b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
18 deletions
+34
-18
FirmwareUpgrade.qml
src/VehicleSetup/FirmwareUpgrade.qml
+21
-0
FirmwareUpgradeController.cc
src/VehicleSetup/FirmwareUpgradeController.cc
+6
-18
FirmwareUpgradeController.h
src/VehicleSetup/FirmwareUpgradeController.h
+7
-0
No files found.
src/VehicleSetup/FirmwareUpgrade.qml
View file @
081af596
...
...
@@ -14,6 +14,7 @@ Rectangle {
property
var
qgcPal
:
QGCPalette
{
colorGroupEnabled
:
true
}
property
FirmwareUpgradeController
controller
:
FirmwareUpgradeController
{
upgradeButton
:
upgradeButton
progressBar
:
progressBar
statusLog
:
statusTextArea
firmwareType
:
FirmwareUpgradeController
.
StableFirmware
}
...
...
@@ -35,6 +36,21 @@ Rectangle {
width
:
10
}
/*
_ui->statusLog->setText(tr("WARNING: BETA FIRMWARE\n"
- "This firmware version is ONLY intended for beta testers. "
- "Although it has received FLIGHT TESTING, it represents actively changed code. Do NOT use for normal operation.\n\n"
- SELECT_FIRMWARE_LICENSE));
- break;
-
- case 2:
- _ui->statusLog->setText(tr("WARNING: CONTINUOUS BUILD FIRMWARE\n"
- "This firmware has NOT BEEN FLIGHT TESTED. "
- "It is only intended for DEVELOPERS. Run bench tests without props first. "
- "Do NOT fly this without addional safety precautions. Follow the mailing "
- "list actively when using it.\n\n"
- SELECT_FIRMWARE_LICENSE));
*/
ExclusiveGroup
{
id
:
firmwareGroup
}
QGCRadioButton
{
...
...
@@ -90,6 +106,11 @@ Rectangle {
width
:
10
}
ProgressBar
{
id
:
progressBar
width
:
parent
.
width
}
TextArea
{
id
:
statusTextArea
width
:
parent
.
width
...
...
src/VehicleSetup/FirmwareUpgradeController.cc
View file @
081af596
...
...
@@ -50,15 +50,6 @@ FirmwareUpgradeController::FirmwareUpgradeController(void) :
_threadController
=
new
PX4FirmwareUpgradeThreadController
(
this
);
Q_CHECK_PTR
(
_threadController
);
/*
// FIXME: NYI
// Connect standard ui elements
connect(_ui->tryAgain, &QPushButton::clicked, this, &FirmwareUpgradeController::_tryAgainButton);
connect(_ui->cancel, &QPushButton::clicked, this, &FirmwareUpgradeController::_cancelButton);
connect(_ui->next, &QPushButton::clicked, this, &FirmwareUpgradeController::_nextButton);
connect(_ui->firmwareCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(_firmwareSelected(int)));
*/
connect
(
_threadController
,
&
PX4FirmwareUpgradeThreadController
::
foundBoard
,
this
,
&
FirmwareUpgradeController
::
_foundBoard
);
connect
(
_threadController
,
&
PX4FirmwareUpgradeThreadController
::
foundBootloader
,
this
,
&
FirmwareUpgradeController
::
_foundBootloader
);
connect
(
_threadController
,
&
PX4FirmwareUpgradeThreadController
::
bootloaderSyncFailed
,
this
,
&
FirmwareUpgradeController
::
_bootloaderSyncFailed
);
...
...
@@ -309,9 +300,7 @@ void FirmwareUpgradeController::_downloadProgress(qint64 curr, qint64 total)
{
// Take care of cases where 0 / 0 is emitted as error return value
if
(
total
>
0
)
{
// FIXME: NYI
Q_UNUSED
(
curr
);
//_ui->progressBar->setValue((curr*100) / total);
_progressBar
->
setProperty
(
"value"
,
(
float
)
curr
/
(
float
)
total
);
}
}
...
...
@@ -569,10 +558,10 @@ void FirmwareUpgradeController::_error(const int command, const QString errorStr
/// @brief Updates the progress bar from long running bootloader commands
void
FirmwareUpgradeController
::
_updateProgress
(
int
curr
,
int
total
)
{
//
FIXME: NYI
Q_UNUSED
(
curr
);
Q_UNUSED
(
total
);
// _ui->progressBar->setValue((curr*100) / total);
//
Take care of cases where 0 / 0 is emitted as error return value
if
(
total
>
0
)
{
_progressBar
->
setProperty
(
"value"
,
(
float
)
curr
/
(
float
)
total
);
}
}
/// @brief Resets the state machine back to the beginning
...
...
@@ -586,8 +575,7 @@ void FirmwareUpgradeController::_restart(void)
void
FirmwareUpgradeController
::
_eraseProgressTick
(
void
)
{
_eraseTickCount
++
;
// FIXME: NYI
// _ui->progressBar->setValue((_eraseTickCount*_eraseTickMsec*100) / _eraseTotalMsec);
_progressBar
->
setProperty
(
"value"
,
(
float
)(
_eraseTickCount
*
_eraseTickMsec
)
/
(
float
)
_eraseTotalMsec
);
}
void
FirmwareUpgradeController
::
doFirmwareUpgrade
(
void
)
...
...
src/VehicleSetup/FirmwareUpgradeController.h
View file @
081af596
...
...
@@ -68,6 +68,9 @@ public:
/// TextArea for log output
Q_PROPERTY
(
QQuickItem
*
statusLog
READ
statusLog
WRITE
setStatusLog
)
/// Progress bar for you know what
Q_PROPERTY
(
QQuickItem
*
progressBar
READ
progressBar
WRITE
setProgressBar
)
/// Begins the firware upgrade process
Q_INVOKABLE
void
doFirmwareUpgrade
(
void
);
...
...
@@ -77,6 +80,9 @@ public:
QQuickItem
*
upgradeButton
(
void
)
{
return
_upgradeButton
;
}
void
setUpgradeButton
(
QQuickItem
*
upgradeButton
)
{
_upgradeButton
=
upgradeButton
;
}
QQuickItem
*
progressBar
(
void
)
{
return
_progressBar
;
}
void
setProgressBar
(
QQuickItem
*
progressBar
)
{
_progressBar
=
progressBar
;
}
QQuickItem
*
statusLog
(
void
)
{
return
_statusLog
;
}
void
setStatusLog
(
QQuickItem
*
statusLog
)
{
_statusLog
=
statusLog
;
}
...
...
@@ -141,6 +147,7 @@ private:
FirmwareType_t
_firmwareType
;
///< Firmware type to load
QQuickItem
*
_upgradeButton
;
///< Upgrade button in ui
QQuickItem
*
_statusLog
;
///< Status log TextArea Qml control
QQuickItem
*
_progressBar
;
bool
_searchingForBoard
;
///< true: searching for board, false: search for bootloader
};
...
...
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