Merge branch 'main' into teya-integration

This commit is contained in:
hugh-unicenta
2023-11-10 17:56:41 +00:00
committed by GitHub
8 changed files with 134 additions and 72 deletions
@@ -61,6 +61,14 @@ public class JRootFrame extends javax.swing.JFrame implements AppMessage {
initComponents();
}
public JRootApp getRootapp() {
return m_rootapp;
}
public void setRootapp(JRootApp m_rootapp) {
this.m_rootapp = m_rootapp;
}
/**
* @param props
*/
@@ -98,6 +106,7 @@ public class JRootFrame extends javax.swing.JFrame implements AppMessage {
new JFrmConfig(props).setVisible(true); // Show the configuration window.
}
setRootapp(m_rootapp);
}
/**
@@ -98,7 +98,6 @@ public class StartPOS {
String hostname = config.getProperty("machine.hostname");
TicketInfo.setHostname(hostname);
applicationStarted(hostname);
String screenmode = config.getProperty("machine.screenmode");
@@ -106,6 +105,8 @@ public class StartPOS {
JRootKiosk rootkiosk = new JRootKiosk();
try {
rootkiosk.initFrame(config);
applicationStarted(hostname, rootkiosk.getRootapp());
} catch (IOException ex) {
log.error(ex.getMessage());
}
@@ -113,18 +114,25 @@ public class StartPOS {
JRootFrame rootframe = new JRootFrame();
try {
rootframe.initFrame(config);
applicationStarted(hostname, rootframe.getRootapp());
} catch (Exception ex) {
log.error(ex.getMessage());
}
}
});
}
private static void applicationStarted(String host) {
private static void applicationStarted(String host, JRootApp jRootApp) {
new Thread(() -> {
Metrics metrics = new Metrics();
metrics.setDevice(host);
metrics.setUniCentaVersion(AppLocal.APP_VERSION);
new Application().postMetrics(metrics);
try {
Metrics metrics = new Metrics();
metrics.setDevice(host);
metrics.setUniCentaVersion(AppLocal.APP_VERSION);
Application application = new Application();
application.postMetrics(metrics);
application.startEventListener(host, jRootApp);
} catch (Exception e) {
log.error("Problem with starting the uniCenta plugin application:${}", e.getMessage());
}
}).start();
}
}