-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOutput.qml
63 lines (49 loc) · 1.68 KB
/
Output.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
pragma ComponentBehavior: Bound
import QtQuick 2.0
import QtQuick.Layouts 1.0
import QtQml.Models 2.1
GridLayout {
id: root
rowSpacing: 10
rows: 3
columns: 1
property var driver
ListModel {
id: channelsDescription
ListElement {label: "X channel"; channelName: "x"}
ListElement {label: "Y channel"; channelName: "y"}
ListElement {label: "Z channel"; channelName: "z"}
}
Repeater {
id: channels
model: channelsDescription
property var driver: root.driver
delegate: Item{
id: delegate
implicitWidth: channel.implicitWidth
implicitHeight: channel.implicitHeight
required property string label
required property string channelName
property var channelHandler: root.driver.getChannel(channelName)
Channel {
id: channel
label: delegate.label
onOffsetChanged: delegate.channelHandler.offset = offset
onAmplitudeChanged: delegate.channelHandler.amplitude = amplitude
onFrequencyChanged: delegate.channelHandler.frequency = frequency
}
Connections {
id: connection
target: delegate.channelHandler
function onOffsetChanged() {channel.offset = delegate.channelHandler.offset}
function onAmplitudeChanged() {channel.amplitude = delegate.channelHandler.amplitude}
function onFrequencyChanged() {channel.frequency = delegate.channelHandler.frequency}
}
}
}
}
/*##^##
Designer {
D{i:0;formeditorZoom:0.75}
}
##^##*/