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
53c6a9f1
Commit
53c6a9f1
authored
Oct 19, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2048 from DonLakeFlyer/SensorCal
Reset internal state correctly
parents
f53d60d3
a0e03501
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
14 deletions
+36
-14
SensorsComponentController.cc
src/AutoPilotPlugins/PX4/SensorsComponentController.cc
+32
-14
SensorsComponentController.h
src/AutoPilotPlugins/PX4/SensorsComponentController.h
+4
-0
No files found.
src/AutoPilotPlugins/PX4/SensorsComponentController.cc
View file @
53c6a9f1
...
@@ -32,6 +32,8 @@
...
@@ -32,6 +32,8 @@
#include <QVariant>
#include <QVariant>
#include <QQmlProperty>
#include <QQmlProperty>
QGC_LOGGING_CATEGORY
(
SensorsComponentControllerLog
,
"SensorsComponentControllerLog"
)
SensorsComponentController
::
SensorsComponentController
(
void
)
:
SensorsComponentController
::
SensorsComponentController
(
void
)
:
_statusLog
(
NULL
),
_statusLog
(
NULL
),
_progressBar
(
NULL
),
_progressBar
(
NULL
),
...
@@ -106,10 +108,38 @@ void SensorsComponentController::_startVisualCalibration(void)
...
@@ -106,10 +108,38 @@ void SensorsComponentController::_startVisualCalibration(void)
_airspeedButton
->
setEnabled
(
false
);
_airspeedButton
->
setEnabled
(
false
);
_levelButton
->
setEnabled
(
false
);
_levelButton
->
setEnabled
(
false
);
_cancelButton
->
setEnabled
(
true
);
_cancelButton
->
setEnabled
(
true
);
_resetInternalState
();
_progressBar
->
setProperty
(
"value"
,
0
);
_progressBar
->
setProperty
(
"value"
,
0
);
}
}
void
SensorsComponentController
::
_resetInternalState
(
void
)
{
_orientationCalDownSideDone
=
true
;
_orientationCalUpsideDownSideDone
=
true
;
_orientationCalLeftSideDone
=
true
;
_orientationCalRightSideDone
=
true
;
_orientationCalTailDownSideDone
=
true
;
_orientationCalNoseDownSideDone
=
true
;
_orientationCalDownSideInProgress
=
false
;
_orientationCalUpsideDownSideInProgress
=
false
;
_orientationCalLeftSideInProgress
=
false
;
_orientationCalRightSideInProgress
=
false
;
_orientationCalNoseDownSideInProgress
=
false
;
_orientationCalTailDownSideInProgress
=
false
;
_orientationCalDownSideRotate
=
false
;
_orientationCalUpsideDownSideRotate
=
false
;
_orientationCalLeftSideRotate
=
false
;
_orientationCalRightSideRotate
=
false
;
_orientationCalNoseDownSideRotate
=
false
;
_orientationCalTailDownSideRotate
=
false
;
emit
orientationCalSidesRotateChanged
();
emit
orientationCalSidesDoneChanged
();
emit
orientationCalSidesInProgressChanged
();
}
void
SensorsComponentController
::
_stopCalibration
(
SensorsComponentController
::
StopCalibrationCode
code
)
void
SensorsComponentController
::
_stopCalibration
(
SensorsComponentController
::
StopCalibrationCode
code
)
{
{
disconnect
(
_uas
,
&
UASInterface
::
textMessageReceived
,
this
,
&
SensorsComponentController
::
_handleUASTextMessage
);
disconnect
(
_uas
,
&
UASInterface
::
textMessageReceived
,
this
,
&
SensorsComponentController
::
_handleUASTextMessage
);
...
@@ -122,20 +152,7 @@ void SensorsComponentController::_stopCalibration(SensorsComponentController::St
...
@@ -122,20 +152,7 @@ void SensorsComponentController::_stopCalibration(SensorsComponentController::St
_cancelButton
->
setEnabled
(
false
);
_cancelButton
->
setEnabled
(
false
);
if
(
code
==
StopCalibrationSuccess
)
{
if
(
code
==
StopCalibrationSuccess
)
{
_orientationCalDownSideDone
=
true
;
_resetInternalState
();
_orientationCalUpsideDownSideDone
=
true
;
_orientationCalLeftSideDone
=
true
;
_orientationCalRightSideDone
=
true
;
_orientationCalTailDownSideDone
=
true
;
_orientationCalNoseDownSideDone
=
true
;
_orientationCalDownSideInProgress
=
false
;
_orientationCalUpsideDownSideInProgress
=
false
;
_orientationCalLeftSideInProgress
=
false
;
_orientationCalRightSideInProgress
=
false
;
_orientationCalNoseDownSideInProgress
=
false
;
_orientationCalTailDownSideInProgress
=
false
;
emit
orientationCalSidesDoneChanged
();
emit
orientationCalSidesInProgressChanged
();
_progressBar
->
setProperty
(
"value"
,
1
);
_progressBar
->
setProperty
(
"value"
,
1
);
}
else
{
}
else
{
...
@@ -226,6 +243,7 @@ void SensorsComponentController::_handleUASTextMessage(int uasId, int compId, in
...
@@ -226,6 +243,7 @@ void SensorsComponentController::_handleUASTextMessage(int uasId, int compId, in
}
}
_appendStatusLog
(
text
);
_appendStatusLog
(
text
);
qCDebug
(
SensorsComponentControllerLog
)
<<
text
;
if
(
_unknownFirmwareVersion
)
{
if
(
_unknownFirmwareVersion
)
{
// We don't know how to do visual cal with the version of firwmare
// We don't know how to do visual cal with the version of firwmare
...
...
src/AutoPilotPlugins/PX4/SensorsComponentController.h
View file @
53c6a9f1
...
@@ -32,6 +32,9 @@
...
@@ -32,6 +32,9 @@
#include "UASInterface.h"
#include "UASInterface.h"
#include "FactPanelController.h"
#include "FactPanelController.h"
#include "QGCLoggingCategory.h"
Q_DECLARE_LOGGING_CATEGORY
(
SensorsComponentControllerLog
)
/// Sensors Component MVC Controller for SensorsComponent.qml.
/// Sensors Component MVC Controller for SensorsComponent.qml.
class
SensorsComponentController
:
public
FactPanelController
class
SensorsComponentController
:
public
FactPanelController
...
@@ -115,6 +118,7 @@ private:
...
@@ -115,6 +118,7 @@ private:
void
_appendStatusLog
(
const
QString
&
text
);
void
_appendStatusLog
(
const
QString
&
text
);
void
_refreshParams
(
void
);
void
_refreshParams
(
void
);
void
_hideAllCalAreas
(
void
);
void
_hideAllCalAreas
(
void
);
void
_resetInternalState
(
void
);
enum
StopCalibrationCode
{
enum
StopCalibrationCode
{
StopCalibrationSuccess
,
StopCalibrationSuccess
,
...
...
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