-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataWaveformHandler.java
More file actions
86 lines (54 loc) · 2.29 KB
/
Copy pathDataWaveformHandler.java
File metadata and controls
86 lines (54 loc) · 2.29 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
package wf.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import wf.model.Waveform;
public class DataWaveformHandler {
private static final DataWaveformHandler INSTANCE = new DataWaveformHandler();
//private final Map<Integer, ObservableList<Waveform>> ch1wf_map = new HashMap<Integer, ObservableList<Waveform>>();
//private final Map<Integer, ObservableList<Waveform>> ch2wf_map = new HashMap<Integer, ObservableList<Waveform>>();
//private final Map<Integer, ObservableList<Waveform>> ch3wf_map = new HashMap<Integer, ObservableList<Waveform>>();
//private final Map<Integer, ObservableList<Waveform>> ch4wf_map = new HashMap<Integer, ObservableList<Waveform>>();
private static ObservableList<Waveform> ch1wf = FXCollections.observableArrayList();
private static ObservableList<Waveform> ch2wf = FXCollections.observableArrayList();
private static ObservableList<Waveform> ch3wf = FXCollections.observableArrayList();
private static ObservableList<Waveform> ch4wf = FXCollections.observableArrayList();
private static List<ObservableList<Waveform>> wf_all = new ArrayList<ObservableList<Waveform>>(Arrays.asList(ch1wf, ch2wf, ch3wf, ch4wf));
//private final List<Map<Integer, ObservableList<Waveform>>> wf_map = new ArrayList<>();
public DataWaveformHandler() {
//create initial dummy record
//wf_all.add(ch1wf);
//wf_all.add(ch2wf);
//wf_all.add(ch3wf);
//wf_all.add(ch4wf);
//wf_map.add(ch1wf_map);
//wf_map.add(ch2wf_map);
//wf_map.add(ch3wf_map);
//wf_map.add(ch4wf_map);
}
public static ObservableList<Waveform> getCh1Waveforms() {
return ch1wf;
}
public static ObservableList<Waveform> getCh2Waveforms() {
return ch2wf;
}
public static ObservableList<Waveform> getCh3Waveforms() {
return ch3wf;
}
public static ObservableList<Waveform> getCh4Waveforms() {
return ch4wf;
}
public static List<ObservableList<Waveform>> getWaveforms() {
return wf_all;
}
public static void deleteWaveforms() {
for(int i = 0; i < 4; i++) {
wf_all.get(i).clear();
}
}
public static DataWaveformHandler getInstance() {
return INSTANCE;
}
}