RTC fixes
parent
c0286e6a2e
commit
098199123a
|
@ -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");
|
||||
|
||||
|
|
|
@ -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(){
|
||||
|
|
|
@ -77,4 +77,6 @@ public interface IDeviceConnector {
|
|||
|
||||
public void shutdown();
|
||||
|
||||
public void checkRealTimeClock();
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -303,4 +303,8 @@ public class SimulatedCounter implements IDeviceConnector {
|
|||
@Override
|
||||
public void shutdown() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkRealTimeClock() {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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(":");
|
||||
|
|
Loading…
Reference in New Issue