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
55cdf5db
Commit
55cdf5db
authored
Dec 21, 2010
by
lm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved and bugfixed window persistence
parent
e53a9d6f
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
546 additions
and
958 deletions
+546
-958
UASManager.cc
src/uas/UASManager.cc
+13
-1
DebugConsole.cc
src/ui/DebugConsole.cc
+24
-24
HDDisplay.cc
src/ui/HDDisplay.cc
+2
-2
HUD.cc
src/ui/HUD.cc
+10
-2
MainWindow.cc
src/ui/MainWindow.cc
+490
-922
MainWindow.h
src/ui/MainWindow.h
+7
-7
No files found.
src/uas/UASManager.cc
View file @
55cdf5db
...
@@ -71,6 +71,18 @@ void UASManager::run()
...
@@ -71,6 +71,18 @@ void UASManager::run()
void
UASManager
::
addUAS
(
UASInterface
*
uas
)
void
UASManager
::
addUAS
(
UASInterface
*
uas
)
{
{
// WARNING: The active uas is set here
// and then announced below. This is necessary
// to make sure the getActiveUAS() function
// returns the UAS once the UASCreated() signal
// is emitted. The code is thus NOT redundant.
bool
firstUAS
=
false
;
if
(
activeUAS
==
NULL
)
{
firstUAS
=
true
;
activeUAS
=
uas
;
}
// Only execute if there is no UAS at this index
// Only execute if there is no UAS at this index
if
(
!
systems
.
contains
(
uas
->
getUASID
()))
if
(
!
systems
.
contains
(
uas
->
getUASID
()))
{
{
...
@@ -79,7 +91,7 @@ void UASManager::addUAS(UASInterface* uas)
...
@@ -79,7 +91,7 @@ void UASManager::addUAS(UASInterface* uas)
}
}
// If there is no active UAS yet, set the first one as the active UAS
// If there is no active UAS yet, set the first one as the active UAS
if
(
activeUAS
==
NULL
)
if
(
firstUAS
)
{
{
setActiveUAS
(
uas
);
setActiveUAS
(
uas
);
}
}
...
...
src/ui/DebugConsole.cc
View file @
55cdf5db
...
@@ -205,30 +205,30 @@ void DebugConsole::paintEvent(QPaintEvent *event)
...
@@ -205,30 +205,30 @@ void DebugConsole::paintEvent(QPaintEvent *event)
{
{
Q_UNUSED
(
event
);
Q_UNUSED
(
event
);
// Update bandwidth
// Update bandwidth
if
(
holdOn
)
//
if (holdOn)
{
//
{
//qDebug() << "Data rate:" << dataRate/1000.0f << "kB/s";
//
//qDebug() << "Data rate:" << dataRate/1000.0f << "kB/s";
QString
rate
(
"data rate: %1"
);
//
QString rate("data rate: %1");
rate
.
arg
(
dataRate
);
//
rate.arg(dataRate);
QPainter
painter
(
this
);
//
QPainter painter(this);
painter
.
setRenderHint
(
QPainter
::
HighQualityAntialiasing
);
//
painter.setRenderHint(QPainter::HighQualityAntialiasing);
painter
.
translate
(
width
()
/
5.0
f
,
height
()
/
5.0
f
);
//
painter.translate(width()/5.0f, height()/5.0f);
//QFont font("Bitstream Vera Sans");
//
//QFont font("Bitstream Vera Sans");
QFont
font
=
painter
.
font
();
//
QFont font = painter.font();
font
.
setPixelSize
((
int
)(
60.0
f
));
//
font.setPixelSize((int)(60.0f));
QFontMetrics
metrics
=
QFontMetrics
(
font
);
//
QFontMetrics metrics = QFontMetrics(font);
int
border
=
qMax
(
4
,
metrics
.
leading
());
//
int border = qMax(4, metrics.leading());
QRect
rect
=
metrics
.
boundingRect
(
0
,
0
,
width
()
-
2
*
border
,
int
(
height
()
*
0.125
),
//
QRect rect = metrics.boundingRect(0, 0, width() - 2*border, int(height()*0.125),
Qt
::
AlignLeft
|
Qt
::
TextWordWrap
,
rate
);
//
Qt::AlignLeft | Qt::TextWordWrap, rate);
painter
.
setPen
(
QColor
(
255
,
50
,
50
));
//
painter.setPen(QColor(255, 50, 50));
painter
.
setRenderHint
(
QPainter
::
TextAntialiasing
);
//
painter.setRenderHint(QPainter::TextAntialiasing);
painter
.
drawText
(
QRect
(
QPoint
(
static_cast
<
int
>
(
width
()
/
5.0
f
),
static_cast
<
int
>
(
height
()
/
5.0
f
)),
QPoint
(
static_cast
<
int
>
(
width
()
-
width
()
/
5.0
f
),
static_cast
<
int
>
(
height
()
-
height
()
/
5.0
f
))),
rate
);
//
painter.drawText(QRect(QPoint(static_cast<int>(width()/5.0f), static_cast<int>(height()/5.0f)), QPoint(static_cast<int>(width() - width()/5.0f), static_cast<int>(height() - height()/5.0f))), rate);
//Qt::AlignRight | Qt::TextWordWrap
//
//Qt::AlignRight | Qt::TextWordWrap
}
//
}
}
}
void
DebugConsole
::
receiveBytes
(
LinkInterface
*
link
,
QByteArray
bytes
)
void
DebugConsole
::
receiveBytes
(
LinkInterface
*
link
,
QByteArray
bytes
)
...
...
src/ui/HDDisplay.cc
View file @
55cdf5db
...
@@ -134,7 +134,7 @@ HDDisplay::HDDisplay(QStringList* plotList, QWidget *parent) :
...
@@ -134,7 +134,7 @@ HDDisplay::HDDisplay(QStringList* plotList, QWidget *parent) :
if
(
!
QFile
::
exists
(
fontFileName
))
qDebug
()
<<
"ERROR! font file: "
<<
fontFileName
<<
" DOES NOT EXIST!"
;
if
(
!
QFile
::
exists
(
fontFileName
))
qDebug
()
<<
"ERROR! font file: "
<<
fontFileName
<<
" DOES NOT EXIST!"
;
fontDatabase
.
addApplicationFont
(
fontFileName
);
fontDatabase
.
addApplicationFont
(
fontFileName
);
font
=
fontDatabase
.
font
(
fontFamilyName
,
"Roman"
,
(
int
)(
10
*
scalingFactor
*
1.2
f
+
0.5
f
));
font
=
fontDatabase
.
font
(
fontFamilyName
,
"Roman"
,
qMax
(
5
,
(
int
)(
10
*
scalingFactor
*
1.2
f
+
0.5
f
)
));
if
(
font
.
family
()
!=
fontFamilyName
)
qDebug
()
<<
"ERROR! Font not loaded: "
<<
fontFamilyName
;
if
(
font
.
family
()
!=
fontFamilyName
)
qDebug
()
<<
"ERROR! Font not loaded: "
<<
fontFamilyName
;
// Connect with UAS
// Connect with UAS
...
@@ -151,7 +151,7 @@ HDDisplay::~HDDisplay()
...
@@ -151,7 +151,7 @@ HDDisplay::~HDDisplay()
void
HDDisplay
::
enableGLRendering
(
bool
enable
)
void
HDDisplay
::
enableGLRendering
(
bool
enable
)
{
{
Q_UNUSED
(
enable
)
}
}
void
HDDisplay
::
triggerUpdate
()
void
HDDisplay
::
triggerUpdate
()
...
...
src/ui/HUD.cc
View file @
55cdf5db
...
@@ -150,8 +150,16 @@ HUD::HUD(int width, int height, QWidget* parent)
...
@@ -150,8 +150,16 @@ HUD::HUD(int width, int height, QWidget* parent)
if
(
!
QFile
::
exists
(
fontFileName
))
qDebug
()
<<
"ERROR! font file: "
<<
fontFileName
<<
" DOES NOT EXIST!"
;
if
(
!
QFile
::
exists
(
fontFileName
))
qDebug
()
<<
"ERROR! font file: "
<<
fontFileName
<<
" DOES NOT EXIST!"
;
fontDatabase
.
addApplicationFont
(
fontFileName
);
fontDatabase
.
addApplicationFont
(
fontFileName
);
font
=
fontDatabase
.
font
(
fontFamilyName
,
"Roman"
,
(
int
)(
10
*
scalingFactor
*
1.2
f
+
0.5
f
));
font
=
fontDatabase
.
font
(
fontFamilyName
,
"Roman"
,
qMax
(
5
,(
int
)(
10.0
f
*
scalingFactor
*
1.2
f
+
0.5
f
)));
if
(
font
.
family
()
!=
fontFamilyName
)
qDebug
()
<<
"ERROR! Font not loaded: "
<<
fontFamilyName
;
QFont
*
fontPtr
=
&
font
;
if
(
!
fontPtr
)
{
qDebug
()
<<
"ERROR! FONT NOT LOADED!"
;
}
else
{
if
(
font
.
family
()
!=
fontFamilyName
)
qDebug
()
<<
"ERROR! WRONG FONT LOADED: "
<<
fontFamilyName
;
}
// Connect with UAS
// Connect with UAS
UASManager
*
manager
=
UASManager
::
instance
();
UASManager
*
manager
=
UASManager
::
instance
();
...
...
src/ui/MainWindow.cc
View file @
55cdf5db
This diff is collapsed.
Click to expand it.
src/ui/MainWindow.h
View file @
55cdf5db
...
@@ -138,17 +138,14 @@ public slots:
...
@@ -138,17 +138,14 @@ public slots:
/** @brief Reload the CSS style sheet */
/** @brief Reload the CSS style sheet */
void
reloadStylesheet
();
void
reloadStylesheet
();
void
closeEvent
(
QCloseEvent
*
event
);
/*
/*
==========================================================
==========================================================
Potentially Deprecated
Potentially Deprecated
==========================================================
==========================================================
*/
*/
void
loadPixhawkEngineerView
();
/** @brief Load view with all widgets */
void
loadAllView
();
void
loadWidgets
();
void
loadWidgets
();
/** @brief Load data view, allowing to plot flight data */
/** @brief Load data view, allowing to plot flight data */
...
@@ -228,13 +225,15 @@ protected:
...
@@ -228,13 +225,15 @@ protected:
}
TOOLS_WIDGET_NAMES
;
}
TOOLS_WIDGET_NAMES
;
typedef
enum
_SETTINGS_SECTIONS
{
typedef
enum
_SETTINGS_SECTIONS
{
SECTION_MENU
,
SECTION_MENU
,
SUB_SECTION_CHECKED
,
SUB_SECTION_CHECKED
,
SUB_SECTION_LOCATION
,
SUB_SECTION_LOCATION
,
}
SETTINGS_SECTIONS
;
}
SETTINGS_SECTIONS
;
typedef
enum
_VIEW_SECTIONS
{
typedef
enum
_VIEW_SECTIONS
{
VIEW_ENGINEER
,
VIEW_ENGINEER
,
VIEW_OPERATOR
,
VIEW_OPERATOR
,
VIEW_PILOT
,
VIEW_PILOT
,
...
@@ -301,6 +300,7 @@ protected:
...
@@ -301,6 +300,7 @@ protected:
/** @brief Keeps track of the current view */
/** @brief Keeps track of the current view */
VIEW_SECTIONS
currentView
;
VIEW_SECTIONS
currentView
;
bool
aboutToCloseFlag
;
QStatusBar
*
statusBar
;
QStatusBar
*
statusBar
;
QStatusBar
*
createStatusBar
();
QStatusBar
*
createStatusBar
();
...
...
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