diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/BmsChargingDataLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/BmsChargingDataLogic.java index 6ce9cfa6..de5b3054 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/BmsChargingDataLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/BmsChargingDataLogic.java @@ -27,45 +27,46 @@ public class BmsChargingDataLogic implements ServiceLogic { public ServiceResult service(ServiceParameter sp) throws Exception { Map req = sp.getParameters(); - String hex = (String) req.get("hex"); - int idxStart = 60; - int hibsn = Integer.parseInt(hex.substring(idxStart, 2 + idxStart), 16);//BMS 最高单体动力蓄电池电压所在编号 - idxStart = 2 + idxStart; - int hibtemp = Integer.parseInt(hex.substring(idxStart, 2 + idxStart), 16) - 50;//BMS 最高动力蓄电池温度 - idxStart = 2 + idxStart; - int hibtempchkpt = Integer.parseInt(hex.substring(idxStart, 2 + idxStart), 16);//最高温度检测点编号 - idxStart = 2 + idxStart; - int lobtemp = Integer.parseInt(hex.substring(idxStart, 2 + idxStart), 16) - 50;//最低动力蓄电池温度 - idxStart = 2 + idxStart; - int lobtempchkpt = Integer.parseInt(hex.substring(idxStart, 2 + idxStart), 16);//最低动力蓄电池温度检测点编号 - idxStart = 2 + idxStart; - String flags1 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart));//前4检测标识位 - idxStart = 2 + idxStart; - String flags2 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart));//后4检测标识位 - idxStart = 0; - String flag = flags1.substring(idxStart, 2 + idxStart); - idxStart = 2 + idxStart; - String sb = flag.equals("00") ? "正常" : (flag.equals("01") ? "过高" : "正常");//BMS 单体动力蓄电池电压过高/过低 - flag = flags1.substring(idxStart, 2 + idxStart); - idxStart = 2 + idxStart; - String wb = flag.equals("00") ? "正常" : (flag.equals("01") ? "过高" : "正常");//BMS 整车动力蓄电池荷电状态SOC 过高/过低 - flag = flags1.substring(idxStart, 2 + idxStart); - idxStart = 2 + idxStart; - String pbovcurrency = flag.equals("00") ? "正常" : (flag.equals("01") ? "过流" : "不可信状态");//BMS 动力蓄电池充电过电流 - flag = flags1.substring(idxStart, 2 + idxStart); - String pbtemphi = flag.equals("00") ? "正常" : (flag.equals("01") ? "过高" : "不可信状态");//BMS 动力蓄电池温度过高 - idxStart = 0; - flag = flags1.substring(idxStart, 2 + idxStart); - idxStart = 2 + idxStart; - String pbinsulation = flag.equals("00") ? "正常" : (flag.equals("01") ? "不正常" : "不可信状态");//BMS 动力蓄电池绝缘状态 - flag = flags2.substring(idxStart, 2 + idxStart); - idxStart = 2 + idxStart; - String pboconn = flag.equals("00") ? "正常" : (flag.equals("01") ? "不正常" : "不可信状态");//BMS 动力蓄电池组输出连接器连接状态 - flag = flags2.substring(idxStart, 2 + idxStart); - idxStart = 2 + idxStart; - String chargingForbidden = flag.equals("00") ? "禁止" : "允许";//充电禁止 - flag = flags2.substring(idxStart, 2 + idxStart); - String reserved = flag;//预留位 +//todo test only +// String hex = (String) req.get("hex"); +// int idxStart = 60; +// int hibsn = Integer.parseInt(hex.substring(idxStart, 2 + idxStart), 16);//BMS 最高单体动力蓄电池电压所在编号 +// idxStart = 2 + idxStart; +// int hibtemp = Integer.parseInt(hex.substring(idxStart, 2 + idxStart), 16) - 50;//BMS 最高动力蓄电池温度 +// idxStart = 2 + idxStart; +// int hibtempchkpt = Integer.parseInt(hex.substring(idxStart, 2 + idxStart), 16);//最高温度检测点编号 +// idxStart = 2 + idxStart; +// int lobtemp = Integer.parseInt(hex.substring(idxStart, 2 + idxStart), 16) - 50;//最低动力蓄电池温度 +// idxStart = 2 + idxStart; +// int lobtempchkpt = Integer.parseInt(hex.substring(idxStart, 2 + idxStart), 16);//最低动力蓄电池温度检测点编号 +// idxStart = 2 + idxStart; +// String flags1 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart));//前4检测标识位 +// idxStart = 2 + idxStart; +// String flags2 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart));//后4检测标识位 +// idxStart = 0; +// String flag = flags1.substring(idxStart, 2 + idxStart); +// idxStart = 2 + idxStart; +// String sb = flag.equals("00") ? "正常" : (flag.equals("01") ? "过高" : "正常");//BMS 单体动力蓄电池电压过高/过低 +// flag = flags1.substring(idxStart, 2 + idxStart); +// idxStart = 2 + idxStart; +// String wb = flag.equals("00") ? "正常" : (flag.equals("01") ? "过高" : "正常");//BMS 整车动力蓄电池荷电状态SOC 过高/过低 +// flag = flags1.substring(idxStart, 2 + idxStart); +// idxStart = 2 + idxStart; +// String pbovcurrency = flag.equals("00") ? "正常" : (flag.equals("01") ? "过流" : "不可信状态");//BMS 动力蓄电池充电过电流 +// flag = flags1.substring(idxStart, 2 + idxStart); +// String pbtemphi = flag.equals("00") ? "正常" : (flag.equals("01") ? "过高" : "不可信状态");//BMS 动力蓄电池温度过高 +// idxStart = 0; +// flag = flags1.substring(idxStart, 2 + idxStart); +// idxStart = 2 + idxStart; +// String pbinsulation = flag.equals("00") ? "正常" : (flag.equals("01") ? "不正常" : "不可信状态");//BMS 动力蓄电池绝缘状态 +// flag = flags2.substring(idxStart, 2 + idxStart); +// idxStart = 2 + idxStart; +// String pboconn = flag.equals("00") ? "正常" : (flag.equals("01") ? "不正常" : "不可信状态");//BMS 动力蓄电池组输出连接器连接状态 +// flag = flags2.substring(idxStart, 2 + idxStart); +// idxStart = 2 + idxStart; +// String chargingForbidden = flag.equals("00") ? "禁止" : "允许";//充电禁止 +// flag = flags2.substring(idxStart, 2 + idxStart); +// String reserved = flag;//预留位 //682382A90025808360000100100122041109221317998083600001001001FF57FF56FF85F14D05 XhpcDeviceMessage deviceMessage = new XhpcDeviceMessage(); diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/BmsErrorDataLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/BmsErrorDataLogic.java index fded20e8..9f8989dd 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/BmsErrorDataLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/BmsErrorDataLogic.java @@ -29,89 +29,89 @@ public class BmsErrorDataLogic implements ServiceLogic { String remark = "充电桩与 BMS 充电错误报文"; Map req = sp.getParameters(); - - String hex = (String) req.get("hex"); - int idxStart = 60; - String flags1 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart));//每字节若干检测标识位 - idxStart = 2 + idxStart; - String flags2 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); - idxStart = 2 + idxStart; - String flags3 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); - idxStart = 2 + idxStart; - String flags4 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); - idxStart = 2 + idxStart; - String flags5 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); - idxStart = 2 + idxStart; - String flags6 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); - idxStart = 2 + idxStart; - String flags7 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); - idxStart = 2 + idxStart; - String flags8 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); - idxStart = 0;//1 - String flag = flags1.substring(idxStart, 2 + idxStart); - String spn2560x00 = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 SPN2560=0x00 的充电机辨识报文超时 - idxStart = 2 + idxStart; - flag = flags1.substring(idxStart, 2 + idxStart); - String spn2560xAA = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 SPN2560=0xAA 的充电机辨识报文超时 - idxStart = 2 + idxStart; - flag = flags1.substring(idxStart, 4 + idxStart); - String reserved1 = flag;//预留位 - idxStart = 0;//2 - String rectsyncmax = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收充电机的时间同步和充电机最大输出能力报文超时 - idxStart = 2 + idxStart; - flag = flags2.substring(idxStart, 2 + idxStart); - String recchgprepcompl = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收充电机完成充电准备报文超时 - idxStart = 2 + idxStart; - flag = flags2.substring(idxStart, 4 + idxStart); - String reserved2 = flag;//预留位 - idxStart = 0;//3 - flag = flags3.substring(idxStart, 2 + idxStart); - String recchgst = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收充电机充电状态报文超时 - idxStart = 2 + idxStart; - flag = flags3.substring(idxStart, 2 + idxStart); - String recchgstop = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收充电机中止充电报文超时 - idxStart = 2 + idxStart; - flag = flags3.substring(idxStart, 4 + idxStart); - String reserved3 = flag;//预留位 - idxStart = 0; // 4 - flag = flags4.substring(idxStart, 2 + idxStart); - String recchgsum = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收充电机充电统计报文超时 - idxStart = 2 + idxStart; - flag = flags4.substring(idxStart, 6 + idxStart); - String reserved4 = flag;//BMS 其他 - idxStart = 0; // 5 - flag = flags5.substring(idxStart, 2 + idxStart); - String recbmsvid = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 BMS 和车辆的辨识报文超时 - idxStart = 2 + idxStart; - flag = flags5.substring(idxStart, 6 + idxStart); - String reserved5 = flag;//BMS 其他 - idxStart = 0;//6 - flag = flags6.substring(idxStart, 2 + idxStart); - String recbatarg = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收电池充电参数报文超时 - idxStart = 2 + idxStart; - flag = flags6.substring(idxStart, 2 + idxStart); - String recbmsprecompl = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 BMS 完成充电准备报文超时 - idxStart = 2 + idxStart; - flag = flags3.substring(idxStart, 4 + idxStart); - String reserved6 = flag;//预留位 - idxStart = 0;//7 - flag = flags7.substring(idxStart, 2 + idxStart); - String recbatsumsts = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收电池充电总状态报文超时 - idxStart = 2 + idxStart; - flag = flags7.substring(idxStart, 2 + idxStart); - String recbmschgreq = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收电池充电要求报文超时 - idxStart = 2 + idxStart; - flag = flags7.substring(idxStart, 2 + idxStart); - String recbmsstopchg = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 BMS 中止充电报文超时 - idxStart = 2 + idxStart; - flag = flags3.substring(idxStart, 2 + idxStart); - String reserved7 = flag;//预留位 - idxStart = 0;//8 - flag = flags8.substring(idxStart, 2 + idxStart); - String recbumssum = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 BMS 充电统计报文超时 - idxStart = 2 + idxStart; - flag = flags3.substring(idxStart, 6 + idxStart); - String reserved8 = flag;//预留位 +// todo test only +// String hex = (String) req.get("hex"); +// int idxStart = 60; +// String flags1 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart));//每字节若干检测标识位 +// idxStart = 2 + idxStart; +// String flags2 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); +// idxStart = 2 + idxStart; +// String flags3 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); +// idxStart = 2 + idxStart; +// String flags4 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); +// idxStart = 2 + idxStart; +// String flags5 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); +// idxStart = 2 + idxStart; +// String flags6 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); +// idxStart = 2 + idxStart; +// String flags7 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); +// idxStart = 2 + idxStart; +// String flags8 = HexUtils.toBinaryString(hex.substring(idxStart, 2 + idxStart)); +// idxStart = 0;//1 +// String flag = flags1.substring(idxStart, 2 + idxStart); +// String spn2560x00 = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 SPN2560=0x00 的充电机辨识报文超时 +// idxStart = 2 + idxStart; +// flag = flags1.substring(idxStart, 2 + idxStart); +// String spn2560xAA = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 SPN2560=0xAA 的充电机辨识报文超时 +// idxStart = 2 + idxStart; +// flag = flags1.substring(idxStart, 4 + idxStart); +// String reserved1 = flag;//预留位 +// idxStart = 0;//2 +// String rectsyncmax = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收充电机的时间同步和充电机最大输出能力报文超时 +// idxStart = 2 + idxStart; +// flag = flags2.substring(idxStart, 2 + idxStart); +// String recchgprepcompl = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收充电机完成充电准备报文超时 +// idxStart = 2 + idxStart; +// flag = flags2.substring(idxStart, 4 + idxStart); +// String reserved2 = flag;//预留位 +// idxStart = 0;//3 +// flag = flags3.substring(idxStart, 2 + idxStart); +// String recchgst = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收充电机充电状态报文超时 +// idxStart = 2 + idxStart; +// flag = flags3.substring(idxStart, 2 + idxStart); +// String recchgstop = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收充电机中止充电报文超时 +// idxStart = 2 + idxStart; +// flag = flags3.substring(idxStart, 4 + idxStart); +// String reserved3 = flag;//预留位 +// idxStart = 0; // 4 +// flag = flags4.substring(idxStart, 2 + idxStart); +// String recchgsum = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收充电机充电统计报文超时 +// idxStart = 2 + idxStart; +// flag = flags4.substring(idxStart, 6 + idxStart); +// String reserved4 = flag;//BMS 其他 +// idxStart = 0; // 5 +// flag = flags5.substring(idxStart, 2 + idxStart); +// String recbmsvid = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 BMS 和车辆的辨识报文超时 +// idxStart = 2 + idxStart; +// flag = flags5.substring(idxStart, 6 + idxStart); +// String reserved5 = flag;//BMS 其他 +// idxStart = 0;//6 +// flag = flags6.substring(idxStart, 2 + idxStart); +// String recbatarg = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收电池充电参数报文超时 +// idxStart = 2 + idxStart; +// flag = flags6.substring(idxStart, 2 + idxStart); +// String recbmsprecompl = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 BMS 完成充电准备报文超时 +// idxStart = 2 + idxStart; +// flag = flags3.substring(idxStart, 4 + idxStart); +// String reserved6 = flag;//预留位 +// idxStart = 0;//7 +// flag = flags7.substring(idxStart, 2 + idxStart); +// String recbatsumsts = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收电池充电总状态报文超时 +// idxStart = 2 + idxStart; +// flag = flags7.substring(idxStart, 2 + idxStart); +// String recbmschgreq = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收电池充电要求报文超时 +// idxStart = 2 + idxStart; +// flag = flags7.substring(idxStart, 2 + idxStart); +// String recbmsstopchg = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 BMS 中止充电报文超时 +// idxStart = 2 + idxStart; +// flag = flags3.substring(idxStart, 2 + idxStart); +// String reserved7 = flag;//预留位 +// idxStart = 0;//8 +// flag = flags8.substring(idxStart, 2 + idxStart); +// String recbumssum = flag.equals("00") ? "正常" : (flag.equals("01") ? "超时" : "不可信状态");//接收 BMS 充电统计报文超时 +// idxStart = 2 + idxStart; +// flag = flags3.substring(idxStart, 6 + idxStart); +// String reserved8 = flag;//预留位 XhpcDeviceMessage deviceMessage = new XhpcDeviceMessage(); deviceMessage.setType(StationDeviceEnum.PILE.getCode()); diff --git a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/OrderDataLogic.java b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/OrderDataLogic.java index a346ae94..bc8f418f 100644 --- a/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/OrderDataLogic.java +++ b/xhpc-modules/xhpc-power-pile/src/main/java/com/xhpc/pp/logic/OrderDataLogic.java @@ -106,6 +106,7 @@ public class OrderDataLogic implements ServiceLogic { if (sr == null) { final Integer stopReasonInt = Integer.valueOf(stopReason, 16); if (stopReasonInt <= 0x49) { +// if (stopReasonInt >= 0x40 && stopReasonInt <= 0x49) { // todo wi lh 0x40? sr = "充电完成(0X".concat(stopReason).concat(")"); } else if (stopReasonInt <= 0x69) { sr = "充电启动失败(0X".concat(stopReason).concat(")");