use of cl.utfsm.samplingSystemUI.core.DataItem in project ACS by ACS-Community.
the class Display2 method run.
public void run() {
//FileWriter fileW = new FileWriter(AcsInformation.getInstance(), SamplingManager.getInstance());
LinkedBlockingQueue<DataItem> cChannel;
Collection<DataItem> c = new LinkedList<DataItem>();
while (true) {
try {
if (stop == true)
return;
Thread.sleep(5000);
cChannel = ThreadCommunicator.getInstance().getChannel("NC_LAMP1_brightness_10000000_1");
if (cChannel == null)
continue;
cChannel.drainTo(c);
if (c.isEmpty())
continue;
for (DataItem item : c) {
//DataItem i = (DataItem)item;
System.out.println(item.getTime() + " " + item.getValue());
//fileW.initializeComponents();
//fileW.showData();
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
Aggregations