Commit b6e722c6 authored by Don Gagne's avatar Don Gagne

Convert to QGCView

parent fb26f834
......@@ -31,11 +31,12 @@ import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
FactPanel {
id: panel
QGCView {
id: rootQGCView
viewPanel: view
QGCPalette { id: palette; colorGroupEnabled: enabled }
FactPanelController { id: controller; factPanel: panel }
FactPanelController { id: controller; factPanel: rootQGCView }
property int flightLineWidth: 2 // width of lines for flight graphic
property int loiterAltitudeColumnWidth: 180 // width of loiter altitude column
......@@ -47,265 +48,271 @@ FactPanel {
property int arrowWidth: 18 // width for arrow graphic
property int firstColumnWidth: 220 // Width of first column in return home triggers area
Column {
QGCView {
id: view
anchors.fill: parent
QGCLabel {
text: "SAFETY CONFIG"
font.pixelSize: ScreenTools.largeFontPixelSize
}
Column {
anchors.fill: parent
Item { height: 20; width: 10 } // spacer
QGCLabel {
text: "SAFETY CONFIG"
font.pixelSize: ScreenTools.largeFontPixelSize
}
//-----------------------------------------------------------------
//-- Return Home Triggers
Item { height: 20; width: 10 } // spacer
QGCLabel { text: "Triggers For Return Home"; font.pixelSize: ScreenTools.mediumFontPixelSize; }
//-----------------------------------------------------------------
//-- Return Home Triggers
Item { height: 10; width: 10 } // spacer
QGCLabel { text: "Triggers For Return Home"; font.pixelSize: ScreenTools.mediumFontPixelSize; }
Rectangle {
width: parent.width
height: triggerColumn.height
color: palette.windowShade
Item { height: 10; width: 10 } // spacer
Column {
id: triggerColumn
spacing: controlVerticalSpacing
anchors.margins: shadedMargin
anchors.left: parent.left
Rectangle {
width: parent.width
height: triggerColumn.height
color: palette.windowShade
// Top margin
Item { height: 1; width: 10 }
Column {
id: triggerColumn
spacing: controlVerticalSpacing
anchors.margins: shadedMargin
anchors.left: parent.left
Row {
spacing: 10
QGCLabel { text: "RC Transmitter Signal Loss"; width: firstColumnWidth; anchors.baseline: rcLossField.baseline }
QGCLabel { text: "Return Home after"; anchors.baseline: rcLossField.baseline }
FactTextField {
id: rcLossField
fact: controller.getParameterFact(-1, "COM_RC_LOSS_T")
showUnits: true
}
}
// Top margin
Item { height: 1; width: 10 }
Row {
spacing: 10
FactCheckBox {
id: telemetryTimeoutCheckbox
anchors.baseline: telemetryLossField.baseline
width: firstColumnWidth
fact: controller.getParameterFact(-1, "COM_DL_LOSS_EN")
checkedValue: 1
uncheckedValue: 0
text: "Telemetry Signal Timeout"
Row {
spacing: 10
QGCLabel { text: "RC Transmitter Signal Loss"; width: firstColumnWidth; anchors.baseline: rcLossField.baseline }
QGCLabel { text: "Return Home after"; anchors.baseline: rcLossField.baseline }
FactTextField {
id: rcLossField
fact: controller.getParameterFact(-1, "COM_RC_LOSS_T")
showUnits: true
}
}
QGCLabel { text: "Return Home after"; anchors.baseline: telemetryLossField.baseline }
FactTextField {
id: telemetryLossField
fact: controller.getParameterFact(-1, "COM_DL_LOSS_T")
showUnits: true
enabled: telemetryTimeoutCheckbox.checked
Row {
spacing: 10
FactCheckBox {
id: telemetryTimeoutCheckbox
anchors.baseline: telemetryLossField.baseline
width: firstColumnWidth
fact: controller.getParameterFact(-1, "COM_DL_LOSS_EN")
checkedValue: 1
uncheckedValue: 0
text: "Telemetry Signal Timeout"
}
QGCLabel { text: "Return Home after"; anchors.baseline: telemetryLossField.baseline }
FactTextField {
id: telemetryLossField
fact: controller.getParameterFact(-1, "COM_DL_LOSS_T")
showUnits: true
enabled: telemetryTimeoutCheckbox.checked
}
}
}
// Bottom margin
Item { height: 1; width: 10 }
// Bottom margin
Item { height: 1; width: 10 }
}
}
}
Item { height: 20; width: 10 } // spacer
//-----------------------------------------------------------------
//-- Return Home Settings
Item { height: 20; width: 10 } // spacer
QGCLabel { text: "Return Home Settings"; font.pixelSize: ScreenTools.mediumFontPixelSize; }
//-----------------------------------------------------------------
//-- Return Home Settings
Item { height: 10; width: 10 } // spacer
QGCLabel { text: "Return Home Settings"; font.pixelSize: ScreenTools.mediumFontPixelSize; }
Rectangle {
width: parent.width
height: settingsColumn.height
color: palette.windowShade
Item { height: 10; width: 10 } // spacer
Column {
id: settingsColumn
width: parent.width
anchors.margins: shadedMargin
anchors.left: parent.left
Rectangle {
width: parent.width
height: settingsColumn.height
color: palette.windowShade
Item { height: shadedMargin; width: 10 } // top margin
Column {
id: settingsColumn
width: parent.width
anchors.margins: shadedMargin
anchors.left: parent.left
// This item is the holder for the climb alt and loiter seconds fields
Item {
width: parent.width
height: climbAltitudeColumn.height
Item { height: shadedMargin; width: 10 } // top margin
Column {
id: climbAltitudeColumn
spacing: controlVerticalSpacing
QGCLabel { text: "Climb to altitude of" }
FactTextField {
id: climbField
fact: controller.getParameterFact(-1, "RTL_RETURN_ALT")
showUnits: true
// This item is the holder for the climb alt and loiter seconds fields
Item {
width: parent.width
height: climbAltitudeColumn.height
Column {
id: climbAltitudeColumn
spacing: controlVerticalSpacing
QGCLabel { text: "Climb to altitude of" }
FactTextField {
id: climbField
fact: controller.getParameterFact(-1, "RTL_RETURN_ALT")
showUnits: true
}
}
}
Column {
x: flightGraphic.width - 200
spacing: controlVerticalSpacing
Column {
x: flightGraphic.width - 200
spacing: controlVerticalSpacing
QGCCheckBox {
id: homeLoiterCheckbox
checked: fact.value > 0
text: "Loiter at Home altitude for"
QGCCheckBox {
id: homeLoiterCheckbox
checked: fact.value > 0
text: "Loiter at Home altitude for"
property Fact fact: controller.getParameterFact(-1, "RTL_LAND_DELAY")
property Fact fact: controller.getParameterFact(-1, "RTL_LAND_DELAY")
onClicked: {
fact.value = checked ? 60 : -1
onClicked: {
fact.value = checked ? 60 : -1
}
}
}
FactTextField {
fact: controller.getParameterFact(-1, "RTL_LAND_DELAY")
showUnits: true
enabled: homeLoiterCheckbox.checked == true
FactTextField {
fact: controller.getParameterFact(-1, "RTL_LAND_DELAY")
showUnits: true
enabled: homeLoiterCheckbox.checked == true
}
}
}
}
Item { height: 20; width: 10 } // spacer
Item { height: 20; width: 10 } // spacer
// This row holds the flight graphic and the home loiter alt column
Row {
width: parent.width
spacing: 20
// This row holds the flight graphic and the home loiter alt column
Row {
width: parent.width
spacing: 20
// Flight graphic
Item {
id: flightGraphic
width: parent.width - loiterAltitudeColumnWidth
height: 200 // controls the height of the flight graphic
Rectangle {
x: planeWidth / 2
height: planeImage.y - 5
width: flightLineWidth
color: palette.button
}
Rectangle {
x: planeWidth / 2
height: flightLineWidth
width: parent.width - x
color: palette.button
}
Rectangle {
x: parent.width - flightLineWidth
height: parent.height - homeWidth - arrowToHomeSpacing
width: flightLineWidth
color: palette.button
}
// Flight graphic
Item {
id: flightGraphic
width: parent.width - loiterAltitudeColumnWidth
height: 200 // controls the height of the flight graphic
QGCColoredImage {
id: planeImage
y: parent.height - planeWidth - 40
source: "/qmlimages/SafetyComponentPlane.png"
fillMode: Image.PreserveAspectFit
width: planeWidth
height: planeWidth
smooth: true
color: palette.button
}
Rectangle {
x: planeWidth / 2
height: planeImage.y - 5
width: flightLineWidth
color: palette.button
}
Rectangle {
x: planeWidth / 2
height: flightLineWidth
width: parent.width - x
color: palette.button
}
Rectangle {
x: parent.width - flightLineWidth
height: parent.height - homeWidth - arrowToHomeSpacing
width: flightLineWidth
color: palette.button
}
QGCColoredImage {
x: planeWidth + 70
y: parent.height - height - 20
width: 80
height: parent.height / 2
source: "/qmlimages/SafetyComponentTree.svg"
fillMode: Image.Stretch
smooth: true
color: palette.windowShadeDark
}
QGCColoredImage {
id: planeImage
y: parent.height - planeWidth - 40
source: "/qmlimages/SafetyComponentPlane.png"
fillMode: Image.PreserveAspectFit
width: planeWidth
height: planeWidth
smooth: true
color: palette.button
}
QGCColoredImage {
x: planeWidth + 15
y: parent.height - height
width: 100
height: parent.height * .75
source: "/qmlimages/SafetyComponentTree.svg"
fillMode: Image.PreserveAspectFit
smooth: true
color: palette.button
}
QGCColoredImage {
x: planeWidth + 70
y: parent.height - height - 20
width: 80
height: parent.height / 2
source: "/qmlimages/SafetyComponentTree.svg"
fillMode: Image.Stretch
smooth: true
color: palette.windowShadeDark
}
QGCColoredImage {
x: parent.width - (arrowWidth/2) - 1
y: parent.height - homeWidth - arrowToHomeSpacing - 2
source: "/qmlimages/SafetyComponentArrowDown.png"
fillMode: Image.PreserveAspectFit
width: arrowWidth
height: arrowWidth
smooth: true
color: palette.button
}
QGCColoredImage {
x: planeWidth + 15
y: parent.height - height
width: 100
height: parent.height * .75
source: "/qmlimages/SafetyComponentTree.svg"
fillMode: Image.PreserveAspectFit
smooth: true
color: palette.button
}
QGCColoredImage {
x: parent.width - (arrowWidth/2) - 1
y: parent.height - homeWidth - arrowToHomeSpacing - 2
source: "/qmlimages/SafetyComponentArrowDown.png"
fillMode: Image.PreserveAspectFit
width: arrowWidth
height: arrowWidth
smooth: true
color: palette.button
}
QGCColoredImage {
id: homeImage
x: parent.width - (homeWidth / 2)
y: parent.height - homeWidth
source: "/qmlimages/SafetyComponentHome.png"
fillMode: Image.PreserveAspectFit
width: homeWidth
height: homeWidth
smooth: true
color: palette.button
QGCColoredImage {
id: homeImage
x: parent.width - (homeWidth / 2)
y: parent.height - homeWidth
source: "/qmlimages/SafetyComponentHome.png"
fillMode: Image.PreserveAspectFit
width: homeWidth
height: homeWidth
smooth: true
color: palette.button
}
}
}
Column {
spacing: controlVerticalSpacing
Column {
spacing: controlVerticalSpacing
QGCLabel {
text: "Home loiter altitude";
color: palette.text;
enabled: homeLoiterCheckbox.checked === true
}
FactTextField {
id: descendField;
fact: controller.getParameterFact(-1, "RTL_DESCEND_ALT")
enabled: homeLoiterCheckbox.checked === true
showUnits: true
QGCLabel {
text: "Home loiter altitude";
color: palette.text;
enabled: homeLoiterCheckbox.checked === true
}
FactTextField {
id: descendField;
fact: controller.getParameterFact(-1, "RTL_DESCEND_ALT")
enabled: homeLoiterCheckbox.checked === true
showUnits: true
}
}
}
}
Item { height: shadedMargin; width: 10 } // bottom margin
Item { height: shadedMargin; width: 10 } // bottom margin
}
}
}
QGCLabel {
width: parent.width
font.pixelSize: ScreenTools.mediumFontPixelSize
text: "Warning: You have an advanced safety configuration set using the NAV_RCL_OBC parameter. The above settings may not apply.";
visible: fact.value !== 0
wrapMode: Text.Wrap
QGCLabel {
width: parent.width
font.pixelSize: ScreenTools.mediumFontPixelSize
text: "Warning: You have an advanced safety configuration set using the NAV_RCL_OBC parameter. The above settings may not apply.";
visible: fact.value !== 0
wrapMode: Text.Wrap
property Fact fact: controller.getParameterFact(-1, "NAV_RCL_OBC")
}
property Fact fact: controller.getParameterFact(-1, "NAV_RCL_OBC")
}
QGCLabel {
width: parent.width
font.pixelSize: ScreenTools.mediumFontPixelSize
text: "Warning: You have an advanced safety configuration set using the NAV_DLL_OBC parameter. The above settings may not apply.";
visible: fact.value !== 0
wrapMode: Text.Wrap
QGCLabel {
width: parent.width
font.pixelSize: ScreenTools.mediumFontPixelSize
text: "Warning: You have an advanced safety configuration set using the NAV_DLL_OBC parameter. The above settings may not apply.";
visible: fact.value !== 0
wrapMode: Text.Wrap
property Fact fact: controller.getParameterFact(-1, "NAV_DLL_OBC")
property Fact fact: controller.getParameterFact(-1, "NAV_DLL_OBC")
}
}
}
} // QGCVIew
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment