2016-09-06 16:49:11 +02:00
|
|
|
package org.hwo.pulscounter.ui;
|
|
|
|
|
|
|
|
import org.hwo.pulscounter.ExportSetting;
|
2016-09-08 18:47:31 +02:00
|
|
|
import org.hwo.pulscounter.PulsCounterApplication;
|
2016-09-06 16:49:11 +02:00
|
|
|
import org.hwo.pulscounter.PulsCounterApplicationListener;
|
|
|
|
import org.hwo.servicelink.ServiceLinkException;
|
|
|
|
|
|
|
|
public class BatchRunner implements PulsCounterApplicationListener{
|
|
|
|
|
2016-09-08 18:47:31 +02:00
|
|
|
private PulsCounterApplication pulsCounterApplication;
|
2016-09-06 16:49:11 +02:00
|
|
|
|
2016-09-08 18:47:31 +02:00
|
|
|
public BatchRunner(PulsCounterApplication pulsCounterApplication){
|
|
|
|
this.pulsCounterApplication = pulsCounterApplication;
|
|
|
|
|
|
|
|
pulsCounterApplication.addPulsCounterApplicationListener(this);
|
|
|
|
|
|
|
|
pulsCounterApplication.notifyUiIsFinished(true);
|
2016-09-06 16:49:11 +02:00
|
|
|
|
2016-09-08 18:47:31 +02:00
|
|
|
// run();
|
2016-09-06 16:49:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void run(){
|
2016-09-13 12:07:01 +02:00
|
|
|
/*
|
2016-09-06 16:49:11 +02:00
|
|
|
try {
|
|
|
|
|
2016-09-08 18:47:31 +02:00
|
|
|
for (ExportSetting es: pulsCounterApplication.getExportSettings()){
|
2016-09-06 16:49:11 +02:00
|
|
|
if (es.getAutostart()){
|
|
|
|
es.export();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (ServiceLinkException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
// TODO Auto-generated catch block
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
2016-09-13 12:07:01 +02:00
|
|
|
*/
|
2016-09-08 18:47:31 +02:00
|
|
|
pulsCounterApplication.notifyUiIsFinished(false);
|
2016-09-06 16:49:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void messageArrived(String message) {
|
|
|
|
System.err.println(message);
|
|
|
|
}
|
2016-09-08 18:47:31 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void interfaceClassesChanged(PulsCounterApplication pulsCounterApplication) {
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void interfacesChanged(PulsCounterApplication pulsCounterApplication) {
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
}
|
2016-09-06 16:49:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|