-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.qml
92 lines (79 loc) · 1.96 KB
/
main.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import QtQuick 2.9
import QtQuick.Controls 2.1
import QtCharts 2.1
import QtQuick.Layouts 1.15
import SimpleFOC 1.0
ApplicationWindow
{
width: 800
height: 600
SimpleFOCSerialScope
{
id: scope_
traces : SimpleFOCScope
{
id: ds_
chart: chart_
}
port: "/dev/ttyACM0"
bauds: 115200
headers: ['demo.h']
}
Timer
{
interval: 50
running: true
repeat: true
onTriggered:
{
if(ds_.dirty)
ds_.refresh();
}
}
ColumnLayout
{
anchors.fill: parent
Text{text: "port: " + scope_.port}
Text{text: "bauds: " + scope_.bauds}
Text{text: "headers: " + scope_.headers}
Button{text: "connect"; onClicked: scope_.beginListneing()}
RowLayout
{
Layout.fillWidth: true
Repeater
{
model: ds_.dataSources
CheckBox
{
text: modelData
onCheckedChanged: ds_.toggleDatasource(modelData)
Component.onCompleted: checked = true
}
}
}
ChartView
{
id: chart_
title: "Simple FOC Scope"
antialiasing: true
Layout.fillHeight: true
Layout.fillWidth: true
function createSeriesWithLabel(label)
{
// critical to put the serie in var before returning to workaround a pyside6 bug
return chart_.createSeries(ChartView.SeriesTypeLine, label, axisX, axisY);
// return line;
}
ValueAxis {
id: axisY
min: ds_.yMin
max: ds_.yMax
}
ValueAxis {
id: axisX
min: ds_.xMin
max: ds_.xMax
}
}
}
}