|
|
|
@ -1,5 +1,6 @@
|
|
|
|
package com.zhehekeji.web.service;
|
|
|
|
package com.zhehekeji.web.service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.zhehekeji.web.lib.PtzControlModule;
|
|
|
|
import io.netty.buffer.ByteBuf;
|
|
|
|
import io.netty.buffer.ByteBuf;
|
|
|
|
import io.netty.channel.ChannelHandlerContext;
|
|
|
|
import io.netty.channel.ChannelHandlerContext;
|
|
|
|
import io.netty.handler.codec.FixedLengthFrameDecoder;
|
|
|
|
import io.netty.handler.codec.FixedLengthFrameDecoder;
|
|
|
|
@ -90,12 +91,16 @@ public class MyProtocolDecoder extends FixedLengthFrameDecoder {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (type.equals(ACTION)) {
|
|
|
|
} else if (type.equals(ACTION)) {
|
|
|
|
log.info("action code,{} plcId:{},orderInfo:{}", code, plcId, plcOrderInfo.toString());
|
|
|
|
log.info("action code,{} plcId:{},orderInfo:{}", code, plcId, plcOrderInfo.toString());
|
|
|
|
if(!code.equals("C6")){
|
|
|
|
if(!code.equals("C6") && !code.equals("C7")){
|
|
|
|
|
|
|
|
// C1-5 是执行动作,需要保存执行到第几步了
|
|
|
|
Integer times = OrderAction.put(plcOrderInfo.getOrderNum());
|
|
|
|
Integer times = OrderAction.put(plcOrderInfo.getOrderNum());
|
|
|
|
//执行动作
|
|
|
|
//执行动作
|
|
|
|
plcService.action(plcOrderInfo, plcId, times, code);
|
|
|
|
plcService.action(plcOrderInfo, plcId, times, code);
|
|
|
|
|
|
|
|
} else if(code.equals("C7")){
|
|
|
|
|
|
|
|
//旋转360 然后发送C8命令
|
|
|
|
|
|
|
|
plcService.turn360AndC8(plcId);
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
// if(){}
|
|
|
|
// 其他命令执行动作
|
|
|
|
plcService.action(plcOrderInfo, plcId, 1, code);
|
|
|
|
plcService.action(plcOrderInfo, plcId, 1, code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (type.equals(WARN)) {
|
|
|
|
} else if (type.equals(WARN)) {
|
|
|
|
|