Browse Source

地磅错误提示、设备状态名称

985653680@qq.com 10 months ago
parent
commit
f283f5ee00

+ 8 - 2
src/main/java/com/gzlh/device/weighbridge/handler/impl/CommonWeighbridgeHandler.java

@@ -87,8 +87,14 @@ public class CommonWeighbridgeHandler {
                 //todo read timeout
                 //读取超时
                 DeviceCache.setInterrupt(true);
-                ThreadUtil.sleep(500);
-                eventBus.startEvent(ModuleEnum.WEIGHBRIDGE_MODULE.getModuleEn() + "." + WeighbridgeEvent.TIMEOUT);
+//                ThreadUtil.sleep(500);
+//                eventBus.startEvent(ModuleEnum.WEIGHBRIDGE_MODULE.getModuleEn() + "." + WeighbridgeEvent.TIMEOUT);
+                LedOptions options = new LedOptions().setLine("03").setColor("04").setShowType("0B");
+                SystemObject.ledFactory.handler(SysConfig.serialSetting.getLed().getBrand())
+                        .sendMsg("称重异常",options);
+
+                SystemObject.ledFactory.handler(SysConfig.serialSetting.getLed().getBrand())
+                        .sendMsg("请退出通道后并联系工作人员",options.setLine("04").setColor("01"));
                 return;
             }
             ApplicationConfig applicationConfig = SpringUtil.getBean(ApplicationConfig.class);

+ 5 - 5
src/main/java/com/gzlh/utils/DeviceCache.java

@@ -60,31 +60,31 @@ public class DeviceCache {
         DeviceStatus.Device capture =  new DeviceStatus.Device(caputreSetting.getHost(),
                 caputreSetting.getPort(),
                 LedBrandType.getBrandByCode(caputreSetting.getBrand()),
-                ModuleEnum.CAPTURE_MODULE.getModuleEn());
+                ModuleEnum.CAPTURE_MODULE.getModuleZh());
         deviceStatus.getDeviceList().add(capture);
 
         DeviceStatus.Device plc =  new DeviceStatus.Device(serialSetting.getHost(),
                 serialSetting.getPlc().getPort(),
                 "",
-                ModuleEnum.PLC_MODULE.getModuleEn());
+                ModuleEnum.PLC_MODULE.getModuleZh());
         deviceStatus.getDeviceList().add(plc);
 
         DeviceStatus.Device led = new DeviceStatus.Device(serialSetting.getHost(),
                 serialSetting.getLed().getPort(),
                 LedBrandType.getBrandByCode(serialSetting.getLed().getBrand()),
-                ModuleEnum.LED_MODULE.getModuleEn());
+                ModuleEnum.LED_MODULE.getModuleZh());
         deviceStatus.getDeviceList().add(led);
 
         DeviceStatus.Device weighbridge = new DeviceStatus.Device(serialSetting.getHost(),
                 serialSetting.getWeighbridge().getPort(),
                 WeighbridgeBrandType.getBrandByCode(serialSetting.getWeighbridge().getBrand()),
-                ModuleEnum.WEIGHBRIDGE_MODULE.getModuleEn());
+                ModuleEnum.WEIGHBRIDGE_MODULE.getModuleZh());
         deviceStatus.getDeviceList().add(weighbridge);
 
         DeviceStatus.Device electron = new DeviceStatus.Device(serialSetting.getHost(),
                 serialSetting.getElectron().getPort(),
                 ElectronBrandType.getBrandByCode(serialSetting.getElectron().getBrand()),
-                ModuleEnum.ELECTRON_MODULE.getModuleEn());
+                ModuleEnum.ELECTRON_MODULE.getModuleZh());
         deviceStatus.getDeviceList().add(electron);
     }