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
49c71137
Commit
49c71137
authored
Apr 13, 2010
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor improvements in UAS display
parent
36a43a28
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
60 deletions
+39
-60
mavlink.pri
mavlink.pri
+0
-28
Core.cc
src/Core.cc
+2
-10
Core.h
src/Core.h
+1
-3
UASView.ui
src/ui/UASView.ui
+2
-2
UASView.cc
src/ui/uas/UASView.cc
+30
-16
UASView.h
src/ui/uas/UASView.h
+4
-1
No files found.
mavlink.pri
deleted
100644 → 0
View file @
36a43a28
# -------------------------------------------------
# MAVGround - Micro Air Vehicle Groundstation
# Please see our website at <http://pixhawk.ethz.ch>
# Original Author:
# Lorenz Meier <mavteam@student.ethz.ch>
# Contributing Authors (in alphabetical order):
# (c) 2009 PIXHAWK Team
# This file is part of the mav groundstation project
# MAVGround is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# MAVGround is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with MAVGround. If not, see <http://www.gnu.org/licenses/>.
# ABOUT THIS FILE:
# This file includes the MAVLink protocol from outside the groundstation directory
# Change the MAVLINKDIR to whereever the MAVLink .c and .h files are located.
# DO NOT USE A TRAILING SLASH!
# ------------------------------------------------------------------------------
MAVLINKDIR = ../embedded/src/comm/mavlink
INCLUDEPATH += $$MAVLINKDIR
HEADERS += \
$$MAVLINKDIR/mavlink.h
SOURCES += $$MAVLINKDIR/protocol.c
src/Core.cc
View file @
49c71137
...
...
@@ -94,12 +94,12 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
// Start the user interface
splashScreen
->
showMessage
(
tr
(
"Starting User Interface"
),
Qt
::
AlignLeft
|
Qt
::
AlignBottom
,
QColor
(
62
,
93
,
141
));
startUI
();
// Start UI
mainWindow
=
new
MainWindow
();
// Remove splash screen
splashScreen
->
finish
(
mainWindow
);
}
/**
...
...
@@ -133,12 +133,4 @@ void Core::startUASManager()
UASManager
::
instance
();
}
/**
* @brief Start and show the user interface.
**/
void
Core
::
startUI
()
{
// Start UI
mainWindow
=
new
MainWindow
();
}
src/Core.h
View file @
49c71137
...
...
@@ -23,7 +23,7 @@ This file is part of the PIXHAWK project
/**
* @file
* @brief
M
ain class
* @brief
Definition of m
ain class
*
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
...
...
@@ -65,8 +65,6 @@ protected:
**/
void
startUASManager
();
void
startUI
();
private:
MainWindow
*
mainWindow
;
//ViconTarsusProtocol* tarsus;
...
...
src/ui/UASView.ui
View file @
49c71137
...
...
@@ -7,7 +7,7 @@
<x>
0
</x>
<y>
0
</y>
<width>
362
</width>
<height>
1
16
</height>
<height>
1
20
</height>
</rect>
</property>
<property
name=
"sizePolicy"
>
...
...
@@ -201,7 +201,7 @@ QProgressBar::chunk#thrustBar {
<number>
6
</number>
</property>
<item>
<widget
class=
"QGroupBox"
name=
"
groupBox
"
>
<widget
class=
"QGroupBox"
name=
"
uasViewFrame
"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Maximum"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
...
...
src/ui/uas/UASView.cc
View file @
49c71137
...
...
@@ -45,6 +45,7 @@ UASView::UASView(UASInterface* uas, QWidget *parent) :
stateDesc
(
tr
(
"Unknown system state"
)),
mode
(
"MAV_MODE_UNKNOWN"
),
thrust
(
0
),
isActive
(
false
),
m_ui
(
new
Ui
::
UASView
)
{
this
->
uas
=
uas
;
...
...
@@ -67,7 +68,7 @@ UASView::UASView(UASInterface* uas, QWidget *parent) :
connect
(
uas
,
SIGNAL
(
systemTypeSet
(
UASInterface
*
,
uint
)),
this
,
SLOT
(
setSystemType
(
UASInterface
*
,
uint
)));
// Setup UAS selection
connect
(
m_ui
->
groupBox
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
setUASasActive
(
bool
)));
connect
(
m_ui
->
uasViewFrame
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
setUASasActive
(
bool
)));
// Setup user interaction
connect
(
m_ui
->
liftoffButton
,
SIGNAL
(
clicked
()),
uas
,
SLOT
(
launch
()));
...
...
@@ -90,20 +91,7 @@ UASView::UASView(UASInterface* uas, QWidget *parent) :
m_ui
->
nameLabel
->
setText
(
uas
->
getUASName
());
}
// Get min/max values from UAS
// TODO get these values from UAS
//m_ui->speedBar->setMinimum(0);
//m_ui->speedBar->setMaximum(15);
// UAS color
QColor
uasColor
=
uas
->
getColor
();
uasColor
=
uasColor
.
darker
(
475
);
QString
colorstyle
;
colorstyle
=
colorstyle
.
sprintf
(
"QGroupBox { border: 2px solid #4A4A4F; border-radius: 5px; padding: 0px; margin: 0px; background-color: #%02X%02X%02X;}"
,
uasColor
.
red
(),
uasColor
.
green
(),
uasColor
.
blue
());
m_ui
->
groupBox
->
setStyleSheet
(
colorstyle
);
//m_ui->groupBox->setAutoFillBackground(true);
setBackgroundColor
();
// Heartbeat fade
refreshTimer
=
new
QTimer
(
this
);
...
...
@@ -116,9 +104,35 @@ UASView::~UASView()
delete
m_ui
;
}
void
UASView
::
setUASasActive
(
bool
)
/**
* Set the background color based on the MAV color. If the MAV is selected as the
* currently actively controlled system, the frame color is highlighted
*/
void
UASView
::
setBackgroundColor
()
{
// UAS color
QColor
uasColor
=
uas
->
getColor
();
QString
colorstyle
;
QString
borderColor
=
"#4A4A4F"
;
if
(
isActive
)
{
borderColor
=
"#FA4A4F"
;
uasColor
=
uasColor
.
darker
(
475
);
}
else
{
uasColor
=
uasColor
.
darker
(
675
);
}
colorstyle
=
colorstyle
.
sprintf
(
"QGroupBox { border-radius: 5px; padding: 0px; margin: 0px; background-color: #%02X%02X%02X; border: 2px solid %s; }"
,
uasColor
.
red
(),
uasColor
.
green
(),
uasColor
.
blue
(),
borderColor
.
toStdString
().
c_str
());
m_ui
->
uasViewFrame
->
setStyleSheet
(
colorstyle
);
}
void
UASView
::
setUASasActive
(
bool
active
)
{
UASManager
::
instance
()
->
setActiveUAS
(
this
->
uas
);
this
->
isActive
=
active
;
setBackgroundColor
();
}
void
UASView
::
updateMode
(
int
sysId
,
QString
status
,
QString
description
)
...
...
src/ui/uas/UASView.h
View file @
49c71137
...
...
@@ -69,6 +69,8 @@ public slots:
void
setSystemType
(
UASInterface
*
uas
,
unsigned
int
systemType
);
/** @brief Set the current UAS as the globally active system */
void
setUASasActive
(
bool
);
/** @brief Set the background color for the widget */
void
setBackgroundColor
();
protected:
void
changeEvent
(
QEvent
*
e
);
...
...
@@ -82,7 +84,8 @@ protected:
QString
state
;
QString
stateDesc
;
QString
mode
;
double
thrust
;
double
thrust
;
///< Current vehicle thrust: 0 - 1.0 for 100% thrust
bool
isActive
;
///< Is this MAV selected by the user?
void
mouseDoubleClickEvent
(
QMouseEvent
*
event
);
/** @brief Mouse enters the widget */
...
...
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