lisai17@sina.com 2020-09-22 21:34:03 +08:00
parent 3bc624b4f2
commit b9ce32de75
9 changed files with 49 additions and 13 deletions

View File

@ -303,6 +303,8 @@ public class DeviceThread extends Thread {
public boolean cmdResetFlow(String which) { public boolean cmdResetFlow(String which) {
for (Controller controller : controllers) { for (Controller controller : controllers) {
log.error("查找重置流程 %s", controller.getWhich());
if (controller.getWhich().equals(which)) { if (controller.getWhich().equals(which)) {
controller.setResetFlow(true); controller.setResetFlow(true);
controller.resetCurrentLicense(); controller.resetCurrentLicense();
@ -311,6 +313,8 @@ public class DeviceThread extends Thread {
} }
} }
log.error("未找到对应流程 %s", which);
return false; return false;
} }

View File

@ -62,6 +62,8 @@ public class InController extends Controller implements Runnable {
// 出现错位等情况时,需要重置流程,重新开始 // 出现错位等情况时,需要重置流程,重新开始
if (getResetFlow()) { if (getResetFlow()) {
log.debug("%s 【%s】 重置流程", getWhich(), getCurrentLicense());
try { try {
getPlc().write(plcSensor1Reset()); // 重置地感状态 getPlc().write(plcSensor1Reset()); // 重置地感状态
} catch (IOException e) { } catch (IOException e) {
@ -69,8 +71,10 @@ public class InController extends Controller implements Runnable {
} }
setResetFlow(false); // 重置流程 setResetFlow(false); // 重置流程
resetCurrentLicense(); // 重置当前流程中的车辆 resetCurrentLicense(); // 重置当前流程中的车辆
log.debug("%s 【%s】 重置流程", getWhich(), pair.license);
continue; // 2020-09-22
// 如果流程处理完成后,已经再等待车牌的时候点击了重置流程,实质上是没有进重置的
// 所以这里将旧的重置,但是流程继续
} }
// 将识别的到的车牌加入服务端队列 // 将识别的到的车牌加入服务端队列
@ -271,6 +275,18 @@ public class InController extends Controller implements Runnable {
resetCurrentLicense(); resetCurrentLicense();
log.debug("%s 【%s】流程处理完毕", getWhich(), pair.license); log.debug("%s 【%s】流程处理完毕", getWhich(), pair.license);
if (getResetFlow()) {
try {
getPlc().write("sensorIn2Reset");
} catch (IOException e) {
log.debug("%s 【%s】 重置地感线圈状态失败", getWhich(), pair.license);
log.error(e.getMessage(), e);
}
setResetFlow(false);
resetCurrentLicense();
continue;
}
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
} }

View File

@ -62,6 +62,8 @@ public class OutController extends Controller implements Runnable {
// 出现错位等情况时,需要重置流程,重新开始 // 出现错位等情况时,需要重置流程,重新开始
if (getResetFlow()) { if (getResetFlow()) {
log.debug("%s 【%s】 重置流程", getWhich(), getCurrentLicense());
try { try {
getPlc().write(plcSensor1Reset()); // 重置地感状态 getPlc().write(plcSensor1Reset()); // 重置地感状态
} catch (IOException e) { } catch (IOException e) {
@ -69,8 +71,10 @@ public class OutController extends Controller implements Runnable {
} }
setResetFlow(false); // 重置流程 setResetFlow(false); // 重置流程
resetCurrentLicense(); // 重置当前流程中的车辆 resetCurrentLicense(); // 重置当前流程中的车辆
log.debug("%s 【%s】 重置流程", getWhich(), pair.license);
continue; // 2020-09-22
// 如果流程处理完成后,已经再等待车牌的时候点击了重置流程,实质上是没有进重置的
// 所以这里将旧的重置,但是流程继续
} }
// 将识别的到的车牌加入服务端队列 // 将识别的到的车牌加入服务端队列
@ -270,6 +274,18 @@ public class OutController extends Controller implements Runnable {
resetCurrentLicense(); resetCurrentLicense();
log.debug("%s 【%s】流程处理完毕", getWhich(), pair.license); log.debug("%s 【%s】流程处理完毕", getWhich(), pair.license);
if (getResetFlow()) {
try {
getPlc().write("sensorOut2Reset");
} catch (IOException e) {
log.debug("%s 【%s】 重置地感线圈状态失败", getWhich(), pair.license);
log.error(e.getMessage(), e);
}
setResetFlow(false);
resetCurrentLicense();
continue;
}
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
} }

View File

@ -98,7 +98,7 @@ public class PLC extends Device {
try { try {
boolean f = this.socket != null && this.socket.isConnected() && !this.socket.isClosed(); boolean f = this.socket != null && this.socket.isConnected() && !this.socket.isClosed();
if (!f) { if (!f) {
log.debug("PLC 未连接或者连接已断开, %s", f); log.debug("PLC 未连接或者连接已断开, %s %s", this.getId(), this.getIp());
return false; return false;
} }
plcWrite("ping", (byte) 1, presetRead); plcWrite("ping", (byte) 1, presetRead);
@ -256,10 +256,10 @@ public class PLC extends Device {
public static void main(String[] args) { public static void main(String[] args) {
try { try {
PLC plc = new PLC("_plc", "192.168.20.20", 502, com.cowr.local.ssjygl.devicectrl.common.DeviceThread.defaultAddressTable); PLC plc = new PLC("_plc", "192.168.20.21", 502, com.cowr.local.ssjygl.devicectrl.common.DeviceThread.defaultAddressTable);
plc.connect(); plc.connect();
plc.isConnected(); plc.isConnected();
plc.write("rodIn1Down"); plc.write("rodOut2Down");
// plc.write("rodOut2Up"); // plc.write("rodOut2Up");
// plc.write("sensorIn2Reset"); // plc.write("sensorIn2Reset");

View File

@ -70,7 +70,7 @@ public class CellAddresses {
// 车牌号 // 车牌号
public static final CellAddress truckLicense = makeCellAddress("m11"); public static final CellAddress truckLicense = makeCellAddress("m11");
// 机打发票号码 // 机打发票号码
public static final CellAddress invoiceCode = makeCellAddress("o7"); // public static final CellAddress invoiceCode = makeCellAddress("o7");
public static Map<String, CellAddress> addrMap = new HashMap<>(); public static Map<String, CellAddress> addrMap = new HashMap<>();
@ -104,7 +104,7 @@ public class CellAddresses {
addrMap.put("remark", remark); addrMap.put("remark", remark);
addrMap.put("drawer", drawer); addrMap.put("drawer", drawer);
addrMap.put("truck_license", truckLicense); addrMap.put("truck_license", truckLicense);
addrMap.put("invoice_code", invoiceCode); // addrMap.put("invoice_code", invoiceCode);
// addrMap.put("haulerCo", haulerCo); // addrMap.put("haulerCo", haulerCo);
} }

View File

@ -381,7 +381,7 @@ public class Config extends JFinalConfig {
// 这边将 生产 环境运行目录写死,只有在这个目录下运行时,才算 生产 环境 // 这边将 生产 环境运行目录写死,只有在这个目录下运行时,才算 生产 环境
String path = PathKit.getWebRootPath(); String path = PathKit.getWebRootPath();
log.debug("WebRootPath:", path); log.debug("WebRootPath:", path);
String linux_dev_dir = "/home/a/ssjy_xsx"; String linux_dev_dir = "/home/a/ssjy_xsx/ssjygl-xsx-local-release";
if (linux_dev_dir.equals(path)) { if (linux_dev_dir.equals(path)) {
ENV = "prod"; ENV = "prod";

View File

@ -10,7 +10,7 @@ socketserver.port=21002
socketio.port=12002 socketio.port=12002
#当前部署本地程序的砂站id #当前部署本地程序的砂站id
current.supermarket_id=1 current.supermarket_id=6
#打印用到的配置信息 #打印用到的配置信息
print.vendor=浠水县长投环保有限公司 print.vendor=浠水县长投环保有限公司

View File

@ -4,7 +4,7 @@ jdbcUrl=jdbc:mysql://rm-wz9wa070076b2uge2ro.mysql.rds.aliyuncs.com:3306/ssjy_xsx
user=dev_ssjy_xsx user=dev_ssjy_xsx
password=Ssjy_xs_890 password=Ssjy_xs_890
#jdbcUrl=jdbc:mysql://localhost:3306/ssjy_xsx_dev?characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&useInformationSchema=true&serverTimezone=GMT%2B8&autoReconnect=true #jdbcUrl=jdbc:mysql://192.168.20.2:3306/ssjy_xsx_dev?characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&useInformationSchema=true&serverTimezone=GMT%2B8&autoReconnect=true
#user=root #user=root
#password=Ssjy_xsx_890 #password=Ssjy_xsx_890

View File

@ -10,7 +10,7 @@ socketserver.port=21002
socketio.port=12002 socketio.port=12002
#当前部署本地程序的砂站id #当前部署本地程序的砂站id
current.supermarket_id=2 current.supermarket_id=6
#打印用到的配置信息 #打印用到的配置信息
print.vendor=浠水县长投环保有限公司 print.vendor=浠水县长投环保有限公司