Commit 353b727b authored by Gus Grubba's avatar Gus Grubba

Make mainIsMap visible downstream

Clip PIP window so when video is set to fit width, the hight is clipped
Remove ExclusiveGroup from CameraCalc radio buttons
Remove ExclusiveGroup from FWLandingPatternEditor radio buttons
Set main window minimum width and height
parent b6a0f25c
...@@ -40,24 +40,24 @@ Item { ...@@ -40,24 +40,24 @@ Item {
} }
} }
property alias guidedController: guidedActionsController property alias guidedController: guidedActionsController
property bool activeVehicleJoystickEnabled: activeVehicle ? activeVehicle.joystickEnabled : false property bool activeVehicleJoystickEnabled: activeVehicle ? activeVehicle.joystickEnabled : false
property bool mainIsMap: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_mainIsMapKey, true) : true
property var _missionController: _planController.missionController property bool isBackgroundDark: mainIsMap ? (mainWindow.flightDisplayMap ? mainWindow.flightDisplayMap.isSatelliteMap : true) : true
property var _geoFenceController: _planController.geoFenceController
property var _rallyPointController: _planController.rallyPointController property var _missionController: _planController.missionController
property bool _mainIsMap: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_mainIsMapKey, true) : true property var _geoFenceController: _planController.geoFenceController
property bool _isPipVisible: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_PIPVisibleKey, true) : false property var _rallyPointController: _planController.rallyPointController
property bool _useChecklist: QGroundControl.settingsManager.appSettings.useChecklist.rawValue property bool _isPipVisible: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_PIPVisibleKey, true) : false
property real _savedZoomLevel: 0 property bool _useChecklist: QGroundControl.settingsManager.appSettings.useChecklist.rawValue
property real _margins: ScreenTools.defaultFontPixelWidth / 2 property real _savedZoomLevel: 0
property real _pipSize: mainWindow.width * 0.2 property real _margins: ScreenTools.defaultFontPixelWidth / 2
property alias _guidedController: guidedActionsController property real _pipSize: mainWindow.width * 0.2
property alias _altitudeSlider: altitudeSlider property alias _guidedController: guidedActionsController
property alias _altitudeSlider: altitudeSlider
readonly property var _dynamicCameras: activeVehicle ? activeVehicle.dynamicCameras : null readonly property var _dynamicCameras: activeVehicle ? activeVehicle.dynamicCameras : null
readonly property bool _isCamera: _dynamicCameras ? _dynamicCameras.cameras.count > 0 : false readonly property bool _isCamera: _dynamicCameras ? _dynamicCameras.cameras.count > 0 : false
readonly property bool isBackgroundDark: _mainIsMap ? (mainWindow.flightDisplayMap ? mainWindow.flightDisplayMap.isSatelliteMap : true) : true
readonly property real _defaultRoll: 0 readonly property real _defaultRoll: 0
readonly property real _defaultPitch: 0 readonly property real _defaultPitch: 0
readonly property real _defaultHeading: 0 readonly property real _defaultHeading: 0
...@@ -70,8 +70,8 @@ Item { ...@@ -70,8 +70,8 @@ Item {
readonly property string _PIPVisibleKey: "IsPIPVisible" readonly property string _PIPVisibleKey: "IsPIPVisible"
function setStates() { function setStates() {
QGroundControl.saveBoolGlobalSetting(_mainIsMapKey, _mainIsMap) QGroundControl.saveBoolGlobalSetting(_mainIsMapKey, mainIsMap)
if(_mainIsMap) { if(mainIsMap) {
//-- Adjust Margins //-- Adjust Margins
_flightMapContainer.state = "fullMode" _flightMapContainer.state = "fullMode"
_flightVideo.state = "pipMode" _flightVideo.state = "pipMode"
...@@ -277,8 +277,8 @@ Item { ...@@ -277,8 +277,8 @@ Item {
Window { Window {
id: videoWindow id: videoWindow
width: !_mainIsMap ? _mapAndVideo.width : _pipSize width: !mainIsMap ? _mapAndVideo.width : _pipSize
height: !_mainIsMap ? _mapAndVideo.height : _pipSize * (9/16) height: !mainIsMap ? _mapAndVideo.height : _pipSize * (9/16)
visible: false visible: false
Item { Item {
...@@ -309,7 +309,7 @@ Item { ...@@ -309,7 +309,7 @@ Item {
} }
} }
QGCMapPalette { id: mapPal; lightColors: _mainIsMap ? mainWindow.flightDisplayMap.isSatelliteMap : true } QGCMapPalette { id: mapPal; lightColors: mainIsMap ? mainWindow.flightDisplayMap.isSatelliteMap : true }
Item { Item {
id: _mapAndVideo id: _mapAndVideo
...@@ -318,12 +318,12 @@ Item { ...@@ -318,12 +318,12 @@ Item {
//-- Map View //-- Map View
Item { Item {
id: _flightMapContainer id: _flightMapContainer
z: _mainIsMap ? _mapAndVideo.z + 1 : _mapAndVideo.z + 2 z: mainIsMap ? _mapAndVideo.z + 1 : _mapAndVideo.z + 2
anchors.left: _mapAndVideo.left anchors.left: _mapAndVideo.left
anchors.bottom: _mapAndVideo.bottom anchors.bottom: _mapAndVideo.bottom
visible: _mainIsMap || _isPipVisible && !QGroundControl.videoManager.fullScreen visible: mainIsMap || _isPipVisible && !QGroundControl.videoManager.fullScreen
width: _mainIsMap ? _mapAndVideo.width : _pipSize width: mainIsMap ? _mapAndVideo.width : _pipSize
height: _mainIsMap ? _mapAndVideo.height : _pipSize * (9/16) height: mainIsMap ? _mapAndVideo.height : _pipSize * (9/16)
states: [ states: [
State { State {
name: "pipMode" name: "pipMode"
...@@ -348,7 +348,7 @@ Item { ...@@ -348,7 +348,7 @@ Item {
flightWidgets: flightDisplayViewWidgets flightWidgets: flightDisplayViewWidgets
rightPanelWidth: ScreenTools.defaultFontPixelHeight * 9 rightPanelWidth: ScreenTools.defaultFontPixelHeight * 9
multiVehicleView: !singleVehicleView.checked multiVehicleView: !singleVehicleView.checked
scaleState: (_mainIsMap && flyViewOverlay.item) ? (flyViewOverlay.item.scaleState ? flyViewOverlay.item.scaleState : "bottomMode") : "bottomMode" scaleState: (mainIsMap && flyViewOverlay.item) ? (flyViewOverlay.item.scaleState ? flyViewOverlay.item.scaleState : "bottomMode") : "bottomMode"
Component.onCompleted: { Component.onCompleted: {
mainWindow.flightDisplayMap = _fMap mainWindow.flightDisplayMap = _fMap
} }
...@@ -358,12 +358,12 @@ Item { ...@@ -358,12 +358,12 @@ Item {
//-- Video View //-- Video View
Item { Item {
id: _flightVideo id: _flightVideo
z: _mainIsMap ? _mapAndVideo.z + 2 : _mapAndVideo.z + 1 z: mainIsMap ? _mapAndVideo.z + 2 : _mapAndVideo.z + 1
width: !_mainIsMap ? _mapAndVideo.width : _pipSize width: !mainIsMap ? _mapAndVideo.width : _pipSize
height: !_mainIsMap ? _mapAndVideo.height : _pipSize * (9/16) height: !mainIsMap ? _mapAndVideo.height : _pipSize * (9/16)
anchors.left: _mapAndVideo.left anchors.left: _mapAndVideo.left
anchors.bottom: _mapAndVideo.bottom anchors.bottom: _mapAndVideo.bottom
visible: QGroundControl.videoManager.hasVideo && (!_mainIsMap || _isPipVisible) visible: QGroundControl.videoManager.hasVideo && (!mainIsMap || _isPipVisible)
onParentChanged: { onParentChanged: {
/* If video comes back from popup /* If video comes back from popup
...@@ -471,9 +471,9 @@ Item { ...@@ -471,9 +471,9 @@ Item {
visible: QGroundControl.videoManager.hasVideo && !QGroundControl.videoManager.fullScreen && _flightVideo.state != "popup" visible: QGroundControl.videoManager.hasVideo && !QGroundControl.videoManager.fullScreen && _flightVideo.state != "popup"
isHidden: !_isPipVisible isHidden: !_isPipVisible
isDark: isBackgroundDark isDark: isBackgroundDark
enablePopup: _mainIsMap enablePopup: mainIsMap
onActivated: { onActivated: {
_mainIsMap = !_mainIsMap mainIsMap = !mainIsMap
setStates() setStates()
} }
onHideIt: { onHideIt: {
...@@ -741,7 +741,7 @@ Item { ...@@ -741,7 +741,7 @@ Item {
width: airspaceRow.width + (ScreenTools.defaultFontPixelWidth * 3) width: airspaceRow.width + (ScreenTools.defaultFontPixelWidth * 3)
height: airspaceRow.height * 1.25 height: airspaceRow.height * 1.25
color: qgcPal.globalTheme === QGCPalette.Light ? Qt.rgba(1,1,1,0.95) : Qt.rgba(0,0,0,0.75) color: qgcPal.globalTheme === QGCPalette.Light ? Qt.rgba(1,1,1,0.95) : Qt.rgba(0,0,0,0.75)
visible: QGroundControl.airmapSupported && _mainIsMap && flightPermit && flightPermit !== AirspaceFlightPlanProvider.PermitNone visible: QGroundControl.airmapSupported && mainIsMap && flightPermit && flightPermit !== AirspaceFlightPlanProvider.PermitNone
radius: 3 radius: 3
border.width: 1 border.width: 1
border.color: qgcPal.globalTheme === QGCPalette.Light ? Qt.rgba(0,0,0,0.35) : Qt.rgba(1,1,1,0.35) border.color: qgcPal.globalTheme === QGCPalette.Light ? Qt.rgba(0,0,0,0.35) : Qt.rgba(1,1,1,0.35)
......
...@@ -55,7 +55,7 @@ FlightMap { ...@@ -55,7 +55,7 @@ FlightMap {
property bool _airspaceEnabled: QGroundControl.airmapSupported ? (QGroundControl.settingsManager.airMapSettings.enableAirMap.rawValue && QGroundControl.airspaceManager.connected): false property bool _airspaceEnabled: QGroundControl.airmapSupported ? (QGroundControl.settingsManager.airMapSettings.enableAirMap.rawValue && QGroundControl.airspaceManager.connected): false
property bool _disableVehicleTracking: false property bool _disableVehicleTracking: false
property bool _keepVehicleCentered: _mainIsMap ? false : true property bool _keepVehicleCentered: mainIsMap ? false : true
function updateAirspace(reset) { function updateAirspace(reset) {
if(_airspaceEnabled) { if(_airspaceEnabled) {
...@@ -191,7 +191,7 @@ FlightMap { ...@@ -191,7 +191,7 @@ FlightMap {
// Add trajectory points to the map // Add trajectory points to the map
MapItemView { MapItemView {
model: _mainIsMap ? activeVehicle ? activeVehicle.trajectoryPoints : 0 : 0 model: mainIsMap ? activeVehicle ? activeVehicle.trajectoryPoints : 0 : 0
delegate: MapPolyline { delegate: MapPolyline {
line.width: 3 line.width: 3
line.color: "red" line.color: "red"
...@@ -210,7 +210,7 @@ FlightMap { ...@@ -210,7 +210,7 @@ FlightMap {
vehicle: object vehicle: object
coordinate: object.coordinate coordinate: object.coordinate
map: flightMap map: flightMap
size: _mainIsMap ? ScreenTools.defaultFontPixelHeight * 3 : ScreenTools.defaultFontPixelHeight size: mainIsMap ? ScreenTools.defaultFontPixelHeight * 3 : ScreenTools.defaultFontPixelHeight
z: QGroundControl.zOrderVehicles z: QGroundControl.zOrderVehicles
} }
} }
...@@ -236,7 +236,7 @@ FlightMap { ...@@ -236,7 +236,7 @@ FlightMap {
PlanMapItems { PlanMapItems {
map: flightMap map: flightMap
largeMapView: _mainIsMap largeMapView: mainIsMap
masterController: masterController masterController: masterController
isActiveVehicle: _vehicle.active isActiveVehicle: _vehicle.active
...@@ -252,7 +252,7 @@ FlightMap { ...@@ -252,7 +252,7 @@ FlightMap {
// Allow custom builds to add map items // Allow custom builds to add map items
CustomMapItems { CustomMapItems {
map: flightMap map: flightMap
largeMapView: _mainIsMap largeMapView: mainIsMap
} }
GeoFenceMapVisuals { GeoFenceMapVisuals {
......
...@@ -21,7 +21,8 @@ import QGroundControl.Vehicle 1.0 ...@@ -21,7 +21,8 @@ import QGroundControl.Vehicle 1.0
import QGroundControl.Controllers 1.0 import QGroundControl.Controllers 1.0
Item { Item {
id: root id: root
clip: true
property double _ar: QGroundControl.videoManager.aspectRatio property double _ar: QGroundControl.videoManager.aspectRatio
property bool _showGrid: QGroundControl.settingsManager.videoSettings.gridLines.rawValue > 0 property bool _showGrid: QGroundControl.settingsManager.videoSettings.gridLines.rawValue > 0
property var _videoReceiver: QGroundControl.videoManager.videoReceiver property var _videoReceiver: QGroundControl.videoManager.videoReceiver
...@@ -41,7 +42,7 @@ Item { ...@@ -41,7 +42,7 @@ Item {
text: QGroundControl.settingsManager.videoSettings.streamEnabled.rawValue ? qsTr("WAITING FOR VIDEO") : qsTr("VIDEO DISABLED") text: QGroundControl.settingsManager.videoSettings.streamEnabled.rawValue ? qsTr("WAITING FOR VIDEO") : qsTr("VIDEO DISABLED")
font.family: ScreenTools.demiboldFontFamily font.family: ScreenTools.demiboldFontFamily
color: "white" color: "white"
font.pointSize: _mainIsMap ? ScreenTools.smallFontPointSize : ScreenTools.largeFontPointSize font.pointSize: mainIsMap ? ScreenTools.smallFontPointSize : ScreenTools.largeFontPointSize
anchors.centerIn: parent anchors.centerIn: parent
} }
MouseArea { MouseArea {
......
...@@ -27,11 +27,13 @@ import QGroundControl.Airmap 1.0 ...@@ -27,11 +27,13 @@ import QGroundControl.Airmap 1.0
Item { Item {
id: widgetRoot id: widgetRoot
readonly property real _rightPanelWidth: Math.min(parent.width / 3, ScreenTools.defaultFontPixelWidth * 30)
property bool useLightColors property bool useLightColors
property var missionController property var missionController
property bool showValues: !QGroundControl.airspaceManager.airspaceVisible property bool showValues: !QGroundControl.airspaceManager.airspaceVisible
property bool _isSatellite: _mainIsMap ? (mainWindow.flightDisplayMap ? mainWindow.flightDisplayMap.isSatelliteMap : true) : true property bool _isSatellite: mainIsMap ? (mainWindow.flightDisplayMap ? mainWindow.flightDisplayMap.isSatelliteMap : true) : true
property bool _lightWidgetBorders: _isSatellite property bool _lightWidgetBorders: _isSatellite
property bool _airspaceEnabled: QGroundControl.airmapSupported ? QGroundControl.settingsManager.airMapSettings.enableAirMap.rawValue : false property bool _airspaceEnabled: QGroundControl.airmapSupported ? QGroundControl.settingsManager.airMapSettings.enableAirMap.rawValue : false
...@@ -117,7 +119,7 @@ Item { ...@@ -117,7 +119,7 @@ Item {
anchors.top: parent.verticalCenter anchors.top: parent.verticalCenter
spacing: ScreenTools.defaultFontPixelHeight spacing: ScreenTools.defaultFontPixelHeight
property bool noGPSLockVisible: activeVehicle && !activeVehicle.coordinate.isValid && _mainIsMap property bool noGPSLockVisible: activeVehicle && !activeVehicle.coordinate.isValid && mainIsMap
property bool prearmErrorVisible: activeVehicle && activeVehicle.prearmError property bool prearmErrorVisible: activeVehicle && activeVehicle.prearmError
QGCLabel { QGCLabel {
...@@ -161,10 +163,9 @@ Item { ...@@ -161,10 +163,9 @@ Item {
// Airmap Airspace Control // Airmap Airspace Control
AirspaceControl { AirspaceControl {
id: airspaceControl id: airspaceControl
width: getPreferredInstrumentWidth() width: _rightPanelWidth
planView: false planView: false
visible: _airspaceEnabled visible: _airspaceEnabled
anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5
} }
//------------------------------------------------------- //-------------------------------------------------------
//-- Instrument Panel //-- Instrument Panel
......
...@@ -70,8 +70,6 @@ Column { ...@@ -70,8 +70,6 @@ Column {
id: cameraOrientationGroup id: cameraOrientationGroup
} }
ExclusiveGroup { id: fixedValueGroup }
SectionHeader { SectionHeader {
id: cameraHeader id: cameraHeader
text: qsTr("Camera") text: qsTr("Camera")
...@@ -109,7 +107,6 @@ Column { ...@@ -109,7 +107,6 @@ Column {
width: _editFieldWidth width: _editFieldWidth
text: "Landscape" text: "Landscape"
checked: !!cameraCalc.landscape.value checked: !!cameraCalc.landscape.value
exclusiveGroup: cameraOrientationGroup
onClicked: cameraCalc.landscape.value = 1 onClicked: cameraCalc.landscape.value = 1
} }
...@@ -117,7 +114,6 @@ Column { ...@@ -117,7 +114,6 @@ Column {
id: cameraOrientationPortrait id: cameraOrientationPortrait
text: "Portrait" text: "Portrait"
checked: !cameraCalc.landscape.value checked: !cameraCalc.landscape.value
exclusiveGroup: cameraOrientationGroup
onClicked: cameraCalc.landscape.value = 0 onClicked: cameraCalc.landscape.value = 0
} }
} }
...@@ -243,7 +239,6 @@ Column { ...@@ -243,7 +239,6 @@ Column {
id: fixedDistanceRadio id: fixedDistanceRadio
text: distanceToSurfaceLabel text: distanceToSurfaceLabel
checked: !!cameraCalc.valueSetIsDistance.value checked: !!cameraCalc.valueSetIsDistance.value
exclusiveGroup: fixedValueGroup
onClicked: cameraCalc.valueSetIsDistance.value = 1 onClicked: cameraCalc.valueSetIsDistance.value = 1
} }
...@@ -258,7 +253,6 @@ Column { ...@@ -258,7 +253,6 @@ Column {
id: fixedImageDensityRadio id: fixedImageDensityRadio
text: qsTr("Ground Res") text: qsTr("Ground Res")
checked: !cameraCalc.valueSetIsDistance.value checked: !cameraCalc.valueSetIsDistance.value
exclusiveGroup: fixedValueGroup
onClicked: cameraCalc.valueSetIsDistance.value = 0 onClicked: cameraCalc.valueSetIsDistance.value = 0
} }
......
...@@ -43,8 +43,6 @@ Rectangle { ...@@ -43,8 +43,6 @@ Rectangle {
property int _altitudeMode: missionItem.altitudesAreRelative ? QGroundControl.AltitudeModeRelative : QGroundControl.AltitudeModeAbsolute property int _altitudeMode: missionItem.altitudesAreRelative ? QGroundControl.AltitudeModeRelative : QGroundControl.AltitudeModeAbsolute
ExclusiveGroup { id: distanceGlideGroup }
Column { Column {
id: editorColumn id: editorColumn
anchors.margins: _margin anchors.margins: _margin
...@@ -139,7 +137,6 @@ Rectangle { ...@@ -139,7 +137,6 @@ Rectangle {
id: specifyLandingDistance id: specifyLandingDistance
text: qsTr("Landing Dist") text: qsTr("Landing Dist")
checked: missionItem.valueSetIsDistance.rawValue checked: missionItem.valueSetIsDistance.rawValue
exclusiveGroup: distanceGlideGroup
onClicked: missionItem.valueSetIsDistance.rawValue = checked onClicked: missionItem.valueSetIsDistance.rawValue = checked
Layout.fillWidth: true Layout.fillWidth: true
} }
...@@ -154,7 +151,6 @@ Rectangle { ...@@ -154,7 +151,6 @@ Rectangle {
id: specifyGlideSlope id: specifyGlideSlope
text: qsTr("Glide Slope") text: qsTr("Glide Slope")
checked: !missionItem.valueSetIsDistance.rawValue checked: !missionItem.valueSetIsDistance.rawValue
exclusiveGroup: distanceGlideGroup
onClicked: missionItem.valueSetIsDistance.rawValue = !checked onClicked: missionItem.valueSetIsDistance.rawValue = !checked
Layout.fillWidth: true Layout.fillWidth: true
} }
......
...@@ -22,10 +22,15 @@ import QGroundControl.FlightMap 1.0 ...@@ -22,10 +22,15 @@ import QGroundControl.FlightMap 1.0
/// Native QML top level window /// Native QML top level window
ApplicationWindow { ApplicationWindow {
id: mainWindow id: mainWindow
width: 1280 width: 1280
height: 720 height: 720
visible: true minimumWidth: 920
minimumHeight: 646
visible: true
onWidthChanged: console.log('W: ' + width)
onHeightChanged: console.log('H: ' + height)
readonly property real _topBottomMargins: ScreenTools.defaultFontPixelHeight * 0.5 readonly property real _topBottomMargins: ScreenTools.defaultFontPixelHeight * 0.5
readonly property string _mainToolbar: QGroundControl.corePlugin.options.mainToolbarUrl readonly property string _mainToolbar: QGroundControl.corePlugin.options.mainToolbarUrl
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment