| | |
| | | byte[] bytes = GlCreate.createStart2Cd(para.rtuAddr, para.commandCode); |
| | | if(para.param != null){ |
| | | DataCd80_5BVo cdData = (DataCd80_5BVo)para.param ; |
| | | byte[] bs = new byte[2] ; |
| | | byte[] bs = new byte[3] ; |
| | | bs[0] = (byte)(Integer.parseInt(cdData.getControllerType(), 16)); |
| | | bs[1] = cdData.projectNo.byteValue() ; |
| | | GlCreate.createTp(bs, 2) ; |
| | | bs[2] = 0x01 ;//01:成功 81:失败 |
| | | //GlCreate.createTp(bs, 2) ; |
| | | bytes = ByteUtil.bytesMerge(bytes, bs) ; |
| | | }else{ |
| | | throw new Exception("下行命令参数据为null") ; |
| | |
| | | cdData.projectNo = (int)bs[index]; |
| | | |
| | | index++ ; |
| | | GlParse.parseRtuDt(bs, index) ; |
| | | cdData.rtuDt = GlParse.parseRtuDt(bs, index) ; |
| | | |
| | | index += 6 ; |
| | | GlParse.parseAlarmAndState(bs, index, cdData) ; |
| | |
| | | * @return |
| | | */ |
| | | public static void parseAlarmAndState(byte[] bs, int index, AlarmVo vo){ |
| | | byte b = bs[index] ; |
| | | byte b = bs[index + 1] ; |
| | | vo.statePump = (byte)(b & 0x1) ; |
| | | vo.alarmWaterRemain = (byte)(b >> 1 & 1) ; |
| | | vo.alarm0WaterRemain = (byte)(b >> 2 & 1) ; |
| | |
| | | vo.alarmWaterMeterBreak = (byte)(b >> 6 & 1) ; |
| | | vo.alarmEleMeterFault = (byte)(b >> 7 & 1) ; |
| | | |
| | | index++ ; |
| | | b = bs[index] ; |
| | | vo.alarm0MoneyRemain = (byte)(b & 0x1) ; |
| | | vo.alarmInnerDoor = (byte)(b >> 1 & 1) ; |
| | |
| | | sb.append(" 三相电欠压 : ") ; |
| | | sb.append(alarmEleLowVolt == null?"未知":(alarmEleLowVolt.byteValue() == 0 ? "正常":(alarmEleLowVolt.byteValue() == 1 ? "报警":"未知"))) ; |
| | | sb.append("\n") ; |
| | | sb.append(" IC卡使能 : ") ; |
| | | sb.append(" 支持IC卡 : ") ; |
| | | sb.append(stateIcEnable == null?"未知":(stateIcEnable.byteValue() == 0 ? "支持":(stateIcEnable.byteValue() == 1 ? "不支持":"未知"))) ; |
| | | sb.append("\n") ; |
| | | |