12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- package com.gzlh.infrared.handler.impl;
- import cn.hutool.core.util.StrUtil;
- import cn.hutool.extra.spring.SpringUtil;
- import com.gzlh.config.ModuleEnum;
- import com.gzlh.event.EventBus;
- import com.gzlh.infrared.action.InfraredAction;
- import com.gzlh.led.factory.LedFactory;
- import com.gzlh.led.handler.ILedHandler;
- import com.gzlh.led.properties.LedPropertiesConfig;
- import com.gzlh.infrared.brand.RedBrandType;
- import com.gzlh.infrared.handler.IRedHandler;
- import com.gzlh.weighbridge.config.WeighbridgePropertiesConfig;
- import com.gzlh.weighbridge.factory.WeighbridgeFactory;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.stereotype.Service;
- import javax.annotation.Resource;
- /**
- * 聚英翱翔电子 01082899821 聚英翱翔电子,按0,转技术电话
- * dam0404d 品牌
- */
- @Service
- @Slf4j
- public class RedHandlerSoarDAM0404 implements IRedHandler {
- /**
- * 断开的信号
- */
- private final static String FIRST_BREAK_SIGNAL = "01 02 01 02 20 49";
- /**
- * 从断开到闭合
- */
- private final static String FIRST_LINK_SIGNAL = "01 02 01 03 E1 89";
- @Override
- public RedBrandType brandType() {
- return RedBrandType.SHANGHAI_YANGBAND_BX;
- }
- @Override
- public void handlerMsg(String content) {
- log.info(RedBrandType.SHANGHAI_YANGBAND_BX.getBrand() + "对红外处理消息:{}", content);
- content = StrUtil.replace(content, " ", "").toUpperCase();
- //进 被遮挡
- if (StrUtil.equals(StrUtil.replace(FIRST_BREAK_SIGNAL, " ", ""), content)) {
- //todo test msg
- }else if (StrUtil.equals(StrUtil.replace(FIRST_LINK_SIGNAL, " ", ""), content)){
- EventBus eventBus= SpringUtil.getBean(EventBus.class);
- // //入红外被挡住
- // eventBus.handlerEvent(ModuleEnum.INFRARED_MODULE.getModuleEn()+"."+ InfraredAction.IN_BREAK);
- eventBus.start(ModuleEnum.INFRARED_MODULE.getModuleEn(),ModuleEnum.INFRARED_MODULE.getModuleEn()+"."+ InfraredAction.IN_BREAK);
- }
- }
- @Override
- public void handlerAction(String action) {
- }
- }
|