| | |
| | | private short dt_user_cmd = Power_ComBase.CMD_NULL; |
| | | private int dt_user_cmd_regaddr = 0; //用户控制时的寄存器地址 |
| | | |
| | | |
| | | public boolean is_ClosePage = false; //是否退出界面 |
| | | /*********************************************************************/ |
| | | |
| | | private boolean CommThreadRunning = false; |
| | |
| | | public short mAddrSettedNow = 0; |
| | | |
| | | private short dt_cmd = ModBus_ComBase.CMD_Null; |
| | | public int dt_cmd_ack = Power_ComBase.CMD_NULL; |
| | | public int dt_cmd_ack = IAC_ComBase.CMD_Null; |
| | | public MyModBusRtu rtu_rt; |
| | | |
| | | public MyModBusRtu rtu_rx; |
| | |
| | | comm_rx_cnt = 0; |
| | | CommThreadRunning = true; |
| | | } |
| | | is_ClosePage = false; |
| | | m_TestParamFromDev.setIs_ReadParam(false); |
| | | return res; |
| | | } |
| | |
| | | |
| | | rtu_rt.reg_addr = IAC_ComBase.CMD_RealData_Addr; |
| | | rtu_rt.reg_count = IAC_RealData.REG_Count; |
| | | |
| | | if((dt_cmd_cnt % 3 == 0) && !is_ClosePage) { |
| | | //退出界面 |
| | | rtu_rt.Cmd = MyModBusRtu.CMD_TYPE_WRITE_STD; |
| | | |
| | | rtu_rt.reg_addr = IAC_ComBase.CMD_ClosePage_Addr; |
| | | |
| | | dt_data = IAC_Cmd.createControlByteBuffer(0x0001&0xFFFF); |
| | | rtu_rt.reg_count = dt_data.capacity()/2; |
| | | } |
| | | |
| | | } else { |
| | | //数据 |
| | |
| | | if(IAC_ComBase.CMD_Success == rtu_rx.result) { |
| | | isSuccess = true; |
| | | op_result = "控制稳态测试成功-" + Com.get_DTF(new Date(), Com.DTF_YMDhms); |
| | | dt_cmd_ack = IAC_ComBase.CMD_WTTest_Success_Ack; |
| | | }else { |
| | | op_result = "控制稳态测试失败-" + Com.get_DTF(new Date(), Com.DTF_YMDhms); |
| | | dt_cmd_ack = IAC_ComBase.CMD_WTTest_Fail_Ack; |
| | | } |
| | | }else if(IAC_ComBase.CMD_ZDTest_Addr == rtu_rx.reg_addr) { |
| | | if(IAC_ComBase.CMD_Success == rtu_rx.result) { |
| | | isSuccess = true; |
| | | dt_cmd_ack = IAC_ComBase.CMD_ZDTest_Success_Ack; |
| | | op_result = "控制整定测试成功-" + Com.get_DTF(new Date(), Com.DTF_YMDhms); |
| | | }else { |
| | | dt_cmd_ack = IAC_ComBase.CMD_ZDTest_Fail_Ack; |
| | | op_result = "控制整定测试失败-" + Com.get_DTF(new Date(), Com.DTF_YMDhms); |
| | | } |
| | | }else if(IAC_ComBase.CMD_BDTest_Addr == rtu_rx.reg_addr) { |
| | | if(IAC_ComBase.CMD_Success == rtu_rx.result) { |
| | | isSuccess = true; |
| | | dt_cmd_ack = IAC_ComBase.CMD_BDTest_Success_Ack; |
| | | op_result = "控制波动测试成功-" + Com.get_DTF(new Date(), Com.DTF_YMDhms); |
| | | }else { |
| | | dt_cmd_ack = IAC_ComBase.CMD_BDTest_Fail_Ack; |
| | | op_result = "控制波动测试失败-" + Com.get_DTF(new Date(), Com.DTF_YMDhms); |
| | | } |
| | | }else if(IAC_ComBase.CMD_STTest_Addr == rtu_rx.reg_addr) { |
| | | if(IAC_ComBase.CMD_Success == rtu_rx.result) { |
| | | isSuccess = true; |
| | | dt_cmd_ack = IAC_ComBase.CMD_STTest_Success_Ack; |
| | | op_result = "控制瞬态测试成功-" + Com.get_DTF(new Date(), Com.DTF_YMDhms); |
| | | }else { |
| | | dt_cmd_ack = IAC_ComBase.CMD_STTest_Fail_Ack; |
| | | op_result = "控制瞬态测试失败-" + Com.get_DTF(new Date(), Com.DTF_YMDhms); |
| | | } |
| | | }else if(IAC_ComBase.CMD_XBTest_Addr == rtu_rx.reg_addr) { |
| | | if(IAC_ComBase.CMD_Success == rtu_rx.result) { |
| | | isSuccess = true; |
| | | dt_cmd_ack = IAC_ComBase.CMD_XBTest_Success_Ack; |
| | | op_result = "控制谐波测试成功-" + Com.get_DTF(new Date(), Com.DTF_YMDhms); |
| | | }else { |
| | | dt_cmd_ack = IAC_ComBase.CMD_XBTest_Fail_Ack; |
| | | op_result = "控制谐波测试失败-" + Com.get_DTF(new Date(), Com.DTF_YMDhms); |
| | | } |
| | | }else if(IAC_ComBase.CMD_ClosePage_Addr == rtu_rx.reg_addr) { |
| | | if(IAC_ComBase.CMD_Success == rtu_rx.result) { |
| | | isSuccess = true; |
| | | op_result = "退出界面成功-" + Com.get_DTF(new Date(), Com.DTF_YMDhms); |
| | | is_ClosePage = true; |
| | | //op_result = "退出界面成功-" + Com.get_DTF(new Date(), Com.DTF_YMDhms); |
| | | }else { |
| | | op_result = "退出界面失败-" + Com.get_DTF(new Date(), Com.DTF_YMDhms); |
| | | //op_result = "退出界面失败-" + Com.get_DTF(new Date(), Com.DTF_YMDhms); |
| | | } |
| | | } |
| | | |