RTC fixes

WIP-PC2
Harald Christian Joachim Wolff 2018-01-15 18:33:28 +01:00
parent c0286e6a2e
commit 098199123a
6 changed files with 17 additions and 7 deletions

View File

@ -11,7 +11,6 @@ public class Application {
Logging.Init(args, "synololog.log");
PulsCounterApplication application = new PulsCounterApplication(args);
log(LogLevel.INFO,"Application initialized, starting up user interface");

View File

@ -259,11 +259,11 @@ public class PulsCounterApplication implements ServiceLinkListener{
waitUiFinished();
ShutdownNotification sn = new ShutdownNotification();
if (Component.class.isInstance(ui)){
sn.setLocationRelativeTo((Component)ui);
}
sn.setVisible(true);
// ShutdownNotification sn = new ShutdownNotification();
// if (Component.class.isInstance(ui)){
// sn.setLocationRelativeTo((Component)ui);
// }
// sn.setVisible(true);
try {
@ -273,7 +273,7 @@ public class PulsCounterApplication implements ServiceLinkListener{
log(e);
}
sn.setVisible(false);
// sn.setVisible(false);
}
private void initialize(){

View File

@ -77,4 +77,6 @@ public interface IDeviceConnector {
public void shutdown();
public void checkRealTimeClock();
}

View File

@ -118,6 +118,8 @@ public class SimpleLinkDeviceConnector implements IDeviceConnector {
public int[] getCounters() {
checkOpen();
checkRealTimeClock();
try {
return ArrayHelper.unbox(this.simpleLink.readInt(0x0600,32));
} catch (ServiceLinkException | IOException e){
@ -734,6 +736,8 @@ public class SimpleLinkDeviceConnector implements IDeviceConnector {
Calendar calendar = Calendar.getInstance();
try {
checkOpen();
Integer deviceTime = simpleLink.readInt(0x001C);
Long currentTime = (System.currentTimeMillis()/1000);

View File

@ -303,4 +303,8 @@ public class SimulatedCounter implements IDeviceConnector {
@Override
public void shutdown() {
}
@Override
public void checkRealTimeClock() {
}
}

View File

@ -26,6 +26,7 @@ public class BatchRunner implements PulsCounterApplicationListener{
}
public void run(){
pulsCounterApplication.getInterfaces().get(0).checkRealTimeClock();
for (String cmd: pulsCounterApplication.getBatchCommands()){
String[] tokens = cmd.split(":");