-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGaussian.qml
More file actions
151 lines (128 loc) · 3.43 KB
/
Copy pathGaussian.qml
File metadata and controls
151 lines (128 loc) · 3.43 KB
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
import QtQuick 2.0
import QtQuick.Controls 2.14
Item {
id: rootItem
property alias gaussianWave: spinRectId
property int scaGaus: 1
property real expGaus: 0.5
property int lenGaus: 10
property int deGaus: 0
Rectangle{
id: spinRectId
width: parent.width
height: parent.height
Row{
spacing: 15
x: spinRectId.x + 65
y: spinRectId.y + 80
Label{
height: parent.height
verticalAlignment: Text.AlignVCenter
text: "Scaling factor:"
font.pixelSize: 17
}
SpinBox{
id: scaleFactor
from:-10
to:10
value: 1
onValueChanged: {
spinRectId.updateSignal(scaleFactor.value, mm.spim.value/100, length.value, delay.value)
scaGaus = scaleFactor.value
}
}
}
Row{
spacing: 15
x: spinRectId.x + 5
y: spinRectId.y + 220
Label{
id: lbl
height: parent.height
verticalAlignment: Text.AlignVCenter
text: "Exponential Constant:"
font.pixelSize: 17
}
// Adjust CustomSpinBox value in CustomSpinBox qml file [from to]
CustomSpinBox{
id: mm
y: lbl.y - 20
x: lbl.x + 185
realValue: 0.5
realStepSize: 0.05
spim.onValueChanged: {
spinRectId.updateSignal(scaleFactor.value, spim.value/100, length.value, delay.value)
expGaus = spim.value/100
}
}
/*
SpinBox{
id: expConst
from:-10
to:10
onValueChanged: {
spinRectId.updateSignal(scaleFactor.value, expConst.value, length.value, delay.value)
expGaus = expConst.value
}
}
*/
}
Row{
spacing: 15
x: spinRectId.x + 115
y: spinRectId.y + 320
Label{
height: parent.height
verticalAlignment: Text.AlignVCenter
text: "Length:"
font.pixelSize: 17
}
SpinBox{
id: length
from: 1
to: 10
value: 10
onValueChanged: {
spinRectId.updateSignal(scaleFactor.value,mm.spim.value/100, length.value, delay.value)
lenGaus = length.value
}
}
}
Row{
spacing: 15
x: spinRectId.x + 125
y: spinRectId.y + 440
Label{
height: parent.height
verticalAlignment: Text.AlignVCenter
text: "Delay:"
font.pixelSize: 17
}
SpinBox{
id: delay
from: -10
to: 10
value: 0
onValueChanged: {
spinRectId.updateSignal(scaleFactor.value, mm.spim.value/100, length.value, delay.value)
deGaus = delay.value
}
}
}
function updateSignal(sc, ex, le, de){
sig.clear()
ccdemo.gauss(sc, ex, le, de)
var c = ccdemo.sig_gaus_y
var t = ccdemo.sig_gaus_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)
}
}
}