| | |
| | | public static final int CMD_SetAlarmParam = 0x66; //设置告警参数 |
| | | public static final int CMD_SetAlarmParam_ACK = 0x67; //设置告警参数成功 |
| | | |
| | | public static final int CMD_SetBreakerControl = 0x70; //设置微断控制器参数 |
| | | public static final int CMD_SetBreakerControl_ACK = 0x71; //设置微断控制器参数成功 |
| | | public static final int CMD_SetBreakerState = 0x70; //控制断路器开关 |
| | | public static final int CMD_SetBreakerState_ACK = 0x71; //控制断路器开关成功 |
| | | |
| | | } |
| | |
| | | |
| | | public Response update(CKPowerDevBreakerControl param) { |
| | | UpdateWrapper<CKPowerDevBreakerControl> update = Wrappers.update(); |
| | | update.set("switch_state",param.getSwitchState()).set("op_cmd",CMD_Constant.CMD_SetBreakerControl).eq("breaker_id",param.getBreakerId()); |
| | | update.set("switch_state",param.getSwitchState()).set("op_cmd",CMD_Constant.CMD_SetBreakerState).eq("breaker_id",param.getBreakerId()); |
| | | mapper.update(null,update); |
| | | //读取opCmd返回是否成功 |
| | | QueryWrapper<CKPowerDevBreakerControl> query = Wrappers.query(); |
| | | //TODO 设置ACK不一样,需要更新!!! |
| | | Response opStatus = OpCmdUtil.getOpStatus(mapper, query, CMD_Constant.CMD_SetBreakerControl, 20, null); |
| | | Response opStatus = OpCmdUtil.getOpStatus(mapper, query, CMD_Constant.CMD_SetBreakerState, 20, null); |
| | | if(opStatus.getData()!=null && (boolean)opStatus.getData()) { //成功 |
| | | //分合闸记录 |
| | | Date now = new Date(); |
| | |
| | | case CMD_Constant.CMD_SetAlarmParam:{ |
| | | return opCmdAck ==CMD_Constant.CMD_SetAlarmParam_ACK ; |
| | | } |
| | | case CMD_Constant.CMD_SetBreakerControl:{ |
| | | return opCmdAck ==CMD_Constant.CMD_SetBreakerControl_ACK ; |
| | | case CMD_Constant.CMD_SetBreakerState:{ |
| | | return opCmdAck ==CMD_Constant.CMD_SetBreakerState_ACK ; |
| | | } |
| | | default: |
| | | return false; |