-
Notifications
You must be signed in to change notification settings - Fork 0
/
GraphView.qml
69 lines (61 loc) · 1.56 KB
/
GraphView.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
64
65
66
67
68
69
import QtQuick 2.15
import QtCharts 2.15
ChartView {
id: chartView
width: 600
height: 400
title: "SNR pattern"
property int graphIndex
ValueAxis {
id: axisY1
min: 0
max: 1
labelFormat: "%ddB"
}
ValueAxis {
id: axisX
min: 0
max: 32
labelFormat: "Sec%02d"
}
LineSeries {
id: lineSeriesId
name: "signal 1"
axisX: axisX
axisY: axisY1
useOpenGL: true
}
Connections {
target: dataStream
function onSeries1Update(minValue, maxValue) {
if (graphIndex === 1) {
axisY1.max = Math.ceil(maxValue/10) * 10;
}
}
function onSeries2Update(minValue, maxValue) {
if (graphIndex === 2) {
axisY1.max = Math.ceil(maxValue/10) * 10;
}
}
function onSeries3Update(minValue, maxValue) {
if (graphIndex === 3) {
axisY1.max = Math.ceil(maxValue/10) * 10;
}
}
// function seriesUpdate(minValue, maxValue) {
// if (graphIndex === 4) {
// axisY1.max = Math.ceil(maxValue/10) * 10;
// }
// }
}
Component.onCompleted: {
console.log("Chartview load completed.")
if (graphIndex === 1) {
dataStream.series1 = lineSeriesId
} else if (graphIndex === 2) {
dataStream.series2 = lineSeriesId
} else if (graphIndex === 3) {
dataStream.series3 = lineSeriesId
}
}
}