Commit b42742ab authored by Valentin Platzgummer's avatar Valentin Platzgummer

bugs fixed

parent a4e86d1e
......@@ -760,6 +760,7 @@ QGCView {
GuidedActionsController {
id: guidedActionsController
wimaController: wimaController
wimaMenu: wimaMenu
missionController: _missionController
confirmDialog: guidedActionConfirm
actionList: guidedActionList
......
......@@ -216,17 +216,18 @@ FlightMap {
}
// Add mission items generated by wima planer to the map
// all Items
WimaPlanMapItems {
map: flightMap
largeMapView: _mainIsMap
missionItems: wimaController.missionItems
path: wimaController.waypointPath
showItems: _wimaEnabled && _showAllWimaItems
zOrderWP: QGroundControl.zOrderWaypointIndicators-2
zOrderLines: QGroundControl.zOrderWaypointLines-2
color: "#B4808080" // gray with alpha 0.7
zOrderWP: QGroundControl.zOrderWaypointIndicators-3
zOrderLines: QGroundControl.zOrderWaypointLines-1
color: "gray"
}
// current Items
WimaPlanMapItems {
map: flightMap
largeMapView: _mainIsMap
......@@ -234,7 +235,7 @@ FlightMap {
path: wimaController.currentWaypointPath
showItems: _wimaEnabled && _showCurrentWimaItems
zOrderWP: QGroundControl.zOrderWaypointIndicators-1
zOrderLines: QGroundControl.zOrderWaypointLines-1
zOrderLines: QGroundControl.zOrderWaypointIndicators-2
color: "green" // gray with alpha 0.7
}
......
......@@ -27,6 +27,7 @@ Item {
property var wimaController // must be provided by the user
property var planMasterController // must be provided by the user
readonly property alias missionReadyForStart: _private.missionReadyForStart
property bool _controllerValid: planMasterController !== undefined
property real _controllerProgressPct: _controllerValid ? planMasterController.missionController.progressPct : 0
......@@ -34,14 +35,21 @@ Item {
signal initSmartRTL();
Item {
id: _private
property bool missionReadyForStart: true
}
// Progress bar visibility
on_ControllerProgressPctChanged: {
if (_controllerProgressPct === 1) {
uploadCompleteText.visible = true
progressBar.visible = false
uploadCompleteText.visible = true
progressBar.visible = false
_private.missionReadyForStart = true
} else if (_controllerProgressPct > 0) {
progressBar.visible = true
uploadCompleteText.visible = false
progressBar.visible = true
uploadCompleteText.visible = false
_private.missionReadyForStart = false
}
}
......@@ -225,7 +233,7 @@ Item {
width: parent.width
QGCLabel {
text: qsTr("Phase Speed")
text: qsTr("Mission Speed")
Layout.fillWidth: true
}
FactTextField {
......@@ -234,7 +242,7 @@ Item {
}
QGCLabel {
text: qsTr("Arrival and Return Speed")
text: qsTr("AaR Speed")
Layout.fillWidth: true
}
FactTextField {
......@@ -298,7 +306,11 @@ Item {
QGCButton {
id: buttonUpload
text: qsTr("Upload")
onClicked: wimaController.uploadToVehicle()
onClicked: {
if (!planMasterController.offline) {
wimaController.uploadToVehicle()
}
}
Layout.fillWidth: true
}
......
......@@ -28,6 +28,7 @@ Item {
id: _root
property var wimaController
property var wimaMenu
property var missionController
property var confirmDialog
property var actionList
......@@ -120,6 +121,7 @@ Item {
property bool showOrbit: _guidedActionsEnabled && !_hideOrbit && _vehicleFlying && _activeVehicle.orbitModeSupported && !_missionActive
property bool showLandAbort: _guidedActionsEnabled && _vehicleFlying && _activeVehicle.fixedWing && _vehicleLanding
property bool showGotoLocation: _guidedActionsEnabled && _vehicleFlying
property bool wimaEnabled: wimaController.enableWimaController.value
// Note: The '_missionItemCount - 2' is a hack to not trigger resume mission when a mission ends with an RTL item
property bool showResumeMission: _activeVehicle && !_vehicleArmed && _vehicleWasFlying && _missionAvailable && _resumeMissionIndex > 0 && (_resumeMissionIndex < _missionItemCount - 2)
......@@ -130,7 +132,7 @@ Item {
property bool _guidedActionsEnabled: (!ScreenTools.isDebug && QGroundControl.corePlugin.options.guidedActionsRequireRCRSSI && _activeVehicle) ? _rcRSSIAvailable : _activeVehicle
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property string _flightMode: _activeVehicle ? _activeVehicle.flightMode : ""
property bool _missionAvailable: missionController.containsItems
property bool _missionAvailable: wimaEnabled ? wimaMenu.missionReadyForStart : missionController.containsItems
property bool _missionActive: _activeVehicle ? _vehicleArmed && (_vehicleInLandMode || _vehicleInRTLMode || _vehicleInMissionMode) : false
property bool _vehicleArmed: _activeVehicle ? _activeVehicle.armed : false
property bool _vehicleFlying: _activeVehicle ? _activeVehicle.flying : false
......
......@@ -33,7 +33,9 @@ Item {
// Add the mission item visuals to the map
Repeater {
model: largeMapView ? _missionController.visualItems : 0
property bool show: largeMapView
property var wimaController
model: show ? _missionController.visualItems : 0
delegate: MissionItemMapVisual {
map: _map
......
......@@ -30,8 +30,29 @@ Item {
property var _map: map
property var _missionLineViewComponent
property var zoom: map.zoomLevel
property bool showItems: true
// onZoomChanged: {
// console.log('zoomLevel')
// console.log(zoom)
// }
function hideNumber() {
if (zoom > 19.5) {
return 1
} else if (zoom > 19) {
return 2
} else if (zoom > 17) {
return 4
} else if (zoom > 14) {
return 8
} else {
return -1
}
}
Component {
id: missionLineViewComponent
......@@ -51,6 +72,17 @@ Item {
map: _map
color: _root.color
zOrder: _root.zOrderWP
visible: isVisible(index) && _root.visible
function isVisible(index) {
var num = hideNumber()
if (num > 0) {
return ((index+num) % num) == 0 ? true : false
} else {
return false
}
}
}
}
......
......@@ -101,6 +101,7 @@ public:
Q_PROPERTY(QString corridorScanComplexItemName READ corridorScanComplexItemName CONSTANT)
Q_PROPERTY(QString structureScanComplexItemName READ structureScanComplexItemName CONSTANT)
Q_INVOKABLE void removeMissionItem(int index);
/// Add a new simple mission item to the list
......
......@@ -107,7 +107,7 @@ Item {
MissionItemIndicator {
coordinate: _missionItem.coordinate
visible: _missionItem.specifiesCoordinate
visible: _missionItem.specifiesCoordinate && _root.visible
z: _root.zOrder
missionItem: _missionItem
sequenceNumber: _missionItem.sequenceNumber
......
......@@ -970,10 +970,11 @@ void WimaController::checkBatteryLevel()
Vehicle *managerVehicle = masterController()->managerVehicle();
WimaSettings* wimaSettings = qgcApp()->toolbox()->settingsManager()->wimaSettings();
int batteryThreshold = wimaSettings->lowBatteryThreshold()->rawValue().toInt();
bool enabled = _enableWimaController.rawValue().toBool();
static long attemptCounter = 0;
if (managerVehicle != nullptr) {
if (managerVehicle != nullptr && enabled == true) {
Fact *battery1percentRemaining = managerVehicle->battery1FactGroup()->getFact(VehicleBatteryFactGroup::_percentRemainingFactName);
Fact *battery2percentRemaining = managerVehicle->battery2FactGroup()->getFact(VehicleBatteryFactGroup::_percentRemainingFactName);
......
......@@ -32,6 +32,14 @@
#include "RunGuard.h"
#endif
#ifndef QML_PROFILE
#define QML_PROFILE 1
#endif
#if QML_PROFILE
#include <QQmlDebuggingEnabler>
#endif
#ifdef UNITTEST_BUILD
#include "UnitTest.h"
#endif
......@@ -246,6 +254,11 @@ int main(int argc, char *argv[])
//-- Initialize Cache System
getQGCMapEngine()->init();
#if QML_PROFILE
QQmlDebuggingEnabler enabler;
#endif
int exitCode = 0;
#ifdef UNITTEST_BUILD
......
......@@ -42,6 +42,8 @@ Item {
readonly property string _wimaViewSource: "WimaView.qml"
readonly property string _analyzeViewSource: "AnalyzeView.qml"
readonly property int _messageLifeTime: 10000 // ms, messages will be removed from the screen after this time
onHeightChanged: {
//-- We only deal with the available height if within the Fly or Plan view
if(!setupViewLoader.visible) {
......@@ -656,7 +658,7 @@ Item {
// Message life-time timer
Timer {
id: lifetimeTimer
interval: 10000 // ms
interval: _messageLifeTime // ms
repeat: false
onTriggered: {
......
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