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
ac08dd5a
Commit
ac08dd5a
authored
May 06, 2020
by
DoinLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
f48f8c8c
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
751 additions
and
293 deletions
+751
-293
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-0
ArduSubFirmwarePlugin.cc
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc
+15
-4
ArduSubFirmwarePlugin.h
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h
+4
-2
FirmwarePlugin.cc
src/FirmwarePlugin/FirmwarePlugin.cc
+14
-5
FirmwarePlugin.h
src/FirmwarePlugin/FirmwarePlugin.h
+14
-6
FlyViewCustomLayer.qml
src/FlightDisplay/FlyViewCustomLayer.qml
+2
-2
FlyViewMap.qml
src/FlightDisplay/FlyViewMap.qml
+2
-2
FlyViewWidgetLayer.qml
src/FlightDisplay/FlyViewWidgetLayer.qml
+3
-3
PlanToolBar.qml
src/PlanView/PlanToolBar.qml
+0
-1
PlanToolBarIndicators.qml
src/PlanView/PlanToolBarIndicators.qml
+19
-43
QGCToolBarButton.qml
src/QmlControls/QGCToolBarButton.qml
+2
-2
qmldir
src/QmlControls/QGroundControl/Controls/qmldir
+1
-0
Vehicle.cc
src/Vehicle/Vehicle.cc
+14
-4
Vehicle.h
src/Vehicle/Vehicle.h
+6
-3
QGCCorePlugin.cc
src/api/QGCCorePlugin.cc
+12
-2
QGCCorePlugin.h
src/api/QGCCorePlugin.h
+14
-7
QGCOptions.cc
src/api/QGCOptions.cc
+0
-15
QGCOptions.h
src/api/QGCOptions.h
+0
-9
MainRootWindow.qml
src/ui/MainRootWindow.qml
+14
-14
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+167
-158
MainToolBarIndicators.qml
src/ui/toolbar/MainToolBarIndicators.qml
+32
-11
ToolBarBase.qml
src/ui/toolbar/ToolBarBase.qml
+415
-0
No files found.
qgroundcontrol.qrc
View file @
ac08dd5a
...
...
@@ -177,6 +177,7 @@
<file alias="QGroundControl/Controls/SurveyMapVisual.qml">src/PlanView/SurveyMapVisual.qml</file>
<file alias="QGroundControl/Controls/TerrainStatus.qml">src/PlanView/TerrainStatus.qml</file>
<file alias="QGroundControl/Controls/TakeoffItemMapVisual.qml">src/PlanView/TakeoffItemMapVisual.qml</file>
<file alias="QGroundControl/Controls/ToolBarBase.qml">src/ui/toolbar/ToolBarBase.qml</file>
<file alias="QGroundControl/Controls/ToolStrip.qml">src/QmlControls/ToolStrip.qml</file>
<file alias="QGroundControl/Controls/TransectStyleComplexItemStats.qml">src/PlanView/TransectStyleComplexItemStats.qml</file>
<file alias="QGroundControl/Controls/VehicleRotationCal.qml">src/QmlControls/VehicleRotationCal.qml</file>
...
...
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc
View file @
ac08dd5a
...
...
@@ -217,20 +217,31 @@ bool ArduSubFirmwarePlugin::supportsMotorInterference(void)
return
false
;
}
const
QVariantList
&
ArduSubFirmwarePlugin
::
tool
Bar
Indicators
(
const
Vehicle
*
vehicle
)
const
QVariantList
&
ArduSubFirmwarePlugin
::
toolIndicators
(
const
Vehicle
*
vehicle
)
{
Q_UNUSED
(
vehicle
);
//-- Sub specific list of indicators (Enter your modified list here)
if
(
_tool
Bar
Indicators
.
size
()
==
0
)
{
_tool
Bar
Indicators
=
QVariantList
({
if
(
_toolIndicators
.
size
()
==
0
)
{
_toolIndicators
=
QVariantList
({
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/MessageIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/BatteryIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/JoystickIndicator.qml"
)),
});
}
return
_toolIndicators
;
}
const
QVariantList
&
ArduSubFirmwarePlugin
::
modeIndicators
(
const
Vehicle
*
vehicle
)
{
Q_UNUSED
(
vehicle
);
//-- Sub specific list of indicators (Enter your modified list here)
if
(
_modeIndicators
.
size
()
==
0
)
{
_modeIndicators
=
QVariantList
({
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/ModeIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/ArmedIndicator.qml"
)),
});
}
return
_
toolBar
Indicators
;
return
_
mode
Indicators
;
}
void
ArduSubFirmwarePlugin
::
_handleNamedValueFloat
(
mavlink_message_t
*
message
)
...
...
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h
View file @
ac08dd5a
...
...
@@ -136,14 +136,16 @@ public:
QString
brandImageOutdoor
(
const
Vehicle
*
vehicle
)
const
final
{
Q_UNUSED
(
vehicle
);
return
QStringLiteral
(
"/qmlimages/APM/BrandImageSub"
);
}
const
FirmwarePlugin
::
remapParamNameMajorVersionMap_t
&
paramNameRemapMajorVersionMap
(
void
)
const
final
{
return
_remapParamName
;
}
int
remapParamNameHigestMinorVersionNumber
(
int
majorVersionNumber
)
const
final
;
const
QVariantList
&
toolBarIndicators
(
const
Vehicle
*
vehicle
)
final
;
const
QVariantList
&
toolIndicators
(
const
Vehicle
*
vehicle
)
final
;
const
QVariantList
&
modeIndicators
(
const
Vehicle
*
vehicle
)
final
;
bool
adjustIncomingMavlinkMessage
(
Vehicle
*
vehicle
,
mavlink_message_t
*
message
)
final
;
virtual
QMap
<
QString
,
FactGroup
*>*
factGroups
(
void
)
final
;
void
adjustMetaData
(
MAV_TYPE
vehicleType
,
FactMetaData
*
metaData
)
override
final
;
private:
QVariantList
_toolBarIndicators
;
QVariantList
_toolIndicators
;
QVariantList
_modeIndicators
;
static
bool
_remapParamNameIntialized
;
QMap
<
QString
,
QString
>
_factRenameMap
;
static
FirmwarePlugin
::
remapParamNameMajorVersionMap_t
_remapParamName
;
...
...
src/FirmwarePlugin/FirmwarePlugin.cc
View file @
ac08dd5a
...
...
@@ -304,17 +304,26 @@ QString FirmwarePlugin::vehicleImageCompass(const Vehicle*) const
return
QStringLiteral
(
"/qmlimages/compassInstrumentArrow.svg"
);
}
const
QVariantList
&
FirmwarePlugin
::
toolBar
Indicators
(
const
Vehicle
*
)
const
QVariantList
&
FirmwarePlugin
::
tool
Indicators
(
const
Vehicle
*
)
{
//-- Default list of indicators for all vehicles.
if
(
_tool
Bar
IndicatorList
.
size
()
==
0
)
{
_tool
Bar
IndicatorList
=
QVariantList
({
if
(
_toolIndicatorList
.
size
()
==
0
)
{
_toolIndicatorList
=
QVariantList
({
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/MessageIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/GPSIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/TelemetryRSSIIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/RCRSSIIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/BatteryIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/GPSRTKIndicator.qml"
)),
});
}
return
_toolIndicatorList
;
}
const
QVariantList
&
FirmwarePlugin
::
modeIndicators
(
const
Vehicle
*
)
{
//-- Default list of indicators for all vehicles.
if
(
_modeIndicatorList
.
size
()
==
0
)
{
_modeIndicatorList
=
QVariantList
({
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/ROIIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/ArmedIndicator.qml"
)),
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/ModeIndicator.qml"
)),
...
...
@@ -323,7 +332,7 @@ const QVariantList &FirmwarePlugin::toolBarIndicators(const Vehicle*)
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/LinkIndicator.qml"
)),
});
}
return
_
toolBar
IndicatorList
;
return
_
mode
IndicatorList
;
}
const
QVariantList
&
FirmwarePlugin
::
cameraList
(
const
Vehicle
*
)
...
...
src/FirmwarePlugin/FirmwarePlugin.h
View file @
ac08dd5a
...
...
@@ -267,10 +267,15 @@ public:
/// Return the resource file which contains the vehicle icon used in the compass
virtual
QString
vehicleImageCompass
(
const
Vehicle
*
vehicle
)
const
;
/// Allows the core plugin to override the toolbar indicators
/// signals toolbarIndicatorsChanged
/// @return A list of QUrl with the indicators (see MainToolBarIndicators.qml)
virtual
const
QVariantList
&
toolBarIndicators
(
const
Vehicle
*
vehicle
);
/// Returns the list of toolbar tool indicators associated with a vehicle
/// signals toolIndicatorsChanged
/// @return A list of QUrl with the indicators
virtual
const
QVariantList
&
toolIndicators
(
const
Vehicle
*
vehicle
);
/// Returns the list of toolbar mode indicators associated with a vehicle
/// signals modeIndicatorsChanged
/// @return A list of QUrl with the indicators
virtual
const
QVariantList
&
modeIndicators
(
const
Vehicle
*
vehicle
);
/// Returns a list of CameraMetaData objects for available cameras on the vehicle.
/// TODO: This should go into QGCCameraManager
...
...
@@ -330,7 +335,8 @@ public:
static
const
QString
px4FollowMeFlightMode
;
signals:
void
toolbarIndicatorsChanged
(
void
);
void
toolIndicatorsChanged
(
void
);
void
modeIndicatorsChanged
(
void
);
protected:
// Arms the vehicle with validation and retries
...
...
@@ -351,7 +357,9 @@ protected:
virtual
QString
_versionRegex
()
{
return
QString
();
}
private:
QVariantList
_toolBarIndicatorList
;
QVariantList
_toolIndicatorList
;
QVariantList
_modeIndicatorList
;
static
QVariantList
_cameraList
;
///< Standard QGC camera list
};
...
...
src/FlightDisplay/FlyViewCustomLayer.qml
View file @
ac08dd5a
...
...
@@ -34,8 +34,8 @@ import QGroundControl.Vehicle 1.0
Item
{
id
:
_root
property
var
parentToolInsets
// These insets tell you what screen real estate is available for positioning the controls in your overlay
property
var
to
olInsets
:
_toolInsets
// These are the insets for your custom overlay additions
property
var
parentToolInsets
// These insets tell you what screen real estate is available for positioning the controls in your overlay
property
var
to
talToolInsets
:
_toolInsets
// These are the insets for your custom overlay additions
property
var
mapControl
QGCToolInsets
{
...
...
src/FlightDisplay/FlyViewMap.qml
View file @
ac08dd5a
...
...
@@ -41,8 +41,8 @@ FlightMap {
property
var
guidedActionsController
property
var
rightPanelWidth
property
var
planMasterController
property
bool
pipMode
:
false
// true: map is shown in a small pip mode
property
var
toolInsets
// Insets for the center viewport area
property
bool
pipMode
:
false
// true: map is shown in a small pip mode
property
var
toolInsets
// Insets for the center viewport area
property
var
_planMasterController
:
planMasterController
property
var
_geoFenceController
:
planMasterController
.
geoFenceController
...
...
src/FlightDisplay/FlyViewWidgetLayer.qml
View file @
ac08dd5a
...
...
@@ -33,9 +33,9 @@ import QGroundControl.Vehicle 1.0
Item
{
id
:
_root
property
var
parentToolInsets
property
var
totalToolInsets
:
_totalToolInsets
property
var
mapControl
property
var
parentToolInsets
property
var
totalToolInsets
:
_totalToolInsets
property
var
mapControl
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
var
_planMasterController
:
mainWindow
.
planMasterControllerPlanView
...
...
src/PlanView/PlanToolBar.qml
View file @
ac08dd5a
...
...
@@ -32,7 +32,6 @@ Rectangle {
id
:
settingsButton
Layout.fillHeight
:
true
icon.source
:
"
/qmlimages/PaperPlane.svg
"
logo
:
true
checked
:
false
onClicked
:
{
checked
=
false
...
...
src/PlanView/PlanToolBarIndicators.qml
View file @
ac08dd5a
...
...
@@ -11,7 +11,7 @@ import QGroundControl.Palette 1.0
// Toolbar for Plan View
Item
{
anchors.fill
:
parent
width
:
missionStats
.
width
+
_margins
property
var
_planMasterController
:
mainWindow
.
planMasterControllerPlanView
property
var
_currentMissionItem
:
mainWindow
.
currentPlanMissionItem
///< Mission item to display status for
...
...
@@ -109,11 +109,9 @@ Item {
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.leftMargin
:
_margins
anchors.rightMargin
:
_margins
anchors.left
:
parent
.
left
anchors.right
:
uploadButton
.
visible
?
uploadButton
.
left
:
parent
.
right
columnSpacing
:
0
columns
:
3
columns
:
4
GridLayout
{
columns
:
8
...
...
@@ -226,37 +224,25 @@ Item {
}
Item
{
width
:
1
;
height
:
1
}
/*
FIXME: Swap point display is currently hidden since the code which calcs it doesn't work correctly
QGCLabel { text: qsTr("Swap waypoint:"); font.pointSize: _dataFontSize; }
QGCLabel {
text: _batteryChangePointText
font.pointSize: _dataFontSize
Layout.minimumWidth: _mediumValueWidth
}
*/
}
}
QGCButton
{
id
:
uploadButton
anchors.rightMargin
:
_margins
anchors.right
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
text
:
_controllerDirty
?
qsTr
(
"
Upload Required
"
)
:
qsTr
(
"
Upload
"
)
enabled
:
!
_controllerSyncInProgress
visible
:
!
_controllerOffline
&&
!
_controllerSyncInProgress
&&
!
uploadCompleteText
.
visible
primary
:
_controllerDirty
onClicked
:
_planMasterController
.
upload
()
PropertyAnimation
on
opacity
{
easing.type
:
Easing
.
OutQuart
from
:
0.5
to
:
1
loops
:
Animation
.
Infinite
running
:
_controllerDirty
&&
!
_controllerSyncInProgress
alwaysRunToEnd
:
true
duration
:
2000
QGCButton
{
id
:
uploadButton
text
:
_controllerDirty
?
qsTr
(
"
Upload Required
"
)
:
qsTr
(
"
Upload
"
)
enabled
:
!
_controllerSyncInProgress
visible
:
!
_controllerOffline
&&
!
_controllerSyncInProgress
&&
!
uploadCompleteText
.
visible
primary
:
_controllerDirty
onClicked
:
_planMasterController
.
upload
()
PropertyAnimation
on
opacity
{
easing.type
:
Easing
.
OutQuart
from
:
0.5
to
:
1
loops
:
Animation
.
Infinite
running
:
_controllerDirty
&&
!
_controllerSyncInProgress
alwaysRunToEnd
:
true
duration
:
2000
}
}
}
...
...
@@ -277,16 +263,6 @@ Item {
}
}
/*
Rectangle {
anchors.bottom: parent.bottom
height: toolBar.height * 0.05
width: activeVehicle ? activeVehicle.parameterManager.loadProgress * parent.width : 0
color: qgcPal.colorGreen
visible: !largeProgressBar.visible
}
*/
// Large mission download progress bar
Rectangle
{
id
:
largeProgressBar
...
...
src/QmlControls/QGCToolBarButton.qml
View file @
ac08dd5a
...
...
@@ -32,7 +32,7 @@ Button {
background
:
Rectangle
{
anchors.fill
:
parent
color
:
logo
?
qgcPal
.
brandingPurple
:
(
button
.
checked
?
qgcPal
.
buttonHighlight
:
Qt
.
rgba
(
0
,
0
,
0
,
0
)
)
color
:
button
.
checked
?
qgcPal
.
buttonHighlight
:
Qt
.
rgba
(
0
,
0
,
0
,
0
)
}
contentItem
:
Row
{
...
...
@@ -44,7 +44,7 @@ Button {
width
:
height
sourceSize.height
:
parent
.
height
fillMode
:
Image
.
PreserveAspectFit
color
:
logo
?
"
white
"
:
(
button
.
checked
?
qgcPal
.
buttonHighlightText
:
qgcPal
.
buttonText
)
color
:
logo
?
"
transparent
"
:
(
button
.
checked
?
qgcPal
.
buttonHighlightText
:
qgcPal
.
buttonText
)
source
:
button
.
icon
.
source
anchors.verticalCenter
:
parent
.
verticalCenter
}
...
...
src/QmlControls/QGroundControl/Controls/qmldir
View file @
ac08dd5a
...
...
@@ -99,6 +99,7 @@ SurveyMapVisuals 1.0 SurveyMapVisuals.qml
TerrainStatus 1.0 TerrainStatus.qml
TransectStyleComplexItemStats 1.0 TransectStyleComplexItemStats.qml
TransectStyleMapVisuals 1.0 TransectStyleMapVisuals.qml
ToolBarBase 1.0 ToolBarBase.qml
ToolStrip 1.0 ToolStrip.qml
VehicleRotationCal 1.0 VehicleRotationCal.qml
VehicleSummaryRow 1.0 VehicleSummaryRow.qml
...
...
src/Vehicle/Vehicle.cc
View file @
ac08dd5a
...
...
@@ -414,8 +414,8 @@ Vehicle::Vehicle(MAV_AUTOPILOT firmwareType,
,
_flightDistanceFact
(
0
,
_flightDistanceFactName
,
FactMetaData
::
valueTypeDouble
)
,
_flightTimeFact
(
0
,
_flightTimeFactName
,
FactMetaData
::
valueTypeElapsedTimeInSeconds
)
,
_distanceToHomeFact
(
0
,
_distanceToHomeFactName
,
FactMetaData
::
valueTypeDouble
)
,
_headingToNextWPFact
(
0
,
_headingToNextWPFactName
,
FactMetaData
::
valueTypeDouble
)
,
_missionItemIndexFact
(
0
,
_missionItemIndexFactName
,
FactMetaData
::
valueTypeUint16
)
,
_headingToNextWPFact
(
0
,
_headingToNextWPFactName
,
FactMetaData
::
valueTypeDouble
)
,
_headingToHomeFact
(
0
,
_headingToHomeFactName
,
FactMetaData
::
valueTypeDouble
)
,
_distanceToGCSFact
(
0
,
_distanceToGCSFactName
,
FactMetaData
::
valueTypeDouble
)
,
_hobbsFact
(
0
,
_hobbsFactName
,
FactMetaData
::
valueTypeString
)
...
...
@@ -446,7 +446,8 @@ void Vehicle::_commonInit()
{
_firmwarePlugin
=
_firmwarePluginManager
->
firmwarePluginForAutopilot
(
_firmwareType
,
_vehicleType
);
connect
(
_firmwarePlugin
,
&
FirmwarePlugin
::
toolbarIndicatorsChanged
,
this
,
&
Vehicle
::
toolBarIndicatorsChanged
);
connect
(
_firmwarePlugin
,
&
FirmwarePlugin
::
toolIndicatorsChanged
,
this
,
&
Vehicle
::
toolIndicatorsChanged
);
connect
(
_firmwarePlugin
,
&
FirmwarePlugin
::
modeIndicatorsChanged
,
this
,
&
Vehicle
::
modeIndicatorsChanged
);
connect
(
this
,
&
Vehicle
::
coordinateChanged
,
this
,
&
Vehicle
::
_updateDistanceHeadingToHome
);
connect
(
this
,
&
Vehicle
::
coordinateChanged
,
this
,
&
Vehicle
::
_updateDistanceToGCS
);
...
...
@@ -3902,10 +3903,19 @@ QString Vehicle::vehicleImageCompass() const
return
QString
();
}
const
QVariantList
&
Vehicle
::
toolBarIndicators
()
const
QVariantList
&
Vehicle
::
toolIndicators
()
{
if
(
_firmwarePlugin
)
{
return
_firmwarePlugin
->
toolIndicators
(
this
);
}
static
QVariantList
emptyList
;
return
emptyList
;
}
const
QVariantList
&
Vehicle
::
modeIndicators
()
{
if
(
_firmwarePlugin
)
{
return
_firmwarePlugin
->
toolBar
Indicators
(
this
);
return
_firmwarePlugin
->
mode
Indicators
(
this
);
}
static
QVariantList
emptyList
;
return
emptyList
;
...
...
src/Vehicle/Vehicle.h
View file @
ac08dd5a
...
...
@@ -615,7 +615,8 @@ public:
Q_PROPERTY
(
unsigned
int
telemetryTXBuffer
READ
telemetryTXBuffer
NOTIFY
telemetryTXBufferChanged
)
Q_PROPERTY
(
int
telemetryLNoise
READ
telemetryLNoise
NOTIFY
telemetryLNoiseChanged
)
Q_PROPERTY
(
int
telemetryRNoise
READ
telemetryRNoise
NOTIFY
telemetryRNoiseChanged
)
Q_PROPERTY
(
QVariantList
toolBarIndicators
READ
toolBarIndicators
NOTIFY
toolBarIndicatorsChanged
)
Q_PROPERTY
(
QVariantList
toolIndicators
READ
toolIndicators
NOTIFY
toolIndicatorsChanged
)
Q_PROPERTY
(
QVariantList
modeIndicators
READ
modeIndicators
NOTIFY
modeIndicatorsChanged
)
Q_PROPERTY
(
bool
initialPlanRequestComplete
READ
initialPlanRequestComplete
NOTIFY
initialPlanRequestCompleteChanged
)
Q_PROPERTY
(
QVariantList
staticCameraList
READ
staticCameraList
CONSTANT
)
Q_PROPERTY
(
QGCCameraManager
*
dynamicCameras
READ
dynamicCameras
NOTIFY
dynamicCamerasChanged
)
...
...
@@ -1086,7 +1087,8 @@ public:
QString
vehicleImageOutline
()
const
;
QString
vehicleImageCompass
()
const
;
const
QVariantList
&
toolBarIndicators
();
const
QVariantList
&
toolIndicators
();
const
QVariantList
&
modeIndicators
();
const
QVariantList
&
staticCameraList
()
const
;
bool
capabilitiesKnown
()
const
{
return
_capabilityBitsKnown
;
}
...
...
@@ -1160,7 +1162,8 @@ signals:
void
capabilitiesKnownChanged
(
bool
capabilitiesKnown
);
void
initialPlanRequestCompleteChanged
(
bool
initialPlanRequestComplete
);
void
capabilityBitsChanged
(
uint64_t
capabilityBits
);
void
toolBarIndicatorsChanged
();
void
toolIndicatorsChanged
();
void
modeIndicatorsChanged
();
void
highLatencyLinkChanged
(
bool
highLatencyLink
);
void
priorityLinkNameChanged
(
const
QString
&
priorityLinkName
);
void
linksChanged
();
...
...
src/api/QGCCorePlugin.cc
View file @
ac08dd5a
...
...
@@ -516,8 +516,18 @@ QString QGCCorePlugin::stableVersionCheckFileUrl() const
#endif
}
QStringList
QGCCorePlugin
::
startupPages
()
QStringList
QGCCorePlugin
::
startupPages
()
{
return
{
"/qml/QGroundControl/Specific/UnitsWizardPage.qml"
};
}
const
QVariantList
&
QGCCorePlugin
::
toolBarIndicators
(
void
)
{
//-- Default list of indicators for all vehicles.
if
(
_toolBarIndicatorList
.
size
()
==
0
)
{
_toolBarIndicatorList
=
QVariantList
({
QVariant
::
fromValue
(
QUrl
::
fromUserInput
(
"qrc:/toolbar/GPSRTKIndicator.qml"
)),
});
}
return
_toolBarIndicatorList
;
}
src/api/QGCCorePlugin.h
View file @
ac08dd5a
...
...
@@ -58,7 +58,7 @@ public:
Q_PROPERTY
(
QString
brandImageOutdoor
READ
brandImageOutdoor
CONSTANT
)
Q_PROPERTY
(
QmlObjectListModel
*
customMapItems
READ
customMapItems
CONSTANT
)
Q_PROPERTY
(
QStringList
startupPages
READ
startupPages
NOTIFY
startupPagesChanged
)
Q_PROPERTY
(
QVariantList
toolBarIndicators
READ
toolBarIndicators
NOTIFY
toolBarIndicatorsChanged
)
Q_INVOKABLE
bool
guidedActionsControllerLogging
()
const
;
...
...
@@ -172,6 +172,11 @@ public:
/// @return QML files paths that will be loaded using the StartupWizard control
virtual
QStringList
startupPages
();
/// Returns the list of toolbar indicators which are not related to a vehicle
/// signals toolbarIndicatorsChanged
/// @return A list of QUrl with the indicators
virtual
const
QVariantList
&
toolBarIndicators
(
void
);
bool
showTouchAreas
()
const
{
return
_showTouchAreas
;
}
bool
showAdvancedUI
()
const
{
return
_showAdvancedUI
;
}
void
setShowTouchAreas
(
bool
show
);
...
...
@@ -181,12 +186,13 @@ public:
void
setToolbox
(
QGCToolbox
*
toolbox
);
signals:
void
settingsPagesChanged
();
void
analyzePagesChanged
();
void
instrumentPagesChanged
();
void
showTouchAreasChanged
(
bool
showTouchAreas
);
void
showAdvancedUIChanged
(
bool
showAdvancedUI
);
void
startupPagesChanged
();
void
settingsPagesChanged
();
void
analyzePagesChanged
();
void
instrumentPagesChanged
();
void
showTouchAreasChanged
(
bool
showTouchAreas
);
void
showAdvancedUIChanged
(
bool
showAdvancedUI
);
void
startupPagesChanged
();
void
toolBarIndicatorsChanged
();
protected
slots
:
void
_activeVehicleChanged
(
Vehicle
*
activeVehicle
);
...
...
@@ -203,6 +209,7 @@ protected:
Vehicle
*
_activeVehicle
=
nullptr
;
QGCCameraManager
*
_dynamicCameras
=
nullptr
;
QGCCameraControl
*
_currentCamera
=
nullptr
;
QVariantList
_toolBarIndicatorList
;
private:
QGCCorePlugin_p
*
_p
;
...
...
src/api/QGCOptions.cc
View file @
ac08dd5a
...
...
@@ -21,16 +21,6 @@ QGCOptions::QGCOptions(QObject* parent)
QQmlEngine
::
setObjectOwnership
(
this
,
QQmlEngine
::
CppOwnership
);
}
QUrl
QGCOptions
::
mainToolbarUrl
()
const
{
return
QUrl
(
QStringLiteral
(
"qrc:/toolbar/MainToolBar.qml"
));
}
QUrl
QGCOptions
::
planToolbarUrl
()
const
{
return
QUrl
(
QStringLiteral
(
"qrc:/qml/PlanToolBar.qml"
));
}
QColor
QGCOptions
::
toolbarBackgroundLight
()
const
{
return
QColor
(
255
,
255
,
255
,
204
);
...
...
@@ -41,11 +31,6 @@ QColor QGCOptions::toolbarBackgroundDark() const
return
QColor
(
0
,
0
,
0
,
192
);
}
QUrl
QGCOptions
::
planToolbarIndicatorsUrl
()
const
{
return
QUrl
(
QStringLiteral
(
"PlanToolBar.qml"
));
}
QGCFlyViewOptions
*
QGCOptions
::
flyViewOptions
(
void
)
{
if
(
!
_defaultFlyViewOptions
)
{
...
...
src/api/QGCOptions.h
View file @
ac08dd5a
...
...
@@ -55,11 +55,8 @@ public:
Q_PROPERTY
(
double
toolbarHeightMultiplier
READ
toolbarHeightMultiplier
CONSTANT
)
Q_PROPERTY
(
bool
enablePlanViewSelector
READ
enablePlanViewSelector
CONSTANT
)
Q_PROPERTY
(
QUrl
preFlightChecklistUrl
READ
preFlightChecklistUrl
CONSTANT
)
Q_PROPERTY
(
QUrl
mainToolbarUrl
READ
mainToolbarUrl
CONSTANT
)
Q_PROPERTY
(
QUrl
planToolbarUrl
READ
planToolbarUrl
CONSTANT
)
Q_PROPERTY
(
QColor
toolbarBackgroundLight
READ
toolbarBackgroundLight
CONSTANT
)
Q_PROPERTY
(
QColor
toolbarBackgroundDark
READ
toolbarBackgroundDark
CONSTANT
)
Q_PROPERTY
(
QUrl
planToolbarIndicatorsUrl
READ
planToolbarIndicatorsUrl
CONSTANT
)
Q_PROPERTY
(
bool
showSensorCalibrationCompass
READ
showSensorCalibrationCompass
NOTIFY
showSensorCalibrationCompassChanged
)
Q_PROPERTY
(
bool
showSensorCalibrationGyro
READ
showSensorCalibrationGyro
NOTIFY
showSensorCalibrationGyroChanged
)
Q_PROPERTY
(
bool
showSensorCalibrationAccel
READ
showSensorCalibrationAccel
NOTIFY
showSensorCalibrationAccelChanged
)
...
...
@@ -107,16 +104,10 @@ public:
/// Provides an optional, custom preflight checklist
virtual
QUrl
preFlightChecklistUrl
()
const
{
return
QUrl
::
fromUserInput
(
"qrc:/qml/PreFlightCheckList.qml"
);
}
/// Allows replacing the Main toolbar
virtual
QUrl
mainToolbarUrl
()
const
;
/// Allows replacing the Plan View toolbar
virtual
QUrl
planToolbarUrl
()
const
;
/// Allows replacing the toolbar Light Theme color
virtual
QColor
toolbarBackgroundLight
()
const
;
/// Allows replacing the toolbar Dark Theme color
virtual
QColor
toolbarBackgroundDark
()
const
;
/// Allows replacing the Plan View toolbar container
virtual
QUrl
planToolbarIndicatorsUrl
()
const
;
/// By returning false you can hide the following sensor calibration pages
virtual
bool
showSensorCalibrationCompass
()
const
{
return
true
;
}
virtual
bool
showSensorCalibrationGyro
()
const
{
return
true
;
}
...
...
src/ui/MainRootWindow.qml
View file @
ac08dd5a
...
...
@@ -49,10 +49,7 @@ ApplicationWindow {
property
var
_rgPreventViewSwitch
:
[
false
]
readonly
property
real
_topBottomMargins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
readonly
property
string
_mainToolbar
:
QGroundControl
.
corePlugin
.
options
.
mainToolbarUrl
readonly
property
string
_planToolbar
:
QGroundControl
.
corePlugin
.
options
.
planToolbarUrl
//-------------------------------------------------------------------------
//-- Global Scope Variables
...
...
@@ -107,44 +104,47 @@ ApplicationWindow {
return
_rgPreventViewSwitch
[
_rgPreventViewSwitch
.
length
-
1
]
}
function
viewSwitch
(
isPlanView
)
{
function
viewSwitch
(
isPlanView
,
showModeIndicators
)
{
settingsWindow
.
visible
=
false
setupWindow
.
visible
=
false
analyzeWindow
.
visible
=
false
flightView
.
visible
=
false
planViewLoader
.
visible
=
false
if
(
isPlanView
)
{
toolbar
.
source
=
_planToolbar
var
indicatorSource
if
(
isPlanView
)
{
indicatorSource
=
"
qrc:/qml/PlanToolBarIndicators.qml
"
}
else
{
toolbar
.
source
=
_mainToolbar
indicatorSource
=
"
qrc:/toolbar/MainToolBarIndicators.qml
"
}
toolbar
.
item
.
indicatorSource
=
indicatorSource
toolbar
.
item
.
showModeIndicators
=
showModeIndicators
}
function
showFlyView
()
{
if
(
!
flightView
.
visible
)
{
mainWindow
.
showPreFlightChecklistIfNeeded
()
}
viewSwitch
(
false
)
viewSwitch
(
false
,
true
)
flightView
.
visible
=
true
}
function
showPlanView
()
{
viewSwitch
(
true
)
viewSwitch
(
true
,
false
)
planViewLoader
.
visible
=
true
}
function
showAnalyzeView
()
{
viewSwitch
(
false
)
viewSwitch
(
false
,
false
)
analyzeWindow
.
visible
=
true
}
function
showSetupView
()
{
viewSwitch
(
false
)
viewSwitch
(
false
,
false
)
setupWindow
.
visible
=
true
}
function
showSettingsView
()
{
viewSwitch
(
false
)
viewSwitch
(
false
,
false
)
settingsWindow
.
visible
=
true
}
...
...
@@ -324,13 +324,13 @@ ApplicationWindow {
header
:
ToolBar
{
height
:
ScreenTools
.
toolbarHeight
visible
:
!
QGroundControl
.
videoManager
.
fullScreen
background
:
Rectangle
{
background
:
Rectangle
{
color
:
qgcPal
.
globalTheme
===
QGCPalette
.
Light
?
QGroundControl
.
corePlugin
.
options
.
toolbarBackgroundLight
:
QGroundControl
.
corePlugin
.
options
.
toolbarBackgroundDark
}
Loader
{
id
:
toolbar
anchors.fill
:
parent
source
:
_mainToolbar
source
:
"
qrc:/toolbar/MainToolBar.qml
"
//-- Toggle Full Screen / Windowed
MouseArea
{
anchors.fill
:
parent
...
...
src/ui/toolbar/MainToolBar.qml
View file @
ac08dd5a
...
...
@@ -20,13 +20,40 @@ import QGroundControl.ScreenTools 1.0
import
QGroundControl
.
Controllers
1.0
Item
{
id
:
toolBar
id
:
_root
Component.onCompleted
:
{
//-- TODO: Get this from the actual state
flyButton
.
checked
=
true
property
alias
indicatorSource
:
indicatorLoader
.
source
property
alias
showModeIndicators
:
indicatorLoader
.
showModeIndicators
// FIXME: Reaching up for communicationLost?
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
Component.onCompleted
:
_viewButtonClicked
(
flyButton
)
function
_viewButtonClicked
(
button
)
{
if
(
mainWindow
.
preventViewSwitch
())
{
return
false
}
viewButtonSelectRow
.
visible
=
false
buttonSelectHideTimer
.
stop
()
currentButton
.
icon
.
source
=
button
.
icon
.
source
currentButton
.
logo
=
button
.
logo
return
true
}
//-- Setup can be invoked from c++ side
Connections
{
target
:
setupWindow
onVisibleChanged
:
{
if
(
setupWindow
.
visible
)
{
_viewButtonClicked
(
setupButton
)
}
}
}
QGCPalette
{
id
:
qgcPal
}
/// Bottom single pixel divider
Rectangle
{
anchors.left
:
parent
.
left
...
...
@@ -37,105 +64,87 @@ Item {
visible
:
qgcPal
.
globalTheme
===
QGCPalette
.
Light
}
//-- Setup can be invoked from c++ side
Connections
{
target
:
setupWindow
onVisibleChanged
:
{
if
(
setupWindow
.
visible
)
{
buttonRow
.
clearAllChecks
()
setupButton
.
checked
=
true
RowLayout
{
id
:
viewButtonRow
anchors.bottomMargin
:
1
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
spacing
:
ScreenTools
.
defaultFontPixelWidth
/
2
QGCToolBarButton
{
id
:
currentButton
Layout.fillHeight
:
true
onClicked
:
{
viewButtonSelectRow
.
visible
=
!
viewButtonSelectRow
.
visible
if
(
viewButtonSelectRow
.
visible
)
{
buttonSelectHideTimer
.
start
()
}
else
{
buttonSelectHideTimer
.
stop
()
}
}
}
}
QGCFlickable
{
anchors.fill
:
parent
contentWidth
:
toolbarRow
.
width
flickableDirection
:
Flickable
.
HorizontalFlick
//---------------------------------------------
// Toolbar Row
RowLayout
{
id
:
toolbarRow
anchors.bottomMargin
:
1
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
spacing
:
ScreenTools
.
defaultFontPixelWidth
/
2
// Important Note: Toolbar buttons must manage their checked state manually in order to support
// view switch prevention. There doesn't seem to be a way to make this work if they are in a
// ButtonGroup.
//---------------------------------------------
// Toolbar Row
RowLayout
{
id
:
buttonRow
Layout.fillHeight
:
true
spacing
:
0
function
clearAllChecks
()
{
for
(
var
i
=
0
;
i
<
buttonRow
.
children
.
length
;
i
++
)
{
if
(
buttonRow
.
children
[
i
].
toString
().
startsWith
(
"
QGCToolBarButton
"
))
{
buttonRow
.
children
[
i
].
checked
=
false
}
}
}
id
:
viewButtonSelectRow
Layout.fillHeight
:
true
spacing
:
0
visible
:
false
Timer
{
id
:
buttonSelectHideTimer
interval
:
5000
repeat
:
false
onTriggered
:
viewButtonSelectRow
.
visible
=
false
}
QGCToolBarButton
{
id
:
settingsButton
Layout.fillHeight
:
true
icon.source
:
"
/res/QGCLogoWhite
"
logo
:
true
visible
:
!
QGroundControl
.
corePlugin
.
options
.
combineSettingsAndSetup
onClicked
:
{
if
(
mainWindow
.
preventViewSwitch
())
{
return
}
buttonRow
.
clearAllChecks
()
checked
=
true
QGCToolBarButton
{
id
:
settingsButton
Layout.fillHeight
:
true
icon.source
:
"
/res/QGCLogoFull
"
logo
:
true
visible
:
currentButton
.
icon
.
source
!==
icon
.
source
&&
!
QGroundControl
.
corePlugin
.
options
.
combineSettingsAndSetup
onClicked
:
{
if
(
_viewButtonClicked
(
this
))
{
mainWindow
.
showSettingsView
()
}
}
}
QGCToolBarButton
{
id
:
setupButton
Layout.fillHeight
:
true
icon.source
:
"
/qmlimages/Gears.svg
"
onClicked
:
{
if
(
mainWindow
.
preventViewSwitch
())
{
return
}
buttonRow
.
clearAllChecks
()
checked
=
true
QGCToolBarButton
{
id
:
setupButton
Layout.fillHeight
:
true
icon.source
:
"
/qmlimages/Gears.svg
"
visible
:
currentButton
.
icon
.
source
!==
icon
.
source
onClicked
:
{
if
(
_viewButtonClicked
(
this
))
{
mainWindow
.
showSetupView
()
}
}
}
QGCToolBarButton
{
id
:
planButton
Layout.fillHeight
:
true
icon.source
:
"
/qmlimages/Plan.svg
"
onClicked
:
{
if
(
mainWindow
.
preventViewSwitch
())
{
return
}
buttonRow
.
clearAllChecks
()
checked
=
true
QGCToolBarButton
{
id
:
planButton
Layout.fillHeight
:
true
icon.source
:
"
/qmlimages/Plan.svg
"
visible
:
currentButton
.
icon
.
source
!==
icon
.
source
onClicked
:
{
if
(
_viewButtonClicked
(
this
))
{
mainWindow
.
showPlanView
()
}
}
}
QGCToolBarButton
{
id
:
flyButton
Layout.fillHeight
:
true
icon.source
:
"
/qmlimages/PaperPlane.svg
"
onClicked
:
{
if
(
mainWindow
.
preventViewSwitch
())
{
return
}
buttonRow
.
clearAllChecks
()
checked
=
true
QGCToolBarButton
{
id
:
flyButton
Layout.fillHeight
:
true
icon.source
:
"
/qmlimages/PaperPlane.svg
"
visible
:
currentButton
.
icon
.
source
!==
icon
.
source
onClicked
:
{
if
(
_viewButtonClicked
(
this
))
{
mainWindow
.
showFlyView
()
// Easter Egg mechanism
_clickCount
++
eggTimer
.
restart
()
...
...
@@ -149,70 +158,71 @@ Item {
QGroundControl
.
corePlugin
.
showTouchAreas
=
!
QGroundControl
.
corePlugin
.
showTouchAreas
}
}
}
property
int
_clickCount
:
0
property
int
_clickCount
:
0
Timer
{
id
:
eggTimer
interval
:
1000
repeat
:
false
onTriggered
:
parent
.
_clickCount
=
0
}
Timer
{
id
:
eggTimer
interval
:
1000
repeat
:
false
onTriggered
:
parent
.
_clickCount
=
0
}
MessageDialog
{
id
:
advancedModeConfirmation
title
:
qsTr
(
"
Advanced Mode
"
)
text
:
QGroundControl
.
corePlugin
.
showAdvancedUIMessage
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
No
onYes
:
{
QGroundControl
.
corePlugin
.
showAdvancedUI
=
true
advancedModeConfirmation
.
close
()
}
MessageDialog
{
id
:
advancedModeConfirmation
title
:
qsTr
(
"
Advanced Mode
"
)
text
:
QGroundControl
.
corePlugin
.
showAdvancedUIMessage
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
No
onYes
:
{
QGroundControl
.
corePlugin
.
showAdvancedUI
=
true
advancedModeConfirmation
.
close
()
}
}
}
QGCToolBarButton
{
id
:
analyzeButton
Layout.fillHeight
:
true
icon.source
:
"
/qmlimages/Analyze.svg
"
visible
:
QGroundControl
.
corePlugin
.
showAdvancedUI
onClicked
:
{
if
(
mainWindow
.
preventViewSwitch
())
{
return
}
buttonRow
.
clearAllChecks
()
checked
=
true
QGCToolBarButton
{
id
:
analyzeButton
Layout.fillHeight
:
true
icon.source
:
"
/qmlimages/Analyze.svg
"
visible
:
currentButton
.
icon
.
source
!==
icon
.
source
&&
QGroundControl
.
corePlugin
.
showAdvancedUI
onClicked
:
{
if
(
_viewButtonClicked
(
this
))
{
mainWindow
.
showAnalyzeView
()
}
}
}
}
}
Item
{
Layout.fillHeight
:
true
width
:
ScreenTools
.
defaultFontPixelWidth
/
2
visible
:
activeVehicle
}
Rectangle
{
id
:
separator
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.left
:
viewButtonRow
.
right
width
:
1
color
:
qgcPal
.
text
}
Rectangle
{
Layout.margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
Layout.fillHeight
:
true
width
:
1
color
:
qgcPal
.
text
visible
:
activeVehicle
}
QGCFlickable
{
id
:
toolsFlickable
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelHeight
/
2
anchors.left
:
separator
.
right
anchors.right
:
connectionStatus
.
visible
?
connectionStatus
.
left
:
parent
.
right
anchors.bottomMargin
:
1
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
contentWidth
:
indicatorLoader
.
width
flickableDirection
:
Flickable
.
HorizontalFlick
Item
{
Layout.fillHeight
:
true
width
:
ScreenTools
.
defaultFontPixelWidth
/
2
visible
:
activeVehicle
}
}
Loader
{
id
:
indicatorLoader
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
source
:
"
qrc:/toolbar/MainToolBarIndicators.qml
"
Loader
{
id
:
toolbarIndicators
Layout.fillHeight
:
true
source
:
"
/toolbar/MainToolBarIndicators.qml
"
visible
:
activeVehicle
&&
!
communicationLost
}
property
bool
showModeIndicators
:
true
}
}
...
...
@@ -223,7 +233,7 @@ Item {
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.66
visible
:
activeVehicle
&&
!
communicationLost
&&
x
>
(
toolbarRow
.
x
+
toolbarRow
.
w
idth
+
ScreenTools
.
defaultFontPixelWidth
)
visible
:
_activeVehicle
&&
!
communicationLost
&&
x
>
(
toolsFlickable
.
x
+
toolsFlickable
.
contentW
idth
+
ScreenTools
.
defaultFontPixelWidth
)
fillMode
:
Image
.
PreserveAspectFit
source
:
_outdoorPalette
?
_brandImageOutdoor
:
_brandImageIndoor
mipmap
:
true
...
...
@@ -236,27 +246,27 @@ Item {
property
bool
_userBrandingOutdoor
:
_userBrandImageOutdoor
.
length
!=
0
property
string
_brandImageIndoor
:
_userBrandingIndoor
?
_userBrandImageIndoor
:
(
_userBrandingOutdoor
?
_userBrandImageOutdoor
:
(
_corePluginBranding
?
QGroundControl
.
corePlugin
.
brandImageIndoor
:
(
activeVehicle
?
activeVehicle
.
brandImageIndoor
:
""
)
)
)
_userBrandImageOutdoor
:
(
_corePluginBranding
?
QGroundControl
.
corePlugin
.
brandImageIndoor
:
(
activeVehicle
?
activeVehicle
.
brandImageIndoor
:
""
)
)
)
property
string
_brandImageOutdoor
:
_userBrandingOutdoor
?
_userBrandImageOutdoor
:
(
_userBrandingIndoor
?
_userBrandImageIndoor
:
(
_corePluginBranding
?
QGroundControl
.
corePlugin
.
brandImageOutdoor
:
(
activeVehicle
?
activeVehicle
.
brandImageOutdoor
:
""
)
)
)
_userBrandImageIndoor
:
(
_corePluginBranding
?
QGroundControl
.
corePlugin
.
brandImageOutdoor
:
(
activeVehicle
?
activeVehicle
.
brandImageOutdoor
:
""
)
)
)
}
// Small parameter download progress bar
Rectangle
{
anchors.bottom
:
parent
.
bottom
height
:
toolBar
.
height
*
0.05
width
:
activeVehicle
?
activeVehicle
.
parameterManager
.
loadProgress
*
parent
.
width
:
0
height
:
_root
.
height
*
0.05
width
:
_activeVehicle
?
_
activeVehicle
.
parameterManager
.
loadProgress
*
parent
.
width
:
0
color
:
qgcPal
.
colorGreen
visible
:
!
largeProgressBar
.
visible
}
...
...
@@ -271,7 +281,7 @@ Item {
color
:
qgcPal
.
window
visible
:
_showLargeProgress
property
bool
_initialDownloadComplete
:
activeVehicle
?
activeVehicle
.
parameterManager
.
parametersReady
:
true
property
bool
_initialDownloadComplete
:
_activeVehicle
?
_
activeVehicle
.
parameterManager
.
parametersReady
:
true
property
bool
_userHide
:
false
property
bool
_showLargeProgress
:
!
_initialDownloadComplete
&&
!
_userHide
&&
qgcPal
.
globalTheme
===
QGCPalette
.
Light
...
...
@@ -283,7 +293,7 @@ Item {
Rectangle
{
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
width
:
activeVehicle
?
activeVehicle
.
parameterManager
.
loadProgress
*
parent
.
width
:
0
width
:
_activeVehicle
?
_
activeVehicle
.
parameterManager
.
loadProgress
*
parent
.
width
:
0
color
:
qgcPal
.
colorGreen
}
...
...
@@ -308,7 +318,6 @@ Item {
}
}
//-------------------------------------------------------------------------
//-- Waiting for a vehicle
QGCLabel
{
...
...
@@ -319,26 +328,27 @@ Item {
font.pointSize
:
ScreenTools
.
mediumFontPointSize
font.family
:
ScreenTools
.
demiboldFontFamily
color
:
qgcPal
.
colorRed
visible
:
!
activeVehicle
visible
:
!
_
activeVehicle
}
//-------------------------------------------------------------------------
//-- Connection Status
Row
{
id
:
connectionStatus
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.right
:
parent
.
right
layoutDirection
:
Qt
.
RightToLeft
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
activeVehicle
&&
communicationLost
visible
:
_
activeVehicle
&&
communicationLost
QGCButton
{
id
:
disconnectButton
anchors.verticalCenter
:
parent
.
verticalCenter
text
:
qsTr
(
"
Disconnect
"
)
primary
:
true
onClicked
:
activeVehicle
.
disconnectInactiveVehicle
()
onClicked
:
_
activeVehicle
.
disconnectInactiveVehicle
()
}
QGCLabel
{
...
...
@@ -350,5 +360,4 @@ Item {
color
:
qgcPal
.
colorRed
}
}
}
src/ui/toolbar/MainToolBarIndicators.qml
View file @
ac08dd5a
...
...
@@ -7,15 +7,10 @@
*
****************************************************************************/
import
QtQuick
2.11
import
QtQuick
.
Controls
2.4
import
QtQuick
.
Layouts
1.11
import
QtQuick
2.12
import
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
MultiVehicleManager
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
1.0
import
QGroundControl
.
ScreenTools
1.0
//-------------------------------------------------------------------------
//-- Toolbar Indicators
...
...
@@ -23,15 +18,41 @@ Row {
id
:
indicatorRow
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.margins
:
_toolIndicatorMargins
spacing
:
ScreenTools
.
defaultFontPixelWidth
*
1.5
// This property should come in from the Loader
//property bool showModeIndicators: true
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
real
_toolIndicatorMargins
:
ScreenTools
.
defaultFontPixelHeight
*
0.66
Repeater
{
id
:
appRepeater
model
:
QGroundControl
.
corePlugin
.
toolBarIndicators
Loader
{
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
source
:
modelData
visible
:
item
.
showIndicator
}
}
Repeater
{
model
:
_activeVehicle
?
_activeVehicle
.
toolIndicators
:
[]
Loader
{
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
source
:
modelData
visible
:
item
.
showIndicator
}
}
Repeater
{
model
:
activeVehicle
?
activeVehicle
.
toolBar
Indicators
:
[]
model
:
_activeVehicle
&&
showModeIndicators
?
_activeVehicle
.
mode
Indicators
:
[]
Loader
{
id
:
indicatorLoader
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.66
source
:
modelData
visible
:
item
.
showIndicator
}
...
...
src/ui/toolbar/ToolBarBase.qml
0 → 100644
View file @
ac08dd5a
/****************************************************************************
*
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import
QtQuick
2.11
import
QtQuick
.
Controls
2.4
import
QtQuick
.
Layouts
1.11
import
QtQuick
.
Dialogs
1.3
import
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
MultiVehicleManager
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Controllers
1.0
Item
{
id
:
_root
// FIXME: Reaching up for communicationLost?
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
real
_toolIndicatorMargins
:
ScreenTools
.
defaultFontPixelHeight
*
0.66
Component.onCompleted
:
_viewButtonClicked
(
flyButton
)
function
_viewButtonClicked
(
button
)
{
if
(
mainWindow
.
preventViewSwitch
())
{
return
false
}
viewButtonSelectRow
.
visible
=
false
buttonSelectHideTimer
.
stop
()
currentButton
.
icon
.
source
=
button
.
icon
.
source
currentButton
.
logo
=
button
.
logo
return
true
}
//-- Setup can be invoked from c++ side
Connections
{
target
:
setupWindow
onVisibleChanged
:
{
if
(
setupWindow
.
visible
)
{
_viewButtonClicked
(
setupButton
)
}
}
}
QGCPalette
{
id
:
qgcPal
}
/// Bottom single pixel divider
Rectangle
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.bottom
:
parent
.
bottom
height
:
1
color
:
"
black
"
visible
:
qgcPal
.
globalTheme
===
QGCPalette
.
Light
}
//-- Setup can be invoked from c++ side
Connections
{
target
:
setupWindow
onVisibleChanged
:
{
if
(
setupWindow
.
visible
)
{
buttonRow
.
clearAllChecks
()
setupButton
.
checked
=
true
}
}
}
RowLayout
{
id
:
viewButtonRow
anchors.bottomMargin
:
1
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
spacing
:
ScreenTools
.
defaultFontPixelWidth
/
2
QGCToolBarButton
{
id
:
currentButton
Layout.fillHeight
:
true
onClicked
:
{
viewButtonSelectRow
.
visible
=
!
viewButtonSelectRow
.
visible
if
(
viewButtonSelectRow
.
visible
)
{
buttonSelectHideTimer
.
start
()
}
else
{
buttonSelectHideTimer
.
stop
()
}
}
}
//---------------------------------------------
// Toolbar Row
RowLayout
{
id
:
viewButtonSelectRow
Layout.fillHeight
:
true
spacing
:
0
visible
:
false
Timer
{
id
:
buttonSelectHideTimer
interval
:
5000
repeat
:
false
onTriggered
:
viewButtonSelectRow
.
visible
=
false
}
QGCToolBarButton
{
id
:
settingsButton
Layout.fillHeight
:
true
icon.source
:
"
/res/QGCLogoFull
"
logo
:
true
visible
:
currentButton
.
icon
.
source
!==
icon
.
source
&&
!
QGroundControl
.
corePlugin
.
options
.
combineSettingsAndSetup
onClicked
:
{
if
(
_viewButtonClicked
(
this
))
{
mainWindow
.
showSettingsView
()
}
}
}
QGCToolBarButton
{
id
:
setupButton
Layout.fillHeight
:
true
icon.source
:
"
/qmlimages/Gears.svg
"
visible
:
currentButton
.
icon
.
source
!==
icon
.
source
onClicked
:
{
if
(
_viewButtonClicked
(
this
))
{
mainWindow
.
showSetupView
()
}
}
}
QGCToolBarButton
{
id
:
planButton
Layout.fillHeight
:
true
icon.source
:
"
/qmlimages/Plan.svg
"
visible
:
currentButton
.
icon
.
source
!==
icon
.
source
onClicked
:
{
if
(
_viewButtonClicked
(
this
))
{
mainWindow
.
showPlanView
()
}
}
}
QGCToolBarButton
{
id
:
flyButton
Layout.fillHeight
:
true
icon.source
:
"
/qmlimages/PaperPlane.svg
"
visible
:
currentButton
.
icon
.
source
!==
icon
.
source
onClicked
:
{
if
(
_viewButtonClicked
(
this
))
{
mainWindow
.
showFlyView
()
// Easter Egg mechanism
_clickCount
++
eggTimer
.
restart
()
if
(
_clickCount
==
5
)
{
if
(
!
QGroundControl
.
corePlugin
.
showAdvancedUI
)
{
advancedModeConfirmation
.
open
()
}
else
{
QGroundControl
.
corePlugin
.
showAdvancedUI
=
false
}
}
else
if
(
_clickCount
==
7
)
{
QGroundControl
.
corePlugin
.
showTouchAreas
=
!
QGroundControl
.
corePlugin
.
showTouchAreas
}
}
}
property
int
_clickCount
:
0
Timer
{
id
:
eggTimer
interval
:
1000
repeat
:
false
onTriggered
:
parent
.
_clickCount
=
0
}
MessageDialog
{
id
:
advancedModeConfirmation
title
:
qsTr
(
"
Advanced Mode
"
)
text
:
QGroundControl
.
corePlugin
.
showAdvancedUIMessage
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
No
onYes
:
{
QGroundControl
.
corePlugin
.
showAdvancedUI
=
true
advancedModeConfirmation
.
close
()
}
}
}
QGCToolBarButton
{
id
:
analyzeButton
Layout.fillHeight
:
true
icon.source
:
"
/qmlimages/Analyze.svg
"
visible
:
currentButton
.
icon
.
source
!==
icon
.
source
&&
QGroundControl
.
corePlugin
.
showAdvancedUI
onClicked
:
{
if
(
_viewButtonClicked
(
this
))
{
mainWindow
.
showAnalyzeView
()
}
}
}
}
}
// View / Tool separator
Row
{
id
:
separator
anchors.bottomMargin
:
1
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
spacing
:
ScreenTools
.
defaultFontPixelWidth
*
1.5
Item
{
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
width
:
ScreenTools
.
defaultFontPixelWidth
/
2
}
Rectangle
{
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
width
:
1
color
:
qgcPal
.
text
}
Item
{
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
width
:
ScreenTools
.
defaultFontPixelWidth
/
2
}
}
QGCFlickable
{
id
:
toolsFlickable
anchors.left
:
separator
.
right
anchors.right
:
connectionStatus
.
visible
?
connectionStatus
.
left
:
parent
.
right
anchors.bottomMargin
:
1
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
contentWidth
:
toolRow
.
width
flickableDirection
:
Flickable
.
HorizontalFlick
Row
{
id
:
toolRow
anchors.bottomMargin
:
1
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
spacing
:
ScreenTools
.
defaultFontPixelWidth
*
1.5
Repeater
{
id
:
appRepeater
model
:
QGroundControl
.
corePlugin
.
toolBarIndicators
Loader
{
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.margins
:
_toolIndicatorMargins
source
:
modelData
visible
:
item
.
showIndicator
}
}
Repeater
{
model
:
_activeVehicle
?
_activeVehicle
.
toolBarIndicators
:
[]
Loader
{
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.margins
:
_toolIndicatorMargins
source
:
modelData
visible
:
item
.
showIndicator
}
}
}
}
//-------------------------------------------------------------------------
//-- Branding Logo
Image
{
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.66
visible
:
_activeVehicle
&&
!
communicationLost
&&
x
>
(
toolsFlickable
.
x
+
toolsFlickable
.
contentWidth
+
ScreenTools
.
defaultFontPixelWidth
)
fillMode
:
Image
.
PreserveAspectFit
source
:
_outdoorPalette
?
_brandImageOutdoor
:
_brandImageIndoor
mipmap
:
true
property
bool
_outdoorPalette
:
qgcPal
.
globalTheme
===
QGCPalette
.
Light
property
bool
_corePluginBranding
:
QGroundControl
.
corePlugin
.
brandImageIndoor
.
length
!=
0
property
string
_userBrandImageIndoor
:
QGroundControl
.
settingsManager
.
brandImageSettings
.
userBrandImageIndoor
.
value
property
string
_userBrandImageOutdoor
:
QGroundControl
.
settingsManager
.
brandImageSettings
.
userBrandImageOutdoor
.
value
property
bool
_userBrandingIndoor
:
_userBrandImageIndoor
.
length
!=
0
property
bool
_userBrandingOutdoor
:
_userBrandImageOutdoor
.
length
!=
0
property
string
_brandImageIndoor
:
_userBrandingIndoor
?
_userBrandImageIndoor
:
(
_userBrandingOutdoor
?
_userBrandImageOutdoor
:
(
_corePluginBranding
?
QGroundControl
.
corePlugin
.
brandImageIndoor
:
(
activeVehicle
?
activeVehicle
.
brandImageIndoor
:
""
)
)
)
property
string
_brandImageOutdoor
:
_userBrandingOutdoor
?
_userBrandImageOutdoor
:
(
_userBrandingIndoor
?
_userBrandImageIndoor
:
(
_corePluginBranding
?
QGroundControl
.
corePlugin
.
brandImageOutdoor
:
(
activeVehicle
?
activeVehicle
.
brandImageOutdoor
:
""
)
)
)
}
// Small parameter download progress bar
Rectangle
{
anchors.bottom
:
parent
.
bottom
height
:
_root
.
height
*
0.05
width
:
_activeVehicle
?
_activeVehicle
.
parameterManager
.
loadProgress
*
parent
.
width
:
0
color
:
qgcPal
.
colorGreen
visible
:
!
largeProgressBar
.
visible
}
// Large parameter download progress bar
Rectangle
{
id
:
largeProgressBar
anchors.bottom
:
parent
.
bottom
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
height
:
parent
.
height
color
:
qgcPal
.
window
visible
:
_showLargeProgress
property
bool
_initialDownloadComplete
:
_activeVehicle
?
_activeVehicle
.
parameterManager
.
parametersReady
:
true
property
bool
_userHide
:
false
property
bool
_showLargeProgress
:
!
_initialDownloadComplete
&&
!
_userHide
&&
qgcPal
.
globalTheme
===
QGCPalette
.
Light
Connections
{
target
:
QGroundControl
.
multiVehicleManager
onActiveVehicleChanged
:
largeProgressBar
.
_userHide
=
false
}
Rectangle
{
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
width
:
_activeVehicle
?
_activeVehicle
.
parameterManager
.
loadProgress
*
parent
.
width
:
0
color
:
qgcPal
.
colorGreen
}
QGCLabel
{
anchors.centerIn
:
parent
text
:
qsTr
(
"
Downloading Parameters
"
)
font.pointSize
:
ScreenTools
.
largeFontPointSize
}
QGCLabel
{
anchors.margins
:
_margin
anchors.right
:
parent
.
right
anchors.bottom
:
parent
.
bottom
text
:
qsTr
(
"
Click anywhere to hide
"
)
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
largeProgressBar
.
_userHide
=
true
}
}
//-------------------------------------------------------------------------
//-- Waiting for a vehicle
QGCLabel
{
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.right
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
text
:
qsTr
(
"
Waiting For Vehicle Connection
"
)
font.pointSize
:
ScreenTools
.
mediumFontPointSize
font.family
:
ScreenTools
.
demiboldFontFamily
color
:
qgcPal
.
colorRed
visible
:
!
_activeVehicle
}
//-------------------------------------------------------------------------
//-- Connection Status
Row
{
id
:
connectionStatus
anchors.rightMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.right
:
parent
.
right
layoutDirection
:
Qt
.
RightToLeft
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
_activeVehicle
&&
communicationLost
QGCButton
{
id
:
disconnectButton
anchors.verticalCenter
:
parent
.
verticalCenter
text
:
qsTr
(
"
Disconnect
"
)
primary
:
true
onClicked
:
_activeVehicle
.
disconnectInactiveVehicle
()
}
QGCLabel
{
id
:
connectionLost
anchors.verticalCenter
:
parent
.
verticalCenter
text
:
qsTr
(
"
COMMUNICATION LOST
"
)
font.pointSize
:
ScreenTools
.
largeFontPointSize
font.family
:
ScreenTools
.
demiboldFontFamily
color
:
qgcPal
.
colorRed
}
}
}
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