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 {
}
}
property alias guidedController: guidedActionsController
property bool activeVehicleJoystickEnabled: activeVehicle ? activeVehicle.joystickEnabled : false
property var _missionController: _planController.missionController
property var _geoFenceController: _planController.geoFenceController
property var _rallyPointController: _planController.rallyPointController
property bool _mainIsMap: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_mainIsMapKey, true) : true
property bool _isPipVisible: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_PIPVisibleKey, true) : false
property bool _useChecklist: QGroundControl.settingsManager.appSettings.useChecklist.rawValue
property real _savedZoomLevel: 0
property real _margins: ScreenTools.defaultFontPixelWidth / 2
property real _pipSize: mainWindow.width * 0.2
property alias _guidedController: guidedActionsController
property alias _altitudeSlider: altitudeSlider
property alias guidedController: guidedActionsController
property bool activeVehicleJoystickEnabled: activeVehicle ? activeVehicle.joystickEnabled : false
property bool mainIsMap: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_mainIsMapKey, true) : true
property bool isBackgroundDark: mainIsMap ? (mainWindow.flightDisplayMap ? mainWindow.flightDisplayMap.isSatelliteMap : true) : true
property var _missionController: _planController.missionController
property var _geoFenceController: _planController.geoFenceController
property var _rallyPointController: _planController.rallyPointController
property bool _isPipVisible: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_PIPVisibleKey, true) : false
property bool _useChecklist: QGroundControl.settingsManager.appSettings.useChecklist.rawValue
property real _savedZoomLevel: 0
property real _margins: ScreenTools.defaultFontPixelWidth / 2
property real _pipSize: mainWindow.width * 0.2
property alias _guidedController: guidedActionsController
property alias _altitudeSlider: altitudeSlider
readonly property var _dynamicCameras: activeVehicle ? activeVehicle.dynamicCameras : null
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 _defaultPitch: 0
readonly property real _defaultHeading: 0
......@@ -70,8 +70,8 @@ Item {
readonly property string _PIPVisibleKey: "IsPIPVisible"
function setStates() {
QGroundControl.saveBoolGlobalSetting(_mainIsMapKey, _mainIsMap)
if(_mainIsMap) {
QGroundControl.saveBoolGlobalSetting(_mainIsMapKey, mainIsMap)
if(mainIsMap) {
//-- Adjust Margins
_flightMapContainer.state = "fullMode"
_flightVideo.state = "pipMode"
......@@ -277,8 +277,8 @@ Item {
Window {
id: videoWindow
width: !_mainIsMap ? _mapAndVideo.width : _pipSize
height: !_mainIsMap ? _mapAndVideo.height : _pipSize * (9/16)
width: !mainIsMap ? _mapAndVideo.width : _pipSize
height: !mainIsMap ? _mapAndVideo.height : _pipSize * (9/16)
visible: false
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 {
id: _mapAndVideo
......@@ -318,12 +318,12 @@ Item {
//-- Map View
Item {
id: _flightMapContainer
z: _mainIsMap ? _mapAndVideo.z + 1 : _mapAndVideo.z + 2
z: mainIsMap ? _mapAndVideo.z + 1 : _mapAndVideo.z + 2
anchors.left: _mapAndVideo.left
anchors.bottom: _mapAndVideo.bottom
visible: _mainIsMap || _isPipVisible && !QGroundControl.videoManager.fullScreen
width: _mainIsMap ? _mapAndVideo.width : _pipSize
height: _mainIsMap ? _mapAndVideo.height : _pipSize * (9/16)
visible: mainIsMap || _isPipVisible && !QGroundControl.videoManager.fullScreen
width: mainIsMap ? _mapAndVideo.width : _pipSize
height: mainIsMap ? _mapAndVideo.height : _pipSize * (9/16)
states: [
State {
name: "pipMode"
......@@ -348,7 +348,7 @@ Item {
flightWidgets: flightDisplayViewWidgets
rightPanelWidth: ScreenTools.defaultFontPixelHeight * 9
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: {
mainWindow.flightDisplayMap = _fMap
}
......@@ -358,12 +358,12 @@ Item {
//-- Video View
Item {
id: _flightVideo
z: _mainIsMap ? _mapAndVideo.z + 2 : _mapAndVideo.z + 1
width: !_mainIsMap ? _mapAndVideo.width : _pipSize
height: !_mainIsMap ? _mapAndVideo.height : _pipSize * (9/16)
z: mainIsMap ? _mapAndVideo.z + 2 : _mapAndVideo.z + 1
width: !mainIsMap ? _mapAndVideo.width : _pipSize
height: !mainIsMap ? _mapAndVideo.height : _pipSize * (9/16)
anchors.left: _mapAndVideo.left
anchors.bottom: _mapAndVideo.bottom
visible: QGroundControl.videoManager.hasVideo && (!_mainIsMap || _isPipVisible)
visible: QGroundControl.videoManager.hasVideo && (!mainIsMap || _isPipVisible)
onParentChanged: {
/* If video comes back from popup
......@@ -471,9 +471,9 @@ Item {
visible: QGroundControl.videoManager.hasVideo && !QGroundControl.videoManager.fullScreen && _flightVideo.state != "popup"
isHidden: !_isPipVisible
isDark: isBackgroundDark
enablePopup: _mainIsMap
enablePopup: mainIsMap
onActivated: {
_mainIsMap = !_mainIsMap
mainIsMap = !mainIsMap
setStates()
}
onHideIt: {
......@@ -741,7 +741,7 @@ Item {
width: airspaceRow.width + (ScreenTools.defaultFontPixelWidth * 3)
height: airspaceRow.height * 1.25
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
border.width: 1
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 {
property bool _airspaceEnabled: QGroundControl.airmapSupported ? (QGroundControl.settingsManager.airMapSettings.enableAirMap.rawValue && QGroundControl.airspaceManager.connected): false
property bool _disableVehicleTracking: false
property bool _keepVehicleCentered: _mainIsMap ? false : true
property bool _keepVehicleCentered: mainIsMap ? false : true
function updateAirspace(reset) {
if(_airspaceEnabled) {
......@@ -191,7 +191,7 @@ FlightMap {
// Add trajectory points to the map
MapItemView {
model: _mainIsMap ? activeVehicle ? activeVehicle.trajectoryPoints : 0 : 0
model: mainIsMap ? activeVehicle ? activeVehicle.trajectoryPoints : 0 : 0
delegate: MapPolyline {
line.width: 3
line.color: "red"
......@@ -210,7 +210,7 @@ FlightMap {
vehicle: object
coordinate: object.coordinate
map: flightMap
size: _mainIsMap ? ScreenTools.defaultFontPixelHeight * 3 : ScreenTools.defaultFontPixelHeight
size: mainIsMap ? ScreenTools.defaultFontPixelHeight * 3 : ScreenTools.defaultFontPixelHeight
z: QGroundControl.zOrderVehicles
}
}
......@@ -236,7 +236,7 @@ FlightMap {
PlanMapItems {
map: flightMap
largeMapView: _mainIsMap
largeMapView: mainIsMap
masterController: masterController
isActiveVehicle: _vehicle.active
......@@ -252,7 +252,7 @@ FlightMap {
// Allow custom builds to add map items
CustomMapItems {
map: flightMap
largeMapView: _mainIsMap
largeMapView: mainIsMap
}
GeoFenceMapVisuals {
......
......@@ -21,7 +21,8 @@ import QGroundControl.Vehicle 1.0
import QGroundControl.Controllers 1.0
Item {
id: root
id: root
clip: true
property double _ar: QGroundControl.videoManager.aspectRatio
property bool _showGrid: QGroundControl.settingsManager.videoSettings.gridLines.rawValue > 0
property var _videoReceiver: QGroundControl.videoManager.videoReceiver
......@@ -41,7 +42,7 @@ Item {
text: QGroundControl.settingsManager.videoSettings.streamEnabled.rawValue ? qsTr("WAITING FOR VIDEO") : qsTr("VIDEO DISABLED")
font.family: ScreenTools.demiboldFontFamily
color: "white"
font.pointSize: _mainIsMap ? ScreenTools.smallFontPointSize : ScreenTools.largeFontPointSize
font.pointSize: mainIsMap ? ScreenTools.smallFontPointSize : ScreenTools.largeFontPointSize
anchors.centerIn: parent
}
MouseArea {
......
......@@ -27,11 +27,13 @@ import QGroundControl.Airmap 1.0
Item {
id: widgetRoot
readonly property real _rightPanelWidth: Math.min(parent.width / 3, ScreenTools.defaultFontPixelWidth * 30)
property bool useLightColors
property var missionController
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 _airspaceEnabled: QGroundControl.airmapSupported ? QGroundControl.settingsManager.airMapSettings.enableAirMap.rawValue : false
......@@ -117,7 +119,7 @@ Item {
anchors.top: parent.verticalCenter
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
QGCLabel {
......@@ -161,10 +163,9 @@ Item {
// Airmap Airspace Control
AirspaceControl {
id: airspaceControl
width: getPreferredInstrumentWidth()
width: _rightPanelWidth
planView: false
visible: _airspaceEnabled
anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5
}
//-------------------------------------------------------
//-- Instrument Panel
......
......@@ -70,8 +70,6 @@ Column {
id: cameraOrientationGroup
}
ExclusiveGroup { id: fixedValueGroup }
SectionHeader {
id: cameraHeader
text: qsTr("Camera")
......@@ -109,7 +107,6 @@ Column {
width: _editFieldWidth
text: "Landscape"
checked: !!cameraCalc.landscape.value
exclusiveGroup: cameraOrientationGroup
onClicked: cameraCalc.landscape.value = 1
}
......@@ -117,7 +114,6 @@ Column {
id: cameraOrientationPortrait
text: "Portrait"
checked: !cameraCalc.landscape.value
exclusiveGroup: cameraOrientationGroup
onClicked: cameraCalc.landscape.value = 0
}
}
......@@ -243,7 +239,6 @@ Column {
id: fixedDistanceRadio
text: distanceToSurfaceLabel
checked: !!cameraCalc.valueSetIsDistance.value
exclusiveGroup: fixedValueGroup
onClicked: cameraCalc.valueSetIsDistance.value = 1
}
......@@ -258,7 +253,6 @@ Column {
id: fixedImageDensityRadio
text: qsTr("Ground Res")
checked: !cameraCalc.valueSetIsDistance.value
exclusiveGroup: fixedValueGroup
onClicked: cameraCalc.valueSetIsDistance.value = 0
}
......
......@@ -43,8 +43,6 @@ Rectangle {
property int _altitudeMode: missionItem.altitudesAreRelative ? QGroundControl.AltitudeModeRelative : QGroundControl.AltitudeModeAbsolute
ExclusiveGroup { id: distanceGlideGroup }
Column {
id: editorColumn
anchors.margins: _margin
......@@ -139,7 +137,6 @@ Rectangle {
id: specifyLandingDistance
text: qsTr("Landing Dist")
checked: missionItem.valueSetIsDistance.rawValue
exclusiveGroup: distanceGlideGroup
onClicked: missionItem.valueSetIsDistance.rawValue = checked
Layout.fillWidth: true
}
......@@ -154,7 +151,6 @@ Rectangle {
id: specifyGlideSlope
text: qsTr("Glide Slope")
checked: !missionItem.valueSetIsDistance.rawValue
exclusiveGroup: distanceGlideGroup
onClicked: missionItem.valueSetIsDistance.rawValue = !checked
Layout.fillWidth: true
}
......
......@@ -22,10 +22,15 @@ import QGroundControl.FlightMap 1.0
/// Native QML top level window
ApplicationWindow {
id: mainWindow
width: 1280
height: 720
visible: true
id: mainWindow
width: 1280
height: 720
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 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