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
7f35db33
Commit
7f35db33
authored
Jan 26, 2018
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ruleset picker container
Added an "unknown" weather icon for when I get "valid" data and no icon
parent
0e1d01f5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
78 additions
and
12 deletions
+78
-12
AirMapManager.cc
src/Airmap/AirMapManager.cc
+2
-2
AirMapWeatherInformation.cc
src/Airmap/AirMapWeatherInformation.cc
+5
-1
AirspaceControl.qml
src/Airmap/AirspaceControl.qml
+37
-1
AirspaceWeather.qml
src/Airmap/AirspaceWeather.qml
+9
-8
airmap.qrc
src/Airmap/airmap.qrc
+2
-0
right-arrow.svg
src/Airmap/images/right-arrow.svg
+9
-0
unknown.svg
src/Airmap/images/weather-icons/unknown.svg
+14
-0
No files found.
src/Airmap/AirMapManager.cc
View file @
7f35db33
...
@@ -35,8 +35,8 @@ AirMapManager::AirMapManager(QGCApplication* app, QGCToolbox* toolbox)
...
@@ -35,8 +35,8 @@ AirMapManager::AirMapManager(QGCApplication* app, QGCToolbox* toolbox)
{
{
_logger
=
std
::
make_shared
<
qt
::
Logger
>
();
_logger
=
std
::
make_shared
<
qt
::
Logger
>
();
qt
::
register_types
();
// TODO: still needed?s
qt
::
register_types
();
// TODO: still needed?s
_logger
->
logging_category
().
setEnabled
(
QtDebugMsg
,
tru
e
);
_logger
->
logging_category
().
setEnabled
(
QtDebugMsg
,
fals
e
);
_logger
->
logging_category
().
setEnabled
(
QtInfoMsg
,
tru
e
);
_logger
->
logging_category
().
setEnabled
(
QtInfoMsg
,
fals
e
);
_logger
->
logging_category
().
setEnabled
(
QtWarningMsg
,
true
);
_logger
->
logging_category
().
setEnabled
(
QtWarningMsg
,
true
);
_dispatchingLogger
=
std
::
make_shared
<
qt
::
DispatchingLogger
>
(
_logger
);
_dispatchingLogger
=
std
::
make_shared
<
qt
::
DispatchingLogger
>
(
_logger
);
connect
(
&
_shared
,
&
AirMapSharedState
::
error
,
this
,
&
AirMapManager
::
_error
);
connect
(
&
_shared
,
&
AirMapSharedState
::
error
,
this
,
&
AirMapManager
::
_error
);
...
...
src/Airmap/AirMapWeatherInformation.cc
View file @
7f35db33
...
@@ -57,7 +57,11 @@ AirMapWeatherInformation::_requestWeatherUpdate(const QGeoCoordinate& coordinate
...
@@ -57,7 +57,11 @@ AirMapWeatherInformation::_requestWeatherUpdate(const QGeoCoordinate& coordinate
if
(
result
)
{
if
(
result
)
{
const
Status
::
Weather
&
weather
=
result
.
value
().
weather
;
const
Status
::
Weather
&
weather
=
result
.
value
().
weather
;
_valid
=
true
;
_valid
=
true
;
_icon
=
QStringLiteral
(
"qrc:/airmapweather/"
)
+
QString
::
fromStdString
(
weather
.
icon
)
+
QStringLiteral
(
".svg"
);
if
(
weather
.
icon
.
empty
())
{
_icon
=
QStringLiteral
(
"qrc:/airmapweather/unknown.svg"
);
}
else
{
_icon
=
QStringLiteral
(
"qrc:/airmapweather/"
)
+
QString
::
fromStdString
(
weather
.
icon
)
+
QStringLiteral
(
".svg"
);
}
qCDebug
(
AirMapManagerLog
)
<<
"Weather Info: "
<<
_valid
<<
"Icon:"
<<
QString
::
fromStdString
(
weather
.
icon
)
<<
"Condition:"
<<
QString
::
fromStdString
(
weather
.
condition
)
<<
"Temp:"
<<
weather
.
temperature
;
qCDebug
(
AirMapManagerLog
)
<<
"Weather Info: "
<<
_valid
<<
"Icon:"
<<
QString
::
fromStdString
(
weather
.
icon
)
<<
"Condition:"
<<
QString
::
fromStdString
(
weather
.
condition
)
<<
"Temp:"
<<
weather
.
temperature
;
}
else
{
}
else
{
_valid
=
false
;
_valid
=
false
;
...
...
src/Airmap/AirspaceControl.qml
View file @
7f35db33
...
@@ -228,6 +228,7 @@ Item {
...
@@ -228,6 +228,7 @@ Item {
color
:
_colorGray
color
:
_colorGray
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
QGCColoredImage
{
QGCColoredImage
{
id
:
pencilIcon
width
:
height
width
:
height
height
:
parent
.
height
*
0.5
height
:
parent
.
height
*
0.5
sourceSize.height
:
height
sourceSize.height
:
height
...
@@ -301,6 +302,7 @@ Item {
...
@@ -301,6 +302,7 @@ Item {
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.1
)
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.1
)
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
onWheel
:
{
wheel
.
accepted
=
true
;
}
onClicked
:
{
onClicked
:
{
mainWindow
.
enableToolbar
()
mainWindow
.
enableToolbar
()
rootLoader
.
sourceComponent
=
null
rootLoader
.
sourceComponent
=
null
...
@@ -325,11 +327,12 @@ Item {
...
@@ -325,11 +327,12 @@ Item {
}
}
Rectangle
{
Rectangle
{
id
:
ruleSelectorRect
id
:
ruleSelectorRect
x
:
0
y
:
0
color
:
qgcPal
.
window
color
:
qgcPal
.
window
width
:
rulesCol
.
width
+
ScreenTools
.
defaultFontPixelWidth
width
:
rulesCol
.
width
+
ScreenTools
.
defaultFontPixelWidth
height
:
rulesCol
.
height
+
ScreenTools
.
defaultFontPixelHeight
height
:
rulesCol
.
height
+
ScreenTools
.
defaultFontPixelHeight
radius
:
ScreenTools
.
defaultFontPixelWidth
radius
:
ScreenTools
.
defaultFontPixelWidth
anchors.centerIn
:
parent
Column
{
Column
{
id
:
rulesCol
id
:
rulesCol
spacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
spacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
...
@@ -388,8 +391,41 @@ Item {
...
@@ -388,8 +391,41 @@ Item {
}
}
}
}
}
}
//-- Arrow
QGCColoredImage
{
id
:
arrowIconShadow
anchors.fill
:
arrowIcon
sourceSize.height
:
height
source
:
"
qrc:/airmap/right-arrow.svg
"
color
:
qgcPal
.
window
visible
:
false
}
DropShadow
{
anchors.fill
:
arrowIconShadow
visible
:
ruleSelectorRect
.
visible
horizontalOffset
:
4
verticalOffset
:
4
radius
:
32.0
samples
:
65
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.75
)
source
:
arrowIconShadow
}
QGCColoredImage
{
id
:
arrowIcon
width
:
height
height
:
ScreenTools
.
defaultFontPixelHeight
*
2
sourceSize.height
:
height
source
:
"
qrc:/airmap/right-arrow.svg
"
color
:
ruleSelectorRect
.
color
anchors.left
:
ruleSelectorRect
.
right
anchors.top
:
ruleSelectorRect
.
top
anchors.topMargin
:
(
ScreenTools
.
defaultFontPixelHeight
*
4
)
-
(
height
*
0.5
)
+
(
pencilIcon
.
height
*
0.5
)
}
Component.onCompleted
:
{
Component.onCompleted
:
{
mainWindow
.
disableToolbar
()
mainWindow
.
disableToolbar
()
var
target
=
mainWindow
.
mapFromItem
(
pencilIcon
,
0
,
0
)
ruleSelectorRect
.
x
=
target
.
x
-
ruleSelectorRect
.
width
-
(
ScreenTools
.
defaultFontPixelWidth
*
7
)
ruleSelectorRect
.
y
=
target
.
y
-
(
ScreenTools
.
defaultFontPixelHeight
*
4
)
}
}
}
}
}
}
...
...
src/Airmap/AirspaceWeather.qml
View file @
7f35db33
...
@@ -12,30 +12,31 @@ import QGroundControl.Airmap 1.0
...
@@ -12,30 +12,31 @@ import QGroundControl.Airmap 1.0
import
QGroundControl
.
SettingsManager
1.0
import
QGroundControl
.
SettingsManager
1.0
Item
{
Item
{
height
:
_
activeVehicle
&&
_activeVehicle
.
airspaceController
.
hasWeather
?
weatherRow
.
height
:
0
height
:
_
valid
?
weatherRow
.
height
:
0
width
:
_
activeVehicle
&&
_activeVehicle
.
airspaceController
.
hasWeather
?
weatherRow
.
width
:
0
width
:
_
valid
?
weatherRow
.
width
:
0
property
var
iconHeight
:
ScreenTools
.
defaultFontPixelWidth
*
4
property
var
iconHeight
:
ScreenTools
.
defaultFontPixelWidth
*
4
property
bool
_valid
:
_activeVehicle
&&
_activeVehicle
.
airspaceController
.
weatherInfo
.
valid
property
color
_colorWhite
:
"
#ffffff
"
property
color
_colorWhite
:
"
#ffffff
"
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
bool
_celcius
:
QGroundControl
.
settingsManager
.
unitsSettings
.
temperatureUnits
.
rawValue
===
UnitsSettings
.
TemperatureUnitsCelsius
property
bool
_celcius
:
QGroundControl
.
settingsManager
.
unitsSettings
.
temperatureUnits
.
rawValue
===
UnitsSettings
.
TemperatureUnitsCelsius
property
int
_tempC
:
_
activeVehicle
&&
_activeVehicle
.
airspaceController
.
weatherInfo
.
valid
?
_activeVehicle
.
airspaceController
.
weatherInfo
.
temperature
:
0
property
int
_tempC
:
_valid
?
_activeVehicle
.
airspaceController
.
weatherInfo
.
temperature
:
0
property
string
_tempS
:
(
_celcius
?
_tempC
:
_tempC
*
1.8
+
32
).
toFixed
(
0
)
+
(
_celcius
?
"
°C
"
:
"
°F
"
)
property
string
_tempS
:
(
_celcius
?
_tempC
:
_tempC
*
1.8
+
32
).
toFixed
(
0
)
+
(
_celcius
?
"
°C
"
:
"
°F
"
)
Row
{
Row
{
id
:
weatherRow
id
:
weatherRow
spacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
spacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
QGCColoredImage
{
QGCColoredImage
{
width
:
height
width
:
height
height
:
iconHeight
height
:
iconHeight
sourceSize.height
:
height
sourceSize.height
:
height
source
:
_
activeVehicle
&&
_activeVehicle
.
airspaceController
.
weatherInfo
.
valid
?
_activeVehicle
.
airspaceController
.
weatherInfo
.
icon
:
""
source
:
_valid
?
_activeVehicle
.
airspaceController
.
weatherInfo
.
icon
:
""
color
:
_colorWhite
color
:
_colorWhite
visible
:
_
activeVehicle
&&
_activeVehicle
.
airspaceController
.
weatherInfo
.
valid
visible
:
_valid
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
QGCLabel
{
QGCLabel
{
text
:
_tempS
text
:
_tempS
color
:
_colorWhite
color
:
_colorWhite
visible
:
_
activeVehicle
&&
_activeVehicle
.
airspaceController
.
weatherInfo
.
valid
visible
:
_valid
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
}
}
...
...
src/Airmap/airmap.qrc
View file @
7f35db33
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
<file alias="colapse.svg">images/colapse.svg</file>
<file alias="colapse.svg">images/colapse.svg</file>
<file alias="expand.svg">images/expand.svg</file>
<file alias="expand.svg">images/expand.svg</file>
<file alias="pencil.svg">images/pencil.svg</file>
<file alias="pencil.svg">images/pencil.svg</file>
<file alias="right-arrow.svg">images/right-arrow.svg</file>
</qresource>
</qresource>
<qresource prefix="/airmapweather">
<qresource prefix="/airmapweather">
<file alias="clear.svg">images/weather-icons/clear.svg</file>
<file alias="clear.svg">images/weather-icons/clear.svg</file>
...
@@ -45,6 +46,7 @@
...
@@ -45,6 +46,7 @@
<file alias="sunny.svg">images/weather-icons/sunny.svg</file>
<file alias="sunny.svg">images/weather-icons/sunny.svg</file>
<file alias="thunderstorm.svg">images/weather-icons/thunderstorm.svg</file>
<file alias="thunderstorm.svg">images/weather-icons/thunderstorm.svg</file>
<file alias="tornado.svg">images/weather-icons/tornado.svg</file>
<file alias="tornado.svg">images/weather-icons/tornado.svg</file>
<file alias="unknown.svg">images/weather-icons/unknown.svg</file>
<file alias="windy.svg">images/weather-icons/windy.svg</file>
<file alias="windy.svg">images/weather-icons/windy.svg</file>
</qresource>
</qresource>
</RCC>
</RCC>
src/Airmap/images/right-arrow.svg
0 → 100644
View file @
7f35db33
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
version=
"1.1"
id=
"Layer_1"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
x=
"0px"
y=
"0px"
width=
"72px"
height=
"72px"
viewBox=
"0 0 72 72"
style=
"enable-background:new 0 0 72 72;"
xml:space=
"preserve"
>
<style
type=
"text/css"
>
.st0{fill:#FFFFFF;}
</style>
<polygon
class=
"st0"
points=
"0,0 0,72 72,36 "
/>
</svg>
src/Airmap/images/weather-icons/unknown.svg
0 → 100644
View file @
7f35db33
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
version=
"1.1"
id=
"Layer_1"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
x=
"0px"
y=
"0px"
width=
"200px"
height=
"200px"
viewBox=
"0 0 200 200"
style=
"enable-background:new 0 0 200 200;"
xml:space=
"preserve"
>
<title>
sunny
</title>
<desc>
Created with Sketch.
</desc>
<g>
<path
d=
"M88.911,118.466l-0.468-4.671c-1.088-9.691,2.264-20.331,11.186-31.106c8.087-9.629,12.573-16.589,12.573-24.626
c0-9.229-5.702-15.417-17.146-15.499c-6.398,0-13.603,2.088-18.166,5.566l-4.327-11.344c6.107-4.337,16.273-7.25,25.8-7.25
c20.628,0,30.089,12.816,30.089,26.538c0,12.129-6.874,21.039-15.528,31.15c-7.908,9.491-10.797,17.445-10.195,26.632l0.238,4.609
H88.911z M84.955,143.633c0-6.619,4.44-11.316,10.696-11.33c6.387,0,10.575,4.711,10.615,11.33c0,6.242-4.175,11.177-10.696,11.177
C89.247,154.81,84.86,149.875,84.955,143.633z"
/>
</g>
</svg>
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