同进同出调试完成

dev
lisai17@sina.com 2020-12-22 16:32:02 +08:00
parent a547865c13
commit 92c29cd9ad
9 changed files with 21 additions and 16 deletions

View File

@ -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"));

View File

@ -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");
} }
} }

View File

@ -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");
} }
} }

View File

@ -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;

View File

@ -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");

View File

@ -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()

View File

@ -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();

View File

@ -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

View File

@ -59,14 +59,18 @@ public class SupermarketController extends BaseController {
Integer id = record.getInt("id"); Integer id = record.getInt("id");
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);
long st = c.getLong("tm"); if (c.get("tm") == null) {
// 五分钟以内的才进行判断超过5分钟的就认为是离线了
if (nowst - st < Const.SUP_OFFLINE_TIME) {
record.set("status", "在线");
} else {
record.set("status", "离线"); 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 { } else {
record.set("status", "离线"); record.set("status", "离线");