|
@@ -41,6 +41,7 @@ public class MesClient extends JFrame {
|
|
|
public static int mes_heart_beat_cycle = 10; // 心跳周期
|
|
public static int mes_heart_beat_cycle = 10; // 心跳周期
|
|
|
public static int mes_heart_icon_cycle = 1;
|
|
public static int mes_heart_icon_cycle = 1;
|
|
|
public static String mes_line_sn = ""; // 产线编号
|
|
public static String mes_line_sn = ""; // 产线编号
|
|
|
|
|
+ public static String client_version = "0.0.0"; // 打包发布版本,需和后台 JAR 管理版本号对齐
|
|
|
|
|
|
|
|
//session
|
|
//session
|
|
|
public static String sessionid = "";
|
|
public static String sessionid = "";
|
|
@@ -139,6 +140,9 @@ public class MesClient extends JFrame {
|
|
|
public static TaskParam curTaskParam = null;
|
|
public static TaskParam curTaskParam = null;
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
|
|
|
+ if (ClientUpgrade.handleInstallArgs(args)) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
if (LockUtil.getInstance().isAppActive() == true){
|
|
if (LockUtil.getInstance().isAppActive() == true){
|
|
|
// JOptionPane.showMessageDialog(null, "已有一个程序在运行,程序退出");
|
|
// JOptionPane.showMessageDialog(null, "已有一个程序在运行,程序退出");
|
|
|
return;
|
|
return;
|
|
@@ -149,6 +153,11 @@ public class MesClient extends JFrame {
|
|
|
try{
|
|
try{
|
|
|
//读文件配置
|
|
//读文件配置
|
|
|
readProperty();
|
|
readProperty();
|
|
|
|
|
+ if (ClientUpgrade.recoverIncompleteInstall()) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ ClientUpgrade.cleanupInstallLeftovers();
|
|
|
|
|
+ ClientUpgrade.checkIfConfigured(null);
|
|
|
|
|
|
|
|
// 显示界面
|
|
// 显示界面
|
|
|
mesClientFrame = new MesClient();
|
|
mesClientFrame = new MesClient();
|
|
@@ -218,6 +227,13 @@ public class MesClient extends JFrame {
|
|
|
}, 100, 1* 1000);
|
|
}, 100, 1* 1000);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private static String parseClientVersion(String value) {
|
|
|
|
|
+ if (value == null || value.trim().isEmpty()) {
|
|
|
|
|
+ return "0.0.0";
|
|
|
|
|
+ }
|
|
|
|
|
+ return ClientVersionUtils.normalize(value.trim());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//读配置文件
|
|
//读配置文件
|
|
|
private static void readProperty() throws IOException{
|
|
private static void readProperty() throws IOException{
|
|
|
String enconding = "UTF-8";
|
|
String enconding = "UTF-8";
|
|
@@ -225,6 +241,7 @@ public class MesClient extends JFrame {
|
|
|
Properties pro = new Properties();
|
|
Properties pro = new Properties();
|
|
|
BufferedReader br = new BufferedReader(new InputStreamReader(is, enconding));
|
|
BufferedReader br = new BufferedReader(new InputStreamReader(is, enconding));
|
|
|
pro.load(br);
|
|
pro.load(br);
|
|
|
|
|
+ client_version = parseClientVersion(pro.getProperty("mes.client.version"));
|
|
|
mes_server_ip = pro.getProperty("mes.server_ip");
|
|
mes_server_ip = pro.getProperty("mes.server_ip");
|
|
|
mes_heart_beat_cycle = Integer.parseInt(pro.getProperty("mes.heart_beat_cycle"));
|
|
mes_heart_beat_cycle = Integer.parseInt(pro.getProperty("mes.heart_beat_cycle"));
|
|
|
String gw = pro.getProperty("mes.gw");
|
|
String gw = pro.getProperty("mes.gw");
|