同进同出调试完成
parent
a547865c13
commit
92c29cd9ad
|
|
@ -195,7 +195,7 @@ public class DeviceThread extends Thread {
|
||||||
}
|
}
|
||||||
} else if (supermarket_id == 7) {
|
} else if (supermarket_id == 7) {
|
||||||
scale = new KeLiScale(which + "_scale", scaleconf.getString("ip"), scaleconf.getIntValue("port"));
|
scale = new KeLiScale(which + "_scale", scaleconf.getString("ip"), scaleconf.getIntValue("port"));
|
||||||
} else if (supermarket_id == 9) {
|
} else if (supermarket_id == 8 || supermarket_id == 9) {
|
||||||
scale = new DingsongScale(which + "_scale", scaleconf.getString("ip"), scaleconf.getIntValue("port"));
|
scale = new DingsongScale(which + "_scale", scaleconf.getString("ip"), scaleconf.getIntValue("port"));
|
||||||
} else {
|
} else {
|
||||||
scale = new XiShuiScale(which + "_scale", scaleconf.getString("ip"), scaleconf.getIntValue("port"));
|
scale = new XiShuiScale(which + "_scale", scaleconf.getString("ip"), scaleconf.getIntValue("port"));
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,10 @@ public class InController extends Controller implements Runnable {
|
||||||
setRod1Up("rodIn1Up");
|
setRod1Up("rodIn1Up");
|
||||||
}
|
}
|
||||||
if (StrKit.isBlank(sensor1Reset)) {
|
if (StrKit.isBlank(sensor1Reset)) {
|
||||||
setRod1Up("sensorIn1Reset");
|
setSensor1Reset("sensorIn1Reset");
|
||||||
}
|
}
|
||||||
if (StrKit.isBlank(sensor1)) {
|
if (StrKit.isBlank(sensor1)) {
|
||||||
setRod1Up("sensorIn1");
|
setSensor1("sensorIn1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,10 +29,10 @@ public class OutController extends Controller implements Runnable {
|
||||||
setRod1Up("rodOut1Up");
|
setRod1Up("rodOut1Up");
|
||||||
}
|
}
|
||||||
if (StrKit.isBlank(sensor1Reset)) {
|
if (StrKit.isBlank(sensor1Reset)) {
|
||||||
setRod1Up("sensorOut1Reset");
|
setSensor1Reset("sensorOut1Reset");
|
||||||
}
|
}
|
||||||
if (StrKit.isBlank(sensor1)) {
|
if (StrKit.isBlank(sensor1)) {
|
||||||
setRod1Up("sensorOut1");
|
setSensor1("sensorOut1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ public abstract class AbsScale extends Device {
|
||||||
|
|
||||||
public void disconnect() {
|
public void disconnect() {
|
||||||
try {
|
try {
|
||||||
log.debug("销毁称重连接");
|
log.debug("销毁称重连接 " + this.getClass());
|
||||||
if (socket != null) {
|
if (socket != null) {
|
||||||
socket.close();
|
socket.close();
|
||||||
socket = null;
|
socket = null;
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,7 @@ public class PLC extends Device {
|
||||||
plc.connect();
|
plc.connect();
|
||||||
plc.isConnected();
|
plc.isConnected();
|
||||||
// plc.write("rodIn1Down");
|
// plc.write("rodIn1Down");
|
||||||
String cmd = "rodIn2Down";
|
String cmd = "rodIn1Down";
|
||||||
plc.write(cmd);
|
plc.write(cmd);
|
||||||
|
|
||||||
// plc.write("sensorIn2Reset");
|
// plc.write("sensorIn2Reset");
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ public class Config extends JFinalConfig {
|
||||||
public static DeviceThread deviceThread = new DeviceThread();
|
public static DeviceThread deviceThread = new DeviceThread();
|
||||||
public static SocketIOService socketio = null;
|
public static SocketIOService socketio = null;
|
||||||
private static boolean client_run = true;
|
private static boolean client_run = true;
|
||||||
public static final String CLINET_VERSION = "20201218";
|
public static final String CLINET_VERSION = "20201222";
|
||||||
|
|
||||||
public static String getRootPath() {
|
public static String getRootPath() {
|
||||||
return PathKit.getWebRootPath()
|
return PathKit.getWebRootPath()
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ public class Main {
|
||||||
log.info("====================================================");
|
log.info("====================================================");
|
||||||
log.info("========= 启动本地服务 ==============");
|
log.info("========= 启动本地服务 ==============");
|
||||||
log.info("========= PID: %s ==============", pid);
|
log.info("========= PID: %s ==============", pid);
|
||||||
|
log.info("========= ver: %s ===========", Config.CLINET_VERSION);
|
||||||
|
|
||||||
boolean isprod = Config.isProd();
|
boolean isprod = Config.isProd();
|
||||||
String path = PathKit.getWebRootPath();
|
String path = PathKit.getWebRootPath();
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ socketserver.port=21002
|
||||||
socketio.port=12002
|
socketio.port=12002
|
||||||
|
|
||||||
#当前部署本地程序的砂站id
|
#当前部署本地程序的砂站id
|
||||||
current.supermarket_id=9
|
current.supermarket_id=8
|
||||||
#落杆后,等待上磅的时间
|
#落杆后,等待上磅的时间
|
||||||
default_scale_wait_time=8000
|
default_scale_wait_time=8000
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,9 @@ public class SupermarketController extends BaseController {
|
||||||
|
|
||||||
if (SvrCacheData.SUP_HEARTBEAT.containsKey(id)) {
|
if (SvrCacheData.SUP_HEARTBEAT.containsKey(id)) {
|
||||||
Record c = SvrCacheData.SUP_HEARTBEAT.get(id);
|
Record c = SvrCacheData.SUP_HEARTBEAT.get(id);
|
||||||
|
if (c.get("tm") == null) {
|
||||||
|
record.set("status", "离线");
|
||||||
|
} else {
|
||||||
long st = c.getLong("tm");
|
long st = c.getLong("tm");
|
||||||
|
|
||||||
// 五分钟以内的才进行判断,超过5分钟的,就认为是离线了
|
// 五分钟以内的才进行判断,超过5分钟的,就认为是离线了
|
||||||
|
|
@ -68,6 +71,7 @@ public class SupermarketController extends BaseController {
|
||||||
} else {
|
} else {
|
||||||
record.set("status", "离线");
|
record.set("status", "离线");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
record.set("status", "离线");
|
record.set("status", "离线");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue