-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPulse.qml.autosave
114 lines (99 loc) · 2.58 KB
/
Pulse.qml.autosave
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import QtQuick 2.0
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.14
Item {
id: rootItem
property alias pulseWave: spinRectId
property int amPulse: 1
property int wiPulse: 2
property int dePulse: 0
Rectangle{
id: spinRectId
width: parent.width
height: parent.height
Column{
id: rootColumn
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.topMargin:100
spacing: 100
Row{
spacing: 45
x: rootColumn.x + 10
Label{
height: parent.height
verticalAlignment: Text.AlignVCenter
text: "Amplitude:"
font.pixelSize: 17
}
SpinBox{
id: amplitude
from:-10
to:10
value:1
onValueChanged: {
spinRectId.updateSignal(amplitude.value, width.value, delay.value)
amPulse = amplitude.value
}
}
}
Row{
spacing: 45
x: rootColumn.x + 44
Label{
height: parent.height
verticalAlignment: Text.AlignVCenter
text: "Width:"
font.pixelSize: 17
}
SpinBox{
id: width
from:1
to:10
value: 2
onValueChanged: {
spinRectId.updateSignal(amplitude.value, width.value, delay.value)
wiPulse = width.value
}
}
}
Row{
spacing: 45
x: rootColumn.x + 46
Label{
height: parent.height
verticalAlignment: Text.AlignVCenter
text: "Delay:"
font.pixelSize: 17
}
SpinBox{
id: delay
from:-10
to:10
value: 0
onValueChanged: {
spinRectId.updateSignal(amplitude.value, width.value, delay.value)
dePulse = delay.value
}
}
}
}
function updateSignal(a, w, d){
sig.clear()
ccdemo.pul(a, w, d)
var c = ccdemo.sig_pul_y
var t = ccdemo.sig_pul_t
ccdemo.getxx(c, t)
ccdemo.gethh(c, t)
for(var i = 0; i< c.length; i++){
sig.append(t[i], c[i])
}
axisX.max = t[t.length-1]
axisX.min = t[0]
axisY.max = Math.max.apply(null, c)
axisY.min = Math.min.apply(null, c)
}
}
}