CircularGeneratorEditor.qml 1.21 KB
Newer Older
1 2 3 4 5 6 7 8 9
import QtQuick 2.0

import QtQuick.Layouts 1.11

import QGroundControl.Controls 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.ScreenTools   1.0

GridLayout {
10
    id: grid
11

12
    property var generator: undefined // CircularGenerator
13
    property var availableWidth
14 15
    property real   _margin: ScreenTools.defaultFontPixelWidth / 2

16
    width:      availableWidth
17 18 19 20
    columnSpacing:  _margin
    rowSpacing:     _margin
    columns:        2

21 22 23 24
    Component.onCompleted: {
        console.assert(generator !== undefined, "please set the generator property")
    }

25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
    QGCLabel { text: qsTr("Distance") }
    FactTextField {
        fact:                   generator.distance
        Layout.fillWidth:       true
    }

    QGCLabel { text: qsTr("Delta Alpha") }
    FactTextField {
        fact:                   generator.deltaAlpha
        Layout.fillWidth:       true
    }

    QGCLabel { text: qsTr("Min. Length") }
    FactTextField {
        fact:                   generator.minLength
        Layout.fillWidth:       true
    }

    QGCButton {
        text:               qsTr("Reset Ref.")
        onClicked:          generator.resetReference();
        Layout.fillWidth:  true
        Layout.columnSpan: 2
    }
}