diff --git a/.appveyor.yml b/.appveyor.yml index 22beb1402e63091d60aad79ff8d188c4d11c9ea0..f3b48d65c5492d80508179baee7f57aba61c14d5 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -15,7 +15,7 @@ environment: install: - git submodule update --init --recursive - call "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 - - set PATH=C:\Qt\Tools\QtCreator\bin;C:\Qt\5.9.3\msvc2015\bin;%PATH% + - set PATH=C:\Qt\Tools\QtCreator\bin;C:\Qt\5.9.4\msvc2015\bin;%PATH% - mkdir %LOCALAPPDATA%\QtProject && copy test\qtlogging.ini %LOCALAPPDATA%\QtProject\ - ps: | Write-Host "Installing GStreamer..." -ForegroundColor Cyan @@ -35,7 +35,7 @@ install: Write-Host "Installed" -ForegroundColor Green build_script: - - mkdir %SHADOW_BUILD_DIR% && cd %SHADOW_BUILD_DIR% && C:\Qt\5.9.3\msvc2015\bin\qmake -r CONFIG-=debug_and_release CONFIG+=%CONFIG% CONFIG+=WarningsAsErrorsOn %APPVEYOR_BUILD_FOLDER%\qgroundcontrol.pro + - mkdir %SHADOW_BUILD_DIR% && cd %SHADOW_BUILD_DIR% && C:\Qt\5.9.4\msvc2015\bin\qmake -r CONFIG-=debug_and_release CONFIG+=%CONFIG% CONFIG+=WarningsAsErrorsOn %APPVEYOR_BUILD_FOLDER%\qgroundcontrol.pro - cd %SHADOW_BUILD_DIR% && jom - if "%CONFIG%" EQU "installer" ( copy %SHADOW_BUILD_DIR%\release\QGroundControl-installer.exe %APPVEYOR_BUILD_FOLDER%\QGroundControl-installer.exe ) # Generate the source server information to embed in the PDB diff --git a/QGCExternalLibs.pri b/QGCExternalLibs.pri index fa0e521ff36f9797cfd0d617948d4a93daaa53bd..00ab5096227298050346409bd61c6bfe5dacc9f0 100644 --- a/QGCExternalLibs.pri +++ b/QGCExternalLibs.pri @@ -21,14 +21,32 @@ WindowsBuild { # In the mean time, it’s possible to define a completely different dialect by defining the # location and name below. +# check for user defined settings in user_config.pri if not already set as qmake argument isEmpty(MAVLINKPATH_REL) { - MAVLINKPATH_REL = libs/mavlink/include/mavlink/v2.0 + exists(user_config.pri):infile(user_config.pri, MAVLINKPATH_REL) { + MAVLINKPATH_REL = $$fromfile(user_config.pri, MAVLINKPATH_REL) + message($$sprintf("Using user-supplied relativ mavlink path '%1' specified in user_config.pri", $$MAVLINKPATH_REL)) + } else { + MAVLINKPATH_REL = libs/mavlink/include/mavlink/v2.0 + } } + isEmpty(MAVLINKPATH) { - MAVLINKPATH = $$BASEDIR/$$MAVLINKPATH_REL + exists(user_config.pri):infile(user_config.pri, MAVLINKPATH) { + MAVLINKPATH = $$fromfile(user_config.pri, MAVLINKPATH) + message($$sprintf("Using user-supplied mavlink path '%1' specified in user_config.pri", $$MAVLINKPATH)) + } else { + MAVLINKPATH = $$BASEDIR/$$MAVLINKPATH_REL + } } + isEmpty(MAVLINK_CONF) { - MAVLINK_CONF = ardupilotmega + exists(user_config.pri):infile(user_config.pri, MAVLINK_CONF) { + MAVLINK_CONF = $$fromfile(user_config.pri, MAVLINK_CONF) + message($$sprintf("Using user-supplied mavlink dialect '%1' specified in user_config.pri", $$MAVLINK_CONF)) + } else { + MAVLINK_CONF = ardupilotmega + } } # If defined, all APM specific MAVLink messages are disabled diff --git a/README.md b/README.md index 715b3d872f54fdba6a20fe91fa7a57db5e693b61..b74050dd6632a86a24abee5c2109c46c9cbc94cc 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ You **need to install Qt as described below** instead of using pre-built package * Windows: Make sure to install VS 2015 32 bit package. ###### Install additional packages: -* Ubuntu: sudo apt-get install speech-dispatcher libudev-dev libsdl2-dev +* Ubuntu: sudo apt-get install speech-dispatcher libudev-dev libsdl2-dev libgstreamer1.0-0 gstreamer1.0-plugins-base libgstreamer-plugins-base1.0-dev gstreamer1.0* * Fedora: sudo dnf install speech-dispatcher SDL2-devel SDL2 systemd-devel * Arch Linux: pacman -Sy speech-dispatcher * Windows: [USB Driver](http://www.pixhawk.org/firmware/downloads) to connect to Pixhawk/PX4Flow/3DR Radio diff --git a/libs/mavlink/include/mavlink/v2.0 b/libs/mavlink/include/mavlink/v2.0 index f36b9c4c5c0c9b6d33621779469de0c1e7eea457..3ddcbdfcd360c846246d8905d877add3488c8363 160000 --- a/libs/mavlink/include/mavlink/v2.0 +++ b/libs/mavlink/include/mavlink/v2.0 @@ -1 +1 @@ -Subproject commit f36b9c4c5c0c9b6d33621779469de0c1e7eea457 +Subproject commit 3ddcbdfcd360c846246d8905d877add3488c8363 diff --git a/localization/qgc.ts b/localization/qgc.ts index 74ef2baa90d9d9e43158c96e716042ba8329635b..27dea14b3baf926123e043453e863d30fcbad06c 100644 --- a/localization/qgc.ts +++ b/localization/qgc.ts @@ -1203,74 +1203,74 @@ APMSafetyComponentSub - - + + Failsafe Actions - - + + GCS Heartbeat: - - + + Leak: - - + + Detector Pin: - - + + Battery: - - + + EKF: - - + + Pilot Input: - - + + Internal Temperature: - - + + Internal Pressure: - - + + Threshold: - - + + Arming Checks - - + + Warning: Turning off arming checks can lead to loss of Vehicle control. @@ -2534,37 +2534,37 @@ propellers on the green thrusters and counter-clockwise propellers on the blue t AppMessages - + Log files (*.txt) - + All Files (*) - + Select log save file - + Save App Log - + Show Latest - + Set logging - + Turn on logging categories @@ -2863,17 +2863,17 @@ propellers on the green thrusters and counter-clockwise propellers on the blue t - + CameraCalc section version %1 not supported - + Custom Camera - + Manual (no camera specs) @@ -3011,62 +3011,87 @@ propellers on the green thrusters and counter-clockwise propellers on the blue t CameraPageWidget - + Video Settings - + Camera Settings - + Trigger Camera - + Camera - + + Free Space: + + + + + Single + + + + + Time Lapse + + + + + Photo Mode + + + + + Photo Interval (seconds) + + + + Reset Camera Defaults - + Reset - + Reset Camera to Factory Settings - + Confirm resetting all settings? - + Storage - + Format - + Format Camera Storage - + Confirm erasing all files? @@ -3112,37 +3137,37 @@ propellers on the green thrusters and counter-clockwise propellers on the blue t CenterMapDropButton - + Center map on: - + Mission - + All items - + Home - + Current Location - + Vehicle - + Follow Vehicle @@ -3180,6 +3205,92 @@ propellers on the green thrusters and counter-clockwise propellers on the blue t + + CorridorScanComplexItem + + + %1 does not support loading this complex mission item type: %2:%3 + + + + + %1 complex item version %2 not supported + + + + + CorridorScanEditor + + + WARNING: Photo interval is below minimum interval (%1 secs) supported by camera. + + + + + Altitude + + + + + Trigger Distance + + + + + Spacing + + + + + Corridor + + + + + Width + + + + + Turnaround dist + + + + + Take images in turnarounds + + + + + Relative altitude + + + + + Rotate Entry Point + + + + + Statistics + + + + + Photo count + + + + + Photo interval + + + + + secs + + + CustomCommandWidget @@ -3600,7 +3711,7 @@ propellers on the green thrusters and counter-clockwise propellers on the blue t FactCheckBox - + Label @@ -3618,20 +3729,24 @@ propellers on the green thrusters and counter-clockwise propellers on the blue t - - - - - - - - + + + + + + + + + + + + Value must be within %1 and %2 - - + + Invalid number @@ -3966,6 +4081,11 @@ propellers on the green thrusters and counter-clockwise propellers on the blue t Parrot Sequioa Monochrome + + + GoPro Hero 4 + + FirmwareUpgrade @@ -4647,88 +4767,88 @@ propellers on the green thrusters and counter-clockwise propellers on the blue t - + NMEA GPS Baudrate: - + Video - + Video Source: - + UDP Port: - + RTSP URL: - + TCP URL: - + Aspect Ratio: - + Disable When Disarmed: - + Brand Image - + Indoor Brand Image Path: - - + + Choose custom brand image file: - + Outdoor Brand Image Path: - + Video Recording - + Auto-Delete Files: - + Max Storage Usage: - + Video File Format: - + %1 Version: %2 @@ -5005,7 +5125,7 @@ propellers on the green thrusters and counter-clockwise propellers on the blue t GuidedActionConfirm - + Slide to confirm @@ -5013,7 +5133,7 @@ propellers on the green thrusters and counter-clockwise propellers on the blue t GuidedActionList - + Select Action @@ -5206,7 +5326,7 @@ propellers on the green thrusters and counter-clockwise propellers on the blue t - + Internal error: unknown actionCode @@ -5240,157 +5360,177 @@ propellers on the green thrusters and counter-clockwise propellers on the blue t - + Not Mapped - + Attitude Controls - + Lateral - + Roll - + Forward - + Pitch - + Yaw - + Throttle - + Skip - + Cancel - + Calibrate - + Additional Joystick settings: - + Enable joystick input - + Enable not allowed (Calibrate First) - + Active joystick: - + Active joystick name not in combo - + Center stick is zero throttle - + Spring loaded throttle smoothing - + Full down stick is zero throttle - + Allow negative Thrust - + Exponential: - + Advanced settings (careful!) - + Joystick mode: - + Deadbands - + + Deadband can be set during the first + + + + + step of calibration by gently wiggling each axis. + + + + + Deadband can also be adjusted by clicking and + + + + + dragging vertically on the corresponding axis monitor. + + + + Button actions: - + Buttons 0-%1 reserved for firmware use - + # - + Function: - + Shift Function: - + Axis Monitor - + Button Monitor @@ -5398,17 +5538,17 @@ propellers on the green thrusters and counter-clockwise propellers on the blue t JoystickConfigController - + Detected %1 joystick axes. To operate PX4, you need at least %2 axes. - + Calibrate - + The current calibration settings are now displayed for each axis on screen. Click the Next button to upload calibration to board. Click Cancel if you don't want to save these values. @@ -5755,45 +5895,45 @@ Click the Next button to upload calibration to board. Click Cancel if you don&ap LogDownloadController - + Available - - + + Canceled - - - + + + Error - + Downloaded - + Timed Out - + Log Download Directory - + Waiting - + UnknownDate @@ -5948,8 +6088,8 @@ Click the Next button to upload calibration to board. Click Cancel if you don&ap MAVLinkProtocol - - + + MAVLink Protocol @@ -5959,17 +6099,17 @@ Click the Next button to upload calibration to board. Click Cancel if you don&ap - + Detected radio still using MAVLink v1.0 on a link with MAVLink v2.0 enabled. Please upgrade the radio firmware. - + MAVLink protocol - + Opening Flight Data file for writing failed. Unable to write to %1. Please choose a different file location. @@ -6045,33 +6185,33 @@ Click the Next button to upload calibration to board. Click Cancel if you don&ap - + Building common widgets. - + Building common actions - - + + Initializing 3D mouse interface - + Restoring last view state - + Restoring last window size - + Done @@ -6358,39 +6498,44 @@ Click the Next button to upload calibration to board. Click Cancel if you don&ap - + + Corridor Scan + + + + Mission item %1 is not an object - + Unsupported complex item type: %1 - + Unknown item type: %1 - + Could not find doJumpId: %1 - + The mission file is corrupted. - + The mission file is not compatible with this version of %1. - - - + + + Mission: %1 @@ -6500,62 +6645,62 @@ Click the Next button to upload calibration to board. Click Cancel if you don&ap - + Waypoint alt - + Flight speed - + Above camera commands will take affect immediately upon mission start. - + Mission End - + Return To Launch - + Vehicle Info - + Cruise speed - + Hover speed - + Planned Home Position - + Altitude - + Actual position set by vehicle at flight time. - + Set Home To Map Center @@ -6720,17 +6865,17 @@ Click the Next button to upload calibration to board. Click Cancel if you don&ap MultiVehicleList - + The following commands will be applied to all vehicles - + Armed - + Disarmed @@ -6738,12 +6883,12 @@ Click the Next button to upload calibration to board. Click Cancel if you don&ap MultiVehicleManager - + Warning: A vehicle is using the same system id as %1: %2 - + Connected to Vehicle %1 @@ -6841,7 +6986,7 @@ Is this really what you want? - + Tile Count: @@ -6872,8 +7017,8 @@ Is this really what you want? - - + + Close @@ -6888,118 +7033,118 @@ Is this really what you want? - - + + Add New Set - + Name: - + Map type: - + Min/Max Zoom Levels - + Est Size: - + Too many tiles - + Download - - - + + + Cancel - - + + Import - - + + Export - + Options - + Offline Maps Options - + Select Tile Sets to Export - + Select All - + Select None - + Tile Set Export Progress - + Tile Set Export Completed - + Map Tile Set Import - + Map Tile Set Import Progress - + Map Tile Set Import Completed - + Append to existing set - + Replace existing set @@ -7501,12 +7646,12 @@ Is this really what you want? PX4ParameterMetaData - + Enabled - + Disabled @@ -8026,32 +8171,32 @@ Is this really what you want? ParameterManager - + Change of parameter %1 requires a Vehicle reboot to take effect - + Parameter write failed: veh:%1 comp:%2 param:%3 - + Parameter read failed: veh:%1 comp:%2 param:%3 - + %1 was unable to retrieve the full set of parameters from vehicle %2. This will cause %1 to be unable to display its full user interface. If you are using modified firmware, you may need to resolve any vehicle startup errors to resolve the issue. If you are using standard firmware, you may need to upgrade to a newer version to resolve the issue. - + Vehicle %1 did not respond to request for parameters. This will cause %2 to be unable to display its full user interface. - + %1 key is not a json object @@ -8114,109 +8259,109 @@ Is this really what you want? - + Vehicle requested item outside range, count:request %1:%2. Send to Vehicle failed. - - + + Vehicle returned error: %1. - + Vehicle did not request all items during write sequence, missed count %1. - + Vehicle returned error: %1. Vehicle remove all failed. - + Vehicle returned error: %1. %2Vehicle did not accept guided item. - + Mission accepted (MAV_MISSION_ACCEPTED) - + Unspecified error (MAV_MISSION_ERROR) - + Coordinate frame is not supported (MAV_MISSION_UNSUPPORTED_FRAME) - + Command is not supported (MAV_MISSION_UNSUPPORTED) - + Mission item exceeds storage space (MAV_MISSION_NO_SPACE) - + One of the parameters has an invalid value (MAV_MISSION_INVALID) - + Param1 has an invalid value (MAV_MISSION_INVALID_PARAM1) - + Param2 has an invalid value (MAV_MISSION_INVALID_PARAM2) - + Param3 has an invalid value (MAV_MISSION_INVALID_PARAM3) - + Param4 has an invalid value (MAV_MISSION_INVALID_PARAM4) - + X/Param5 has an invalid value (MAV_MISSION_INVALID_PARAM5_X) - + Y/Param6 has an invalid value (MAV_MISSION_INVALID_PARAM6_Y) - + Param7 has an invalid value (MAV_MISSION_INVALID_PARAM7) - + Received mission item out of sequence (MAV_MISSION_INVALID_SEQUENCE) - + Not accepting any mission commands (MAV_MISSION_DENIED) - + QGC Internal Error @@ -8224,39 +8369,49 @@ Is this really what you want? PlanMasterController - + + Download not supported on high latency links. + + + + + Upload not supported on high latency links. + + + + Error loading Plan file (%1). %2 - + Plan save error %1 : %2 - + KML save error %1 : %2 - + Supported types (*.%1 *.%2 *.%3 *.%4) - - - + + + All Files (*.*) - + Plan Files (*.%1) - + KML Files (*.%1) @@ -8264,68 +8419,68 @@ Is this really what you want? PlanToolBar - + Selected Waypoint - + Alt diff: - + Azimuth: - - + + Distance: - + Gradient: - + Heading: - + Total Mission - + Max telem dist: - + Time: - + Battery - + Batteries required: - + Upload Required - + Upload @@ -8333,172 +8488,172 @@ Is this really what you want? PlanView - + Vehicle is currently armed. Do you want to upload the mission to the vehicle? - + Apply new alititude - + You have changed the default altitude for mission items. Would you like to apply that altitude to all the items in the current mission? - + Your vehicle is currently flying a mission. In order to upload a new or modified mission the current mission will be paused. - + After the mission is uploaded you can adjust the current waypoint and start the mission. - + Pause and Upload - + You need at least one item to create a KML. - + Plan Upload - + Select Plan File - + Save Plan - + Save KML - + Move the selected mission item to the be after following mission item: - + Plan - + Mission - + Fence - + Rally - + You have unsaved/unsent changes. Loading from the Vehicle will lose these changes. Are you sure you want to load from the Vehicle? - + You have unsaved/unsent changes. Loading from a file will lose these changes. Are you sure you want to load from a file? - + Are you sure you want to remove all items? - + This will also remove all items from the vehicle. - + Create complex pattern: - + Mission overwrite - + GeoFence overwrite - + Rally Points overwrite - + You have unsaved changes. You should upload to your vehicle, or save to a file: - + Sync: - + Upload - + Download - + Save To File... - + Load From File... - + Remove All - + Remove all - + Save KML... - + KML @@ -8903,42 +9058,42 @@ sudo apt-get remove modemmanager - + Telemetry save error - + Unable to save telemetry log. Error copying telemetry to '%1': '%2'. - + The format for QGroundControl saved settings has been modified. Your saved settings have been reset to defaults. - + The Offline Map Cache database has been upgraded. Your old map cache sets have been reset. - + Telemetry Save Error - + Unable to save telemetry log. Application save directory is not set. - + Unable to save telemetry log. Telemetry save directory "%1" does not exist. - + Parameters are missing from firmware. You may be running a version of firmware QGC does not work correctly with or your firmware has a bug in it. Missing params: %1 @@ -9048,22 +9203,22 @@ sudo apt-get remove modemmanager QGCFileDownload - + Could not save downloaded file to %1. Error: %2 - + Download cancelled - + Error: File Not Found - + Error during download. Error: %1 @@ -9455,7 +9610,7 @@ sudo apt-get remove modemmanager QGCLogEntry - + Pending @@ -9613,41 +9768,82 @@ sudo apt-get remove modemmanager - + Circle - + Polygon - + Set radius... - + Edit position... - + Edit Position - + Load KML... - + Radius: + + QGCMapPolyline + + + File not found: %1 + + + + + Unable to open file: %1 error: $%2 + + + + + Unable to parse KML file: %1 error: %2 line: %3 + + + + + Unable to find Polygon node in KML + + + + + Internal error: Unable to find coordinates node in KML + + + + + QGCMapPolylineVisuals + + + Select KML File + + + + + KML files (*.kml) + + + QGCMapRCToParamDialog @@ -10385,6 +10581,90 @@ Errors: RadioComponentController + + + Lower the Throttle stick all the way down as shown in diagram. + +It is recommended to disconnect all motors for additional safety, however, the system is designed to not arm during the calibration. + +Click Next to continue + + + + + Lower the Throttle stick all the way down as shown in diagram. +Reset all transmitter trims to center. + +Please ensure all motor power is disconnected AND all props are removed from the vehicle. + +Click Next to continue + + + + + Move the Throttle stick all the way up and hold it there... + + + + + Move the Throttle stick all the way down and leave it there... + + + + + Move the Yaw stick all the way to the left and hold it there... + + + + + Move the Yaw stick all the way to the right and hold it there... + + + + + Move the Roll stick all the way to the left and hold it there... + + + + + Move the Roll stick all the way to the right and hold it there... + + + + + Move the Pitch stick all the way down and hold it there... + + + + + Move the Pitch stick all the way up and hold it there... + + + + + Allow the Pitch stick to move back to center... + + + + + Move all the transmitter switches and/or dials back and forth to their extreme positions. + + + + + All settings have been captured. Click Next to write the new parameters to your board. + + + + + Center the Throttle stick as shown in diagram. +Reset all transmitter trims to center. + +Please ensure all motor power is disconnected from the vehicle. + +Click Next to continue + + Next @@ -11149,8 +11429,13 @@ Click Ok to start calibration. SetupPage - - Setup + + %1 Setup + + + + + (Disabled while the vehicle is armed) @@ -11162,10 +11447,15 @@ Click Ok to start calibration. - + missing message panel text + + + %1 setup must be completed prior to %2 setup. + + %1 does not currently support setup of your vehicle type. @@ -11212,7 +11502,7 @@ Click Ok to start calibration. - + Parameters @@ -11271,18 +11561,18 @@ Click Ok to start calibration. StructureScanComplexItem - + %1 does not support loading this complex mission item type: %2:%3 - + %1 complex item version %2 not supported + - Structure Scan @@ -11290,102 +11580,92 @@ Click Ok to start calibration. StructureScanEditor - + Note: Polygon respresents structure surface not vehicle flight path. - + WARNING: Photo interval is below minimum interval (%1 secs) supported by camera. - + Scan Distance - + Layer Height - + Trigger Distance - + Pitch - + Yaw - + Gimbal - + Scan - - Layers + + Structure height - Altitude - - - - - Relative altitude + # Layers - - Point camera to structure using: + + Bottom layer alt - - Vehicle yaw + + Relative altitude - Gimbal yaw - - - - Rotate entry point - + Statistics - + Photo count - + Photo interval - + secs @@ -11687,6 +11967,15 @@ Click Ok to start calibration. + + TransectStyleComplexItem + + + + Corridor Scan + + + UAS @@ -11826,18 +12115,18 @@ Click Ok to start calibration. UDPLink - - + + UDP Link Error - + Error binding UDP port: %1 - + Error registering Zeroconf @@ -11909,249 +12198,249 @@ Click Ok to start calibration. Vehicle - + MAVLink Generic - + Fixed Wing - + Multi-Rotor - + VTOL - + Rover - + Sub - + Unknown - + %1 command temporarily rejected - + %1 command denied - + %1 command not supported - + %1 command failed - + AutoLoad%1.%2 - + %1 low battery: %2 percent remaining - + Mission transfer failed. Retry transfer. Error: %1 - + GeoFence transfer failed. Retry transfer. Error: %1 - + Rally Point transfer failed. Retry transfer. Error: %1 - + %1 communication lost - + %1 communication regained - + Generic micro air vehicle - + Fixed wing aircraft - + Quadrotor - + Coaxial helicopter - + Normal helicopter with tail rotor. - + Ground installation - + Operator control unit / ground control station - + Airship, controlled - + Free balloon, uncontrolled - + Rocket - + Ground rover - + Surface vessel, boat, ship - + Submarine - + Hexarotor - - + + Octorotor - - + + Flapping wing - + Onboard companion controller - + Two-rotor VTOL using control surfaces in vertical operation in addition. Tailsitter - + Quad-rotor VTOL using a V-shaped quad config in vertical operation. Tailsitter - + Tiltrotor VTOL - + VTOL reserved 2 - + VTOL reserved 3 - + VTOL reserved 4 - + VTOL reserved 5 - + Onboard gimbal - + Onboard ADSB peripheral - + vehicle %1 - + %1 %2 flight mode - + armed - + disarmed - + Vehicle did not respond to command: %1 @@ -12259,12 +12548,12 @@ Click Ok to start calibration. VideoReceiver - + Unabled to record video. Video save path must be specified in Settings. - + Invalid video format defined. @@ -12272,12 +12561,12 @@ Click Ok to start calibration. ViewWidget - + missing connected implementation - + no vehicle connected diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc index f9679f4f4725995f1679cf46666d67d3fe1ae5c1..ce7371c7502275d9f819ae8f4b60ad40c684843e 100644 --- a/qgroundcontrol.qrc +++ b/qgroundcontrol.qrc @@ -15,21 +15,29 @@ src/ui/toolbar/JoystickIndicator.qml + src/PlanView/CorridorScanEditor.qml + src/PlanView/CameraCalc.qml + src/PlanView/CorridorScanMapVisual.qml + src/QmlControls/EditPositionDialog.qml + src/QmlControls/FileButton.qml + src/MissionManager/QGCMapCircleVisuals.qml + src/MissionManager/QGCMapPolylineVisuals.qml + src/PlanView/StructureScanMapVisual.qml src/AnalyzeView/AnalyzeView.qml src/ui/AppSettings.qml src/ui/preferences/BluetoothSettings.qml - src/PlanView/CorridorScanEditor.qml + src/FlightMap/Widgets/CameraPageWidget.qml src/ViewWidgets/CustomCommandWidget.qml src/ui/preferences/DebugWindow.qml src/AutoPilotPlugins/Common/ESP8266Component.qml src/AutoPilotPlugins/Common/ESP8266ComponentSummary.qml - src/AutoPilotPlugins/Common/SyslinkComponent.qml src/VehicleSetup/FirmwareUpgrade.qml src/FlightDisplay/FlightDisplayViewDummy.qml src/FlightDisplay/FlightDisplayViewUVC.qml + src/PlanView/FWLandingPatternEditor.qml src/ui/preferences/GeneralSettings.qml src/AnalyzeView/GeoTagPage.qml - src/AnalyzeView/MavlinkConsolePage.qml + src/FlightMap/Widgets/HealthPageWidget.qml src/VehicleSetup/JoystickConfig.qml src/ui/preferences/LinkSettings.qml src/AnalyzeView/LogDownloadPage.qml @@ -37,24 +45,26 @@ src/ui/MainWindowHybrid.qml src/ui/MainWindowInner.qml src/ui/MainWindowNative.qml + src/AnalyzeView/MavlinkConsolePage.qml src/ui/preferences/MavlinkSettings.qml - src/PlanView/PlanView.qml + src/PlanView/MissionSettingsEditor.qml src/ui/preferences/MockLink.qml src/ui/preferences/MockLinkSettings.qml src/AutoPilotPlugins/Common/MotorComponent.qml src/QtLocationPlugin/QMLControl/OfflineMap.qml + src/PlanView/PlanView.qml src/VehicleSetup/PX4FlowSensor.qml + src/FlightMap/Widgets/QGCInstrumentWidget.qml + src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml src/AnalyzeView/AnalyzePage.qml src/QmlControls/AppMessages.qml - src/PlanView/CameraCalc.qml src/PlanView/CameraSection.qml src/QmlControls/ClickableColor.qml - src/PlanView/CorridorScanMapVisual.qml + src/QmlControls/DeadMouseArea.qml src/QmlControls/DropButton.qml - src/QmlControls/EditPositionDialog.qml + src/QmlControls/DropPanel.qml src/QmlControls/ExclusiveGroupItem.qml src/QmlControls/FactSliderPanel.qml - src/QmlControls/FileButton.qml src/QmlControls/FlightModeDropdown.qml src/QmlControls/FlightModeMenu.qml src/PlanView/FWLandingPatternMapVisual.qml @@ -71,7 +81,6 @@ src/PlanView/MissionItemStatus.qml src/QmlControls/ModeSwitchDisplay.qml src/QmlControls/MultiRotorMotorDisplay.qml - src/QmlControls/NoMouseThroughRectangle.qml src/QmlControls/OfflineMapButton.qml src/QmlControls/PageView.qml src/QmlControls/ParameterEditor.qml @@ -89,9 +98,7 @@ src/QmlControls/QGCLabel.qml src/QmlControls/QGCListView.qml src/QmlControls/QGCMapLabel.qml - src/MissionManager/QGCMapCircleVisuals.qml src/MissionManager/QGCMapPolygonVisuals.qml - src/MissionManager/QGCMapPolylineVisuals.qml src/QmlControls/QGCMouseArea.qml src/QmlControls/QGCMovableItem.qml src/QmlControls/QGCPipable.qml @@ -116,13 +123,11 @@ src/ui/toolbar/SignalStrength.qml src/PlanView/SimpleItemMapVisual.qml src/QmlControls/SliderSwitch.qml - src/PlanView/StructureScanMapVisual.qml src/QmlControls/SubMenuButton.qml src/PlanView/SurveyMapVisual.qml + src/QmlControls/ToolStrip.qml src/QmlControls/VehicleRotationCal.qml src/QmlControls/VehicleSummaryRow.qml - src/QmlControls/ToolStrip.qml - src/QmlControls/DropPanel.qml src/ViewWidgets/ViewWidget.qml src/FactSystem/FactControls/FactBitmask.qml src/FactSystem/FactControls/FactCheckBox.qml @@ -137,9 +142,9 @@ src/FlightDisplay/FlightDisplayViewMap.qml src/FlightDisplay/FlightDisplayViewVideo.qml src/FlightDisplay/FlightDisplayViewWidgets.qml - src/FlightDisplay/GuidedActionsController.qml src/FlightDisplay/GuidedActionConfirm.qml src/FlightDisplay/GuidedActionList.qml + src/FlightDisplay/GuidedActionsController.qml src/FlightDisplay/GuidedAltitudeSlider.qml src/FlightDisplay/MultiVehicleList.qml src/FlightDisplay/qmldir @@ -148,9 +153,9 @@ src/FlightMap/Widgets/CenterMapDropPanel.qml src/FlightMap/Widgets/CompassRing.qml src/FlightMap/MapItems/CustomMapItems.qml - src/FlightMap/Widgets/MapFitFunctions.qml src/FlightMap/FlightMap.qml src/FlightMap/Widgets/InstrumentSwipeView.qml + src/FlightMap/Widgets/MapFitFunctions.qml src/FlightMap/MapScale.qml src/FlightMap/MapItems/MissionItemIndicator.qml src/FlightMap/MapItems/MissionItemIndicatorDrag.qml @@ -162,8 +167,6 @@ src/FlightMap/Widgets/QGCAttitudeHUD.qml src/FlightMap/Widgets/QGCAttitudeWidget.qml src/FlightMap/Widgets/QGCCompassWidget.qml - src/FlightMap/Widgets/QGCInstrumentWidget.qml - src/FlightMap/Widgets/QGCInstrumentWidgetAlternate.qml src/FlightMap/Widgets/QGCPitchIndicator.qml src/FlightMap/QGCVideoBackground.qml src/FlightMap/qmldir @@ -178,57 +181,54 @@ src/PlanView/SimpleItemEditor.qml src/PlanView/StructureScanEditor.qml src/PlanView/SurveyItemEditor.qml - src/PlanView/FWLandingPatternEditor.qml - src/PlanView/MissionSettingsEditor.qml + src/AutoPilotPlugins/Common/SyslinkComponent.qml src/ui/preferences/TcpSettings.qml src/test.qml src/ui/preferences/UdpSettings.qml - src/VehicleSetup/VehicleSummary.qml - src/FlightDisplay/VirtualJoystick.qml - src/FlightMap/Widgets/CameraPageWidget.qml - src/FlightMap/Widgets/VideoPageWidget.qml src/FlightMap/Widgets/ValuePageWidget.qml - src/FlightMap/Widgets/HealthPageWidget.qml + src/VehicleSetup/VehicleSummary.qml src/FlightMap/Widgets/VibrationPageWidget.qml + src/FlightMap/Widgets/VideoPageWidget.qml + src/FlightDisplay/VirtualJoystick.qml + src/MissionManager/CameraCalc.FactMetaData.json + src/MissionManager/CameraSpec.FactMetaData.json + src/MissionManager/CorridorScan.SettingsGroup.json + src/QmlControls/EditPositionDialog.FactMetaData.json + src/MissionManager/QGCMapCircle.Facts.json + src/MissionManager/StructureScan.SettingsGroup.json + src/MissionManager/TransectStyle.SettingsGroup.json + src/Settings/App.SettingsGroup.json + src/Settings/AutoConnect.SettingsGroup.json + src/Settings/BrandImage.SettingsGroup.json + src/MissionManager/CameraSection.FactMetaData.json + src/Settings/FlightMap.SettingsGroup.json + src/MissionManager/FWLandingPattern.FactMetaData.json + src/Settings/Guided.SettingsGroup.json src/MissionManager/MavCmdInfoCommon.json src/MissionManager/MavCmdInfoFixedWing.json src/MissionManager/MavCmdInfoMultiRotor.json src/MissionManager/MavCmdInfoRover.json src/MissionManager/MavCmdInfoSub.json src/MissionManager/MavCmdInfoVTOL.json - src/Settings/App.SettingsGroup.json - src/Settings/AutoConnect.SettingsGroup.json - src/Settings/FlightMap.SettingsGroup.json - src/Settings/Guided.SettingsGroup.json - src/MissionManager/QGCMapCircle.Facts.json + src/MissionManager/MissionSettings.FactMetaData.json + src/MissionManager/RallyPoint.FactMetaData.json src/Settings/RTK.SettingsGroup.json - src/MissionManager/TransectStyle.SettingsGroup.json + src/MissionManager/SpeedSection.FactMetaData.json src/MissionManager/Survey.SettingsGroup.json - src/MissionManager/CorridorScan.SettingsGroup.json - src/MissionManager/StructureScan.SettingsGroup.json src/Settings/Units.SettingsGroup.json - src/Settings/Video.SettingsGroup.json - src/MissionManager/RallyPoint.FactMetaData.json - src/MissionManager/FWLandingPattern.FactMetaData.json src/comm/USBBoardInfo.json - src/MissionManager/CameraSection.FactMetaData.json - src/MissionManager/CameraCalc.FactMetaData.json - src/MissionManager/CameraSpec.FactMetaData.json - src/MissionManager/SpeedSection.FactMetaData.json - src/MissionManager/MissionSettings.FactMetaData.json - src/QmlControls/EditPositionDialog.FactMetaData.json - src/Vehicle/VehicleFact.json src/Vehicle/BatteryFact.json + src/Vehicle/ClockFact.json src/Vehicle/GPSFact.json src/Vehicle/GPSRTKFact.json - src/Vehicle/WindFact.json - src/Vehicle/VibrationFact.json - src/Vehicle/TemperatureFact.json src/Vehicle/SubmarineFact.json - src/Settings/BrandImage.SettingsGroup.json - src/Vehicle/ClockFact.json + src/Vehicle/TemperatureFact.json + src/Vehicle/VehicleFact.json + src/Vehicle/VibrationFact.json + src/Vehicle/WindFact.json + src/Settings/Video.SettingsGroup.json src/comm/APMArduCopterMockLink.params diff --git a/src/AnalyzeView/GeoTagPage.qml b/src/AnalyzeView/GeoTagPage.qml index dbaa678792cba5f29d3c9a91de898843a5e344bd..d4f4386f074ddfd71c5a2526bf3c3349e73b7bff 100644 --- a/src/AnalyzeView/GeoTagPage.qml +++ b/src/AnalyzeView/GeoTagPage.qml @@ -110,7 +110,7 @@ AnalyzePage { } QGCLabel { - text: geoController.saveDirectory != "" ? geoController.saveDirectory : "/TAGGED folder in your image folder" + text: geoController.saveDirectory !== "" ? geoController.saveDirectory : "/TAGGED folder in your image folder" anchors.verticalCenter: parent.verticalCenter } } diff --git a/src/AnalyzeView/LogDownloadController.cc b/src/AnalyzeView/LogDownloadController.cc index 57fab3975512ca112688a79fcad5b73ad112f7b5..133a55671663451192a5d4ad5481485970413585 100644 --- a/src/AnalyzeView/LogDownloadController.cc +++ b/src/AnalyzeView/LogDownloadController.cc @@ -21,6 +21,7 @@ #include "QGCMapEngine.h" #include "ParameterManager.h" #include "Vehicle.h" +#include "SettingsManager.h" #include #include @@ -511,7 +512,7 @@ LogDownloadController::download(QString path) QString dir = path; #if defined(__mobile__) if(dir.isEmpty()) { - dir = QDir::homePath(); + dir = qgcApp()->toolbox()->settingsManager()->appSettings()->logSavePath(); } #else if(dir.isEmpty()) { diff --git a/src/AutoPilotPlugins/Common/MotorComponent.qml b/src/AutoPilotPlugins/Common/MotorComponent.qml index dc36a82987cdf1a0d009b3c8c518a15771887561..a964c547f88d72650d379157d5c8c69c0733211c 100644 --- a/src/AutoPilotPlugins/Common/MotorComponent.qml +++ b/src/AutoPilotPlugins/Common/MotorComponent.qml @@ -55,7 +55,7 @@ SetupPage { property real _lastValue: 0 onTriggered: { - if (_lastValue != slider.value) { + if (_lastValue !== slider.value) { controller.vehicle.motorTest(index + 1, slider.value, 1) } } diff --git a/src/AutoPilotPlugins/Common/RadioComponent.qml b/src/AutoPilotPlugins/Common/RadioComponent.qml index c5fb6c91006c4c7578341727650f582d3a562a0b..c4f6b57ea7c731da98df445e891536b9dc77cb96 100644 --- a/src/AutoPilotPlugins/Common/RadioComponent.qml +++ b/src/AutoPilotPlugins/Common/RadioComponent.qml @@ -379,7 +379,7 @@ SetupPage { text: qsTr("Calibrate") onClicked: { - if (text == qsTr("Calibrate")) { + if (text === qsTr("Calibrate")) { showDialog(zeroTrimsDialogComponent, dialogTitle, radioPage.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel) } else { controller.nextButtonClicked() diff --git a/src/AutoPilotPlugins/PX4/AirframeComponent.qml b/src/AutoPilotPlugins/PX4/AirframeComponent.qml index a0920cf22a47e2f9abb70edfea5a7f74a873f182..3d14454af217afd28efdbb22ba2229cbd4005ec9 100644 --- a/src/AutoPilotPlugins/PX4/AirframeComponent.qml +++ b/src/AutoPilotPlugins/PX4/AirframeComponent.qml @@ -202,12 +202,12 @@ Your vehicle will also be restarted in order to complete the process.") QGCCheckBox { // Although this item is invisible we still use it to manage state id: airframeCheckBox - checked: modelData.name == controller.currentAirframeType + checked: modelData.name === controller.currentAirframeType exclusiveGroup: airframeTypeExclusive visible: false onCheckedChanged: { - if (checked && combo.currentIndex != -1) { + if (checked && combo.currentIndex !== -1) { console.log("check box change", combo.currentIndex) controller.autostartId = modelData.airframes[combo.currentIndex].autostartId } diff --git a/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml b/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml index 5dd0f980caabef13f91f11fcf49c821b36815852..1adf6162fa099f12ecaf13f17d0ab02c23fa70e8 100644 --- a/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml @@ -37,7 +37,7 @@ FactPanel { VehicleSummaryRow { labelText: qsTr("Firmware Version:") - valueText: activeVehicle.firmwareMajorVersion == -1 ? qsTr("Unknown") : activeVehicle.firmwareMajorVersion + "." + activeVehicle.firmwareMinorVersion + "." + activeVehicle.firmwarePatchVersion + activeVehicle.firmwareVersionTypeString + valueText: activeVehicle.firmwareMajorVersion === -1 ? qsTr("Unknown") : activeVehicle.firmwareMajorVersion + "." + activeVehicle.firmwareMinorVersion + "." + activeVehicle.firmwarePatchVersion + activeVehicle.firmwareVersionTypeString } } } diff --git a/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml b/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml index e58bc7e97c21077d19c1ee35cb0f4a2b95bf7138..3755d61a2197ddc7e2840117d019a514527fd01b 100644 --- a/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml @@ -18,7 +18,7 @@ FactPanel { property Fact _nullFact property Fact _rcMapFltmode: controller.parameterExists(-1, "RC_MAP_FLTMODE") ? controller.getParameterFact(-1, "RC_MAP_FLTMODE") : _nullFact property Fact _rcMapModeSw: controller.getParameterFact(-1, "RC_MAP_MODE_SW") - property bool _simpleMode: _rcMapFltmode.value > 0 || _rcMapModeSw.value == 0 + property bool _simpleMode: _rcMapFltmode.value > 0 || _rcMapModeSw.value === 0 Loader { anchors.fill: parent diff --git a/src/AutoPilotPlugins/PX4/PX4FlightModes.qml b/src/AutoPilotPlugins/PX4/PX4FlightModes.qml index 68472e8f37340a5d7fba13f28dcce7608c7aa8c6..952d81fa2e1e4982916c02070686fd71f5886a92 100644 --- a/src/AutoPilotPlugins/PX4/PX4FlightModes.qml +++ b/src/AutoPilotPlugins/PX4/PX4FlightModes.qml @@ -39,7 +39,7 @@ SetupPage { property bool _rcMapFltmodeExists: controller.parameterExists(-1, "RC_MAP_FLTMODE") property Fact _rcMapFltmode: _rcMapFltmodeExists ? controller.getParameterFact(-1, "RC_MAP_FLTMODE") : _nullFact property Fact _rcMapModeSw: controller.getParameterFact(-1, "RC_MAP_MODE_SW") - property bool _simpleMode: _rcMapFltmodeExists ? _rcMapFltmode.value > 0 || _rcMapModeSw.value == 0 : false + property bool _simpleMode: _rcMapFltmodeExists ? _rcMapFltmode.value > 0 || _rcMapModeSw.value === 0 : false FactPanelController { id: controller diff --git a/src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml b/src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml index 78d057646314e3cb05e14639bdd22e04674b40cc..48e3f8cb1c4ad7c6e69ae92a2251fe391c8c06fd 100644 --- a/src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml +++ b/src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml @@ -145,7 +145,7 @@ Item { QGCLabel { anchors.baseline: returnCombo.baseline text: qsTr("Return switch:") - color: parent.fact.value == 0 ? qgcPal.text : (controller.rcChannelValues[parent.fact.value - 1] >= 1500 ? "yellow" : qgcPal.text) + color: parent.fact.value === 0 ? qgcPal.text : (controller.rcChannelValues[parent.fact.value - 1] >= 1500 ? "yellow" : qgcPal.text) } FactComboBox { @@ -164,7 +164,7 @@ Item { QGCLabel { anchors.baseline: killCombo.baseline text: qsTr("Kill switch:") - color: parent.fact.value == 0 ? qgcPal.text : (controller.rcChannelValues[parent.fact.value - 1] >= 1500 ? "yellow" : qgcPal.text) + color: parent.fact.value === 0 ? qgcPal.text : (controller.rcChannelValues[parent.fact.value - 1] >= 1500 ? "yellow" : qgcPal.text) } FactComboBox { @@ -183,7 +183,7 @@ Item { QGCLabel { anchors.baseline: offboardCombo.baseline text: qsTr("Offboard switch:") - color: parent.fact.value == 0 ? qgcPal.text : (controller.rcChannelValues[parent.fact.value - 1] >= 1500 ? "yellow" : qgcPal.text) + color: parent.fact.value === 0 ? qgcPal.text : (controller.rcChannelValues[parent.fact.value - 1] >= 1500 ? "yellow" : qgcPal.text) } FactComboBox { @@ -203,7 +203,7 @@ Item { QGCLabel { anchors.baseline: vtolCombo.baseline text: qsTr("VTOL mode switch:") - color: parent.fact.value == 0 ? qgcPal.text : (controller.rcChannelValues[parent.fact.value - 1] >= 1500 ? "yellow" : qgcPal.text) + color: parent.fact.value === 0 ? qgcPal.text : (controller.rcChannelValues[parent.fact.value - 1] >= 1500 ? "yellow" : qgcPal.text) } FactComboBox { diff --git a/src/AutoPilotPlugins/PX4/PowerComponent.qml b/src/AutoPilotPlugins/PX4/PowerComponent.qml index 91419392fd0b78dd43eb87efb7cbd5d6298327ce..ef0f665be9cfbd1b18fb417120bf14495ec207db 100644 --- a/src/AutoPilotPlugins/PX4/PowerComponent.qml +++ b/src/AutoPilotPlugins/PX4/PowerComponent.qml @@ -143,7 +143,7 @@ SetupPage { onClicked: { var measuredVoltageValue = parseFloat(measuredVoltage.text) - if (measuredVoltageValue == 0 || isNaN(measuredVoltageValue)) { + if (measuredVoltageValue === 0 || isNaN(measuredVoltageValue)) { return } var newVoltageDivider = (measuredVoltageValue * battVoltageDivider.value) / controller.vehicle.battery.voltage.value @@ -201,7 +201,7 @@ SetupPage { onClicked: { var measuredCurrentValue = parseFloat(measuredCurrent.text) - if (measuredCurrentValue == 0) { + if (measuredCurrentValue === 0) { return } var newAmpsPerVolt = (measuredCurrentValue * battAmpsPerVolt.value) / controller.vehicle.battery.current.value @@ -379,7 +379,7 @@ SetupPage { QGCCheckBox { id: showUAVCAN text: qsTr("Show UAVCAN Settings") - checked: uavcanEnable.rawValue != 0 + checked: uavcanEnable ? uavcanEnable.rawValue !== 0 : false } QGCGroupBox { diff --git a/src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml b/src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml index 4c88877005727e51af8d30400c8198ec81c31b25..4670bbe3d4da60666096b9fceb9b3c2438194d35 100644 --- a/src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml +++ b/src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml @@ -25,8 +25,8 @@ FactPanel { property Fact airspeedDisabledFact: controller.getParameterFact(-1, "FW_ARSP_MODE") property Fact airspeedBreakerFact: controller.getParameterFact(-1, "CBRK_AIRSPD_CHK") - property bool _airspeedVisible: airspeedDisabledFact.value == false && airspeedBreakerFact.value != 162128 - property bool _airspeedCalRequired: _airspeedVisible && dpressOffFact.value == 0 + property bool _airspeedVisible: airspeedDisabledFact.value === false && airspeedBreakerFact.value !== 162128 + property bool _airspeedCalRequired: _airspeedVisible && dpressOffFact.value === 0 Column { anchors.fill: parent diff --git a/src/AutoPilotPlugins/PX4/SensorsSetup.qml b/src/AutoPilotPlugins/PX4/SensorsSetup.qml index f3cc472d6bf57c407ad12d0e4b71e84b064f99c6..fdbca17573a97decdf398d44dd6875cddf8adcac 100644 --- a/src/AutoPilotPlugins/PX4/SensorsSetup.qml +++ b/src/AutoPilotPlugins/PX4/SensorsSetup.qml @@ -352,7 +352,7 @@ Item { id: compassButton width: _buttonWidth text: qsTr("Compass") - indicatorGreen: cal_mag0_id.value != 0 + indicatorGreen: cal_mag0_id.value !== 0 visible: QGroundControl.corePlugin.options.showSensorCalibrationCompass && showSensorCalibrationCompass onClicked: { @@ -366,7 +366,7 @@ Item { id: gyroButton width: _buttonWidth text: qsTr("Gyroscope") - indicatorGreen: cal_gyro0_id.value != 0 + indicatorGreen: cal_gyro0_id.value !== 0 visible: QGroundControl.corePlugin.options.showSensorCalibrationGyro && showSensorCalibrationGyro onClicked: { @@ -380,7 +380,7 @@ Item { id: accelButton width: _buttonWidth text: qsTr("Accelerometer") - indicatorGreen: cal_acc0_id.value != 0 + indicatorGreen: cal_acc0_id.value !== 0 visible: QGroundControl.corePlugin.options.showSensorCalibrationAccel && showSensorCalibrationAccel onClicked: { @@ -394,8 +394,8 @@ Item { id: levelButton width: _buttonWidth text: qsTr("Level Horizon") - indicatorGreen: sens_board_x_off.value != 0 || sens_board_y_off.value != 0 | sens_board_z_off.value != 0 - enabled: cal_acc0_id.value != 0 && cal_gyro0_id.value != 0 + indicatorGreen: sens_board_x_off.value !== 0 || sens_board_y_off.value !== 0 | sens_board_z_off.value !== 0 + enabled: cal_acc0_id.value !== 0 && cal_gyro0_id.value !== 0 visible: QGroundControl.corePlugin.options.showSensorCalibrationLevel && showSensorCalibrationLevel onClicked: { @@ -410,11 +410,11 @@ Item { width: _buttonWidth text: qsTr("Airspeed") visible: (controller.vehicle.fixedWing || controller.vehicle.vtol) && - controller.getParameterFact(-1, "FW_ARSP_MODE").value == false && - controller.getParameterFact(-1, "CBRK_AIRSPD_CHK").value != 162128 && + controller.getParameterFact(-1, "FW_ARSP_MODE").value === false && + controller.getParameterFact(-1, "CBRK_AIRSPD_CHK").value !== 162128 && QGroundControl.corePlugin.options.showSensorCalibrationAirspeed && showSensorCalibrationAirspeed - indicatorGreen: sens_dpres_off.value != 0 + indicatorGreen: sens_dpres_off.value !== 0 onClicked: { preCalibrationDialogType = "airspeed" diff --git a/src/Camera/QGCCameraControl.h b/src/Camera/QGCCameraControl.h index 307934ba230d8d9748c3a29df35045d639b58112..c4f93152b4787797b033a07bdd1f39dd498ff436 100644 --- a/src/Camera/QGCCameraControl.h +++ b/src/Camera/QGCCameraControl.h @@ -202,16 +202,16 @@ protected: virtual void _setCameraMode (CameraMode mode); protected slots: - void _initWhenReady (); - void _requestCameraSettings (); - void _requestAllParameters (); - void _requestParamUpdates (); - void _requestCaptureStatus (); - void _requestStorageInfo (); - void _downloadFinished (); - void _mavCommandResult (int vehicleId, int component, int command, int result, bool noReponseFromVehicle); - void _dataReady (QByteArray data); - void _paramDone (); + virtual void _initWhenReady (); + virtual void _requestCameraSettings (); + virtual void _requestAllParameters (); + virtual void _requestParamUpdates (); + virtual void _requestCaptureStatus (); + virtual void _requestStorageInfo (); + virtual void _downloadFinished (); + virtual void _mavCommandResult (int vehicleId, int component, int command, int result, bool noReponseFromVehicle); + virtual void _dataReady (QByteArray data); + virtual void _paramDone (); private: bool _handleLocalization (QByteArray& bytes); diff --git a/src/Camera/QGCCameraIO.cc b/src/Camera/QGCCameraIO.cc index 5f98ff41976989a57f8e57fe4f0c26ce0816d5ba..a8d4130251ea22a2b71e10aa466501ed1b0ecb84 100644 --- a/src/Camera/QGCCameraIO.cc +++ b/src/Camera/QGCCameraIO.cc @@ -57,9 +57,18 @@ QGCCameraParamIO::QGCCameraParamIO(QGCCameraControl *control, Fact* fact, Vehicl case FactMetaData::valueTypeUint32: _mavParamType = MAV_PARAM_EXT_TYPE_UINT32; break; + case FactMetaData::valueTypeUint64: + _mavParamType = MAV_PARAM_EXT_TYPE_UINT64; + break; + case FactMetaData::valueTypeInt64: + _mavParamType = MAV_PARAM_EXT_TYPE_INT64; + break; case FactMetaData::valueTypeFloat: _mavParamType = MAV_PARAM_EXT_TYPE_REAL32; break; + case FactMetaData::valueTypeDouble: + _mavParamType = MAV_PARAM_EXT_TYPE_REAL64; + break; //-- String and custom are the same for now case FactMetaData::valueTypeString: case FactMetaData::valueTypeCustom: @@ -145,9 +154,18 @@ QGCCameraParamIO::_sendParameter() case FactMetaData::valueTypeUint32: union_value.param_uint32 = (uint32_t)_fact->rawValue().toUInt(); break; + case FactMetaData::valueTypeInt64: + union_value.param_int64 = (int64_t)_fact->rawValue().toLongLong(); + break; + case FactMetaData::valueTypeUint64: + union_value.param_uint64 = (uint64_t)_fact->rawValue().toULongLong(); + break; case FactMetaData::valueTypeFloat: union_value.param_float = _fact->rawValue().toFloat(); break; + case FactMetaData::valueTypeDouble: + union_value.param_double = _fact->rawValue().toDouble(); + break; //-- String and custom are the same for now case FactMetaData::valueTypeString: case FactMetaData::valueTypeCustom: @@ -282,6 +300,12 @@ QGCCameraParamIO::_valueFromMessage(const char* value, uint8_t param_type) case MAV_PARAM_EXT_TYPE_INT32: var = QVariant(u.param_int32); break; + case MAV_PARAM_EXT_TYPE_UINT64: + var = QVariant((qulonglong)u.param_uint64); + break; + case MAV_PARAM_EXT_TYPE_INT64: + var = QVariant((qlonglong)u.param_int64); + break; case MAV_PARAM_EXT_TYPE_CUSTOM: var = QVariant(QByteArray(value, MAVLINK_MSG_PARAM_EXT_SET_FIELD_PARAM_VALUE_LEN)); break; diff --git a/src/Camera/QGCCameraIO.h b/src/Camera/QGCCameraIO.h index 0337266340912840fe9c46e79c50b39700ac1dd0..236ef6fe40ed235bc84509fc208a2383c403f7b5 100644 --- a/src/Camera/QGCCameraIO.h +++ b/src/Camera/QGCCameraIO.h @@ -19,6 +19,9 @@ MAVPACKED( typedef struct { union { float param_float; + double param_double; + int64_t param_int64; + uint64_t param_uint64; int32_t param_int32; uint32_t param_uint32; int16_t param_int16; diff --git a/src/Camera/QGCCameraManager.h b/src/Camera/QGCCameraManager.h index 9817c574ed566a2d38213e4b3ff2a7b1e7a04383..e443701e6320d7685d33346177bdd026adc1ea23 100644 --- a/src/Camera/QGCCameraManager.h +++ b/src/Camera/QGCCameraManager.h @@ -25,28 +25,28 @@ public: QGCCameraManager(Vehicle* vehicle); virtual ~QGCCameraManager(); - Q_PROPERTY(QmlObjectListModel* cameras READ cameras NOTIFY camerasChanged) + Q_PROPERTY(QmlObjectListModel* cameras READ cameras NOTIFY camerasChanged) //-- Return a list of cameras provided by this vehicle - virtual QmlObjectListModel* cameras () { return &_cameras; } + virtual QmlObjectListModel* cameras () { return &_cameras; } signals: - void camerasChanged (); + void camerasChanged (); protected slots: - void _vehicleReady (bool ready); - void _mavlinkMessageReceived (const mavlink_message_t& message); + virtual void _vehicleReady (bool ready); + virtual void _mavlinkMessageReceived (const mavlink_message_t& message); protected: - QGCCameraControl* _findCamera (int id); - void _requestCameraInfo (int compID); - void _handleHeartbeat (const mavlink_message_t& message); - void _handleCameraInfo (const mavlink_message_t& message); - void _handleStorageInfo (const mavlink_message_t& message); - void _handleCameraSettings (const mavlink_message_t& message); - void _handleParamAck (const mavlink_message_t& message); - void _handleParamValue (const mavlink_message_t& message); - void _handleCaptureStatus (const mavlink_message_t& message); + virtual QGCCameraControl* _findCamera (int id); + virtual void _requestCameraInfo (int compID); + virtual void _handleHeartbeat (const mavlink_message_t& message); + virtual void _handleCameraInfo (const mavlink_message_t& message); + virtual void _handleStorageInfo (const mavlink_message_t& message); + virtual void _handleCameraSettings (const mavlink_message_t& message); + virtual void _handleParamAck (const mavlink_message_t& message); + virtual void _handleParamValue (const mavlink_message_t& message); + virtual void _handleCaptureStatus (const mavlink_message_t& message); protected: Vehicle* _vehicle; diff --git a/src/FactSystem/FactControls/FactBitmask.qml b/src/FactSystem/FactControls/FactBitmask.qml index 11efcba86fc5f1621082af8ef30ca732e7a76536..517ce6a4bf5a4b2361454e6117c3e0f95fbc02ac 100644 --- a/src/FactSystem/FactControls/FactBitmask.qml +++ b/src/FactSystem/FactControls/FactBitmask.qml @@ -33,10 +33,12 @@ Flow { checked: fact.value & fact.bitmaskValues[index] onClicked: { + var i; + var otherCheckbox; if (checked) { if (firstEntryIsAll && index == 0) { - for (var i=1; i::min()); case valueTypeUint32: - return QVariant(std::numeric_limits::min()); + return QVariant(std::numeric_limits::min()); case valueTypeInt32: - return QVariant(std::numeric_limits::min()); + return QVariant(std::numeric_limits::min()); + case valueTypeUint64: + return QVariant((qulonglong)std::numeric_limits::min()); + case valueTypeInt64: + return QVariant((qlonglong)std::numeric_limits::min()); case valueTypeFloat: return QVariant(-std::numeric_limits::max()); case valueTypeDouble: @@ -287,9 +291,13 @@ QVariant FactMetaData::_maxForType(void) const case valueTypeInt16: return QVariant(std::numeric_limits::max()); case valueTypeUint32: - return QVariant(std::numeric_limits::max()); + return QVariant(std::numeric_limits::max()); case valueTypeInt32: - return QVariant(std::numeric_limits::max()); + return QVariant(std::numeric_limits::max()); + case valueTypeUint64: + return QVariant((qulonglong)std::numeric_limits::max()); + case valueTypeInt64: + return QVariant((qlonglong)std::numeric_limits::max()); case valueTypeFloat: return QVariant(std::numeric_limits::max()); case valueTypeElapsedTimeInSeconds: @@ -324,6 +332,14 @@ bool FactMetaData::convertAndValidateRaw(const QVariant& rawValue, bool convertO } } break; + case FactMetaData::valueTypeInt64: + typedValue = QVariant(rawValue.toLongLong(&convertOk)); + if (!convertOnly && convertOk) { + if (typedValue < rawMin() || typedValue > rawMax()) { + errorString = tr("Value must be within %1 and %2").arg(rawMin().toInt()).arg(rawMax().toInt()); + } + } + break; case FactMetaData::valueTypeUint8: case FactMetaData::valueTypeUint16: case FactMetaData::valueTypeUint32: @@ -334,6 +350,14 @@ bool FactMetaData::convertAndValidateRaw(const QVariant& rawValue, bool convertO } } break; + case FactMetaData::valueTypeUint64: + typedValue = QVariant(rawValue.toULongLong(&convertOk)); + if (!convertOnly && convertOk) { + if (typedValue < rawMin() || typedValue > rawMax()) { + errorString = tr("Value must be within %1 and %2").arg(rawMin().toUInt()).arg(rawMax().toUInt()); + } + } + break; case FactMetaData::valueTypeFloat: typedValue = QVariant(rawValue.toFloat(&convertOk)); if (!convertOnly && convertOk) { @@ -389,6 +413,14 @@ bool FactMetaData::convertAndValidateCooked(const QVariant& cookedValue, bool co } } break; + case FactMetaData::valueTypeInt64: + typedValue = QVariant(cookedValue.toLongLong(&convertOk)); + if (!convertOnly && convertOk) { + if (cookedMin() > typedValue || typedValue > cookedMax()) { + errorString = tr("Value must be within %1 and %2").arg(cookedMin().toInt()).arg(cookedMax().toInt()); + } + } + break; case FactMetaData::valueTypeUint8: case FactMetaData::valueTypeUint16: case FactMetaData::valueTypeUint32: @@ -399,6 +431,14 @@ bool FactMetaData::convertAndValidateCooked(const QVariant& cookedValue, bool co } } break; + case FactMetaData::valueTypeUint64: + typedValue = QVariant(cookedValue.toULongLong(&convertOk)); + if (!convertOnly && convertOk) { + if (cookedMin() > typedValue || typedValue > cookedMax()) { + errorString = tr("Value must be within %1 and %2").arg(cookedMin().toUInt()).arg(cookedMax().toUInt()); + } + } + break; case FactMetaData::valueTypeFloat: typedValue = QVariant(cookedValue.toFloat(&convertOk)); if (!convertOnly && convertOk) { @@ -453,6 +493,16 @@ bool FactMetaData::clampValue(const QVariant& cookedValue, QVariant& typedValue) } } break; + case FactMetaData::valueTypeInt64: + typedValue = QVariant(cookedValue.toLongLong(&convertOk)); + if (convertOk) { + if (cookedMin() > typedValue) { + typedValue = cookedMin(); + } else if(typedValue > cookedMax()) { + typedValue = cookedMax(); + } + } + break; case FactMetaData::valueTypeUint8: case FactMetaData::valueTypeUint16: case FactMetaData::valueTypeUint32: @@ -465,6 +515,16 @@ bool FactMetaData::clampValue(const QVariant& cookedValue, QVariant& typedValue) } } break; + case FactMetaData::valueTypeUint64: + typedValue = QVariant(cookedValue.toULongLong(&convertOk)); + if (convertOk) { + if (cookedMin() > typedValue) { + typedValue = cookedMin(); + } else if(typedValue > cookedMax()) { + typedValue = cookedMax(); + } + } + break; case FactMetaData::valueTypeFloat: typedValue = QVariant(cookedValue.toFloat(&convertOk)); if (convertOk) { @@ -742,6 +802,8 @@ FactMetaData::ValueType_t FactMetaData::stringToType(const QString& typeString, << QStringLiteral("Int16") << QStringLiteral("Uint32") << QStringLiteral("Int32") + << QStringLiteral("Uint64") + << QStringLiteral("Int64") << QStringLiteral("Float") << QStringLiteral("Double") << QStringLiteral("String") @@ -755,6 +817,8 @@ FactMetaData::ValueType_t FactMetaData::stringToType(const QString& typeString, << valueTypeInt16 << valueTypeUint32 << valueTypeInt32 + << valueTypeUint64 + << valueTypeInt64 << valueTypeFloat << valueTypeDouble << valueTypeString @@ -789,6 +853,8 @@ size_t FactMetaData::typeToSize(ValueType_t type) case valueTypeFloat: return 4; + case valueTypeUint64: + case valueTypeInt64: case valueTypeDouble: return 8; diff --git a/src/FactSystem/FactMetaData.h b/src/FactSystem/FactMetaData.h index 28c924fa0bdc76b01d5956c4470957a32a13672a..4b298ca2422b2407b6b9c3b0fc5e814fc48756f8 100644 --- a/src/FactSystem/FactMetaData.h +++ b/src/FactSystem/FactMetaData.h @@ -36,6 +36,8 @@ public: valueTypeInt16, valueTypeUint32, valueTypeInt32, + valueTypeUint64, + valueTypeInt64, valueTypeFloat, valueTypeDouble, valueTypeString, diff --git a/src/FactSystem/ParameterManager.cc b/src/FactSystem/ParameterManager.cc index 0d223761eb9ca126439bd36e2a5d719064514a15..ec1cd138437424c3cd39d5cf922375d3b680bf52 100644 --- a/src/FactSystem/ParameterManager.cc +++ b/src/FactSystem/ParameterManager.cc @@ -22,12 +22,9 @@ #include #include -/* types for local parameter cache */ -typedef QPair ParamTypeVal; -typedef QMap CacheMapName2ParamTypeVal; - -QGC_LOGGING_CATEGORY(ParameterManagerVerbose1Log, "ParameterManagerVerbose1Log") -QGC_LOGGING_CATEGORY(ParameterManagerVerbose2Log, "ParameterManagerVerbose2Log") +QGC_LOGGING_CATEGORY(ParameterManagerVerbose1Log, "ParameterManagerVerbose1Log") +QGC_LOGGING_CATEGORY(ParameterManagerVerbose2Log, "ParameterManagerVerbose2Log") +QGC_LOGGING_CATEGORY(ParameterManagerDebugCacheFailureLog, "ParameterManagerDebugCacheFailureLog") // Turn on to debug parameter cache crc misses Fact ParameterManager::_defaultFact; @@ -151,6 +148,24 @@ void ParameterManager::_parameterUpdate(int vehicleId, int componentId, QString return; } + // Used to debug cache crc misses (turn on ParameterManagerDebugCacheFailureLog) + if (!_initialLoadComplete && !_logReplay && _debugCacheCRC.contains(componentId) && _debugCacheCRC[componentId]) { + if (_debugCacheMap[componentId].contains(parameterName)) { + const ParamTypeVal& cacheParamTypeVal = _debugCacheMap[componentId][parameterName]; + size_t dataSize = FactMetaData::typeToSize(static_cast(cacheParamTypeVal.first)); + const void *cacheData = cacheParamTypeVal.second.constData(); + + const void *vehicleData = value.constData(); + + if (memcmp(cacheData, vehicleData, dataSize)) { + qDebug() << "Cache/Vehicle values differ for name:cache:actual" << parameterName << value << cacheParamTypeVal.second; + } + _debugCacheParamSeen[componentId][parameterName] = true; + } else { + qDebug() << "Parameter missing from cache" << parameterName; + } + } + _initialRequestTimeoutTimer.stop(); _waitingParamTimeoutTimer.stop(); @@ -289,6 +304,12 @@ void ParameterManager::_parameterUpdate(int vehicleId, int componentId, QString case MAV_PARAM_TYPE_INT32: factType = FactMetaData::valueTypeInt32; break; + case MAV_PARAM_TYPE_UINT64: + factType = FactMetaData::valueTypeUint64; + break; + case MAV_PARAM_TYPE_INT64: + factType = FactMetaData::valueTypeInt64; + break; case MAV_PARAM_TYPE_REAL32: factType = FactMetaData::valueTypeFloat; break; @@ -334,11 +355,6 @@ void ParameterManager::_parameterUpdate(int vehicleId, int componentId, QString _setupCategoryMap(); } - if (_prevWaitingWriteParamNameCount != 0 && waitingWriteParamNameCount == 0) { - // If all the writes just finished the vehicle is up to date, so persist. - _saveToEEPROM(); - } - // Update param cache. The param cache is only used on PX4 Firmware since ArduPilot and Solo have volatile params // which invalidate the cache. The Solo also streams param updates in flight for things like gimbal values // which in turn causes a perf problem with all the param cache updates. @@ -869,22 +885,13 @@ void ParameterManager::_tryCacheHashLoad(int vehicleId, int componentId, QVarian _parameterSetMajorVersion = -1; _clearMetaData(); qCInfo(ParameterManagerLog) << "Parameters cache match failed" << qPrintable(QFileInfo(cacheFile).absoluteFilePath()); - } -} - -void ParameterManager::_saveToEEPROM(void) -{ - if (_saveRequired) { - _saveRequired = false; - if (_vehicle->firmwarePlugin()->isCapable(_vehicle, FirmwarePlugin::MavCmdPreflightStorageCapability)) { - _vehicle->sendMavCommand(MAV_COMP_ID_ALL, - MAV_CMD_PREFLIGHT_STORAGE, - true, // showError - 1, // Write parameters to EEPROM - -1); // Don't do anything with mission storage - qCDebug(ParameterManagerLog) << _logVehiclePrefix() << "_saveToEEPROM"; - } else { - qCDebug(ParameterManagerLog) << _logVehiclePrefix() << "_saveToEEPROM skipped due to FirmwarePlugin::isCapable"; + if (ParameterManagerDebugCacheFailureLog().isDebugEnabled()) { + _debugCacheCRC[componentId] = true; + _debugCacheMap[componentId] = cacheMap; + foreach (const QString& name, cacheMap.keys()) { + _debugCacheParamSeen[componentId][name] = false; + } + qgcApp()->showMessage(tr("Parameter cache CRC match failed")); } } } @@ -983,9 +990,18 @@ MAV_PARAM_TYPE ParameterManager::_factTypeToMavType(FactMetaData::ValueType_t fa case FactMetaData::valueTypeUint32: return MAV_PARAM_TYPE_UINT32; + case FactMetaData::valueTypeUint64: + return MAV_PARAM_TYPE_UINT64; + + case FactMetaData::valueTypeInt64: + return MAV_PARAM_TYPE_INT64; + case FactMetaData::valueTypeFloat: return MAV_PARAM_TYPE_REAL32; + case FactMetaData::valueTypeDouble: + return MAV_PARAM_TYPE_REAL64; + default: qWarning() << "Unsupported fact type" << factType; // fall through @@ -1013,9 +1029,18 @@ FactMetaData::ValueType_t ParameterManager::_mavTypeToFactType(MAV_PARAM_TYPE ma case MAV_PARAM_TYPE_UINT32: return FactMetaData::valueTypeUint32; + case MAV_PARAM_TYPE_UINT64: + return FactMetaData::valueTypeUint64; + + case MAV_PARAM_TYPE_INT64: + return FactMetaData::valueTypeInt64; + case MAV_PARAM_TYPE_REAL32: return FactMetaData::valueTypeFloat; + case MAV_PARAM_TYPE_REAL64: + return FactMetaData::valueTypeDouble; + default: qWarning() << "Unsupported mav param type" << mavType; // fall through @@ -1086,6 +1111,18 @@ void ParameterManager::_checkInitialLoadComplete(void) // We aren't waiting for any more initial parameter updates, initial parameter loading is complete _initialLoadComplete = true; + // Parameter cache crc failure debugging + foreach (int componentId, _debugCacheParamSeen.keys()) { + if (!_logReplay && _debugCacheCRC.contains(componentId) && _debugCacheCRC[componentId]) { + foreach (const QString& paramName, _debugCacheParamSeen[componentId].keys()) { + if (!_debugCacheParamSeen[componentId][paramName]) { + qDebug() << "Parameter in cache but not on vehicle componentId:Name" << componentId << paramName; + } + } + } + } + _debugCacheCRC.clear(); + qCDebug(ParameterManagerLog) << _logVehiclePrefix() << "Initial load complete"; // Check for index based load failures @@ -1399,6 +1436,7 @@ void ParameterManager::_loadOfflineEditingParams(void) _setupCategoryMap(); _parametersReady = true; _initialLoadComplete = true; + _debugCacheCRC.clear(); } void ParameterManager::saveToJson(int componentId, const QStringList& paramsToSave, QJsonObject& saveObject) diff --git a/src/FactSystem/ParameterManager.h b/src/FactSystem/ParameterManager.h index d0f45b16fb4259b97ca136c3e9c09d4382f27281..33d14ff8a3aa64a8fcd868f5a327bcfd44089227 100644 --- a/src/FactSystem/ParameterManager.h +++ b/src/FactSystem/ParameterManager.h @@ -30,6 +30,7 @@ Q_DECLARE_LOGGING_CATEGORY(ParameterManagerVerbose1Log) Q_DECLARE_LOGGING_CATEGORY(ParameterManagerVerbose2Log) +Q_DECLARE_LOGGING_CATEGORY(ParameterManagerDebugCacheFailureLog) /// Connects to Parameter Manager to load/update Facts class ParameterManager : public QObject @@ -153,7 +154,6 @@ private: MAV_PARAM_TYPE _factTypeToMavType(FactMetaData::ValueType_t factType); FactMetaData::ValueType_t _mavTypeToFactType(MAV_PARAM_TYPE mavType); - void _saveToEEPROM(void); void _checkInitialLoadComplete(void); /// First mapping is by component id @@ -175,6 +175,13 @@ private: int _parameterSetMajorVersion; ///< Version for parameter set, -1 if not known QObject* _parameterMetaData; ///< Opaque data from FirmwarePlugin::loadParameterMetaDataCall + typedef QPair ParamTypeVal; + typedef QMap CacheMapName2ParamTypeVal; + + QMap _debugCacheCRC; ///< true: debug cache crc failure + QMap _debugCacheMap; + QMap> _debugCacheParamSeen; + // Wait counts from previous parameter update cycle int _prevWaitingReadParamIndexCount; int _prevWaitingReadParamNameCount; diff --git a/src/FirmwarePlugin/APM/APMParameterMetaData.cc b/src/FirmwarePlugin/APM/APMParameterMetaData.cc index f707163b6c3c467423f52c5be4a88e7cde3d3d76..2760464324a7ea528ca20a9e2e31818b98dc8868 100644 --- a/src/FirmwarePlugin/APM/APMParameterMetaData.cc +++ b/src/FirmwarePlugin/APM/APMParameterMetaData.cc @@ -44,11 +44,13 @@ QVariant APMParameterMetaData::_stringToTypedVariant(const QString& string, case FactMetaData::valueTypeUint8: case FactMetaData::valueTypeUint16: case FactMetaData::valueTypeUint32: + case FactMetaData::valueTypeUint64: convertTo = QVariant::UInt; break; case FactMetaData::valueTypeInt8: case FactMetaData::valueTypeInt16: case FactMetaData::valueTypeInt32: + case FactMetaData::valueTypeInt64: convertTo = QVariant::Int; break; case FactMetaData::valueTypeFloat: @@ -531,12 +533,14 @@ void APMParameterMetaData::addMetaDataToFact(Fact* fact, MAV_TYPE vehicleType) break; case FactMetaData::valueTypeInt32: + case FactMetaData::valueTypeInt64: typedBitSet = QVariant((int)bitSet); break; case FactMetaData::valueTypeUint8: case FactMetaData::valueTypeUint16: case FactMetaData::valueTypeUint32: + case FactMetaData::valueTypeUint64: typedBitSet = QVariant(bitSet); break; diff --git a/src/FirmwarePlugin/FirmwarePlugin.cc b/src/FirmwarePlugin/FirmwarePlugin.cc index 54112718fceb900e7ae5e354f5fba5715b253383..96efc3a1015fcf9d127f69aaca137f60e84daef9 100644 --- a/src/FirmwarePlugin/FirmwarePlugin.cc +++ b/src/FirmwarePlugin/FirmwarePlugin.cc @@ -492,6 +492,18 @@ const QVariantList& FirmwarePlugin::cameraList(const Vehicle* vehicle) 0.8, // minTriggerInterval this); _cameraList.append(QVariant::fromValue(metaData)); + + metaData = new CameraMetaData(tr("GoPro Hero 4"), + 6.17, // sensorWidth + 4.55, // sendsorHeight + 4000, // imageWidth + 3000, // imageHeight + 2.98, // focalLength + true, // landscape + false, // fixedOrientation + 0, // minTriggerInterval + this); + _cameraList.append(QVariant::fromValue(metaData)); } return _cameraList; diff --git a/src/FirmwarePlugin/FirmwarePlugin.h b/src/FirmwarePlugin/FirmwarePlugin.h index 7d95f4053584ab325563590104caeb1a32668702..461020d514b4ac711c733267e08ad7c8a02649e3 100644 --- a/src/FirmwarePlugin/FirmwarePlugin.h +++ b/src/FirmwarePlugin/FirmwarePlugin.h @@ -43,11 +43,10 @@ public: /// Set of optional capabilites which firmware may support typedef enum { SetFlightModeCapability = 1 << 0, ///< FirmwarePlugin::setFlightMode method is supported - MavCmdPreflightStorageCapability = 1 << 1, ///< MAV_CMD_PREFLIGHT_STORAGE is supported - PauseVehicleCapability = 1 << 2, ///< Vehicle supports pausing at current location - GuidedModeCapability = 1 << 3, ///< Vehicle supports guided mode commands - OrbitModeCapability = 1 << 4, ///< Vehicle supports orbit mode - TakeoffVehicleCapability = 1 << 5, ///< Vehicle supports guided takeoff + PauseVehicleCapability = 1 << 1, ///< Vehicle supports pausing at current location + GuidedModeCapability = 1 << 2, ///< Vehicle supports guided mode commands + OrbitModeCapability = 1 << 3, ///< Vehicle supports orbit mode + TakeoffVehicleCapability = 1 << 4, ///< Vehicle supports guided takeoff } FirmwareCapabilities; /// Maps from on parameter name to another diff --git a/src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc b/src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc index 8ea457b678810bf189621c5f3364dde3ddef3281..602fc0dfa0bdb39190699ec1860a22b63d883e68 100644 --- a/src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc +++ b/src/FirmwarePlugin/PX4/PX4FirmwarePlugin.cc @@ -227,7 +227,7 @@ int PX4FirmwarePlugin::manualControlReservedButtonCount(void) bool PX4FirmwarePlugin::isCapable(const Vehicle *vehicle, FirmwareCapabilities capabilities) { - int available = MavCmdPreflightStorageCapability | SetFlightModeCapability | PauseVehicleCapability | GuidedModeCapability; + int available = SetFlightModeCapability | PauseVehicleCapability | GuidedModeCapability; if (vehicle->multiRotor() || vehicle->vtol()) { available |= TakeoffVehicleCapability; } diff --git a/src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml b/src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml index b7404a0008d1a00bcde4ad8cc37c410f1eae7c1b..cd61fcbf0db8402743a2a4b8238b93e6d7e98b4a 100644 --- a/src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml +++ b/src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml @@ -217,7 +217,7 @@ Set to 2 to use heading from motion capture Defines the capacity of the attached battery. -1.0 100000 - mA + mAh 0 50 true @@ -2259,16 +2259,6 @@ This is the ratio of static pressure error to dynamic pressure generated by a wi 0.5 modules/fw_att_control - - Attitude Wheel Time Constant - This defines the latency between a steering step input and the achieved setpoint (inverse to a P gain). Half a second is a good start value and fits for most average systems. Smaller systems may require smaller values, but as this will wear out servos faster, the value should only be decreased as needed. - 0.4 - 1.0 - s - 2 - 0.05 - modules/gnd_att_control - @@ -2892,6 +2882,16 @@ but also ignore less noise 0.005 modules/gnd_att_control + + Attitude Wheel Time Constant + This defines the latency between a steering step input and the achieved setpoint (inverse to a P gain). Half a second is a good start value and fits for most average systems. Smaller systems may require smaller values, but as this will wear out servos faster, the value should only be decreased as needed. + 0.4 + 1.0 + s + 2 + 0.05 + modules/gnd_att_control + Maximum wheel steering rate This limits the maximum wheel steering rate the controller will output (in degrees per second). Setting a value of zero disables the limit. @@ -3114,7 +3114,7 @@ but also ignore less noise 0 300 s - drivers/iridiumsbd + drivers/telemetry/iridiumsbd @@ -3655,17 +3655,41 @@ Used to calculate increased terrain random walk nosie due to movementtrue modules/mavlink - - Test parameter - This parameter is not actively used by the system. Its purpose is to allow testing the parameter interface on the communication level. - -1000 - 1000 - modules/mavlink - MAVLink airframe type 1 + 27 modules/mavlink + + Generic micro air vehicle + Fixed wing aircraft + Quadrotor + Coaxial helicopter + Normal helicopter with tail rotor + Ground installation + Operator control unit / ground control station + Airship, controlled + Free balloon, uncontrolled + Rocket + Ground rover + Surface vessel, boat, ship + Submarine + Hexarotor + Octorotor + Tricopter + Flapping wing + Kite + Onboard companion controller + Two-rotor VTOL using control surfaces in vertical operation in addition. Tailsitter. + Quad-rotor VTOL using a V-shaped quad config in vertical operation. Tailsitter. + Tiltrotor VTOL + VTOL reserved 2 + VTOL reserved 3 + VTOL reserved 4 + VTOL reserved 5 + Onboard gimbal + Onboard ADSB peripheral + Use/Accept HIL GPS message even if not in HIL mode @@ -3930,6 +3954,15 @@ Used to calculate increased terrain random walk nosie due to movementLockdown + + RC Loss Loiter Time (CASA Outback Challenge rules) + The amount of time in seconds the system should loiter at current position before termination. Only applies if NAV_RCL_ACT is set to 2 (CASA Outback Challenge rules). Set to -1 to make the system skip loitering. + -1.0 + s + 1 + 0.1 + modules/navigator + Set traffic avoidance mode Enabling this will allow the system to respond to transponder data from e.g. ADSB transponders @@ -4156,6 +4189,16 @@ default 1.5 turns per second modules/mc_att_control + + Cutoff frequency for the low pass filter on the D-term in the rate controller + The D-term uses the derivative of the rate and thus is the most susceptible to noise. Therefore, using a D-term filter allows to decrease the driver-level filtering, which leads to reduced control latency and permits to increase the P gains. A value of 0 disables the filter. + 0 + 1000 + Hz + 0 + 10 + modules/mc_att_control + Pitch rate D gain Pitch rate differential gain. Small values help reduce fast oscillations. If value is too big oscillations will appear again. @@ -4202,7 +4245,7 @@ default 1.5 turns per second Pitch P gain Pitch proportional gain, i.e. desired angular speed in rad/s for error 1 rad. 0.0 - 10 + 12 1/s 2 0.1 @@ -4282,7 +4325,7 @@ default 1.5 turns per second Roll P gain Roll proportional gain, i.e. desired angular speed in rad/s for error 1 rad. 0.0 - 8 + 12 1/s 2 0.1 @@ -4503,6 +4546,7 @@ the vehicle will accelerate at this rate until the normal position control speed is 90 degrees. It should be lower than MPC_XY_CRUISE Applies only in AUTO modes (includes also RTL / hold / etc.) 1.0 + 20.0 m/s 2 1 @@ -5568,6 +5612,10 @@ the setpoint will be capped to MPC_XY_VEL_MAX -1.0 1.0 modules/sensors + + Reverse + Normal + RC channel 10 trim @@ -5606,6 +5654,10 @@ the setpoint will be capped to MPC_XY_VEL_MAX -1.0 1.0 modules/sensors + + Reverse + Normal + RC channel 11 trim @@ -5644,6 +5696,10 @@ the setpoint will be capped to MPC_XY_VEL_MAX -1.0 1.0 modules/sensors + + Reverse + Normal + RC channel 12 trim @@ -5682,6 +5738,10 @@ the setpoint will be capped to MPC_XY_VEL_MAX -1.0 1.0 modules/sensors + + Reverse + Normal + RC channel 13 trim @@ -5720,6 +5780,10 @@ the setpoint will be capped to MPC_XY_VEL_MAX -1.0 1.0 modules/sensors + + Reverse + Normal + RC channel 14 trim @@ -5758,6 +5822,10 @@ the setpoint will be capped to MPC_XY_VEL_MAX -1.0 1.0 modules/sensors + + Reverse + Normal + RC channel 15 trim @@ -5796,6 +5864,10 @@ the setpoint will be capped to MPC_XY_VEL_MAX -1.0 1.0 modules/sensors + + Reverse + Normal + RC channel 16 trim @@ -5834,6 +5906,10 @@ the setpoint will be capped to MPC_XY_VEL_MAX -1.0 1.0 modules/sensors + + Reverse + Normal + RC channel 17 trim @@ -5872,6 +5948,10 @@ the setpoint will be capped to MPC_XY_VEL_MAX -1.0 1.0 modules/sensors + + Reverse + Normal + RC channel 18 trim @@ -5911,6 +5991,10 @@ the setpoint will be capped to MPC_XY_VEL_MAX -1.0 1.0 modules/sensors + + Reverse + Normal + RC channel 1 trim @@ -5950,6 +6034,10 @@ the setpoint will be capped to MPC_XY_VEL_MAX -1.0 1.0 modules/sensors + + Reverse + Normal + RC channel 2 trim @@ -5989,6 +6077,10 @@ the setpoint will be capped to MPC_XY_VEL_MAX -1.0 1.0 modules/sensors + + Reverse + Normal + RC channel 3 trim @@ -6028,6 +6120,10 @@ the setpoint will be capped to MPC_XY_VEL_MAX -1.0 1.0 modules/sensors + + Reverse + Normal + RC channel 4 trim @@ -6066,6 +6162,10 @@ the setpoint will be capped to MPC_XY_VEL_MAX -1.0 1.0 modules/sensors + + Reverse + Normal + RC channel 5 trim @@ -6104,6 +6204,10 @@ the setpoint will be capped to MPC_XY_VEL_MAX -1.0 1.0 modules/sensors + + Reverse + Normal + RC channel 6 trim @@ -6142,6 +6246,10 @@ the setpoint will be capped to MPC_XY_VEL_MAX -1.0 1.0 modules/sensors + + Reverse + Normal + RC channel 7 trim @@ -6180,6 +6288,10 @@ the setpoint will be capped to MPC_XY_VEL_MAX -1.0 1.0 modules/sensors + + Reverse + Normal + RC channel 8 trim @@ -6218,6 +6330,10 @@ the setpoint will be capped to MPC_XY_VEL_MAX -1.0 1.0 modules/sensors + + Reverse + Normal + RC channel 9 trim @@ -6243,14 +6359,14 @@ the setpoint will be capped to MPC_XY_VEL_MAX modules/sensors - Cutoff frequency for the low pass filter on roll,pitch, yaw and throttle - Does not get set unless below RC_FLT_SMP_RATE/2 because of filter instability characteristics. - 0.1 + Cutoff frequency for the low pass filter on roll, pitch, yaw and throttle + Does not get set unless below RC_FLT_SMP_RATE/2 because of filter instability characteristics. Set to 0 to disable the filter. + 0 Hz modules/sensors - Sample rate of the remote control values for the low pass filter on roll,pitch, yaw and throttle + Sample rate of the remote control values for the low pass filter on roll, pitch, yaw and throttle Has an influence on the cutoff frequency precision. 1.0 Hz @@ -6688,17 +6804,6 @@ the setpoint will be capped to MPC_XY_VEL_MAX modules/commander - - - Loiter Time - The amount of time in seconds the system should loiter at current position before termination Set to -1 to make the system skip loitering - -1.0 - s - 1 - 0.1 - modules/navigator - - Threshold for selecting acro mode @@ -8000,18 +8105,18 @@ This is used for gathering replay logs for the ekf2 module - Driver level cut frequency for accel - The cut frequency for the 2nd order butterworth filter on the accel driver. This features is currently supported by the mpu6000 and mpu9250. This only affects the signal sent to the controllers, not the estimators. 0 disables the filter. - 5 + Driver level cutoff frequency for accel + The cutoff frequency for the 2nd order butterworth filter on the accel driver. This features is currently supported by the mpu6000 and mpu9250. This only affects the signal sent to the controllers, not the estimators. 0 disables the filter. + 0 1000 Hz true modules/sensors - Driver level cut frequency for gyro - The cut frequency for the 2nd order butterworth filter on the gyro driver. This features is currently supported by the mpu6000 and mpu9250. This only affects the signal sent to the controllers, not the estimators. 0 disables the filter. - 5 + Driver level cutoff frequency for gyro + The cutoff frequency for the 2nd order butterworth filter on the gyro driver. This features is currently supported by the mpu6000 and mpu9250. This only affects the signal sent to the controllers, not the estimators. 0 disables the filter. + 0 1000 Hz true @@ -8056,6 +8161,15 @@ This is used for gathering replay logs for the ekf2 module Roll 270°, Yaw 135° Pitch 90° Pitch 270° + Roll 270°, Yaw 270° + Roll 180°, Pitch 270° + Pitch 90°, Yaw 180 + Pitch 90°, Roll 90° + Yaw 293°, Pitch 68°, Roll 90° (Solo) + Pitch 90°, Roll 270° + Pitch 9°, Yaw 180° + Pitch 45° + Pitch 315° @@ -8080,14 +8194,14 @@ This is used for gathering replay logs for the ekf2 module LeddarOne rangefinder true - modules/sensors + drivers/distance_sensor/leddar_one Lidar-Lite (LL40LS) 0 2 true - modules/sensors + drivers/distance_sensor/ll40ls Disabled PWM @@ -8098,14 +8212,14 @@ This is used for gathering replay logs for the ekf2 module Maxbotix Soanr (mb12xx) true - modules/sensors + drivers/distance_sensor/mb12xx Lightware laser rangefinder (serial) 0 4 true - modules/sensors + drivers/distance_sensor/sf0x Disabled SF02 @@ -8120,7 +8234,7 @@ This is used for gathering replay logs for the ekf2 module 0 5 true - modules/sensors + drivers/distance_sensor/sf1xx Disabled SF10/a @@ -8134,7 +8248,7 @@ This is used for gathering replay logs for the ekf2 module Benewake TFmini laser rangefinder true - modules/sensors + drivers/distance_sensor/tfmini Thermal control of sensor temperature @@ -8149,7 +8263,7 @@ This is used for gathering replay logs for the ekf2 module 0 3 true - modules/sensors + drivers/distance_sensor/teraranger Disabled Autodetect @@ -8325,9 +8439,13 @@ This is used for gathering replay logs for the ekf2 module Normal Telemetry (38400 baud, 8N1) Normal Telemetry (57600 baud, 8N1) Iridium Telemetry (19200 baud, 8N1) + Minimal Telemetry (19200 baud, 8N1) + Minimal Telemetry (38400 baud, 8N1) + Minimal Telemetry (57600 baud, 8N1) Companion Link (921600 baud, 8N1) ESP8266 (921600 baud, 8N1) Normal Telemetry (115200 baud, 8N1) + Minimal Telemetry (115200 baud, 8N1) @@ -9218,9 +9336,10 @@ Airbrakes need to be enables for your selected model/mixer modules/vtol_att_control - Thottle output during back transition -For ESCs and mixers that support reverse thrust on low PWM values set this to a negative value to apply active breaking -For ESCs that support thrust reversal with a control channel please set VT_B_REV_OUT and set this to a positive value to apply active breaking + Target throttle value for the transition to hover flight. +standard vtol: pusher +tailsitter, tiltrotor: main throttle + Note for standard vtol: For ESCs and mixers that support reverse thrust on low PWM values set this to a negative value to apply active breaking For ESCs that support thrust reversal with a control channel please set VT_B_REV_OUT and set this to a positive value to apply active breaking -1 1 2 @@ -9293,15 +9412,6 @@ to accelerate forward if necessary modules/vtol_att_control - - Fixed wing pitch trim - This parameter allows to adjust the neutral elevon position in fixed wing mode. - -1.0 - 1.0 - 2 - 0.01 - modules/vtol_att_control - QuadChute Max Pitch Maximum pitch angle before QuadChute engages Above this the vehicle will transition back to MC mode and enter failsafe RTL @@ -9326,6 +9436,16 @@ to accelerate forward if necessary 1 modules/vtol_att_control + + Target throttle value for the transition to fixed wing flight. +standard vtol: pusher +tailsitter, tiltrotor: main throttle + 0.0 + 1.0 + 3 + 0.01 + modules/vtol_att_control + Airspeed less front transition time (open loop) The duration of the front transition when there is no airspeed feedback available. @@ -9356,6 +9476,14 @@ to accelerate forward if necessary modules/vtol_att_control + + Defines the time window during which the pusher throttle will be ramped up linearly to VT_F_TRANS_THR during a transition +to fixed wing mode. Zero or negative values will produce an instant throttle rise to VT_F_TRANS_THR + 20 + 2 + 0.01 + modules/vtol_att_control + Position of tilt servo in fw mode 0.0 @@ -9384,7 +9512,7 @@ to accelerate forward if necessary Front transition minimum time Minimum time in seconds for front transition. 0.0 - 10.0 + 20.0 s modules/vtol_att_control @@ -9398,14 +9526,6 @@ to accelerate forward if necessary 0.01 modules/vtol_att_control - - Target throttle value for pusher/puller motor during the transition to fw mode - 0.0 - 1.0 - 3 - 0.01 - modules/vtol_att_control - Front transition timeout Time in seconds after which transition will be cancelled. Disabled if set to 0. diff --git a/src/FirmwarePlugin/PX4/PX4ParameterMetaData.cc b/src/FirmwarePlugin/PX4/PX4ParameterMetaData.cc index 84aaaf6e73c323d07cd612ae8d03359630f7d3f9..a4c3b6fc1889a75c1799f72518468986ad706611 100644 --- a/src/FirmwarePlugin/PX4/PX4ParameterMetaData.cc +++ b/src/FirmwarePlugin/PX4/PX4ParameterMetaData.cc @@ -44,11 +44,13 @@ QVariant PX4ParameterMetaData::_stringToTypedVariant(const QString& string, Fact case FactMetaData::valueTypeUint8: case FactMetaData::valueTypeUint16: case FactMetaData::valueTypeUint32: + case FactMetaData::valueTypeUint64: convertTo = QVariant::UInt; break; case FactMetaData::valueTypeInt8: case FactMetaData::valueTypeInt16: case FactMetaData::valueTypeInt32: + case FactMetaData::valueTypeInt64: convertTo = QVariant::Int; break; case FactMetaData::valueTypeFloat: diff --git a/src/FlightDisplay/FlightDisplayView.qml b/src/FlightDisplay/FlightDisplayView.qml index bc815e8e059d3236efd81545365371f2a7f170e6..413b8ec433968c3ad2ba2f43366b79059ba1711c 100644 --- a/src/FlightDisplay/FlightDisplayView.qml +++ b/src/FlightDisplay/FlightDisplayView.qml @@ -94,6 +94,20 @@ QGCView { QGroundControl.saveBoolGlobalSetting(_PIPVisibleKey, state) } + function isInstrumentRight() { + if(QGroundControl.corePlugin.options.instrumentWidget) { + if(QGroundControl.corePlugin.options.instrumentWidget.source.toString().length) { + switch(QGroundControl.corePlugin.options.instrumentWidget.widgetPosition) { + case CustomInstrumentWidget.POS_TOP_LEFT: + case CustomInstrumentWidget.POS_BOTTOM_LEFT: + case CustomInstrumentWidget.POS_CENTER_LEFT: + return false; + } + } + } + return true; + } + PlanMasterController { id: masterController Component.onCompleted: start(false /* editMode */) @@ -447,8 +461,10 @@ QGCView { ToolStrip { visible: (_activeVehicle ? _activeVehicle.guidedModeSupported : true) && !QGroundControl.videoManager.fullScreen id: toolStrip - anchors.leftMargin: ScreenTools.defaultFontPixelWidth - anchors.left: _panel.left + anchors.leftMargin: isInstrumentRight() ? ScreenTools.defaultFontPixelWidth : undefined + anchors.left: isInstrumentRight() ? _panel.left : undefined + anchors.rightMargin:isInstrumentRight() ? undefined : ScreenTools.defaultFontPixelWidth + anchors.right: isInstrumentRight() ? undefined : _panel.right anchors.topMargin: ScreenTools.toolbarHeight + (_margins * 2) anchors.top: _panel.top z: _panel.z + 4 diff --git a/src/FlightDisplay/FlightDisplayViewMap.qml b/src/FlightDisplay/FlightDisplayViewMap.qml index ba210b9024b6464c6a43bbe2a9a0975aa5469645..2719bf84d68338426dbccfc643ef9c2683985022 100644 --- a/src/FlightDisplay/FlightDisplayViewMap.qml +++ b/src/FlightDisplay/FlightDisplayViewMap.qml @@ -162,7 +162,7 @@ FlightMap { onNewItemsFromVehicle: { var visualItems = _missionController.visualItems - if (visualItems && visualItems.count != 1) { + if (visualItems && visualItems.count !== 1) { mapFitFunctions.fitMapViewportToMissionItems() firstVehiclePositionReceived = true } diff --git a/src/FlightDisplay/FlightDisplayViewWidgets.qml b/src/FlightDisplay/FlightDisplayViewWidgets.qml index 533c768771d2a4290d11a53151660fc7635c2f0a..c7be27cb89d22c9b38c637d57fe23272cc1ec4fc 100644 --- a/src/FlightDisplay/FlightDisplayViewWidgets.qml +++ b/src/FlightDisplay/FlightDisplayViewWidgets.qml @@ -55,6 +55,27 @@ Item { if(QGroundControl.corePlugin.options.instrumentWidget) { if(QGroundControl.corePlugin.options.instrumentWidget.source.toString().length) { instrumentsLoader.source = QGroundControl.corePlugin.options.instrumentWidget.source + switch(QGroundControl.corePlugin.options.instrumentWidget.widgetPosition) { + case CustomInstrumentWidget.POS_TOP_LEFT: + instrumentsLoader.state = "topLeftMode" + break; + case CustomInstrumentWidget.POS_BOTTOM_LEFT: + instrumentsLoader.state = "bottomLeftMode" + break; + case CustomInstrumentWidget.POS_CENTER_LEFT: + instrumentsLoader.state = "centerLeftMode" + break; + case CustomInstrumentWidget.POS_TOP_RIGHT: + instrumentsLoader.state = "topRightMode" + break; + case CustomInstrumentWidget.POS_BOTTOM_RIGHT: + instrumentsLoader.state = "bottomRightMode" + break; + case CustomInstrumentWidget.POS_CENTER_RIGHT: + default: + instrumentsLoader.state = "centerRightMode" + break; + } } else { // Note: We currently show alternate instruments all the time. This is a trial change for daily builds. // Leaving non-alternate code in for now in case the trial fails. @@ -63,6 +84,7 @@ Item { instrumentsLoader.source = "qrc:/qml/QGCInstrumentWidgetAlternate.qml" } else { instrumentsLoader.source = "qrc:/qml/QGCInstrumentWidget.qml" + instrumentsLoader.state = QGroundControl.settingsManager.appSettings.showLargeCompass.value === 1 ? "centerRightMode" : "topRightMode" } } } else { @@ -133,6 +155,11 @@ Item { anchors.top: parent.top anchors.topMargin: QGroundControl.corePlugin.options.instrumentWidget.widgetTopMargin + (ScreenTools.defaultFontPixelHeight * 0.5) anchors.margins: ScreenTools.defaultFontPixelHeight * 0.5 + + //-- Instrument Panel + Loader { + id: instrumentsLoader + anchors.margins: ScreenTools.defaultFontPixelHeight / 2 anchors.right: parent.right //------------------------------------------------------- // Airmap Airspace Control @@ -151,5 +178,76 @@ Item { property var qgcView: widgetRoot.qgcView property real maxHeight: widgetRoot ? widgetRoot.height - instrumentsColumn.y - airspaceControl.height - (ScreenTools.defaultFontPixelHeight * 4) : 0 } + z: QGroundControl.zOrderWidgets + property var qgcView: _root.qgcView + property real maxHeight:parent.height - (anchors.margins * 2) + states: [ + State { + name: "topRightMode" + AnchorChanges { + target: instrumentsLoader + anchors.verticalCenter: undefined + anchors.bottom: undefined + anchors.top: _root ? _root.top : undefined + anchors.right: _root ? _root.right : undefined + anchors.left: undefined + } + }, + State { + name: "centerRightMode" + AnchorChanges { + target: instrumentsLoader + anchors.top: undefined + anchors.bottom: undefined + anchors.verticalCenter: _root ? _root.verticalCenter : undefined + anchors.right: _root ? _root.right : undefined + anchors.left: undefined + } + }, + State { + name: "bottomRightMode" + AnchorChanges { + target: instrumentsLoader + anchors.top: undefined + anchors.verticalCenter: undefined + anchors.bottom: _root ? _root.bottom : undefined + anchors.right: _root ? _root.right : undefined + anchors.left: undefined + } + }, + State { + name: "topLeftMode" + AnchorChanges { + target: instrumentsLoader + anchors.verticalCenter: undefined + anchors.bottom: undefined + anchors.top: _root ? _root.top : undefined + anchors.right: undefined + anchors.left: _root ? _root.left : undefined + } + }, + State { + name: "centerLeftMode" + AnchorChanges { + target: instrumentsLoader + anchors.top: undefined + anchors.bottom: undefined + anchors.verticalCenter: _root ? _root.verticalCenter : undefined + anchors.right: undefined + anchors.left: _root ? _root.left : undefined + } + }, + State { + name: "bottomLeftMode" + AnchorChanges { + target: instrumentsLoader + anchors.top: undefined + anchors.verticalCenter: undefined + anchors.bottom: _root ? _root.bottom : undefined + anchors.right: undefined + anchors.left: _root ? _root.left : undefined + } + } + ] } } diff --git a/src/FlightDisplay/GuidedActionConfirm.qml b/src/FlightDisplay/GuidedActionConfirm.qml index 48c159fa2e9cf0804683f9a2d7b7a77e176f6ece..701cf0c18a7d16de26342d564316e9a906668523 100644 --- a/src/FlightDisplay/GuidedActionConfirm.qml +++ b/src/FlightDisplay/GuidedActionConfirm.qml @@ -16,7 +16,7 @@ import QGroundControl.Controls 1.0 import QGroundControl.Palette 1.0 /// Guided actions confirmation dialog -NoMouseThroughRectangle { +Rectangle { id: _root border.color: qgcPal.alertBorder border.width: 1 @@ -42,12 +42,34 @@ NoMouseThroughRectangle { if (hideTrigger) { hideTrigger = false altitudeSlider.visible = false + visibleTimer.stop() visible = false } } + function show(immediate) { + if (immediate) { + visible = true + } else { + // We delay showing the confirmation for a small amount in order to any other state + // changes to propogate through the system. This way only the final state shows up. + visibleTimer.restart() + } + } + + Timer { + id: visibleTimer + interval: 1000 + repeat: false + onTriggered: visible = true + } + QGCPalette { id: qgcPal } + DeadMouseArea { + anchors.fill: parent + } + Column { id: confirmColumn anchors.margins: _margins diff --git a/src/FlightDisplay/GuidedActionList.qml b/src/FlightDisplay/GuidedActionList.qml index 4c002c3ce1137a02353932f17ae89dd20bd53948..768c7d814f5b79a3ff4b4f01163bb81e54957729 100644 --- a/src/FlightDisplay/GuidedActionList.qml +++ b/src/FlightDisplay/GuidedActionList.qml @@ -17,7 +17,7 @@ import QGroundControl.Controls 1.0 import QGroundControl.Palette 1.0 /// Dialog showing list of available guided actions -NoMouseThroughRectangle { +Rectangle { id: _root width: actionColumn.width + (_margins * 4) height: actionColumn.height + (_margins * 4) @@ -35,6 +35,10 @@ NoMouseThroughRectangle { QGCPalette { id: qgcPal } + DeadMouseArea { + anchors.fill: parent + } + ColumnLayout { id: actionColumn anchors.margins: _root._margins diff --git a/src/FlightDisplay/GuidedActionsController.qml b/src/FlightDisplay/GuidedActionsController.qml index 0e08e0cbf6f54e4e0f0ad4fc19f093ab08c685bf..8c5ad1556c59db935c840c158c8e27d9af6f3ccb 100644 --- a/src/FlightDisplay/GuidedActionsController.qml +++ b/src/FlightDisplay/GuidedActionsController.qml @@ -185,9 +185,11 @@ Item { // Called when an action is about to be executed in order to confirm function confirmAction(actionCode, actionData) { + var showImmediate = true closeAll() confirmDialog.action = actionCode confirmDialog.actionData = actionData + confirmDialog.hideTrigger = true _actionData = actionData switch (actionCode) { case actionArm: @@ -219,6 +221,7 @@ Item { altitudeSlider.visible = true break; case actionStartMission: + showImmediate = false confirmDialog.title = startMissionTitle confirmDialog.message = startMissionMessage confirmDialog.hideTrigger = Qt.binding(function() { return !showStartMission }) @@ -229,11 +232,13 @@ Item { confirmDialog.hideTrigger = true break; case actionContinueMission: + showImmediate = false confirmDialog.title = continueMissionTitle confirmDialog.message = continueMissionMessage confirmDialog.hideTrigger = Qt.binding(function() { return !showContinueMission }) break; case actionResumeMission: + showImmediate = false confirmDialog.title = resumeMissionTitle confirmDialog.message = resumeMissionMessage confirmDialog.hideTrigger = Qt.binding(function() { return !showResumeMission }) @@ -308,11 +313,13 @@ Item { console.warn("Unknown actionCode", actionCode) return } - confirmDialog.visible = true + confirmDialog.show(showImmediate) } // Executes the specified action function executeAction(actionCode, actionData) { + var i; + var rgVehicle; switch (actionCode) { case actionRTL: _activeVehicle.guidedModeRTL() @@ -336,10 +343,9 @@ Item { _activeVehicle.startMission() break case actionMVStartMission: - var rgVehicle = QGroundControl.multiVehicleManager.vehicles - for (var i=0; i - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/src/FlightMap/MapItems/CustomMapItems.qml b/src/FlightMap/MapItems/CustomMapItems.qml index 11509da592675e8a14283e4e6d2ec259d42bcf7f..1df427ec2f91187677321874ba5934539c7e99a8 100644 --- a/src/FlightMap/MapItems/CustomMapItems.qml +++ b/src/FlightMap/MapItems/CustomMapItems.qml @@ -29,9 +29,9 @@ Item { Component.onCompleted: { var controlUrl = object.url - if (controlUrl != "") { + if (controlUrl !== "") { var component = Qt.createComponent(controlUrl); - if (component.status == Component.Ready) { + if (component.status === Component.Ready) { _customObject = component.createObject(map, { "customMapObject": object }) if (_customObject) { map.addMapItem(_customObject) diff --git a/src/FlightMap/MapItems/PolygonEditor.qml b/src/FlightMap/MapItems/PolygonEditor.qml index 6f3631c484a166024cb5fc59b023da21358ea4de..1fa7a8dbe244c71f9d056f3953663ba76bae1b06 100644 --- a/src/FlightMap/MapItems/PolygonEditor.qml +++ b/src/FlightMap/MapItems/PolygonEditor.qml @@ -233,7 +233,7 @@ Item { var clickCoordinate = map.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */) var polygonPath = _newPolygon.path - if (polygonPath.length == 0) { + if (polygonPath.length === 0) { // Add first coordinate polygonPath.push(clickCoordinate) } else { @@ -252,10 +252,10 @@ Item { _currentPolygon.path = polygonPath _newPolygon.path = polygonPath - if (_mobile && _currentPolygon.path.length == 1) { + if (_mobile && _currentPolygon.path.length === 1) { _mobilePoint.coordinate = _currentPolygon.path[0] _mobilePoint.visible = true - } else if (_mobile && _currentPolygon.path.length == 2) { + } else if (_mobile && _currentPolygon.path.length === 2) { // Show initial line segment on mobile _mobileSegment.path = [ _currentPolygon.path[0], _currentPolygon.path[1] ] _mobileSegment.visible = true diff --git a/src/FlightMap/MapScale.qml b/src/FlightMap/MapScale.qml index 515d83dc6f8143cc01e045dae578d78b2d7b73da..321afc289e252ecee490387d0c3c2b8da0e683a5 100644 --- a/src/FlightMap/MapScale.qml +++ b/src/FlightMap/MapScale.qml @@ -115,7 +115,7 @@ Item { var rightCoord = mapControl.toCoordinate(Qt.point(scaleLinePixelLength, scale.y), false /* clipToViewPort */) var scaleLineMeters = Math.round(leftCoord.distanceTo(rightCoord)) - if (QGroundControl.settingsManager.unitsSettings.distanceUnits.value == UnitsSettings.DistanceUnitsFeet) { + if (QGroundControl.settingsManager.unitsSettings.distanceUnits.value === UnitsSettings.DistanceUnitsFeet) { calculateFeetRatio(scaleLineMeters, scaleLinePixelLength) } else { calculateMetersRatio(scaleLineMeters, scaleLinePixelLength) diff --git a/src/FlightMap/Widgets/CenterMapDropButton.qml b/src/FlightMap/Widgets/CenterMapDropButton.qml index e4f410ade5b19721bcb221bc1243a4e1e208a0de..ca48c00e398a164fdcb5b336b4a847267a1534e9 100644 --- a/src/FlightMap/Widgets/CenterMapDropButton.qml +++ b/src/FlightMap/Widgets/CenterMapDropButton.qml @@ -61,7 +61,7 @@ DropButton { /// Fits the visible region of the map to inclues all of the specified coordinates. If no coordinates /// are specified the map will center to fitHomePosition() function fitMapViewportToAllCoordinates(coordList) { - if (coordList.length == 0) { + if (coordList.length === 0) { map.center = fitHomePosition() return } @@ -115,16 +115,17 @@ DropButton { } function addFenceItemCoordsForFit(coordList) { + var i var homePosition = fitHomePosition() if (homePosition.isValid && geoFenceController.circleEnabled) { var azimuthList = [ 0, 180, 90, 270 ] - for (var i=0; i 2) { - for (var i=0; i 2) { - for (var i=0; i<_geoFenceController.mapPolygon.path.count; i++) { + for (i = 0; i < _geoFenceController.mapPolygon.path.count; i++) { coordList.push(_geoFenceController.mapPolygon.path[i]) } } diff --git a/src/FlightMap/Widgets/ValuePageWidget.qml b/src/FlightMap/Widgets/ValuePageWidget.qml index 789cfc225f448c2033abf54abf9ffe9ccd2fd3f6..b68146cddc25713a12f2b5ac78d3dc5a79987aa1 100644 --- a/src/FlightMap/Widgets/ValuePageWidget.qml +++ b/src/FlightMap/Widgets/ValuePageWidget.qml @@ -174,8 +174,8 @@ Column { anchors.right: parent.right sourceComponent: factGroupList - property var factGroup: _activeVehicle - property var factGroupName: "Vehicle" + property var factGroup: _activeVehicle + property string factGroupName: "Vehicle" } } } diff --git a/src/Joystick/Joystick.cc b/src/Joystick/Joystick.cc index a7d4f734fb31216c6fd64ab0ca8b2c8e1c066166..3f0ba6aeb22ea2bead37025410237e5f6b698a4f 100644 --- a/src/Joystick/Joystick.cc +++ b/src/Joystick/Joystick.cc @@ -32,6 +32,11 @@ const char* Joystick::_roverTXModeSettingsKey = "TXMode_Rover"; const char* Joystick::_vtolTXModeSettingsKey = "TXMode_VTOL"; const char* Joystick::_submarineTXModeSettingsKey = "TXMode_Submarine"; +const char* Joystick::_buttonActionArm = QT_TR_NOOP("Arm"); +const char* Joystick::_buttonActionDisarm = QT_TR_NOOP("Disarm"); +const char* Joystick::_buttonActionVTOLFixedWing = QT_TR_NOOP("VTOL: Fixed Wing"); +const char* Joystick::_buttonActionVTOLMultiRotor = QT_TR_NOOP("VTOL: Multi-Rotor"); + const char* Joystick::_rgFunctionSettingsKey[Joystick::maxFunction] = { "RollAxis", "PitchAxis", @@ -49,7 +54,7 @@ Joystick::Joystick(const QString& name, int axisCount, int buttonCount, int hatC , _hatCount(hatCount) , _hatButtonCount(4*hatCount) , _totalButtonCount(_buttonCount+_hatButtonCount) - , _calibrationMode(CalibrationModeOff) + , _calibrationMode(false) , _rgAxisValues(NULL) , _rgCalibration(NULL) , _rgButtonValues(NULL) @@ -84,6 +89,10 @@ Joystick::Joystick(const QString& name, int axisCount, int buttonCount, int hatC Joystick::~Joystick() { + // Crash out of the thread if it is still running + terminate(); + wait(); + delete[] _rgAxisValues; delete[] _rgCalibration; delete[] _rgButtonValues; @@ -431,7 +440,7 @@ void Joystick::run(void) } } - if (_calibrationMode != CalibrationModeCalibrating && _calibrated) { + if (_outputEnabled && _calibrated) { int axis = _rgFunctionAxis[rollFunction]; float roll = _adjustRange(_rgAxisValues[axis], _rgCalibration[axis], _deadband); @@ -638,11 +647,12 @@ QStringList Joystick::actions(void) { QStringList list; - list << "Arm" << "Disarm"; + list << _buttonActionArm << _buttonActionDisarm; if (_activeVehicle) { list << _activeVehicle->flightModes(); } + list << _buttonActionVTOLFixedWing << _buttonActionVTOLMultiRotor; return list; } @@ -757,48 +767,44 @@ void Joystick::setDeadband(bool deadband) _saveSettings(); } -void Joystick::startCalibrationMode(CalibrationMode_t mode) +void Joystick::setCalibrationMode(bool calibrating) { - if (mode == CalibrationModeOff) { - qWarning() << "Incorrect mode CalibrationModeOff"; - return; - } + _calibrationMode = calibrating; - _calibrationMode = mode; - - if (!isRunning()) { + if (calibrating && !isRunning()) { _pollingStartedForCalibration = true; startPolling(_multiVehicleManager->activeVehicle()); } -} - -void Joystick::stopCalibrationMode(CalibrationMode_t mode) -{ - if (mode == CalibrationModeOff) { - qWarning() << "Incorrect mode: CalibrationModeOff"; - return; + else if (_pollingStartedForCalibration) { + stopPolling(); } - - if (mode == CalibrationModeCalibrating) { - _calibrationMode = CalibrationModeMonitor; - } else { - _calibrationMode = CalibrationModeOff; - if (_pollingStartedForCalibration) { - stopPolling(); - } + if (calibrating){ + setOutputEnabled(false); //Disable the joystick output before calibrating + } + else if (!calibrating && _calibrated){ + setOutputEnabled(true); //Enable joystick output after calibration } } +void Joystick::setOutputEnabled(bool enabled){ + _outputEnabled = enabled; + emit outputEnabledChanged(_outputEnabled); +} + void Joystick::_buttonAction(const QString& action) { if (!_activeVehicle || !_activeVehicle->joystickEnabled()) { return; } - if (action == "Arm") { + if (action == _buttonActionArm) { _activeVehicle->setArmed(true); - } else if (action == "Disarm") { + } else if (action == _buttonActionDisarm) { _activeVehicle->setArmed(false); + } else if (action == _buttonActionVTOLFixedWing) { + _activeVehicle->setVtolInFwdFlight(true); + } else if (action == _buttonActionVTOLMultiRotor) { + _activeVehicle->setVtolInFwdFlight(false); } else if (_activeVehicle->flightModes().contains(action)) { _activeVehicle->setFlightMode(action); } else { diff --git a/src/Joystick/Joystick.h b/src/Joystick/Joystick.h index d6f15ed8bf7fd300c9eba04c23f238125a481544..8cd6accf66306b3b2e89ec6d0512bdc06f3e6234 100644 --- a/src/Joystick/Joystick.h +++ b/src/Joystick/Joystick.h @@ -61,6 +61,7 @@ public: Q_PROPERTY(QString name READ name CONSTANT) Q_PROPERTY(bool calibrated MEMBER _calibrated NOTIFY calibratedChanged) + Q_PROPERTY(bool outputEnabled MEMBER _outputEnabled WRITE setOutputEnabled NOTIFY outputEnabledChanged) Q_PROPERTY(int totalButtonCount READ totalButtonCount CONSTANT) Q_PROPERTY(int axisCount READ axisCount CONSTANT) @@ -122,20 +123,13 @@ public: void setTXMode(int mode); int getTXMode(void) { return _transmitterMode; } - typedef enum { - CalibrationModeOff, // Not calibrating - CalibrationModeMonitor, // Monitors are active, continue to send to vehicle if already polling - CalibrationModeCalibrating, // Calibrating, stop sending joystick to vehicle - } CalibrationMode_t; - /// Set the current calibration mode - void startCalibrationMode(CalibrationMode_t mode); - - /// Clear the current calibration mode - void stopCalibrationMode(CalibrationMode_t mode); + void setCalibrationMode(bool calibrating); + void setOutputEnabled(bool enabled); signals: void calibratedChanged(bool calibrated); + void outputEnabledChanged(bool enabled); // The raw signals are only meant for use by calibration void rawAxisValueChanged(int index, int value); @@ -201,7 +195,8 @@ protected: int _totalButtonCount; static int _transmitterMode; - CalibrationMode_t _calibrationMode; + bool _calibrationMode; + bool _outputEnabled; int* _rgAxisValues; Calibration_t* _rgCalibration; @@ -241,6 +236,11 @@ private: static const char* _vtolTXModeSettingsKey; static const char* _submarineTXModeSettingsKey; + static const char* _buttonActionArm; + static const char* _buttonActionDisarm; + static const char* _buttonActionVTOLFixedWing; + static const char* _buttonActionVTOLMultiRotor; + private slots: void _activeVehicleChanged(Vehicle* activeVehicle); }; diff --git a/src/MissionManager/PlanMasterController.cc b/src/MissionManager/PlanMasterController.cc index e568a57af51822b0600ff76cc5dd54467bf1fd61..656f4c1b9b27960c2b7ffca409228b80ed6d2775 100644 --- a/src/MissionManager/PlanMasterController.cc +++ b/src/MissionManager/PlanMasterController.cc @@ -356,6 +356,22 @@ void PlanMasterController::loadFromFile(const QString& filename) } } +QJsonDocument PlanMasterController::saveToJson() +{ + QJsonObject planJson; + QJsonObject missionJson; + QJsonObject fenceJson; + QJsonObject rallyJson; + JsonHelper::saveQGCJsonFileHeader(planJson, _planFileType, _planFileVersion); + _missionController.save(missionJson); + _geoFenceController.save(fenceJson); + _rallyPointController.save(rallyJson); + planJson[_jsonMissionObjectKey] = missionJson; + planJson[_jsonGeoFenceObjectKey] = fenceJson; + planJson[_jsonRallyPointsObjectKey] = rallyJson; + return QJsonDocument(planJson); +} + void PlanMasterController::saveToFile(const QString& filename) { if (filename.isEmpty()) { @@ -372,20 +388,7 @@ void PlanMasterController::saveToFile(const QString& filename) if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { qgcApp()->showMessage(tr("Plan save error %1 : %2").arg(filename).arg(file.errorString())); } else { - QJsonObject planJson; - QJsonObject missionJson; - QJsonObject fenceJson; - QJsonObject rallyJson; - - JsonHelper::saveQGCJsonFileHeader(planJson, _planFileType, _planFileVersion); - _missionController.save(missionJson); - _geoFenceController.save(fenceJson); - _rallyPointController.save(rallyJson); - planJson[_jsonMissionObjectKey] = missionJson; - planJson[_jsonGeoFenceObjectKey] = fenceJson; - planJson[_jsonRallyPointsObjectKey] = rallyJson; - - QJsonDocument saveDoc(planJson); + QJsonDocument saveDoc = saveToJson(); file.write(saveDoc.toJson()); } diff --git a/src/MissionManager/PlanMasterController.h b/src/MissionManager/PlanMasterController.h index 03ba7b6e3f3c16ab8612dfb965abe63619e5bcc6..30dd38144326ac1cf87596bba410a92bd5f3858e 100644 --- a/src/MissionManager/PlanMasterController.h +++ b/src/MissionManager/PlanMasterController.h @@ -80,6 +80,8 @@ public: QStringList saveNameFilters (void) const; QStringList saveKmlFilters (void) const; + QJsonDocument saveToJson (); + Vehicle* controllerVehicle(void) { return _controllerVehicle; } Vehicle* managerVehicle(void) { return _managerVehicle; } diff --git a/src/MissionManager/QGCMapPolygonVisuals.qml b/src/MissionManager/QGCMapPolygonVisuals.qml index d24ff4c64bf53df66bfe8a63b51bbac662c5dc02..c0bd2ee7ba343c155f1b878d930e00f14349ad26 100644 --- a/src/MissionManager/QGCMapPolygonVisuals.qml +++ b/src/MissionManager/QGCMapPolygonVisuals.qml @@ -177,8 +177,7 @@ Item { title: qsTr("Select KML File") selectExisting: true nameFilters: [ qsTr("KML files (*.kml)") ] - - + fileExtension: "kml" onAcceptedForLoad: { mapPolygon.loadKMLFile(file) close() diff --git a/src/MissionManager/SurveyMissionItem.h b/src/MissionManager/SurveyMissionItem.h index f19f1c7bf1e7056a73a0e4aed74013db8d86006f..fcbdb9f536de979cf2e4c5a18ad447bb81269021 100644 --- a/src/MissionManager/SurveyMissionItem.h +++ b/src/MissionManager/SurveyMissionItem.h @@ -300,7 +300,7 @@ private: static const char* _jsonFixedValueIsAltitudeKey; static const char* _jsonRefly90DegreesKey; - static const int _hoverAndCaptureDelaySeconds = 2; + static const int _hoverAndCaptureDelaySeconds = 4; }; #endif diff --git a/src/PlanView/CameraCalc.qml b/src/PlanView/CameraCalc.qml index 1143a8184f0b2ca162b5a7889803b6b59e0ee320..6f0d33e45b9ec966e36050fc3af9fb0e9b070ee1 100644 --- a/src/PlanView/CameraCalc.qml +++ b/src/PlanView/CameraCalc.qml @@ -39,7 +39,7 @@ Column { } gridTypeCombo.model = _cameraList var knownCameraIndex = gridTypeCombo.find(cameraCalc.cameraName) - if (knownCameraIndex != -1) { + if (knownCameraIndex !== -1) { gridTypeCombo.currentIndex = knownCameraIndex } else { console.log("Internal error: Known camera not found", cameraCalc.cameraName) diff --git a/src/PlanView/CameraSection.qml b/src/PlanView/CameraSection.qml index bdbba8bc2d91fbfe147810c967fbdb0c88a3e61d..b91cd52b5e8d0413969f4bf1140185fb3b5cb3c8 100644 --- a/src/PlanView/CameraSection.qml +++ b/src/PlanView/CameraSection.qml @@ -46,7 +46,7 @@ Column { anchors.left: parent.left anchors.right: parent.right spacing: ScreenTools.defaultFontPixelWidth - visible: _camera.cameraAction.rawValue == 1 + visible: _camera.cameraAction.rawValue === 1 QGCLabel { text: qsTr("Time") @@ -62,7 +62,7 @@ Column { anchors.left: parent.left anchors.right: parent.right spacing: ScreenTools.defaultFontPixelWidth - visible: _camera.cameraAction.rawValue == 2 + visible: _camera.cameraAction.rawValue === 2 QGCLabel { text: qsTr("Distance") diff --git a/src/PlanView/GeoFenceEditor.qml b/src/PlanView/GeoFenceEditor.qml index 094e4183eade8ffd151d1fb3daec3d3ded5687e4..b5d12f23fa91c6da37496d6f63449f237c50361f 100644 --- a/src/PlanView/GeoFenceEditor.qml +++ b/src/PlanView/GeoFenceEditor.qml @@ -154,7 +154,7 @@ QGCFlickable { QGCLabel { text: qsTr("None") - visible: polygonSection.checked && myGeoFenceController.polygons.count == 0 + visible: polygonSection.checked && myGeoFenceController.polygons.count === 0 } GridLayout { @@ -239,7 +239,7 @@ QGCFlickable { QGCLabel { text: qsTr("None") - visible: circleSection.checked && myGeoFenceController.circles.count == 0 + visible: circleSection.checked && myGeoFenceController.circles.count === 0 } GridLayout { diff --git a/src/PlanView/MissionItemEditor.qml b/src/PlanView/MissionItemEditor.qml index 2eb46f0facc0f2b827577f3fbf7779b4b59e73de..18083de522dc4814967d09be7cf3d9312f2bc0ce 100644 --- a/src/PlanView/MissionItemEditor.qml +++ b/src/PlanView/MissionItemEditor.qml @@ -15,7 +15,7 @@ import QGroundControl.Palette 1.0 /// Mission item edit control Rectangle { id: _root - height: header.height + (editorLoader.visible ? (editorLoader.height + (_margin * 3)) : 0) + height: editorLoader.y + (editorLoader.visible ? editorLoader.height : 0) + (_margin * 2) color: _currentItem ? qgcPal.missionItemEditor : qgcPal.windowShade radius: _radius @@ -33,14 +33,15 @@ Rectangle { property var _masterController: masterController property var _missionController: _masterController.missionController property bool _currentItem: missionItem.isCurrentItem + property color _outerTextColor: _currentItem ? qgcPal.primaryButtonText : qgcPal.text property bool _noMissionItemsAdded: ListView.view.model.count === 1 property real _sectionSpacer: ScreenTools.defaultFontPixelWidth / 2 // spacing between section headings property bool _singleComplexItem: _missionController.complexMissionItemNames.length === 1 readonly property real _editFieldWidth: Math.min(width - _margin * 2, ScreenTools.defaultFontPixelWidth * 12) - readonly property real _margin: ScreenTools.defaultFontPixelWidth * 0.5 - readonly property real _radius: ScreenTools.defaultFontPixelWidth * 0.5 - readonly property real _hamburgerSize: header.height * 0.75 + readonly property real _margin: ScreenTools.defaultFontPixelWidth / 2 + readonly property real _radius: ScreenTools.defaultFontPixelWidth / 2 + readonly property real _hamburgerSize: commandPicker.height * 0.75 readonly property bool _waypointsOnlyMode: QGroundControl.corePlugin.options.missionWaypointsOnly QGCPalette { @@ -51,6 +52,7 @@ Rectangle { FocusScope { id: currentItemScope anchors.fill: parent + MouseArea { anchors.fill: parent onClicked: { @@ -60,76 +62,38 @@ Rectangle { } } - //-- Dialog Component { id: editPositionDialog + EditPositionDialog { coordinate: missionItem.coordinate onCoordinateChanged: missionItem.coordinate = coordinate } } - //-- Header - Row { - id: header - spacing: ScreenTools.defaultFontPixelWidth - height: ScreenTools.defaultFontPixelHeight * 3 - anchors.verticalCenter: editorLoader.visible ? undefined : parent.verticalCenter + + QGCLabel { + id: label + anchors.verticalCenter: commandPicker.verticalCenter + anchors.leftMargin: _margin anchors.left: parent.left - anchors.leftMargin: ScreenTools.defaultFontPixelWidth - Item { - width: ScreenTools.defaultFontPixelWidth * 3 - height: parent.height - QGCColoredImage { - width: ScreenTools.defaultFontPixelHeight - height: width - sourceSize.height: width - source: "qrc:/qmlimages/Home.svg" - visible: missionItem.homePosition - color: qgcPal.text - anchors.centerIn: parent - } - QGCLabel { - text: missionItem.sequenceNumber - color: qgcPal.text - visible: !missionItem.homePosition - anchors.centerIn: parent - } - } - QGCLabel { - id: label - visible: !missionItem.isCurrentItem || !missionItem.isSimpleItem || _waypointsOnlyMode - text: missionItem.commandName - color: qgcPal.text - anchors.verticalCenter: parent.verticalCenter - } - QGCButton { - id: commandPicker - visible: !label.visible - text: missionItem.commandName - anchors.verticalCenter: parent.verticalCenter - Component { - id: commandDialog - MissionCommandDialog { - missionItem: _root.missionItem - } - } - onClicked: qgcView.showDialog(commandDialog, qsTr("Select Mission Command"), qgcView.showDialogDefaultWidth, StandardButton.Cancel) - } + text: missionItem.homePosition ? "H" : missionItem.sequenceNumber + color: _outerTextColor } - //-- Hamburger button at the right of header + QGCColoredImage { id: hamburger anchors.rightMargin: ScreenTools.defaultFontPixelWidth anchors.right: parent.right - anchors.verticalCenter: header.verticalCenter + anchors.verticalCenter: commandPicker.verticalCenter width: _hamburgerSize height: _hamburgerSize sourceSize.height: _hamburgerSize source: "qrc:/qmlimages/Hamburger.svg" visible: missionItem.isCurrentItem && missionItem.sequenceNumber !== 0 - color: qgcPal.text + color: qgcPal.windowShade + } - //-- Hamburger Menu + QGCMouseArea { fillItem: hamburger visible: hamburger.visible @@ -137,54 +101,67 @@ Rectangle { currentItemScope.focus = true hamburgerMenu.popup() } + Menu { id: hamburgerMenu + MenuItem { text: qsTr("Insert waypoint") onTriggered: insertWaypoint() } + Menu { id: patternMenu title: qsTr("Insert pattern") visible: !_singleComplexItem + Instantiator { model: _missionController.complexMissionItemNames + onObjectAdded: patternMenu.insertItem(index, object) onObjectRemoved: patternMenu.removeItem(object) + MenuItem { text: modelData onTriggered: insertComplexItem(modelData) } } } + MenuItem { text: qsTr("Insert ") + _missionController.complexMissionItemNames[0] visible: _singleComplexItem onTriggered: insertComplexItem(_missionController.complexMissionItemNames[0]) } + MenuItem { text: qsTr("Delete") onTriggered: remove() } + MenuItem { text: qsTr("Change command...") onTriggered: commandPicker.clicked() visible: !_waypointsOnlyMode } + MenuItem { text: qsTr("Edit position...") visible: missionItem.specifiesCoordinate onTriggered: qgcView.showDialog(editPositionDialog, qsTr("Edit Position"), qgcView.showDialogDefaultWidth, StandardButton.Cancel) } + MenuSeparator { visible: missionItem.isSimpleItem && !_waypointsOnlyMode } + MenuItem { - text: qsTr("Show all values") - checkable: true - checked: missionItem.isSimpleItem ? missionItem.rawEdit : false - visible: missionItem.isSimpleItem && !_waypointsOnlyMode - onTriggered: { + text: qsTr("Show all values") + checkable: true + checked: missionItem.isSimpleItem ? missionItem.rawEdit : false + visible: missionItem.isSimpleItem && !_waypointsOnlyMode + + onTriggered: { if (missionItem.rawEdit) { if (missionItem.friendlyEditAllowed) { missionItem.rawEdit = false @@ -199,16 +176,48 @@ Rectangle { } } } - //-- Editor Content + + QGCButton { + id: commandPicker + anchors.topMargin: _margin / 2 + anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2 + anchors.rightMargin: ScreenTools.defaultFontPixelWidth + anchors.left: label.right + anchors.top: parent.top + visible: !commandLabel.visible + text: missionItem.commandName + + Component { + id: commandDialog + + MissionCommandDialog { + missionItem: _root.missionItem + } + } + + onClicked: qgcView.showDialog(commandDialog, qsTr("Select Mission Command"), qgcView.showDialogDefaultWidth, StandardButton.Cancel) + } + + QGCLabel { + id: commandLabel + anchors.fill: commandPicker + visible: !missionItem.isCurrentItem || !missionItem.isSimpleItem || _waypointsOnlyMode + verticalAlignment: Text.AlignVCenter + text: missionItem.commandName + color: _outerTextColor + } + Loader { id: editorLoader anchors.leftMargin: _margin + anchors.topMargin: _margin anchors.left: parent.left - anchors.top: header.bottom + anchors.top: commandPicker.bottom source: missionItem.editorQml visible: _currentItem + property var masterController: _masterController property real availableWidth: _root.width - (_margin * 2) ///< How wide the editor should be property var editorRoot: _root } -} +} // Rectangle diff --git a/src/PlanView/MissionSettingsEditor.qml b/src/PlanView/MissionSettingsEditor.qml index 544fa893fa6c4013a19b8f1dcfa4407a19695859..9cb6368d55385bac170db72c70ce62c98e2faf6e 100644 --- a/src/PlanView/MissionSettingsEditor.qml +++ b/src/PlanView/MissionSettingsEditor.qml @@ -36,6 +36,7 @@ Rectangle { property var _fileExtension: QGroundControl.settingsManager.appSettings.missionFileExtension property var _appSettings: QGroundControl.settingsManager.appSettings property bool _waypointsOnlyMode: QGroundControl.corePlugin.options.missionWaypointsOnly + property bool _showCameraSection: !_waypointsOnlyMode || QGroundControl.corePlugin.showAdvancedUI readonly property string _firmwareLabel: qsTr("Firmware") readonly property string _vehicleLabel: qsTr("Vehicle") @@ -91,6 +92,7 @@ Rectangle { CameraSection { id: cameraSection checked: missionItem.cameraSection.settingsSpecified + visible: _showCameraSection } QGCLabel { @@ -100,7 +102,7 @@ Rectangle { wrapMode: Text.WordWrap horizontalAlignment: Text.AlignHCenter font.pointSize: ScreenTools.smallFontPointSize - visible: cameraSection.checked + visible: _showCameraSection && cameraSection.checked } SectionHeader { diff --git a/src/PlanView/PlanToolBar.qml b/src/PlanView/PlanToolBar.qml index ffc92a4b862019f72c68d62951f466e54442b1af..754f3a38442f270112d9c47b376e7c8d9d75c3a9 100644 --- a/src/PlanView/PlanToolBar.qml +++ b/src/PlanView/PlanToolBar.qml @@ -32,13 +32,13 @@ Rectangle { property real missionMaxTelemetry: _controllerValid ? planMasterController.missionController.missionMaxTelemetry : NaN property bool missionDirty: _controllerValid ? planMasterController.missionController.dirty : false - property bool _controllerValid: planMasterController != undefined + property bool _controllerValid: planMasterController !== undefined property bool _controllerOffline: _controllerValid ? planMasterController.offline : true property var _controllerDirty: _controllerValid ? planMasterController.dirty : false property var _controllerSyncInProgress: _controllerValid ? planMasterController.syncInProgress : false - property bool _statusValid: currentMissionItem != undefined - property bool _missionValid: missionItems != undefined + property bool _statusValid: currentMissionItem !== undefined + property bool _missionValid: missionItems !== undefined property real _dataFontSize: ScreenTools.defaultFontPointSize property real _largeValueWidth: ScreenTools.defaultFontPixelWidth * 8 @@ -84,11 +84,8 @@ Rectangle { } //-- Eat mouse events, preventing them from reaching toolbar, which is underneath us. - MouseArea { - anchors.fill: parent - onWheel: { wheel.accepted = true; } - onPressed: { mouse.accepted = true; } - onReleased: { mouse.accepted = true; } + DeadMouseArea { + anchors.fill: parent } //-- The reason for this Row to be here is so the Logo (Home) button is in the same diff --git a/src/PlanView/PlanView.qml b/src/PlanView/PlanView.qml index 3c0c3f8ab57855b94ff4a916935d062c696c59d3..5940de4e31b82b0da735274ec8b840683187c9cf 100644 --- a/src/PlanView/PlanView.qml +++ b/src/PlanView/PlanView.qml @@ -272,7 +272,7 @@ QGCView { QGCFileDialog { id: fileDialog qgcView: _qgcView - property var plan: true + property bool plan: true folder: QGroundControl.settingsManager.appSettings.missionSavePath fileExtension: QGroundControl.settingsManager.appSettings.planFileExtension fileExtension2: QGroundControl.settingsManager.appSettings.missionFileExtension diff --git a/src/PlanView/RallyPointItemEditor.qml b/src/PlanView/RallyPointItemEditor.qml index 91513017bf5c076812d4ad4394a17a1d2bbf28da..a85c84b7395e8898ab4dff84c681e420f8bb921c 100644 --- a/src/PlanView/RallyPointItemEditor.qml +++ b/src/PlanView/RallyPointItemEditor.qml @@ -18,6 +18,7 @@ Rectangle { property var controller ///< RallyPointController property bool _currentItem: rallyPoint ? rallyPoint === controller.currentRallyPoint : false + property color _outerTextColor: _currentItem ? "black" : qgcPal.text readonly property real _margin: ScreenTools.defaultFontPixelWidth / 2 readonly property real _radius: ScreenTools.defaultFontPixelWidth / 2 @@ -46,9 +47,10 @@ Rectangle { anchors.left: indicator.right anchors.verticalCenter: parent.verticalCenter text: qsTr("Rally Point") + color: _outerTextColor } - QGCColoredImage { + Image { id: hamburger anchors.rightMargin: _margin anchors.right: parent.right @@ -57,12 +59,14 @@ Rectangle { height: width sourceSize.height: height source: "qrc:/qmlimages/Hamburger.svg" - color: qgcPal.text + MouseArea { anchors.fill: parent onClicked: hamburgerMenu.popup() + Menu { id: hamburgerMenu + MenuItem { text: qsTr("Delete") onTriggered: controller.removePoint(rallyPoint) @@ -70,7 +74,7 @@ Rectangle { } } } - } + } // Item - titleBar Rectangle { id: valuesRect diff --git a/src/PlanView/RallyPointMapVisuals.qml b/src/PlanView/RallyPointMapVisuals.qml index 57c2f5a3d229cf678d6644f3f21094dd103f191d..e4adb46da72de7d3db54dfed21b526a9eddfdc64 100644 --- a/src/PlanView/RallyPointMapVisuals.qml +++ b/src/PlanView/RallyPointMapVisuals.qml @@ -45,7 +45,7 @@ Item { MissionItemIndicatorDrag { itemCoordinate: rallyPointObject.coordinate - visible: rallyPointObject == myRallyPointController.currentRallyPoint + visible: rallyPointObject === myRallyPointController.currentRallyPoint property var rallyPointObject @@ -67,7 +67,7 @@ Item { sourceItem: MissionItemIndexLabel { id: itemIndexLabel label: qsTr("R", "rally point map item label") - checked: _editingLayer == _layerRallyPoints ? rallyPointObject == myRallyPointController.currentRallyPoint : false + checked: _editingLayer == _layerRallyPoints ? rallyPointObject === myRallyPointController.currentRallyPoint : false onClicked: myRallyPointController.currentRallyPoint = rallyPointObject } diff --git a/src/PlanView/SimpleItemEditor.qml b/src/PlanView/SimpleItemEditor.qml index 23106868791f0a2bfe6153d04a31d1625ae946fd..75c6da4f306b64596bffc941babfa7e0cee4a3a3 100644 --- a/src/PlanView/SimpleItemEditor.qml +++ b/src/PlanView/SimpleItemEditor.qml @@ -44,7 +44,7 @@ Rectangle { QGCLabel { text: object.name - visible: object.name != "" + visible: object.name !== "" Layout.column: 0 Layout.row: index } diff --git a/src/PlanView/SurveyItemEditor.qml b/src/PlanView/SurveyItemEditor.qml index 58fad1c1e11da3041c653ee2d49faf9f3a57185b..ad47d11ebe470df2c7fc302f299d25c37763517c 100644 --- a/src/PlanView/SurveyItemEditor.qml +++ b/src/PlanView/SurveyItemEditor.qml @@ -46,7 +46,7 @@ Rectangle { } else { var index = -1 for (index=0; index<_cameraList.length; index++) { - if (_cameraList[index] == missionItem.camera.value) { + if (_cameraList[index] === missionItem.camera.value) { break; } } @@ -243,7 +243,7 @@ Rectangle { anchors.left: parent.left anchors.right: parent.right spacing: _margin - visible: missionItem.manualGrid.value == true + visible: missionItem.manualGrid.value QGCCheckBox { id: cameraTriggerDistanceCheckBox @@ -273,7 +273,7 @@ Rectangle { anchors.left: parent.left anchors.right: parent.right spacing: _margin - visible: gridTypeCombo.currentIndex != _gridTypeManual + visible: gridTypeCombo.currentIndex !== _gridTypeManual Row { spacing: _margin @@ -443,7 +443,7 @@ Rectangle { id: windRoseButton anchors.verticalCenter: angleText.verticalCenter iconSource: qgcPal.globalTheme === QGCPalette.Light ? "/res/wind-roseBlack.svg" : "/res/wind-rose.svg" - visible: _vehicle.fixedWing + visible: _vehicle ? _vehicle.fixedWing : false onClicked: { windRosePie.angle = Number(gridAngleText.text) @@ -522,7 +522,7 @@ Rectangle { SectionHeader { id: manualGridHeader text: qsTr("Grid") - visible: gridTypeCombo.currentIndex == _gridTypeManual + visible: gridTypeCombo.currentIndex === _gridTypeManual } GridLayout { @@ -547,7 +547,7 @@ Rectangle { anchors.verticalCenter: manualAngleText.verticalCenter Layout.columnSpan: 1 iconSource: qgcPal.globalTheme === QGCPalette.Light ? "/res/wind-roseBlack.svg" : "/res/wind-rose.svg" - visible: _vehicle.fixedWing + visible: _vehicle ? _vehicle.fixedWing : false onClicked: { var cords = manualWindRoseButton.mapToItem(_root, 0, 0) diff --git a/src/PlanView/SurveyMapVisual.qml b/src/PlanView/SurveyMapVisual.qml index 08a52be380aa7cfa768bb91fd59eed983fe0a5c1..7a10c98eee99af5a7b4ab531c95f6b4793716598 100644 --- a/src/PlanView/SurveyMapVisual.qml +++ b/src/PlanView/SurveyMapVisual.qml @@ -90,6 +90,7 @@ Item { QGCMapPolygonVisuals { id: mapPolygonVisuals + qgcView: _root.qgcView mapControl: map mapPolygon: _mapPolygon interactive: _missionItem.isCurrentItem diff --git a/src/QmlControls/DeadMouseArea.qml b/src/QmlControls/DeadMouseArea.qml new file mode 100644 index 0000000000000000000000000000000000000000..39db1ec18925e59f172304a93494b35bd0d7f086 --- /dev/null +++ b/src/QmlControls/DeadMouseArea.qml @@ -0,0 +1,10 @@ +import QtQuick 2.3 +import QtQuick.Controls 1.2 + +MouseArea { + preventStealing:true + hoverEnabled: true + onWheel: { wheel.accepted = true; } + onPressed: { mouse.accepted = true; } + onReleased: { mouse.accepted = true; } +} diff --git a/src/QmlControls/DropButton.qml b/src/QmlControls/DropButton.qml index ceb0cf48a81bc5aeb7934a343e2a103efedd6d3d..7815ffed7f4b211e5f60ae675592c233995817bc 100644 --- a/src/QmlControls/DropButton.qml +++ b/src/QmlControls/DropButton.qml @@ -175,9 +175,9 @@ Item { id: arrowCanvas anchors.fill: parent - property var arrowPoint: Qt.point(0, 0) - property var arrowBase1: Qt.point(0, 0) - property var arrowBase2: Qt.point(0, 0) + property point arrowPoint: Qt.point(0, 0) + property point arrowBase1: Qt.point(0, 0) + property point arrowBase2: Qt.point(0, 0) onPaint: { var context = getContext("2d") diff --git a/src/QmlControls/DropPanel.qml b/src/QmlControls/DropPanel.qml index 11c00e99ab808926b5709f4d84adfc0dac92c19e..91fe3dcc58206c681f06b75c3d2f3d36a5dab191 100644 --- a/src/QmlControls/DropPanel.qml +++ b/src/QmlControls/DropPanel.qml @@ -124,9 +124,9 @@ Item { id: arrowCanvas anchors.fill: parent - property var arrowPoint: Qt.point(0, 0) - property var arrowBase1: Qt.point(0, 0) - property var arrowBase2: Qt.point(0, 0) + property point arrowPoint: Qt.point(0, 0) + property point arrowBase1: Qt.point(0, 0) + property point arrowBase2: Qt.point(0, 0) onPaint: { var context = getContext("2d") diff --git a/src/QmlControls/FlightModeMenu.qml b/src/QmlControls/FlightModeMenu.qml index 9b553a3951dc291673923c9c39b5cad861674c7c..c46df0acafdd4008f865225720eb2330df86d3a1 100644 --- a/src/QmlControls/FlightModeMenu.qml +++ b/src/QmlControls/FlightModeMenu.qml @@ -37,13 +37,14 @@ QGCLabel { function updateFlightModesMenu() { if (activeVehicle && activeVehicle.flightModeSetAvailable) { + var i; // Remove old menu items - for (var i = 0; i < flightModesMenuItems.length; i++) { + for (i = 0; i < flightModesMenuItems.length; i++) { flightModesMenu.removeItem(flightModesMenuItems[i]) } flightModesMenuItems.length = 0 // Add new items - for (var i = 0; i < activeVehicle.flightModes.length; i++) { + for (i = 0; i < activeVehicle.flightModes.length; i++) { var menuItem = flightModeMenuItemComponent.createObject(null, { "text": activeVehicle.flightModes[i] }) flightModesMenuItems.push(menuItem) flightModesMenu.insertItem(i, menuItem) diff --git a/src/QmlControls/MissionCommandDialog.qml b/src/QmlControls/MissionCommandDialog.qml index 5320d69f3b17b781b61a6180c233451086beafa4..03532af91f9ca3b8e9809b9182db7fa70e27a95d 100644 --- a/src/QmlControls/MissionCommandDialog.qml +++ b/src/QmlControls/MissionCommandDialog.qml @@ -68,7 +68,7 @@ QGCViewDialog { color: qgcPal.button property var mavCmdInfo: modelData - property var textColor: qgcPal.buttonText + property color textColor: qgcPal.buttonText Column { id: commandColumn diff --git a/src/QmlControls/NoMouseThroughRectangle.qml b/src/QmlControls/NoMouseThroughRectangle.qml deleted file mode 100644 index 295f6e3c6d32be13989425702da3643b0638a117..0000000000000000000000000000000000000000 --- a/src/QmlControls/NoMouseThroughRectangle.qml +++ /dev/null @@ -1,14 +0,0 @@ -import QtQuick 2.3 -import QtQuick.Controls 1.2 - -/// This control is used to create a Rectangle control which does not allow mouse events to bleed through to the control -/// which is beneath it. -Rectangle { - MouseArea { - anchors.fill: parent - preventStealing: true - onWheel: { wheel.accepted = true; } - onPressed: { mouse.accepted = true; } - onReleased: { mouse.accepted = true; } - } -} diff --git a/src/QmlControls/ParameterEditor.qml b/src/QmlControls/ParameterEditor.qml index 2d9c667c912dd558502eafdbf108c2a06caa831d..c09e3546efa3aca8ea9a11f4a00057bb5a206c17 100644 --- a/src/QmlControls/ParameterEditor.qml +++ b/src/QmlControls/ParameterEditor.qml @@ -253,7 +253,7 @@ QGCView { id: valueLabel width: ScreenTools.defaultFontPixelWidth * 20 color: factRow.modelFact.defaultValueAvailable ? (factRow.modelFact.valueEqualsDefault ? __qgcPal.text : __qgcPal.warningText) : __qgcPal.text - text: factRow.modelFact.enumStrings.length == 0 ? factRow.modelFact.valueString + " " + factRow.modelFact.units : factRow.modelFact.enumStringValue + text: factRow.modelFact.enumStrings.length === 0 ? factRow.modelFact.valueString + " " + factRow.modelFact.units : factRow.modelFact.enumStringValue clip: true } diff --git a/src/QmlControls/ParameterEditorDialog.qml b/src/QmlControls/ParameterEditorDialog.qml index 3a1f5e436ab24f1d89eb8ed53022952a2023b3de..4a97a174dcc4dbef0a1254f67f63f10028ad9236 100644 --- a/src/QmlControls/ParameterEditorDialog.qml +++ b/src/QmlControls/ParameterEditorDialog.qml @@ -116,7 +116,7 @@ QGCViewDialog { QGCTextField { id: valueField text: validate ? validateValue : fact.valueString - visible: fact.enumStrings.length == 0 || validate || manualEntry.checked + visible: fact.enumStrings.length === 0 || validate || manualEntry.checked unitsLabel: fact.units showUnits: fact.units != "" Layout.fillWidth: true @@ -145,7 +145,7 @@ QGCViewDialog { visible: _showCombo model: fact.enumStrings - property bool _showCombo: fact.enumStrings.length != 0 && fact.bitmaskStrings.length == 0 && !validate + property bool _showCombo: fact.enumStrings.length !== 0 && fact.bitmaskStrings.length === 0 && !validate Component.onCompleted: { // We can't bind directly to fact.enumIndex since that would add an unknown value diff --git a/src/QmlControls/QGCButton.qml b/src/QmlControls/QGCButton.qml index 820c83d92f002d69f0a60a3797c64bd6a3685717..f7adf355b18b4908e3a15c49410a2dd183191727 100644 --- a/src/QmlControls/QGCButton.qml +++ b/src/QmlControls/QGCButton.qml @@ -6,15 +6,14 @@ import QGroundControl.Palette 1.0 import QGroundControl.ScreenTools 1.0 Button { - property bool primary: false ///< primary button for a group of buttons - property real pointSize: ScreenTools.defaultFontPointSize ///< Point size for button text - property bool showBorder: _qgcPal.globalTheme === QGCPalette.Light - property bool iconLeft: false - property real backRadius: 0 - property real heightFactor: 0.5 + activeFocusOnPress: true + + property bool primary: false ///< primary button for a group of buttons + property real pointSize: ScreenTools.defaultFontPointSize ///< Point size for button text property var _qgcPal: QGCPalette { colorGroupEnabled: enabled } property bool _showHighlight: (pressed | hovered | checked) && !__forceHoverOff + property bool _showBorder: _qgcPal.globalTheme === QGCPalette.Light // This fixes the issue with button hover where if a Button is near the edge oa QQuickWidget you can // move the mouse fast enough such that the MouseArea does not trigger an onExited. This is turn @@ -25,7 +24,7 @@ Button { property int __lastGlobalMouseX: 0 property int __lastGlobalMouseY: 0 property int _horizontalPadding: ScreenTools.defaultFontPixelWidth - property int _verticalPadding: Math.round(ScreenTools.defaultFontPixelHeight * heightFactor) + property int _verticalPadding: Math.round(ScreenTools.defaultFontPixelHeight / 2) Connections { target: __behavior @@ -61,11 +60,9 @@ Button { /*! This defines the background of the button. */ background: Rectangle { - id: backRect implicitWidth: ScreenTools.implicitButtonWidth implicitHeight: ScreenTools.implicitButtonHeight - radius: backRadius - border.width: showBorder ? 1 : 0 + border.width: _showBorder ? 1: 0 border.color: _qgcPal.buttonText color: _showHighlight ? control._qgcPal.buttonHighlight : @@ -74,35 +71,31 @@ Button { /*! This defines the label of the button. */ label: Item { - implicitWidth: text.implicitWidth + icon.width - implicitHeight: text.implicitHeight - baselineOffset: text.y + text.baselineOffset + implicitWidth: row.implicitWidth + implicitHeight: row.implicitHeight + baselineOffset: row.y + text.y + text.baselineOffset - QGCColoredImage { - id: icon - source: control.iconSource - height: source === "" ? 0 : text.height - width: height - color: text.color - fillMode: Image.PreserveAspectFit - sourceSize.height: height - anchors.left: control.iconLeft ? parent.left : undefined - anchors.leftMargin: control.iconLeft ? ScreenTools.defaultFontPixelWidth : undefined - anchors.right: !control.iconLeft ? parent.right : undefined - anchors.rightMargin: !control.iconLeft ? ScreenTools.defaultFontPixelWidth : undefined - anchors.verticalCenter: parent.verticalCenter - } + Row { + id: row + anchors.centerIn: parent + spacing: ScreenTools.defaultFontPixelWidth * 0.25 + + Image { + source: control.iconSource + anchors.verticalCenter: parent.verticalCenter + } - Text { - id: text - anchors.centerIn: parent - antialiasing: true - text: control.text - font.pointSize: pointSize - font.family: ScreenTools.normalFontFamily - color: _showHighlight ? - control._qgcPal.buttonHighlightText : - (primary ? control._qgcPal.primaryButtonText : control._qgcPal.buttonText) + Text { + id: text + anchors.verticalCenter: parent.verticalCenter + antialiasing: true + text: control.text + font.pointSize: pointSize + font.family: ScreenTools.normalFontFamily + color: _showHighlight ? + control._qgcPal.buttonHighlightText : + (primary ? control._qgcPal.primaryButtonText : control._qgcPal.buttonText) + } } } } diff --git a/src/QmlControls/QGCCheckBox.qml b/src/QmlControls/QGCCheckBox.qml index 735138d28ec87d8a44f310cc35b72e0217c94054..ed602c1678742f9bf8b8f5fb08e9f0e6def34772 100644 --- a/src/QmlControls/QGCCheckBox.qml +++ b/src/QmlControls/QGCCheckBox.qml @@ -6,6 +6,8 @@ import QGroundControl.Palette 1.0 import QGroundControl.ScreenTools 1.0 CheckBox { + activeFocusOnPress: true + property var __qgcPal: QGCPalette { colorGroupEnabled: enabled } style: CheckBoxStyle { diff --git a/src/QmlControls/QGCFileDialog.qml b/src/QmlControls/QGCFileDialog.qml index e770bc714a84cae3927d74c58a6842a8de062825..ecd0782ca9a2b8bdf997e3832c328266f2d8d852 100644 --- a/src/QmlControls/QGCFileDialog.qml +++ b/src/QmlControls/QGCFileDialog.qml @@ -144,7 +144,7 @@ Item { QGCLabel { text: qsTr("No files") - visible: fileList.model.length == 0 + visible: fileList.model.length === 0 } } } diff --git a/src/QmlControls/QGCFlickableHorizontalIndicator.qml b/src/QmlControls/QGCFlickableHorizontalIndicator.qml index b1ac454f77b018ea8cad3808b10ab5959936daa0..41f89653a1b9a6ebaa15bbd79dfcc998ba7f8751 100644 --- a/src/QmlControls/QGCFlickableHorizontalIndicator.qml +++ b/src/QmlControls/QGCFlickableHorizontalIndicator.qml @@ -11,9 +11,9 @@ Rectangle { color: parent.indicatorColor visible: showIndicator - property bool showIndicator: (parent.flickableDirection == Flickable.AutoFlickDirection || - parent.flickableDirection == Flickable.HorizontalFlick || - parent.flickableDirection == Flickable.HorizontalAndVerticalFlick) && + property bool showIndicator: (parent.flickableDirection === Flickable.AutoFlickDirection || + parent.flickableDirection === Flickable.HorizontalFlick || + parent.flickableDirection === Flickable.HorizontalAndVerticalFlick) && (parent.contentWidth > parent.width) Component.onCompleted: animateOpacity.restart() diff --git a/src/QmlControls/QGCFlickableVerticalIndicator.qml b/src/QmlControls/QGCFlickableVerticalIndicator.qml index 67f220d6bef7e9b452c6fc2108887a0cb2e8e81c..9ab426f437718f59c15982c385df03197983ce24 100644 --- a/src/QmlControls/QGCFlickableVerticalIndicator.qml +++ b/src/QmlControls/QGCFlickableVerticalIndicator.qml @@ -11,9 +11,9 @@ Rectangle { color: parent.indicatorColor visible: showIndicator - property bool showIndicator: (parent.flickableDirection == Flickable.AutoFlickDirection || - parent.flickableDirection == Flickable.VerticalFlick || - parent.flickableDirection == Flickable.HorizontalAndVerticalFlick) && + property bool showIndicator: (parent.flickableDirection === Flickable.AutoFlickDirection || + parent.flickableDirection === Flickable.VerticalFlick || + parent.flickableDirection === Flickable.HorizontalAndVerticalFlick) && (parent.contentHeight > parent.height) Component.onCompleted: animateOpacity.restart() diff --git a/src/QmlControls/QGCPipable.qml b/src/QmlControls/QGCPipable.qml index a15e22180837b25c3ae767b4fb6c829b476fe478..e832eda65969147491ec966b9eb4c51db1725da3 100644 --- a/src/QmlControls/QGCPipable.qml +++ b/src/QmlControls/QGCPipable.qml @@ -51,8 +51,8 @@ Item { anchors.right: parent.right height: ScreenTools.minTouchPixels width: height - property var initialX: 0 - property var initialWidth: 0 + property real initialX: 0 + property real initialWidth: 0 onClicked: { // TODO propagate @@ -98,7 +98,7 @@ Item { } // Resize pip window if necessary when main window is resized - property var pipLock: 2 + property int pipLock: 2 Connections { target: pip.parent diff --git a/src/QmlControls/QGCView.qml b/src/QmlControls/QGCView.qml index 1591822b8b57329369d28c5650a28a1a99cfb09b..b50ac571e77367df7375af4404b21f47676c0939 100644 --- a/src/QmlControls/QGCView.qml +++ b/src/QmlControls/QGCView.qml @@ -58,7 +58,7 @@ FactPanel { console.log("Error loading QGCViewDialogContainer.qml: ", dialogComponent.errorString()) return } - var dialogWidth = charWidth == showDialogFullWidth ? parent.width : ScreenTools.defaultFontPixelWidth * charWidth + var dialogWidth = charWidth === showDialogFullWidth ? parent.width : ScreenTools.defaultFontPixelWidth * charWidth var dialog = dialogComponent.createObject(_rootItem, { "anchors.fill": _rootItem, diff --git a/src/QmlControls/QGCViewDialog.qml b/src/QmlControls/QGCViewDialog.qml index 982b5fed748278d3c9180274a14a3a0b597a96d8..0c1e02b1c23ad98b26bc6d6daa8bc78a2b1b63e1 100644 --- a/src/QmlControls/QGCViewDialog.qml +++ b/src/QmlControls/QGCViewDialog.qml @@ -27,10 +27,10 @@ FactPanel { signal hideDialog Keys.onReleased: { - if (event.key == Qt.Key_Escape) { + if (event.key === Qt.Key_Escape) { reject() event.accepted = true - } else if (event.key == Qt.Key_Return || event.key == Qt.Key_Enter) { + } else if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) { accept() event.accepted = true } diff --git a/src/QmlControls/QGroundControl.Controls.qmldir b/src/QmlControls/QGroundControl.Controls.qmldir index 02680ff52d8632d517d830ff2f053a9ef7bfcdbb..65b86d035be9ab5cd631f4990a6c045c8b953843 100644 --- a/src/QmlControls/QGroundControl.Controls.qmldir +++ b/src/QmlControls/QGroundControl.Controls.qmldir @@ -5,6 +5,7 @@ AppMessages 1.0 AppMessages.qml CameraCalc 1.0 CameraCalc.qml CameraSection 1.0 CameraSection.qml ClickableColor 1.0 ClickableColor.qml +DeadMouseArea 1.0 DeadMouseArea.qml DropButton 1.0 DropButton.qml DropPanel 1.0 DropPanel.qml EditPositionDialog 1.0 EditPositionDialog.qml @@ -27,15 +28,11 @@ MissionItemMapVisual 1.0 MissionItemMapVisual.qml MissionItemStatus 1.0 MissionItemStatus.qml ModeSwitchDisplay 1.0 ModeSwitchDisplay.qml MultiRotorMotorDisplay 1.0 MultiRotorMotorDisplay.qml -NoMouseThroughRectangle 1.0 NoMouseThroughRectangle.qml +OfflineMapButton 1.0 OfflineMapButton.qml PageView 1.0 PageView.qml ParameterEditor 1.0 ParameterEditor.qml ParameterEditorDialog 1.0 ParameterEditorDialog.qml PlanToolBar 1.0 PlanToolBar.qml -RallyPointEditorHeader 1.0 RallyPointEditorHeader.qml -RallyPointItemEditor 1.0 RallyPointItemEditor.qml -RallyPointMapVisuals 1.0 RallyPointMapVisuals.qml -RCChannelMonitor 1.0 RCChannelMonitor.qml QGCButton 1.0 QGCButton.qml QGCCheckBox 1.0 QGCCheckBox.qml QGCColoredImage 1.0 QGCColoredImage.qml @@ -45,8 +42,8 @@ QGCFlickable 1.0 QGCFlickable.qml QGCGroupBox 1.0 QGCGroupBox.qml QGCLabel 1.0 QGCLabel.qml QGCListView 1.0 QGCListView.qml -QGCMapLabel 1.0 QGCMapLabel.qml QGCMapCircleVisuals 1.0 QGCMapCircleVisuals.qml +QGCMapLabel 1.0 QGCMapLabel.qml QGCMapPolygonVisuals 1.0 QGCMapPolygonVisuals.qml QGCMapPolylineVisuals 1.0 QGCMapPolylineVisuals.qml QGCMouseArea 1.0 QGCMouseArea.qml @@ -62,6 +59,10 @@ QGCViewDialog 1.0 QGCViewDialog.qml QGCViewDialogContainer 1.0 QGCViewDialogContainer.qml QGCViewMessage 1.0 QGCViewMessage.qml QGCViewPanel 1.0 QGCViewPanel.qml +RallyPointEditorHeader 1.0 RallyPointEditorHeader.qml +RallyPointItemEditor 1.0 RallyPointItemEditor.qml +RallyPointMapVisuals 1.0 RallyPointMapVisuals.qml +RCChannelMonitor 1.0 RCChannelMonitor.qml RoundButton 1.0 RoundButton.qml SectionHeader 1.0 SectionHeader.qml SetupPage 1.0 SetupPage.qml @@ -74,4 +75,3 @@ ToolStrip 1.0 ToolStrip.qml VehicleRotationCal 1.0 VehicleRotationCal.qml VehicleSummaryRow 1.0 VehicleSummaryRow.qml ViewWidget 1.0 ViewWidget.qml -OfflineMapButton 1.0 OfflineMapButton.qml diff --git a/src/QmlControls/QmlTest.qml b/src/QmlControls/QmlTest.qml index 7ff8acb5fc339aaf5ef0870a4da84c62f31ae90b..b6918617d6f54d752c80f6cc201672cbd81a0697 100644 --- a/src/QmlControls/QmlTest.qml +++ b/src/QmlControls/QmlTest.qml @@ -138,7 +138,7 @@ Rectangle { // Header row Loader { sourceComponent: rowHeader - property var text: "" + property string text: "" } Text { width: 80 @@ -172,7 +172,7 @@ Rectangle { // window Loader { sourceComponent: rowHeader - property var text: "window" + property string text: "window" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -204,7 +204,7 @@ Rectangle { // windowShade Loader { sourceComponent: rowHeader - property var text: "windowShade" + property string text: "windowShade" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -236,7 +236,7 @@ Rectangle { // windowShadeDark Loader { sourceComponent: rowHeader - property var text: "windowShadeDark" + property string text: "windowShadeDark" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -268,7 +268,7 @@ Rectangle { // text Loader { sourceComponent: rowHeader - property var text: "text" + property string text: "text" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -300,7 +300,7 @@ Rectangle { // button Loader { sourceComponent: rowHeader - property var text: "button" + property string text: "button" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -332,7 +332,7 @@ Rectangle { // buttonText Loader { sourceComponent: rowHeader - property var text: "buttonText" + property string text: "buttonText" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -364,7 +364,7 @@ Rectangle { // buttonHighlight Loader { sourceComponent: rowHeader - property var text: "buttonHighlight" + property string text: "buttonHighlight" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -396,7 +396,7 @@ Rectangle { // buttonHighlightText Loader { sourceComponent: rowHeader - property var text: "buttonHighlightText" + property string text: "buttonHighlightText" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -428,7 +428,7 @@ Rectangle { // primaryButton Loader { sourceComponent: rowHeader - property var text: "primaryButton" + property string text: "primaryButton" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -460,7 +460,7 @@ Rectangle { // primaryButtonText Loader { sourceComponent: rowHeader - property var text: "primaryButtonText" + property string text: "primaryButtonText" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -492,7 +492,7 @@ Rectangle { // textField Loader { sourceComponent: rowHeader - property var text: "textField" + property string text: "textField" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -524,7 +524,7 @@ Rectangle { // textFieldText Loader { sourceComponent: rowHeader - property var text: "textFieldText" + property string text: "textFieldText" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -556,7 +556,7 @@ Rectangle { // warningText Loader { sourceComponent: rowHeader - property var text: "warningText" + property string text: "warningText" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -588,7 +588,7 @@ Rectangle { // colorGreen Loader { sourceComponent: rowHeader - property var text: "colorGreen" + property string text: "colorGreen" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -620,7 +620,7 @@ Rectangle { // colorOrange Loader { sourceComponent: rowHeader - property var text: "colorOrange" + property string text: "colorOrange" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -652,7 +652,7 @@ Rectangle { // colorRed Loader { sourceComponent: rowHeader - property var text: "colorRed" + property string text: "colorRed" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -684,7 +684,7 @@ Rectangle { // colorGrey Loader { sourceComponent: rowHeader - property var text: "colorGrey" + property string text: "colorGrey" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -716,7 +716,7 @@ Rectangle { // colorBlue Loader { sourceComponent: rowHeader - property var text: "colorBlue" + property string text: "colorBlue" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -748,7 +748,7 @@ Rectangle { // alertBackground Loader { sourceComponent: rowHeader - property var text: "alertBackground" + property string text: "alertBackground" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -780,7 +780,7 @@ Rectangle { // alertBorder Loader { sourceComponent: rowHeader - property var text: "alertBorder" + property string text: "alertBorder" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -812,7 +812,7 @@ Rectangle { // alertText Loader { sourceComponent: rowHeader - property var text: "alertText" + property string text: "alertText" } ClickableColor { property var palette: QGCPalette { colorGroupEnabled: false } @@ -900,7 +900,7 @@ Rectangle { // Header row Loader { sourceComponent: ctlRowHeader - property var text: "" + property string text: "" } Text { width: 100 @@ -920,7 +920,7 @@ Rectangle { // QGCLabel Loader { sourceComponent: ctlRowHeader - property var text: "QGCLabel" + property string text: "QGCLabel" } QGCLabel { width: 100 @@ -937,7 +937,7 @@ Rectangle { // QGCButton Loader { sourceComponent: ctlRowHeader - property var text: "QGCButton" + property string text: "QGCButton" } QGCButton { width: 100 @@ -954,7 +954,7 @@ Rectangle { // QGCButton - primary Loader { sourceComponent: ctlRowHeader - property var text: "QGCButton(primary)" + property string text: "QGCButton(primary)" } QGCButton { width: 100 @@ -973,7 +973,7 @@ Rectangle { // QGCButton - menu Loader { sourceComponent: ctlRowHeader - property var text: "QGCButton(menu)" + property string text: "QGCButton(menu)" } Menu { id: buttonMenu @@ -1004,7 +1004,7 @@ Rectangle { // QGCRadioButton Loader { sourceComponent: ctlRowHeader - property var text: "QGCRadioButton" + property string text: "QGCRadioButton" } QGCRadioButton { width: 100 @@ -1021,7 +1021,7 @@ Rectangle { // QGCCheckBox Loader { sourceComponent: ctlRowHeader - property var text: "QGCCheckBox" + property string text: "QGCCheckBox" } QGCCheckBox { width: 100 @@ -1038,7 +1038,7 @@ Rectangle { // QGCTextField Loader { sourceComponent: ctlRowHeader - property var text: "QGCTextField" + property string text: "QGCTextField" } QGCTextField { width: 100 @@ -1055,7 +1055,7 @@ Rectangle { // QGCComboBox Loader { sourceComponent: ctlRowHeader - property var text: "QGCComboBox" + property string text: "QGCComboBox" } QGCComboBox { width: 100 @@ -1072,7 +1072,7 @@ Rectangle { // SubMenuButton Loader { sourceComponent: ctlRowHeader - property var text: "SubMenuButton" + property string text: "SubMenuButton" } SubMenuButton { width: 100 @@ -1111,15 +1111,15 @@ Rectangle { spacing: 10 anchors.horizontalCenter: parent.horizontalCenter Loader { - property var backgroundColor: qgcPal.window + property color backgroundColor: qgcPal.window sourceComponent: arbBox } Loader { - property var backgroundColor: qgcPal.windowShade + property color backgroundColor: qgcPal.windowShade sourceComponent: arbBox } Loader { - property var backgroundColor: qgcPal.windowShadeDark + property color backgroundColor: qgcPal.windowShadeDark sourceComponent: arbBox } } diff --git a/src/QmlControls/ToolStrip.qml b/src/QmlControls/ToolStrip.qml index 4d7d9aeebd548193390277908f58a205f734adb0..23cbfdda5708e1b5a37a9de1f19c5dd8a1e00c05 100644 --- a/src/QmlControls/ToolStrip.qml +++ b/src/QmlControls/ToolStrip.qml @@ -52,6 +52,10 @@ Rectangle { } } + DeadMouseArea { + anchors.fill: parent + } + Column { id: buttonStripColumn anchors.margins: ScreenTools.defaultFontPixelWidth / 2 diff --git a/src/QtLocationPlugin/QMLControl/OfflineMap.qml b/src/QtLocationPlugin/QMLControl/OfflineMap.qml index eec0d0b84edb5ec2e601ab82b67a7e9da6f86d11..187c12a2dc061b89654b9a39cbc609990079da14 100644 --- a/src/QtLocationPlugin/QMLControl/OfflineMap.qml +++ b/src/QtLocationPlugin/QMLControl/OfflineMap.qml @@ -654,11 +654,9 @@ QGCView { color: Qt.rgba(qgcPal.window.r, qgcPal.window.g, qgcPal.window.b, 0.85) radius: ScreenTools.defaultFontPixelWidth * 0.5 - MouseArea { - anchors.fill: parent - onWheel: { wheel.accepted = true; } - onPressed: { mouse.accepted = true; } - onReleased: { mouse.accepted = true; } + //-- Eat mouse events + DeadMouseArea { + anchors.fill: parent } QGCLabel { diff --git a/src/VehicleSetup/FirmwareUpgrade.qml b/src/VehicleSetup/FirmwareUpgrade.qml index 35a4fdf8816a8409515893cc17f0c5f242d40da2..4633168aa30cd6b53f6f664c607264adbb6d7d83 100644 --- a/src/VehicleSetup/FirmwareUpgrade.qml +++ b/src/VehicleSetup/FirmwareUpgrade.qml @@ -56,7 +56,7 @@ SetupPage { readonly property int _defaultFimwareTypeAPM: 3 property var _defaultFirmwareFact: QGroundControl.settingsManager.appSettings.defaultFirmwareType - property bool _defaultFirmwareIsPX4: _defaultFirmwareFact.rawValue == _defaultFimwareTypePX4 + property bool _defaultFirmwareIsPX4: _defaultFirmwareFact.rawValue === _defaultFimwareTypePX4 property string firmwareWarningMessage property bool controllerCompleted: false @@ -168,7 +168,7 @@ SetupPage { function accept() { hideDialog() if (_singleFirmwareMode) { - controller.flashSingleFirmwareMode() + controller.flashSingleFirmwareMode(controller.selectedFirmwareType) } else { var stack = apmFlightStack.checked ? FirmwareUpgradeController.AutoPilotStackAPM : FirmwareUpgradeController.AutoPilotStackPX4 if (px4Flow) { @@ -353,14 +353,14 @@ SetupPage { currentIndex: controller.selectedFirmwareType onActivated: { - controller.selectedFirmwareType = index - if (model.get(index).firmwareType == FirmwareUpgradeController.BetaFirmware) { + controller.selectedFirmwareType = model.get(index).firmwareType + if (model.get(index).firmwareType === FirmwareUpgradeController.BetaFirmware) { firmwareVersionWarningLabel.visible = true firmwareVersionWarningLabel.text = qsTr("WARNING: BETA FIRMWARE. ") + qsTr("This firmware version is ONLY intended for beta testers. ") + qsTr("Although it has received FLIGHT TESTING, it represents actively changed code. ") + qsTr("Do NOT use for normal operation.") - } else if (model.get(index).firmwareType == FirmwareUpgradeController.DeveloperFirmware) { + } else if (model.get(index).firmwareType === FirmwareUpgradeController.DeveloperFirmware) { firmwareVersionWarningLabel.visible = true firmwareVersionWarningLabel.text = qsTr("WARNING: CONTINUOUS BUILD FIRMWARE. ") + qsTr("This firmware has NOT BEEN FLIGHT TESTED. ") + diff --git a/src/VehicleSetup/FirmwareUpgradeController.cc b/src/VehicleSetup/FirmwareUpgradeController.cc index f417e86ab20abd946667b818eba8579507a818df..2e42ac11b712f4d0d81ad1516a05849907df0ba3 100644 --- a/src/VehicleSetup/FirmwareUpgradeController.cc +++ b/src/VehicleSetup/FirmwareUpgradeController.cc @@ -114,9 +114,9 @@ void FirmwareUpgradeController::flash(const FirmwareIdentifier& firmwareId) flash(firmwareId.autopilotStackType, firmwareId.firmwareType, firmwareId.firmwareVehicleType); } -void FirmwareUpgradeController::flashSingleFirmwareMode(void) +void FirmwareUpgradeController::flashSingleFirmwareMode(FirmwareType_t firmwareType) { - flash(SingleFirmwareMode, StableFirmware, DefaultVehicleFirmware); + flash(SingleFirmwareMode, firmwareType, DefaultVehicleFirmware); } void FirmwareUpgradeController::cancel(void) diff --git a/src/VehicleSetup/FirmwareUpgradeController.h b/src/VehicleSetup/FirmwareUpgradeController.h index 80b1d563208543e6a6a4d1820a8defb42e11aaa2..4c48cf2ac66a6ca962dcb8ded942b52f542983cd 100644 --- a/src/VehicleSetup/FirmwareUpgradeController.h +++ b/src/VehicleSetup/FirmwareUpgradeController.h @@ -123,7 +123,7 @@ public: FirmwareVehicleType_t vehicleType = DefaultVehicleFirmware ); /// Called to flash when upgrade is running in singleFirmwareMode - Q_INVOKABLE void flashSingleFirmwareMode(void); + Q_INVOKABLE void flashSingleFirmwareMode(FirmwareType_t firmwareType); Q_INVOKABLE FirmwareVehicleType_t vehicleTypeFromVersionIndex(int index); diff --git a/src/VehicleSetup/JoystickConfig.qml b/src/VehicleSetup/JoystickConfig.qml index c4bc8430f731ae40456979d2b21d49a220c35ba8..df9a8d22c6264ea186f9275efda8f3c41b012f2e 100644 --- a/src/VehicleSetup/JoystickConfig.qml +++ b/src/VehicleSetup/JoystickConfig.qml @@ -366,9 +366,15 @@ SetupPage { id: enabledCheckBox enabled: _activeJoystick ? _activeJoystick.calibrated : false text: _activeJoystick ? _activeJoystick.calibrated ? qsTr("Enable joystick input") : qsTr("Enable not allowed (Calibrate First)") : "" - checked: _activeVehicle.joystickEnabled - onClicked: _activeVehicle.joystickEnabled = checked + onClicked: _activeJoystick.outputEnabled = checked + + Connections { + target: _activeJoystick + onOutputEnabledChanged: { + enabledCheckBox.checked=enabled + } + } Connections { target: joystickManager diff --git a/src/VehicleSetup/JoystickConfigController.cc b/src/VehicleSetup/JoystickConfigController.cc index 8b4f0b6fd450bedd2704ca263b6a1fdf29edb874..3ee4119eba7a27fe2631e3694ae3cbb914dcfe1e 100644 --- a/src/VehicleSetup/JoystickConfigController.cc +++ b/src/VehicleSetup/JoystickConfigController.cc @@ -82,7 +82,7 @@ void JoystickConfigController::setDeadbandValue(int axis, int value) JoystickConfigController::~JoystickConfigController() { if(_activeJoystick) { - _activeJoystick->stopCalibrationMode(Joystick::CalibrationModeMonitor); + _activeJoystick->setCalibrationMode(false); } } @@ -582,7 +582,7 @@ void JoystickConfigController::_writeCalibration(void) /// @brief Starts the calibration process void JoystickConfigController::_startCalibration(void) { - _activeJoystick->startCalibrationMode(Joystick::CalibrationModeCalibrating); + _activeJoystick->setCalibrationMode(true); _resetInternalCalibrationValues(); _nextButton->setProperty("text", "Next"); @@ -598,7 +598,7 @@ void JoystickConfigController::_stopCalibration(void) { _currentStep = -1; - _activeJoystick->stopCalibrationMode(Joystick::CalibrationModeCalibrating); + _activeJoystick->setCalibrationMode(false); _setInternalCalibrationValuesFromSettings(); _statusText->setProperty("text", ""); @@ -763,7 +763,6 @@ void JoystickConfigController::_signalAllAttitudeValueChanges(void) void JoystickConfigController::_activeJoystickChanged(Joystick* joystick) { bool joystickTransition = false; - if (_activeJoystick) { joystickTransition = true; disconnect(_activeJoystick, &Joystick::rawAxisValueChanged, this, &JoystickConfigController::_axisValueChanged); @@ -781,7 +780,7 @@ void JoystickConfigController::_activeJoystickChanged(Joystick* joystick) if (joystickTransition) { _stopCalibration(); } - _activeJoystick->startCalibrationMode(Joystick::CalibrationModeMonitor); + _activeJoystick->setCalibrationMode(false); _axisCount = _activeJoystick->axisCount(); _rgAxisInfo = new struct AxisInfo[_axisCount]; _axisValueSave = new int[_axisCount]; diff --git a/src/VehicleSetup/VehicleSummary.qml b/src/VehicleSetup/VehicleSummary.qml index cb4a7dc2ff12ecedb00cb1905f3bc24646a9a83d..60286d44d063d3ec50cf9030b7a23a83ef755e3b 100644 --- a/src/VehicleSetup/VehicleSummary.qml +++ b/src/VehicleSetup/VehicleSummary.qml @@ -128,12 +128,12 @@ Rectangle { height: width radius: width / 2 color: modelData.setupComplete ? "#00d932" : "red" - visible: modelData.requiresSetup && modelData.setupSource != "" + visible: modelData.requiresSetup && modelData.setupSource !== "" } onClicked : { console.log(modelData.setupSource) - if (modelData.setupSource != "") { + if (modelData.setupSource !== "") { setupView.showVehicleComponentPanel(modelData) } } diff --git a/src/ViewWidgets/ViewWidget.qml b/src/ViewWidgets/ViewWidget.qml index 04c0c2f14308a63ade1b35f850e717155a8c38a2..0eef437883e717a412cce3a44f84dd1ad2ffde01 100644 --- a/src/ViewWidgets/ViewWidget.qml +++ b/src/ViewWidgets/ViewWidget.qml @@ -2,8 +2,10 @@ import QtQuick 2.3 import QtQuick.Controls 1.2 import QtQuick.Controls.Styles 1.4 -import QGroundControl.Palette 1.0 -import QGroundControl.Controllers 1.0 +import QGroundControl 1.0 +import QGroundControl.Controls 1.0 +import QGroundControl.Controllers 1.0 +import QGroundControl.Palette 1.0 Rectangle { property Component connectedComponent: __componentConnected diff --git a/src/api/QGCOptions.h b/src/api/QGCOptions.h index 3e2607409e64e379a3e497603175ea2c97876668..a441b0139c5e68d335075d07be7163308e16beb3 100644 --- a/src/api/QGCOptions.h +++ b/src/api/QGCOptions.h @@ -121,11 +121,21 @@ class CustomInstrumentWidget : public QObject { Q_OBJECT public: + //-- Widget Position + enum Pos { + POS_TOP_RIGHT, + POS_CENTER_RIGHT, + POS_BOTTOM_RIGHT, + POS_TOP_LEFT, + POS_CENTER_LEFT, + POS_BOTTOM_LEFT + }; + Q_ENUMS(Pos) CustomInstrumentWidget(QObject* parent = NULL); Q_PROPERTY(QUrl source READ source CONSTANT) - Q_PROPERTY(double widgetTopMargin READ widgetTopMargin NOTIFY widgetTopMarginChanged) + Q_PROPERTY(Pos widgetPosition READ widgetPosition NOTIFY widgetPositionChanged) virtual QUrl source () { return QUrl(); } - virtual double widgetTopMargin () { return 0.0; } + virtual Pos widgetPosition () { return POS_TOP_RIGHT; } signals: - void widgetTopMarginChanged(); + void widgetPositionChanged (); }; diff --git a/src/ui/MainWindowHybrid.qml b/src/ui/MainWindowHybrid.qml index 408ea37a94b60bc4808c1467f4134a3d4b20facd..8f58d2253d736dbbcfef220880797d5476b8cd6a 100644 --- a/src/ui/MainWindowHybrid.qml +++ b/src/ui/MainWindowHybrid.qml @@ -22,7 +22,12 @@ Item { } function attemptWindowClose() { - mainWindowInner.item.attemptWindowClose() + try { + mainWindowInner.item.attemptWindowClose() + } + finally { + controller.reallyClose() + } } function showMessage(message) { diff --git a/src/ui/MainWindowInner.qml b/src/ui/MainWindowInner.qml index a344f936996df73adaf391fee2ea8ac015cf262e..e4b6069bda104a8f54a49074eef213ca97767512 100644 --- a/src/ui/MainWindowInner.qml +++ b/src/ui/MainWindowInner.qml @@ -296,13 +296,10 @@ Item { onVtolTransitionToMRFlight: flightView.guidedController.confirmAction(flightView.guidedController.actionVtolTransitionToMRFlight) //-- Entire tool bar area disable on cammand - MouseArea { + DeadMouseArea { id: toolbarBlocker - anchors.fill: parent enabled: false - onWheel: { wheel.accepted = true; } - onPressed: { mouse.accepted = true; } - onReleased: { mouse.accepted = true; } + anchors.fill: parent } }