| | |
| | | case FBS9100_ComBase.CMD_Start: m_cmd_ack = FBS9100_ComBase.CMD_StartAck; break; |
| | | case FBS9100_ComBase.CMD_Stop: m_cmd_ack = FBS9100_ComBase.CMD_StopAck; break; |
| | | case FBS9100_ComBase.CMD_EOperatingSwitch_ControlSwitch: m_cmd_ack = FBS9100_ComBase.CMD_EOperatingSwitch_ControlSwitchAck; break; |
| | | |
| | | case FBS9100_ComBase.CMD_ResetSystem: m_cmd_ack = FBS9100_ComBase.CMD_ResetSystemAck; break; |
| | | default: |
| | | return false; |
| | | } |
| | |
| | | } |
| | | return new Response().set(1, bl, bl == true ? "修改参数成功!" : "设置并联电源参数失败,请检查网络!"); |
| | | } |
| | | |
| | | public Response searchPW(int devId) { |
| | | int opCmd = FBS9100_ComBase.CMD_GetDischargeParm; |
| | | return searchParam(devId,opCmd); |
| | | } |
| | | |
| | | private Response searchParam(int devId, int opCmd) { |
| | | boolean res = sendCmdToDev(opCmd, devId); |
| | | Fbs9100Setparam fbs9100Setparam = null; |
| | | if(res){ |
| | | QueryWrapper<Fbs9100Setparam> query = Wrappers.query(); |
| | | query.eq("dev_id",devId).last(" limit 1"); |
| | | fbs9100Setparam = mapper.selectOne(query); |
| | | } |
| | | return new Response().setII(1, res, fbs9100Setparam, res ? "读取参数成功" : "读取参数失败,请检查网络"); |
| | | } |
| | | |
| | | public Response updatePW(Fbs9100Setparam param) { |
| | | Long devId = param.getDevId(); |
| | | UpdateWrapper<Fbs9100Setparam> update = Wrappers.update(); |
| | | update.set("DisCurr",param.getDisCurr()) |
| | | .set("DisCap",param.getDisCap()) |
| | | .set("DisTime",param.getDisTime()) |
| | | .set("GroupVol_LOW",param.getGroupvolLow()) |
| | | .set("BattGroupNum",param.getBattGroupNum()) |
| | | .set("DCVolHighLimit",param.getDCVolHighLimit()) |
| | | .set("ChargeCurrSet",param.getChargeCurrSet()) |
| | | .eq("dev_id",devId); |
| | | mapper.update(null,update); |
| | | |
| | | boolean res = sendCmdToDev(FBS9100_ComBase.CMD_SetDischargeParm, devId.intValue()); |
| | | return new Response().set(1, res, res ? "修改参数成功" : "设置参数失败,请检查网络"); |
| | | } |
| | | |
| | | public Response updateOpCmdAndTestCmd(int devId,int opCmd,int testCmd) { |
| | | UpdateWrapper<Fbs9100Setparam> update = Wrappers.update(); |
| | | update.set("TestCmd",testCmd).eq("dev_id",devId); |
| | | Boolean res=mapper.update(null,update)==1; |
| | | boolean res2=false; |
| | | if(res){ |
| | | res2=sendCmdToDev(opCmd,devId); |
| | | } |
| | | return new Response().set(1,res2, res2 ?"启动测试成功!":"启动测试失败,请检查网络!"); |
| | | } |
| | | |
| | | public Response updateOpCmd(int devId,int opCmd) { |
| | | boolean res = sendCmdToDev(opCmd,devId); |
| | | return new Response().set(1,res, res ?"停止测试成功!":"停止测试失败,请检查网络!"); |
| | | } |
| | | |
| | | public Response updatePWStartTest(int devId,int opCmd,int testCmd) { |
| | | return updateOpCmdAndTestCmd(devId,opCmd,testCmd); |
| | | } |
| | | |
| | | public Response updatePWStopTest(int devId) { |
| | | return updateOpCmd(devId,FBS9100_ComBase.CMD_Stop); |
| | | } |
| | | |
| | | public Response updatePWRestartDevice(int devId) { |
| | | return updateOpCmd(devId,FBS9100_ComBase.CMD_ResetSystem); |
| | | } |
| | | } |