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
eb676850
Commit
eb676850
authored
Aug 07, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
f7e8ba99
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
23 deletions
+52
-23
QGCQmlWidgetHolder.cpp
src/QGCQmlWidgetHolder.cpp
+6
-1
QGCQmlWidgetHolder.h
src/QGCQmlWidgetHolder.h
+3
-0
MainToolBar.cc
src/ui/toolbar/MainToolBar.cc
+8
-0
MainToolBar.h
src/ui/toolbar/MainToolBar.h
+21
-14
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+14
-8
No files found.
src/QGCQmlWidgetHolder.cpp
View file @
eb676850
...
...
@@ -30,7 +30,7 @@ QGCQmlWidgetHolder::QGCQmlWidgetHolder(QWidget *parent) :
QWidget
(
parent
)
{
_ui
.
setupUi
(
this
);
_ui
.
qmlWidget
->
setResizeMode
(
QQuickWidget
::
SizeRootObjectToView
);
setResizeMode
(
QQuickWidget
::
SizeRootObjectToView
);
}
QGCQmlWidgetHolder
::~
QGCQmlWidgetHolder
()
...
...
@@ -62,3 +62,8 @@ QQuickItem* QGCQmlWidgetHolder::getRootObject(void)
{
return
_ui
.
qmlWidget
->
rootObject
();
}
void
QGCQmlWidgetHolder
::
setResizeMode
(
QQuickWidget
::
ResizeMode
resizeMode
)
{
_ui
.
qmlWidget
->
setResizeMode
(
resizeMode
);
}
\ No newline at end of file
src/QGCQmlWidgetHolder.h
View file @
eb676850
...
...
@@ -60,6 +60,9 @@ public:
bool
setSource
(
const
QUrl
&
qmlUrl
);
void
setContextPropertyObject
(
const
QString
&
name
,
QObject
*
object
);
/// Sets the resize mode for the QQuickWidget container
void
setResizeMode
(
QQuickWidget
::
ResizeMode
resizeMode
);
private:
Ui
::
QGCQmlWidgetHolder
_ui
;
...
...
src/ui/toolbar/MainToolBar.cc
View file @
eb676850
...
...
@@ -92,6 +92,8 @@ MainToolBar::MainToolBar(QWidget* parent)
SLOT
(
_telemetryChanged
(
LinkInterface
*
,
unsigned
,
unsigned
,
unsigned
,
unsigned
,
unsigned
,
unsigned
,
unsigned
)));
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
_setActiveUAS
(
UASInterface
*
)));
connect
(
UASManager
::
instance
(),
SIGNAL
(
UASDeleted
(
UASInterface
*
)),
this
,
SLOT
(
_forgetUAS
(
UASInterface
*
)));
connect
(
this
,
&
MainToolBar
::
heightChanged
,
this
,
&
MainToolBar
::
_heightChanged
);
}
MainToolBar
::~
MainToolBar
()
...
...
@@ -396,3 +398,9 @@ void MainToolBar::_setProgressBarValue(float value)
_progressBarValue
=
value
;
emit
progressBarValueChanged
(
value
);
}
void
MainToolBar
::
_heightChanged
(
double
height
)
{
setMinimumHeight
(
height
);
setMaximumHeight
(
height
);
}
src/ui/toolbar/MainToolBar.h
View file @
eb676850
...
...
@@ -69,19 +69,20 @@ public:
Q_INVOKABLE
void
onDisconnect
(
QString
conf
);
Q_INVOKABLE
void
onEnterMessageArea
(
int
x
,
int
y
);
Q_PROPERTY
(
ViewType_t
currentView
MEMBER
_currentView
NOTIFY
currentViewChanged
)
Q_PROPERTY
(
QStringList
configList
MEMBER
_linkConfigurations
NOTIFY
configListChanged
)
Q_PROPERTY
(
int
connectionCount
READ
connectionCount
NOTIFY
connectionCountChanged
)
Q_PROPERTY
(
QStringList
connectedList
MEMBER
_connectedList
NOTIFY
connectedListChanged
)
Q_PROPERTY
(
bool
showGPS
MEMBER
_showGPS
NOTIFY
showGPSChanged
)
Q_PROPERTY
(
bool
showMav
MEMBER
_showMav
NOTIFY
showMavChanged
)
Q_PROPERTY
(
bool
showMessages
MEMBER
_showMessages
NOTIFY
showMessagesChanged
)
Q_PROPERTY
(
bool
showBattery
MEMBER
_showBattery
NOTIFY
showBatteryChanged
)
Q_PROPERTY
(
bool
showRSSI
MEMBER
_showRSSI
NOTIFY
showRSSIChanged
)
Q_PROPERTY
(
float
progressBarValue
MEMBER
_progressBarValue
NOTIFY
progressBarValueChanged
)
Q_PROPERTY
(
int
remoteRSSI
READ
remoteRSSI
NOTIFY
remoteRSSIChanged
)
Q_PROPERTY
(
int
telemetryRRSSI
READ
telemetryRRSSI
NOTIFY
telemetryRRSSIChanged
)
Q_PROPERTY
(
int
telemetryLRSSI
READ
telemetryLRSSI
NOTIFY
telemetryLRSSIChanged
)
Q_PROPERTY
(
double
height
MEMBER
_toolbarHeight
NOTIFY
heightChanged
)
Q_PROPERTY
(
ViewType_t
currentView
MEMBER
_currentView
NOTIFY
currentViewChanged
)
Q_PROPERTY
(
QStringList
configList
MEMBER
_linkConfigurations
NOTIFY
configListChanged
)
Q_PROPERTY
(
int
connectionCount
READ
connectionCount
NOTIFY
connectionCountChanged
)
Q_PROPERTY
(
QStringList
connectedList
MEMBER
_connectedList
NOTIFY
connectedListChanged
)
Q_PROPERTY
(
bool
showGPS
MEMBER
_showGPS
NOTIFY
showGPSChanged
)
Q_PROPERTY
(
bool
showMav
MEMBER
_showMav
NOTIFY
showMavChanged
)
Q_PROPERTY
(
bool
showMessages
MEMBER
_showMessages
NOTIFY
showMessagesChanged
)
Q_PROPERTY
(
bool
showBattery
MEMBER
_showBattery
NOTIFY
showBatteryChanged
)
Q_PROPERTY
(
bool
showRSSI
MEMBER
_showRSSI
NOTIFY
showRSSIChanged
)
Q_PROPERTY
(
float
progressBarValue
MEMBER
_progressBarValue
NOTIFY
progressBarValueChanged
)
Q_PROPERTY
(
int
remoteRSSI
READ
remoteRSSI
NOTIFY
remoteRSSIChanged
)
Q_PROPERTY
(
int
telemetryRRSSI
READ
telemetryRRSSI
NOTIFY
telemetryRRSSIChanged
)
Q_PROPERTY
(
int
telemetryLRSSI
READ
telemetryLRSSI
NOTIFY
telemetryLRSSIChanged
)
void
setCurrentView
(
int
currentView
);
void
viewStateChanged
(
const
QString
&
key
,
bool
value
);
...
...
@@ -89,7 +90,7 @@ public:
int
telemetryRRSSI
()
{
return
_telemetryRRSSI
;
}
int
telemetryLRSSI
()
{
return
_telemetryLRSSI
;
}
int
connectionCount
()
{
return
_connectionCount
;
}
signals:
void
connectionCountChanged
(
int
count
);
void
currentViewChanged
();
...
...
@@ -104,6 +105,10 @@ signals:
void
remoteRSSIChanged
(
int
value
);
void
telemetryRRSSIChanged
(
int
value
);
void
telemetryLRSSIChanged
(
int
value
);
void
heightChanged
(
double
height
);
/// Shows a non-modal message below the toolbar
void
showMessage
(
const
QString
&
message
);
private
slots
:
void
_forgetUAS
(
UASInterface
*
uas
);
...
...
@@ -115,6 +120,7 @@ private slots:
void
_setProgressBarValue
(
float
value
);
void
_remoteControlRSSIChanged
(
uint8_t
rssi
);
void
_telemetryChanged
(
LinkInterface
*
link
,
unsigned
rxerrors
,
unsigned
fixed
,
unsigned
rssi
,
unsigned
remrssi
,
unsigned
txbuf
,
unsigned
noise
,
unsigned
remnoise
);
void
_heightChanged
(
double
height
);
private:
void
_updateConnection
(
LinkInterface
*
disconnectedLink
=
NULL
);
...
...
@@ -137,6 +143,7 @@ private:
double
_remoteRSSIstore
;
int
_telemetryRRSSI
;
int
_telemetryLRSSI
;
double
_toolbarHeight
;
UASMessageViewRollDown
*
_rollDownMessages
;
};
...
...
src/ui/toolbar/MainToolBar.qml
View file @
eb676850
...
...
@@ -43,14 +43,15 @@ Rectangle {
property
var
qgcPal
:
QGCPalette
{
id
:
palette
;
colorGroupEnabled
:
true
}
property
int
cellSpacerSize
:
ScreenTools
.
isMobile
?
getProportionalDimmension
(
6
)
:
getProportionalDimmension
(
4
)
property
int
cellHeight
:
getProportionalDimmension
(
30
)
readonly
property
real
toolBarHeight
:
ScreenTools
.
defaultFontPixelHeight
*
3
property
int
cellSpacerSize
:
ScreenTools
.
isMobile
?
getProportionalDimmension
(
6
)
:
getProportionalDimmension
(
4
)
readonly
property
int
cellHeight
:
getProportionalDimmension
(
30
)
property
var
colorBlue
:
"
#1a6eaa
"
property
var
colorGreen
:
"
#329147
"
property
var
colorRed
:
"
#942324
"
property
var
colorOrange
:
"
#a76f26
"
property
var
colorWhite
:
"
#f0f0f0
"
readonly
property
var
colorBlue
:
"
#1a6eaa
"
readonly
property
var
colorGreen
:
"
#329147
"
readonly
property
var
colorRed
:
"
#942324
"
readonly
property
var
colorOrange
:
"
#a76f26
"
readonly
property
var
colorWhite
:
"
#f0f0f0
"
property
var
colorOrangeText
:
(
qgcPal
.
globalTheme
===
QGCPalette
.
Light
)
?
"
#b75711
"
:
"
#ea8225
"
property
var
colorRedText
:
(
qgcPal
.
globalTheme
===
QGCPalette
.
Light
)
?
"
#ee1112
"
:
"
#ef2526
"
...
...
@@ -59,8 +60,13 @@ Rectangle {
color
:
qgcPal
.
windowShade
Connections
{
target
:
mainToolBar
onShowMessage
:
mainToolBar
.
height
=
100
}
function
getProportionalDimmension
(
val
)
{
return
toolBarH
older
.
h
eight
*
val
/
40
return
toolBarHeight
*
val
/
40
}
function
getMessageColor
()
{
...
...
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