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