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
b6c11a8d
Commit
b6c11a8d
authored
Jul 14, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
System switching fixed and tested
parent
0519924a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
30 deletions
+35
-30
PrimaryFlightDisplay.cc
src/ui/PrimaryFlightDisplay.cc
+33
-28
PrimaryFlightDisplay.h
src/ui/PrimaryFlightDisplay.h
+2
-2
No files found.
src/ui/PrimaryFlightDisplay.cc
View file @
b6c11a8d
...
...
@@ -170,17 +170,16 @@ PrimaryFlightDisplay::PrimaryFlightDisplay(int width, int height, QWidget *paren
setSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Expanding
);
// Connect with UAS signal
connect
(
UASManager
::
instance
(),
SIGNAL
(
UASCreated
(
UASInterface
*
)),
this
,
SLOT
(
addUAS
(
UASInterface
*
)));
// connect(UASManager::instance(), SIGNAL(UASDeleted(UASInterface*)), this, SLOT(forgetUAS(UASInterface*)));
//connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)), this, SLOT(addUAS(UASInterface*)));
connect
(
UASManager
::
instance
(),
SIGNAL
(
UASDeleted
(
UASInterface
*
)),
this
,
SLOT
(
forgetUAS
(
UASInterface
*
)));
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
setActiveUAS
(
UASInterface
*
)));
// Get a list of all existing UAS and - well attach to one of them. The first one.
foreach
(
UASInterface
*
uas
,
UASManager
::
instance
()
->
getUASList
())
{
addUAS
(
uas
);
}
//
// Get a list of all existing UAS and - well attach to one of them. The first one.
//
foreach (UASInterface* uas, UASManager::instance()->getUASList()) {
//
addUAS(uas);
//
}
if
(
UASManager
::
instance
()
->
getActiveUAS
()
!=
NULL
)
setActiveUAS
(
UASManager
::
instance
()
->
getActiveUAS
());
setActiveUAS
(
UASManager
::
instance
()
->
getActiveUAS
());
// Refresh timer
refreshTimer
->
setInterval
(
updateInterval
);
...
...
@@ -250,27 +249,23 @@ void PrimaryFlightDisplay::paintEvent(QPaintEvent *event)
doPaint
();
}
/*
* Interface towards qgroundcontrol
*/
void
PrimaryFlightDisplay
::
addUAS
(
UASInterface
*
uas
)
///*
// * Interface towards qgroundcontrol
// */
//void PrimaryFlightDisplay::addUAS(UASInterface* uas)
//{
// if (uas)
// {
// if (!this->uas)
// {
// setActiveUAS(uas);
// }
// }
//}
void
PrimaryFlightDisplay
::
forgetUAS
(
UASInterface
*
uas
)
{
if
(
uas
)
{
if
(
!
this
->
uas
)
{
setActiveUAS
(
uas
);
}
}
}
/**
*
* @param uas the UAS/MAV to monitor/display with the HUD
*/
void
PrimaryFlightDisplay
::
setActiveUAS
(
UASInterface
*
uas
)
{
if
(
this
->
uas
!=
NULL
)
{
if
(
this
->
uas
!=
NULL
&&
this
->
uas
==
uas
)
{
// Disconnect any previously connected active MAV
disconnect
(
this
->
uas
,
SIGNAL
(
attitudeChanged
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
updateAttitude
(
UASInterface
*
,
double
,
double
,
double
,
quint64
)));
disconnect
(
this
->
uas
,
SIGNAL
(
attitudeChanged
(
UASInterface
*
,
int
,
double
,
double
,
double
,
quint64
)),
this
,
SLOT
(
updateAttitude
(
UASInterface
*
,
int
,
double
,
double
,
double
,
quint64
)));
...
...
@@ -290,6 +285,16 @@ void PrimaryFlightDisplay::setActiveUAS(UASInterface* uas)
//disconnect(this->uas, SIGNAL(satelliteCountChanged(double, QString)), this, SLOT(updateSatelliteCount(double, QString)));
//disconnect(this->uas, SIGNAL(localizationChanged(UASInterface* uas, int fix)), this, SLOT(updateGPSFixType(UASInterface*,int)));
}
}
/**
*
* @param uas the UAS/MAV to monitor/display with the HUD
*/
void
PrimaryFlightDisplay
::
setActiveUAS
(
UASInterface
*
uas
)
{
// Disconnect the previous one (if any)
forgetUAS
(
this
->
uas
);
if
(
uas
)
{
// Now connect the new UAS
...
...
src/ui/PrimaryFlightDisplay.h
View file @
b6c11a8d
...
...
@@ -26,8 +26,8 @@ public slots:
void
updateNavigationControllerErrors
(
UASInterface
*
uas
,
double
altitudeError
,
double
speedError
,
double
xtrackError
);
/** @brief Set the currently monitored UAS */
void
addUAS
(
UASInterface
*
uas
);
//
void forgetUAS(UASInterface* uas);
//
void addUAS(UASInterface* uas);
void
forgetUAS
(
UASInterface
*
uas
);
void
setActiveUAS
(
UASInterface
*
uas
);
protected:
...
...
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