I\'m trying do define an interface in which I want to plot some values received by an external device. These values are received with a frequency that can be set through the
Instead, use the original MilliDTSC & Millisecond, and invoke advanceTime() and append the old data as required before appending the new data. Using 200 ms as an example, do something like this:
float[] newData = new float[1];
float[] oldData = new float[1];
@Override
public void actionPerformed(ActionEvent e) {
newData[0] = randomValue();
oldData[0] = newData[0];
for (int i = 0; i < 200; i++) {
dataset.advanceTime();
dataset.appendData(oldData);
}
dataset.appendData(newData);
}
Note that there are now 5 samples/second, spaced 200 ms apart.
