|
|
@@ -14,6 +14,16 @@ public class StationConfig {
|
|
|
private String lineSn;
|
|
|
private String serverIp;
|
|
|
|
|
|
+ // 允许启动
|
|
|
+ private String allowStart;
|
|
|
+ // 允许下料
|
|
|
+ private String allowDown;
|
|
|
+ // 开始加工
|
|
|
+ private String startMethod;
|
|
|
+ // 加工结束
|
|
|
+ private String stopMethod;
|
|
|
+ // 故障
|
|
|
+
|
|
|
public StationConfig(String gw, String gwDes, String lineSn, String serverIp) {
|
|
|
this.gw = gw;
|
|
|
this.gwDes = gwDes;
|
|
|
@@ -21,22 +31,82 @@ public class StationConfig {
|
|
|
this.serverIp = serverIp;
|
|
|
}
|
|
|
|
|
|
+ public StationConfig(String gw, String gwDes, String lineSn, String serverIp, String allowStart, String allowDown,
|
|
|
+ String startMethod, String stopMethod) {
|
|
|
+ this.gw = gw;
|
|
|
+ this.gwDes = gwDes;
|
|
|
+ this.lineSn = lineSn;
|
|
|
+ this.serverIp = serverIp;
|
|
|
+ this.allowStart = allowStart;
|
|
|
+ this.allowDown = allowDown;
|
|
|
+ this.startMethod = startMethod;
|
|
|
+ this.stopMethod = stopMethod;
|
|
|
+ }
|
|
|
+
|
|
|
public String getGw() {
|
|
|
return gw;
|
|
|
}
|
|
|
|
|
|
+ public void setGw(String gw) {
|
|
|
+ this.gw = gw;
|
|
|
+ }
|
|
|
+
|
|
|
public String getGwDes() {
|
|
|
return gwDes;
|
|
|
}
|
|
|
|
|
|
+ public void setGwDes(String gwDes) {
|
|
|
+ this.gwDes = gwDes;
|
|
|
+ }
|
|
|
+
|
|
|
public String getLineSn() {
|
|
|
return lineSn;
|
|
|
}
|
|
|
|
|
|
+ public void setLineSn(String lineSn) {
|
|
|
+ this.lineSn = lineSn;
|
|
|
+ }
|
|
|
+
|
|
|
public String getServerIp() {
|
|
|
return serverIp;
|
|
|
}
|
|
|
|
|
|
+ public void setServerIp(String serverIp) {
|
|
|
+ this.serverIp = serverIp;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getAllowStart() {
|
|
|
+ return allowStart;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setAllowStart(String allowStart) {
|
|
|
+ this.allowStart = allowStart;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getAllowDown() {
|
|
|
+ return allowDown;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setAllowDown(String allowDown) {
|
|
|
+ this.allowDown = allowDown;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getStartMethod() {
|
|
|
+ return startMethod;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setStartMethod(String startMethod) {
|
|
|
+ this.startMethod = startMethod;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getStopMethod() {
|
|
|
+ return stopMethod;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setStopMethod(String stopMethod) {
|
|
|
+ this.stopMethod = stopMethod;
|
|
|
+ }
|
|
|
+
|
|
|
public static List<StationConfig> loadAllStations() throws IOException {
|
|
|
List<StationConfig> stations = new ArrayList<>();
|
|
|
Properties props = new Properties();
|
|
|
@@ -53,10 +123,17 @@ public class StationConfig {
|
|
|
for (String gw : stationList.split(",")) {
|
|
|
gw = gw.trim();
|
|
|
String gwDes = props.getProperty("mes.station." + gw + ".name", gw);
|
|
|
- stations.add(new StationConfig(gw, gwDes, lineSn, serverIp));
|
|
|
+ String allowStart = props.getProperty("mes.station." + gw + ".allowStart", "");
|
|
|
+ String allowDown = props.getProperty("mes.station." + gw + ".allowDown", "");
|
|
|
+ String startMethod = props.getProperty("mes.station." + gw + ".startMethod", "");
|
|
|
+ String stopMethod = props.getProperty("mes.station." + gw + ".stopMethod", "");
|
|
|
+ stations.add(new StationConfig(gw, gwDes, lineSn, serverIp, allowStart, allowDown, startMethod, stopMethod));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return stations;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|