RTC fixes
parent
c0286e6a2e
commit
098199123a
|
@ -11,7 +11,6 @@ public class Application {
|
||||||
Logging.Init(args, "synololog.log");
|
Logging.Init(args, "synololog.log");
|
||||||
|
|
||||||
PulsCounterApplication application = new PulsCounterApplication(args);
|
PulsCounterApplication application = new PulsCounterApplication(args);
|
||||||
|
|
||||||
|
|
||||||
log(LogLevel.INFO,"Application initialized, starting up user interface");
|
log(LogLevel.INFO,"Application initialized, starting up user interface");
|
||||||
|
|
||||||
|
|
|
@ -259,11 +259,11 @@ public class PulsCounterApplication implements ServiceLinkListener{
|
||||||
|
|
||||||
waitUiFinished();
|
waitUiFinished();
|
||||||
|
|
||||||
ShutdownNotification sn = new ShutdownNotification();
|
// ShutdownNotification sn = new ShutdownNotification();
|
||||||
if (Component.class.isInstance(ui)){
|
// if (Component.class.isInstance(ui)){
|
||||||
sn.setLocationRelativeTo((Component)ui);
|
// sn.setLocationRelativeTo((Component)ui);
|
||||||
}
|
// }
|
||||||
sn.setVisible(true);
|
// sn.setVisible(true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
@ -273,7 +273,7 @@ public class PulsCounterApplication implements ServiceLinkListener{
|
||||||
log(e);
|
log(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
sn.setVisible(false);
|
// sn.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initialize(){
|
private void initialize(){
|
||||||
|
|
|
@ -77,4 +77,6 @@ public interface IDeviceConnector {
|
||||||
|
|
||||||
public void shutdown();
|
public void shutdown();
|
||||||
|
|
||||||
|
public void checkRealTimeClock();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,6 +118,8 @@ public class SimpleLinkDeviceConnector implements IDeviceConnector {
|
||||||
public int[] getCounters() {
|
public int[] getCounters() {
|
||||||
checkOpen();
|
checkOpen();
|
||||||
|
|
||||||
|
checkRealTimeClock();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return ArrayHelper.unbox(this.simpleLink.readInt(0x0600,32));
|
return ArrayHelper.unbox(this.simpleLink.readInt(0x0600,32));
|
||||||
} catch (ServiceLinkException | IOException e){
|
} catch (ServiceLinkException | IOException e){
|
||||||
|
@ -734,6 +736,8 @@ public class SimpleLinkDeviceConnector implements IDeviceConnector {
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
checkOpen();
|
||||||
|
|
||||||
Integer deviceTime = simpleLink.readInt(0x001C);
|
Integer deviceTime = simpleLink.readInt(0x001C);
|
||||||
Long currentTime = (System.currentTimeMillis()/1000);
|
Long currentTime = (System.currentTimeMillis()/1000);
|
||||||
|
|
||||||
|
|
|
@ -303,4 +303,8 @@ public class SimulatedCounter implements IDeviceConnector {
|
||||||
@Override
|
@Override
|
||||||
public void shutdown() {
|
public void shutdown() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void checkRealTimeClock() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ public class BatchRunner implements PulsCounterApplicationListener{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run(){
|
public void run(){
|
||||||
|
pulsCounterApplication.getInterfaces().get(0).checkRealTimeClock();
|
||||||
|
|
||||||
for (String cmd: pulsCounterApplication.getBatchCommands()){
|
for (String cmd: pulsCounterApplication.getBatchCommands()){
|
||||||
String[] tokens = cmd.split(":");
|
String[] tokens = cmd.split(":");
|
||||||
|
|
Loading…
Reference in New Issue