Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
e9d586b4
Commit
e9d586b4
authored
Feb 21, 2018
by
Gus Grubba
Browse files
Sanitizing QML and JavaScript
Adding missing qgcView to QGCMapPolygonVisuals instance in SurveyMapVisual.qml
parent
61cc29df
Changes
52
Hide whitespace changes
Inline
Side-by-side
src/AnalyzeView/GeoTagPage.qml
View file @
e9d586b4
...
...
@@ -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
}
}
...
...
src/AutoPilotPlugins/Common/MotorComponent.qml
View file @
e9d586b4
...
...
@@ -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
)
}
}
...
...
src/AutoPilotPlugins/Common/RadioComponent.qml
View file @
e9d586b4
...
...
@@ -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
()
...
...
src/AutoPilotPlugins/PX4/AirframeComponent.qml
View file @
e9d586b4
...
...
@@ -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
}
...
...
src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml
View file @
e9d586b4
...
...
@@ -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
}
}
}
src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml
View file @
e9d586b4
...
...
@@ -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
...
...
src/AutoPilotPlugins/PX4/PX4FlightModes.qml
View file @
e9d586b4
...
...
@@ -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
...
...
src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml
View file @
e9d586b4
...
...
@@ -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
{
...
...
src/AutoPilotPlugins/PX4/PowerComponent.qml
View file @
e9d586b4
...
...
@@ -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
.
rawValue
!=
=
0
}
QGCGroupBox
{
...
...
src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml
View file @
e9d586b4
...
...
@@ -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
...
...
src/AutoPilotPlugins/PX4/SensorsSetup.qml
View file @
e9d586b4
...
...
@@ -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
"
...
...
src/FactSystem/FactControls/FactBitmask.qml
View file @
e9d586b4
...
...
@@ -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
<
repeater
.
count
;
i
++
)
{
var
otherCheckbox
=
repeater
.
itemAt
(
i
)
for
(
i
=
1
;
i
<
repeater
.
count
;
i
++
)
{
otherCheckbox
=
repeater
.
itemAt
(
i
)
fact
.
value
&=
~
fact
.
bitmaskValues
[
i
]
otherCheckbox
.
checked
=
false
otherCheckbox
.
enabled
=
false
...
...
@@ -45,8 +47,8 @@ Flow {
fact
.
value
|=
fact
.
bitmaskValues
[
index
]
}
else
{
if
(
firstEntryIsAll
&&
index
==
0
)
{
for
(
var
i
=
1
;
i
<
repeater
.
count
;
i
++
)
{
var
otherCheckbox
=
repeater
.
itemAt
(
i
)
for
(
i
=
1
;
i
<
repeater
.
count
;
i
++
)
{
otherCheckbox
=
repeater
.
itemAt
(
i
)
otherCheckbox
.
enabled
=
true
}
}
...
...
src/FactSystem/FactControls/FactCheckBox.qml
View file @
e9d586b4
...
...
@@ -8,8 +8,6 @@ import QGroundControl.Controls 1.0
QGCCheckBox
{
property
Fact
fact
:
Fact
{
}
property
variant
checkedValue
:
1
property
variant
uncheckedValue
:
0
checkedState
:
fact
?
(
fact
.
typeIsBool
?
...
...
@@ -19,5 +17,5 @@ QGCCheckBox {
text
:
qsTr
(
"
Label
"
)
onClicked
:
fact
.
value
=
checked
?
checkedValue
:
uncheckedValue
onClicked
:
fact
.
value
=
checked
?
1
:
0
}
src/FactSystem/FactControls/FactComboBox.qml
View file @
e9d586b4
...
...
@@ -12,7 +12,7 @@ QGCComboBox {
model
:
fact
?
fact
.
enumStrings
:
null
currentIndex
:
indexModel
?
fact
.
value
:
fact
.
enumIndex
currentIndex
:
fact
?
(
indexModel
?
fact
.
value
:
fact
.
enumIndex
)
:
0
onActivated
:
{
if
(
indexModel
)
{
...
...
src/FactSystem/FactControls/FactTextField.qml
View file @
e9d586b4
...
...
@@ -32,7 +32,7 @@ QGCTextField {
}
if
(
typeof
qgcView
!==
'
undefined
'
&&
qgcView
)
{
var
errorString
=
fact
.
validate
(
text
,
false
/* convertOnly */
)
if
(
errorString
==
""
)
{
if
(
errorString
==
=
""
)
{
fact
.
value
=
text
}
else
{
_validateString
=
text
...
...
src/FlightDisplay/FlightDisplayViewMap.qml
View file @
e9d586b4
...
...
@@ -143,7 +143,7 @@ FlightMap {
onNewItemsFromVehicle
:
{
var
visualItems
=
_missionController
.
visualItems
if
(
visualItems
&&
visualItems
.
count
!=
1
)
{
if
(
visualItems
&&
visualItems
.
count
!=
=
1
)
{
mapFitFunctions
.
fitMapViewportToMissionItems
()
firstVehiclePositionReceived
=
true
}
...
...
src/FlightDisplay/FlightDisplayViewWidgets.qml
View file @
e9d586b4
...
...
@@ -72,7 +72,7 @@ Item {
instrumentsLoader
.
state
=
"
topMode
"
}
else
{
instrumentsLoader
.
source
=
"
qrc:/qml/QGCInstrumentWidget.qml
"
instrumentsLoader
.
state
=
QGroundControl
.
settingsManager
.
appSettings
.
showLargeCompass
.
value
==
1
?
"
centerMode
"
:
"
topMode
"
instrumentsLoader
.
state
=
QGroundControl
.
settingsManager
.
appSettings
.
showLargeCompass
.
value
==
=
1
?
"
centerMode
"
:
"
topMode
"
}
}
}
else
{
...
...
src/FlightDisplay/GuidedActionsController.qml
View file @
e9d586b4
...
...
@@ -313,6 +313,8 @@ Item {
// Executes the specified action
function
executeAction
(
actionCode
,
actionData
)
{
var
i
;
var
rgVehicle
;
switch
(
actionCode
)
{
case
actionRTL
:
_activeVehicle
.
guidedModeRTL
()
...
...
@@ -336,10 +338,9 @@ Item {
_activeVehicle
.
startMission
()
break
case
actionMVStartMission
:
var
rgVehicle
=
QGroundControl
.
multiVehicleManager
.
vehicles
for
(
var
i
=
0
;
i
<
rgVehicle
.
count
;
i
++
)
{
var
vehicle
=
rgVehicle
.
get
(
i
)
vehicle
.
startMission
()
rgVehicle
=
QGroundControl
.
multiVehicleManager
.
vehicles
for
(
i
=
0
;
i
<
rgVehicle
.
count
;
i
++
)
{
rgVehicle
.
get
(
i
).
startMission
()
}
break
case
actionArm
:
...
...
@@ -370,10 +371,9 @@ Item {
_activeVehicle
.
pauseVehicle
()
break
case
actionMVPause
:
var
rgVehicle
=
QGroundControl
.
multiVehicleManager
.
vehicles
for
(
var
i
=
0
;
i
<
rgVehicle
.
count
;
i
++
)
{
var
vehicle
=
rgVehicle
.
get
(
i
)
vehicle
.
pauseVehicle
()
rgVehicle
=
QGroundControl
.
multiVehicleManager
.
vehicles
for
(
i
=
0
;
i
<
rgVehicle
.
count
;
i
++
)
{
rgVehicle
.
get
(
i
).
pauseVehicle
()
}
break
case
actionVtolTransitionToFwdFlight
:
...
...
src/FlightDisplay/MultiVehicleList.qml
View file @
e9d586b4
...
...
@@ -152,7 +152,7 @@ Item {
QGCButton
{
text
:
"
Start Mission
"
visible
:
_vehicle
.
armed
&&
_vehicle
.
flightMode
!=
_vehicle
.
missionFlightMode
visible
:
_vehicle
.
armed
&&
_vehicle
.
flightMode
!=
=
_vehicle
.
missionFlightMode
onClicked
:
_vehicle
.
startMission
()
}
...
...
@@ -164,13 +164,13 @@ Item {
QGCButton
{
text
:
"
RTL
"
visible
:
_vehicle
.
armed
&&
_vehicle
.
flightMode
!=
_vehicle
.
rtlFlightMode
visible
:
_vehicle
.
armed
&&
_vehicle
.
flightMode
!=
=
_vehicle
.
rtlFlightMode
onClicked
:
_vehicle
.
flightMode
=
_vehicle
.
rtlFlightMode
}
QGCButton
{
text
:
"
Take control
"
visible
:
_vehicle
.
armed
&&
_vehicle
.
flightMode
!=
_vehicle
.
takeControlFlightMode
visible
:
_vehicle
.
armed
&&
_vehicle
.
flightMode
!=
=
_vehicle
.
takeControlFlightMode
onClicked
:
_vehicle
.
flightMode
=
_vehicle
.
takeControlFlightMode
}
}
// Row
...
...
src/FlightMap/MapItems/CustomMapItems.qml
View file @
e9d586b4
...
...
@@ -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
)
...
...
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment