Device_Simulator_DTS_Tester/bin/com/ComBase.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/SPCommElectLock.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/data/ElectLock_ComBase.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/data/ElectLock_State.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$1$1.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$1.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$10.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$11.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$12.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$13.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$14.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$15.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$16.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$17.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$18.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$19.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$2.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$20.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$21.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$22.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$23.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$24.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$25.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$26.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$27.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$28.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$29.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$3.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$30.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$31.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$32.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$33.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$34.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$35.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$36.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$37.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$38.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$39.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$4.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$40.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$41.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$42.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$43.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$44.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$45.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$46.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$47.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$48.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$49.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$5.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$50.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$51.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$52.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$53.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$54.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$55.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$56.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$57.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$58.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$59.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$6.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$60.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$61.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$62.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$63.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$64.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$65.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$66.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$67.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$68.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$69.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$7.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$70.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$71.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$72.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$73$1.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$73.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$74.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$75.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$76.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$77.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$8.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base$9.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_page_base.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/electlock/electlock_util.classBinary files differ
Device_Simulator_DTS_Tester/bin/com/dev/modbus/MyModBusRtu.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$1.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$10.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$11.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$12.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$13.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$14.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$15.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$16.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$17.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$18.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$19.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$2.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$20.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$21.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$22.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$23.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$24.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$25.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$3.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$4.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$5.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$6.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$7.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$8.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer$9.classBinary files differ
Device_Simulator_DTS_Tester/bin/main/main_window_computer.classBinary files differ
Device_Simulator_DTS_Tester/bin/version.txt
@@ -1,5 +1,11 @@ 智能电子锁 V1.107 edit by lijun 2025-04-10 1.基本完成智能电子锁遥信,遥测,遥调,遥控基本功能 全功能假负载调试工具 V1.101 edit by lijun 2024-02-21 Device_Simulator_DTS_Tester/src/com/ComBase.java
@@ -1,5 +1,9 @@ package com; import java.nio.ByteBuffer; import java.nio.ByteOrder; public class ComBase { public static final byte CapType_Rest = 0; @@ -181,6 +185,32 @@ return rest_time; } public static ByteBuffer mkFloat32Buffer(float value) { ByteBuffer buff = ByteBuffer.allocate(4); buff.order(ByteOrder.BIG_ENDIAN); buff.putFloat(value); buff.flip(); return buff; } public static ByteBuffer mkUInt16Buffer(int value) { ByteBuffer buff = ByteBuffer.allocate(2); buff.order(ByteOrder.BIG_ENDIAN); buff.putShort(ComBase.changeIntToShort(value)); buff.flip(); return buff; } public static ByteBuffer mkInt32Buffer(int value) { ByteBuffer buff = ByteBuffer.allocate(4); buff.order(ByteOrder.BIG_ENDIAN); buff.putShort(ComBase.changeIntToShort((value>>16)&0xFFFF)); buff.putShort(ComBase.changeIntToShort((value&0xFFFF))); buff.flip(); return buff; } //---------------------------------------------------------------------------------- } /*************************************************************************************** Device_Simulator_DTS_Tester/src/com/dev/electlock/SPCommElectLock.java
New file @@ -0,0 +1,940 @@ package com.dev.electlock; import gnu.io.SerialPort; import gnu.io.UnsupportedCommOperationException; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.Date; import javax.swing.JOptionPane; import javax.swing.JTextArea; import org.apache.logging.log4j.Logger; import sp_comm.CommSerialPort; import sp_comm.Comm_Socket; import main.page_debug_inf; import com.Com; import com.ComFn; import com.Crc16; import com.PlaySound; import com.dev.bts.data.FBS9100_ComBase; import com.dev.bts.data.FBS9100_DFU; import com.dev.electlock.data.ElectLock_ComBase; import com.dev.electlock.data.ElectLock_State; import com.dev.fbs9600_mon.SPCommMon; import com.dev.modbus.MyModBusRtu; import com.dev.simpower.dev.Power_ACData; import com.dev.simpower.dev.Power_AlmParam; import com.dev.simpower.dev.Power_AlmState; import com.dev.simpower.dev.Power_ComBase; import com.dev.simpower.dev.Power_LIBMSData; import com.dev.simpower.dev.Power_ModelData; import com.dev.simpower.dev.Power_Param; import com.dev.simpower.dev.Power_RoadState; import com.dev.simpower.dev.Power_TimeControl; public class SPCommElectLock implements Runnable/*, SerialPortEventListener*/ { public static final byte MODBUS_TYPE_YC = 0x01; public static final byte MODBUS_TYPE_STD = 0x02; public static final short CMD_TYPE_READ = 0x03; public static final short CMD_TYPE_WRITE_YC = 0x05; public static final short CMD_TYPE_WRITE_STD = 0x06; public static final short CMD_TYPE_WRITE_MULTY = 0x10; public static final int DEV_PARAM_DATA_STATE_NULL = 0; public static final int DEV_PARAM_DATA_STATE_QUERY = 1; public static final int DEV_PARAM_DATA_STATE_UPDATE = 2; public static final int CommBautrate_Update = 115200; private ByteBuffer dt_databuffer = ByteBuffer.allocate(0); //遥控遥调数据 private short dt_user_cmd = Power_ComBase.CMD_NULL; private int dt_user_cmd_regaddr = 0; //用户控制时的寄存器地址 /*********************************************************************/ public short m_CMD_TYPE_WRITE = CMD_TYPE_WRITE_YC; private byte m_MODBUS_TYPE = MODBUS_TYPE_YC; private boolean CommThreadRunning = false; public boolean AutoStartResTestEn = false; public Date AutoStartResTestTime = new Date(); public Date AutoSaveResDataTime = new Date(); public boolean AutoSaveResDataEn = false; public int AutoSaveResDataCount = 0; public String AutoSaveDataFileName = ""; private ByteBuffer CommRxBuffer = ByteBuffer.allocate(1500); private ByteBuffer CommTxBuffer = ByteBuffer.allocate(1048); public int comm_tx_cnt = 0; public int comm_rx_cnt = 0; private int comm_bautrate = 9600; public int dt_target_addr = 0; public int m_ZDHJ_REG_CNT = 1; public int ZDHJ_BattCount = -1; //--------------------------------------------------------// public int dev_param_data_state = 0; public int dev_param_addr = 0; public int dev_param_curr_range = 0; public double dev_param_FloatCurrLev = 0; public double dev_param_float_curr_lev = 0; public double dev_param_wenbo_curr_lev = 0; public int dev_param_auto_restest_interval = 0; public int dev_param_res_test_type = 0; public int dev_param_ResDisTestMethod = 0; public int dev_param_Batt_StdCap = 0; public double dev_param_res_dis_slope = 0; public double dev_param_res_wenbo_slope = 0; public int dev_param_monnum_setmode = 0; public int dev_param_devid = 0; public double[] dev_param_resparam_d = new double[4]; public double[] dev_param_resparam_s = new double[4]; //--------------------------------------------------------// public int dev_stat_version = 0; public int dev_stat_state = 0; public double GroupVol = 0; public double BattCurr = 0; public int BattState = 0; public int BattCurrDir = 0; public double AvgWenBoCurr = 0; public double PeakWenBoCurr = 0; public int SpiCommErrCount = 0; //SPI通信错误计数 public int ResTestCount = 0; //内阻测试次数 public int CurentResTestMode = 0; //当前内阻测试方法 public int BianhaoErrNum = 0; //编号错误单体号 public double ExTemp = 0; //外部温度 //--------------------------------------------------------// public short mAddrSettedNow = 0; private short dt_cmd = CMD_TYPE_READ; public int dt_cmd_ack = Power_ComBase.CMD_NULL; public MyModBusRtu rtu_rt; public MyModBusRtu rtu_rx; public Date dt_cmd_ack_time = new Date(); private short dt_cmd_regaddr = 0; private short dt_cmd_regcnt = 0; private short[] dt_cmd_regdata = null; private int dt_cmd_cnt = 0; private page_debug_inf dt_debug_inf; private int m_COMM_PORT_TYPE = 0; private CommSerialPort m_SP_Comm = null; private Comm_Socket m_SocketComm = null; private Logger m_Log = null; private int read_libms_index = 0; //读取锂电池包索引 private int read_model_index = 0; //读取电源模块索引 public Power_ACData m_AcData; public ElectLock_State m_ElectLock_State; public Power_LIBMSData[] m_LibmsDatas; public Power_ModelData[] m_ModelDatas; public Power_AlmState m_AlmState; public Power_Param m_ParamFromDev; //设备读取的参数 public Power_TimeControl m_TimeControlFromDev; //设备读取的参数 public Power_RoadState m_RoadStateFromDev; //设备读取的参数 public Power_AlmParam m_AlmParamFromDev; //设备读取的告警参数 public String op_result = ""; //控制返回结果 public String op_result_sysparam = ""; //系统参数结果字符串 public String op_result_powerparam = ""; //电源结果字符串 public String op_result_almaram = ""; //电源告警结果字符串 public String op_result_jiaozhun = ""; //电源校准结果字符串 public short dt_user_cmd_ack = Power_ComBase.CMD_NULL; //操作返回结果,用于界面判断geng'xin private boolean dt_dfu_en = false; //远程升级标识 private boolean dt_change_commBautrate = false; private JTextArea dt_show_msg; //升级文本信息域 private String dt_dfuFileName; //升级文件名称 public SPCommElectLock(int addr_t, int bitrate, page_debug_inf debug, Logger log) { dt_target_addr = addr_t & 0x00FF; comm_bautrate = bitrate; dt_debug_inf = debug; m_Log = log; rtu_rx = new MyModBusRtu(); m_RoadStateFromDev = new Power_RoadState(); m_TimeControlFromDev = new Power_TimeControl(); m_ParamFromDev = new Power_Param(); m_AcData = new Power_ACData(); m_AlmState = new Power_AlmState(); m_ElectLock_State = new ElectLock_State(); m_LibmsDatas = new Power_LIBMSData[Power_ComBase.LIBMSDATA_MAX_COUNT]; for(int i =0;i<m_LibmsDatas.length;i++) { m_LibmsDatas[i] = new Power_LIBMSData(); } m_ModelDatas = new Power_ModelData[Power_ComBase.LIMODEL_MAX_COUNT]; for(int i =0;i<m_LibmsDatas.length;i++) { m_ModelDatas[i] = new Power_ModelData(); } } public void setCommBautrate(int bt_rate) { if(SPCommMon.COMM_PORT_TYPE_Serial != m_COMM_PORT_TYPE) { return; } try { comm_bautrate = bt_rate; m_SP_Comm.serialPort.setSerialPortParams(comm_bautrate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } //初始化串口 public boolean OpenCommPort(int comm_port_type, String comm_name_or_ip, int bitrate_or_comm_port) { boolean res = false; m_COMM_PORT_TYPE = comm_port_type; if(SPCommMon.COMM_PORT_TYPE_Serial == m_COMM_PORT_TYPE) { m_SP_Comm = new CommSerialPort(bitrate_or_comm_port, m_Log); res = m_SP_Comm.OpenCommPort(comm_name_or_ip); } else { m_SocketComm = new Comm_Socket(comm_name_or_ip, bitrate_or_comm_port); res = true; } if(true == res) { CommTxBuffer.order(ByteOrder.BIG_ENDIAN); CommRxBuffer.order(ByteOrder.BIG_ENDIAN); comm_tx_cnt = 0; comm_rx_cnt = 0; CommThreadRunning = true; } return res; } private void makeCommTxData() { CommTxBuffer.clear(); rtu_rt = new MyModBusRtu(); ByteBuffer dt_data = ByteBuffer.allocate(0); rtu_rt.addr = dt_target_addr; if(dt_user_cmd == Power_ComBase.CMD_NULL) { //随机读取实时数据 if(++dt_cmd_cnt > 1000) { dt_cmd_cnt = 0; } rtu_rt.Cmd = MyModBusRtu.CMD_TYPE_READ_INPUT; rtu_rt.reg_addr = ElectLock_ComBase.LOCK_REAL_ADDR; rtu_rt.reg_count = ElectLock_State.Reg_Count_Real; } else { //数据 dt_data = dt_databuffer; //遥调遥控数据 rtu_rt.Cmd = dt_user_cmd; dt_user_cmd = Power_ComBase.CMD_NULL; rtu_rt.reg_addr = dt_user_cmd_regaddr; if(dt_data.capacity() > 0) { rtu_rt.reg_count = dt_data.capacity()/2; }else { System.out.println("rtu_rt.reg_addr:" + rtu_rt.reg_addr + " 为传入设置的数值"); //rtu_rt.reg_count = Power_Param.REG_Count; } } makeRTData(rtu_rt,dt_data); } public void makeRTData(MyModBusRtu rtu,ByteBuffer bf) { CommTxBuffer.position(0); CommTxBuffer.put((byte)rtu.addr); CommTxBuffer.put((byte)rtu.Cmd); CommTxBuffer.putShort((short)rtu.reg_addr); if(rtu.Cmd == MyModBusRtu.CMD_TYPE_READ || rtu.Cmd == MyModBusRtu.CMD_TYPE_READ_INPUT) { //读取 CommTxBuffer.putShort((short)rtu.reg_count); } else if( rtu.Cmd == MyModBusRtu.CMD_TYPE_WRITE_STD || rtu.Cmd == MyModBusRtu.CMD_TYPE_WRITE_YC || rtu.Cmd == MyModBusRtu.CMD_TYPE_WRITE_SysUpdate || rtu.Cmd == MyModBusRtu.CMD_TYPE_Read_UpdateFile ) { //单点写入 CommTxBuffer.put(bf); } else if(rtu.Cmd == MyModBusRtu.CMD_TYPE_WRITE_MULTY) { //多点写入 CommTxBuffer.putShort((short)rtu.reg_count); CommTxBuffer.put((byte)bf.capacity()); CommTxBuffer.put(bf); } int crc = Crc16.CalCRC16(CommTxBuffer, CommTxBuffer.position()) & 0xFFFF; CommTxBuffer.putShort((short) crc); CommTxBuffer.flip(); //System.out.println("发送数据长度:" + CommTxBuffer.remaining()); } public void tr_Msg(ByteBuffer bbf_tx, ByteBuffer bbf_rx, boolean showdat) { if(++comm_tx_cnt > 32500) { comm_tx_cnt = 0; } if(SPCommMon.COMM_PORT_TYPE_Serial == m_COMM_PORT_TYPE) { m_SP_Comm.SP_Comm(bbf_tx, bbf_rx, CommSerialPort.mutycomm_Type_Samd09, dt_debug_inf, showdat); } else { m_SocketComm.SocketComm(bbf_tx, bbf_rx, dt_debug_inf, showdat); } } public void CloseCommPort() { CommThreadRunning = false; } public void setCommCmd(short cmd, int cmd_reg_addr, short[] reg_data, int reg_len) { if(dt_cmd_regaddr > 0) { return; } dt_cmd = cmd; dt_cmd_regaddr = (short) cmd_reg_addr; dt_cmd_regdata = reg_data; dt_cmd_regcnt = (short) reg_len; } public void setCommCmd(short cmd, int cmd_user_reg_addr, ByteBuffer bf) { if(dt_cmd_regaddr > 0) { return; } dt_user_cmd = cmd; //命令 dt_user_cmd_regaddr = (short) cmd_user_reg_addr; //寄存器地址 dt_databuffer = bf; //遥控或遥调数据 } public void setCommCmdAck(int ack_t) { dt_cmd_ack = ack_t; dt_cmd_ack_time = new Date(); //System.out.println(Com.get_DTF(dt_cmd_ack_time, Com.DTF_YMDhms) + ", " + dev_param_data_state); String wav_f = "6133.wav"; if(ack_t%2 == 0) { wav_f = "4577.wav"; } if(ack_t > 0) { new PlaySound(wav_f); } } private boolean processRxData(ByteBuffer bbf_rx) { rtu_rx.clear(); boolean isSuccess = false; if(rtu_rx.putByteBuffer(bbf_rx)) { if(MyModBusRtu.CMD_TYPE_READ == rtu_rx.Cmd) { // if(Power_ComBase.PWD_ACData_RegAddr_Start == rtu_rt.reg_addr) { // //读取极简化电源遥测数据 // if(m_AcData.putByteBuffer(bbf_rx)) { // isSuccess = true; // } // }else if(Power_ComBase.PWD_LIBMSData_RegAddr_Start1 <= rtu_rt.reg_addr && rtu_rt.reg_addr <= Power_ComBase.PWD_LIBMSData_RegAddr_Start4) { // //锂电池包数据 // if(m_LibmsDatas[read_libms_index].putByteBuffer(bbf_rx)) { // // //System.out.println("锂电池包:"+(read_libms_index+1)+"读取成功"); // read_libms_index ++; // if(read_libms_index >= Power_ComBase.LIBMSDATA_MAX_COUNT) { // read_libms_index = 0; // } // isSuccess = true; // } // }else if(Power_ComBase.PWD_ModelData_RegAddr_Start1 <= rtu_rt.reg_addr && rtu_rt.reg_addr <= Power_ComBase.PWD_ModelData_RegAddr_Start4) { // //电源模块数据 // if(m_ModelDatas[read_model_index].putByteBuffer(bbf_rx)) { // // //System.out.println("电源模块:"+(read_model_index+1)+"读取成功"); // read_model_index ++; // if(read_model_index >= Power_ComBase.LIMODEL_MAX_COUNT) { // read_model_index = 0; // } // isSuccess = true; // } // }else if(Power_ComBase.PWD_ModelAlm_RegAddr_Start == rtu_rt.reg_addr) { // if(m_AlmState.putByteBuffer(bbf_rx)) { // isSuccess = true; // } // }else if(Power_ComBase.PWD_SysParam_RegAddr_Start == rtu_rt.reg_addr) { // if(m_ParamFromDev.putByteBuffer(bbf_rx)) { // dt_user_cmd_ack = Power_ComBase.PWD_SysParam_Read_ACK; // op_result_sysparam = "读取电源系统参数成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // isSuccess = true; // } // }else if(Power_ComBase.PWD_PowerParam_RegAddr_Start == rtu_rt.reg_addr) { // //System.out.println("999"); // if(m_ParamFromDev.putPowerByteBuffer(bbf_rx)) { // dt_user_cmd_ack = Power_ComBase.PWD_PwdParam_Read_ACK; // op_result_powerparam = "读取电源参数成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // isSuccess = true; // } // }else if(Power_ComBase.PWD_AlmParam_RegAddr_Start == rtu_rt.reg_addr) { // m_AlmParamFromDev = new Power_AlmParam(); // if(m_AlmParamFromDev.putByteBuffer(bbf_rx)) { // dt_user_cmd_ack = Power_ComBase.PWD_AlmParam_Read_ACK; // op_result_almaram = "读取电源告警参数成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // isSuccess = true; // } // }else if(Power_ComBase.PWD_SchoolTime_RegAddr_Start == rtu_rt.reg_addr) { // if(m_ParamFromDev.putTimeByteBuffer(bbf_rx)) { // dt_user_cmd_ack = Power_ComBase.PWD_SchoolTime_Read_ACK; // op_result_jiaozhun = "读取设备时间成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // isSuccess = true; // } // }else if(Power_ComBase.PWD_Load1Time_RegAddr_Start == rtu_rt.reg_addr) { // if(m_TimeControlFromDev.putByteBuffer1(bbf_rx)) { // dt_user_cmd_ack = Power_ComBase.PWD_Load1Time_Read_ACK; // op_result_jiaozhun = "读取1-6路分时参数成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // isSuccess = true; // } // }else if(Power_ComBase.PWD_Load7Time_RegAddr_Start == rtu_rt.reg_addr) { // if(m_TimeControlFromDev.putByteBuffer2(bbf_rx)) { // dt_user_cmd_ack = Power_ComBase.PWD_Load2Time_Read_ACK; // op_result_jiaozhun = "读取7-12路分时参数成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // isSuccess = true; // } // }else if(Power_ComBase.PWD_LoadControl_RegAddr_Start == rtu_rt.reg_addr) { // if(m_RoadStateFromDev.putByteBuffer(bbf_rx)) { // //System.err.println("读取分路1~12分路状态成功" + m_RoadStateFromDev); // isSuccess = true; // } // } }else if(MyModBusRtu.CMD_TYPE_READ_INPUT == rtu_rx.Cmd){ if(ElectLock_ComBase.LOCK_REAL_ADDR == rtu_rt.reg_addr) { //读取实时数据 if(m_ElectLock_State.putByteBuffer(bbf_rx)) { isSuccess = true; } } }else if(MyModBusRtu.CMD_TYPE_WRITE_YC == rtu_rx.Cmd){ if(ElectLock_ComBase.LOCK_CLEAR_AUTH_ADDR == rtu_rx.reg_addr) { //清空所有授权卡 if(ElectLock_ComBase.Control_Value == rtu_rx.result) { isSuccess = true; op_result = "清空所有授权卡成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); }else { op_result = "清空所有授权卡失败" + Com.get_DTF(new Date(), Com.DTF_YMDhms); } }else if(ElectLock_ComBase.LOCK_REMOTE_OPEN_ADDR == rtu_rx.reg_addr) { //远程开锁 if(ElectLock_ComBase.Control_Value == rtu_rx.result) { isSuccess = true; op_result = "远程开锁成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); }else { op_result = "远程开锁失败" + Com.get_DTF(new Date(), Com.DTF_YMDhms); } }else if(ElectLock_ComBase.LOCK_RESTART_ADDR == rtu_rx.reg_addr) { //远程重启 if(ElectLock_ComBase.Control_Value == rtu_rx.result) { isSuccess = true; op_result = "远程重启成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); }else { op_result = "远程重启失败" + Com.get_DTF(new Date(), Com.DTF_YMDhms); } } }else if(MyModBusRtu.CMD_TYPE_WRITE_STD == rtu_rx.Cmd) { if(ElectLock_ComBase.LOCK_SET_ADDR_ADDR == rtu_rx.reg_addr) { if(rtu_rx.result > 0) { isSuccess = true; op_result = "设置锁具地址成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); }else { op_result = "设置锁具地址失败" + Com.get_DTF(new Date(), Com.DTF_YMDhms); } }else if(ElectLock_ComBase.LOCK_Add_ID_AUTH_ADDR == rtu_rx.reg_addr) { if(rtu_rx.result > 0) { isSuccess = true; op_result = "设置锁具地址成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); }else { op_result = "设置锁具地址失败" + Com.get_DTF(new Date(), Com.DTF_YMDhms); } }else if(ElectLock_ComBase.LOCK_SET_Model_ADDR == rtu_rx.reg_addr) { if(rtu_rx.result >= 0) { isSuccess = true; op_result = "设置锁具工作模式成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); }else { op_result = "设置锁具工作模式失败" + Com.get_DTF(new Date(), Com.DTF_YMDhms); } } // if(Power_ComBase.PWD_DoorControl_RegAddr_Start == rtu_rx.reg_addr) { // //门磁控制 // if(Power_ComBase.CMD_Fail != rtu_rx.result) { // op_result_sysparam = "控制门磁打开成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // }else { // op_result_sysparam = "控制门磁关闭成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // } // isSuccess = true; // }else if(Power_ComBase.PWD_LoadControl_RegAddr_Start <= rtu_rx.reg_addr && rtu_rx.reg_addr < Power_ComBase.PWD_BackControl_RegAddr_Start) { // //分路1~12控制 // int idx = rtu_rx.reg_addr - Power_ComBase.PWD_LoadControl_RegAddr_Start +1; // if(Power_ComBase.CMD_Fail != rtu_rx.result) { // op_result_sysparam = "控制分路" + idx + "打开成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // }else { // op_result_sysparam = "控制分路" + idx + "关闭成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // } // isSuccess = true; // }else if(Power_ComBase.PWD_BackControl_RegAddr_Start <= rtu_rx.reg_addr && rtu_rx.reg_addr < Power_ComBase.PWD_DoorControl_RegAddr_Start) { // //分路1~12备电控制 // int idx = rtu_rx.reg_addr - Power_ComBase.PWD_BackControl_RegAddr_Start +1; // if(Power_ComBase.CMD_Fail != rtu_rx.result) { // op_result_sysparam = "控制分路" + idx + "备电控制打开成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // }else { // op_result_sysparam = "控制分路" + idx + "备电控制关闭失败" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // } // isSuccess = true; // } }else if(MyModBusRtu.CMD_TYPE_WRITE_MULTY == rtu_rx.Cmd) { if(ElectLock_ComBase.LOCK_Add_ID_AUTH_ADDR == rtu_rx.reg_addr) { //添加授权ID卡 if(ElectLock_ComBase.RegCount_Double == rtu_rx.result) { isSuccess = true; op_result = "添加授权卡ID成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); }else { op_result = "添加授权卡ID失败" + Com.get_DTF(new Date(), Com.DTF_YMDhms); } }else if(ElectLock_ComBase.LOCK_Clear_ID_AUTH_ADDR == rtu_rx.reg_addr) { //取消授权ID卡 if(ElectLock_ComBase.RegCount_Double == rtu_rx.result) { isSuccess = true; op_result = "移除授权卡ID成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); }else { op_result = "移除授权卡ID失败" + Com.get_DTF(new Date(), Com.DTF_YMDhms); } } // if(Power_ComBase.PWD_PowerParam_RegAddr_Start == rtu_rx.reg_addr) { // //设置电源参数 // if(rtu_rx.result == Power_Param.REG_Count_Power) { // op_result_powerparam = "设置电源参数成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // isSuccess = true; // }else { // op_result_powerparam = "设置电源参数失败" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // } // }else if(Power_ComBase.PWD_AlmParam_RegAddr_Start == rtu_rx.reg_addr) { // //设置电源告警参数 // if(rtu_rx.result == Power_AlmParam.REG_Count) { // op_result_almaram = "设置电源告警参数成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // isSuccess = true; // }else { // op_result_almaram = "设置电源告警参数失败" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // } // }else if(Power_ComBase.PWD_SysParam_RegAddr_Start == rtu_rx.reg_addr) { // //设置电源系统参数 // if(rtu_rx.result == Power_Param.REG_Count) { // op_result_sysparam = "设置电源系统参数成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // isSuccess = true; // }else { // op_result_sysparam = "设置电源系统参数失败" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // } // }else if(Power_ComBase.PWD_SchoolTime_RegAddr_Start == rtu_rx.reg_addr) { // //设置电源校时 // if(rtu_rx.result == Power_Param.REG_Count_Time) { // op_result_jiaozhun = "设置电源校时成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // isSuccess = true; // }else { // op_result_jiaozhun = "设置电源校时失败" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // } // }else if(Power_ComBase.PWD_Load1Time_RegAddr_Start == rtu_rx.reg_addr) { // //设置分路1-6分时控制 // if(rtu_rx.result == Power_TimeControl.REG_Count) { // op_result_jiaozhun = "设置分路1-6分时参数成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // isSuccess = true; // }else { // op_result_jiaozhun = "设置分路1-6分时参数失败" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // } // }else if(Power_ComBase.PWD_Load7Time_RegAddr_Start == rtu_rx.reg_addr) { // //设置分路7-12分时控制 // if(rtu_rx.result == Power_TimeControl.REG_Count) { // op_result_jiaozhun = "设置分路7-12分时参数成功" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // isSuccess = true; // }else { // op_result_jiaozhun = "设置分路7-12分时参数失败" + Com.get_DTF(new Date(), Com.DTF_YMDhms); // } // } } else if(MyModBusRtu.CMD_TYPE_WRITE_SysUpdate == rtu_rx.Cmd) { if(Power_ComBase.PWD_SysReStart_RegAddr_Start == rtu_rx.reg_addr) { //远程重启设备 if(rtu_rx.result == 0xBBBB) { //设备远程重启成功 dt_user_cmd_ack = Power_ComBase.PWD_SysRestart_Success_ACK; isSuccess = true; }else { //设备远程重启失败 dt_user_cmd_ack = Power_ComBase.PWD_SysRestart_Fail_ACK; } }else if(Power_ComBase.PWD_TransUpdateFile_RegAddr_Start == rtu_rx.reg_addr) { if(rtu_rx.result != 0) { isSuccess = true; } }else if(Power_ComBase.PWD_StartUpdate_RegAddr_Start == rtu_rx.reg_addr) { if(rtu_rx.result == (0xEEEE)) { isSuccess = true; System.out.println("切换设备波特率成功...."); }else if(rtu_rx.result != 0) { isSuccess = true; appendUppdateInfo("System Update Success ... " + Com.get_DTF(new Date(), Com.DTF_YMDhms) + "\n"); }else { appendUppdateInfo("System Update Fail ... " + Com.get_DTF(new Date(), Com.DTF_YMDhms) + "\n"); } } } else if(MyModBusRtu.CMD_TYPE_Read_UpdateFile == rtu_rx.Cmd) { if(Power_ComBase.PWD_TransUpdateFile_RegAddr_Start == rtu_rt.reg_addr) { if(bbf_rx.remaining() > 2) { isSuccess = true; }else { System.err.println("返回数据长度不足"); } } } } if(bbf_rx.limit() > 0 && isSuccess) { if(++comm_rx_cnt > 32500) { comm_rx_cnt = 0; } } return isSuccess; } public void setAutoStartRestTest(String filename, int type, boolean en) { AutoSaveDataFileName = filename; AutoStartResTestEn = en; AutoSaveResDataCount = 0; } private void closeSPCommPort() { if(SPCommMon.COMM_PORT_TYPE_Serial == m_COMM_PORT_TYPE) { m_SP_Comm.serialPort.close(); } else { m_SocketComm.socketClose(); } } public void run() { while(true == CommThreadRunning) { try { Thread.sleep(200); if(dt_dfu_en == false) { if(dt_change_commBautrate) { //升级过程中失败,恢复时切换连接时的波特率 //setCommBautrate(comm_bautrate); dt_change_commBautrate = false; } makeCommTxData(); tr_Msg(CommTxBuffer, CommRxBuffer, true); processRxData(CommRxBuffer); } else { //--------------------------- BOOTLOADER_CMD_WRITE-----------------------------// dt_show_msg.append("---------------------------------------------------\n"); String dfu_text_inf = "Power System Update Start." + Com.get_DTF(new Date(), Com.DTF_YMDhms) + "\n"; appendUppdateInfo(dfu_text_inf); if(!dt_change_commBautrate) { appendUppdateInfo("开始设置锁具串口波特率为 " + CommBautrate_Update +"\n"); for(int k = 0;k<3;k++) { dt_user_cmd = MyModBusRtu.CMD_TYPE_WRITE_SysUpdate; dt_user_cmd_regaddr = Power_ComBase.PWD_StartUpdate_RegAddr_Start; dt_databuffer = electlock_util.createSysUpdateControlByteBuffer(0xEEEE); makeCommTxData(); tr_Msg(CommTxBuffer, CommRxBuffer, true); if(true == processRxData(CommRxBuffer)) { if(rtu_rx.result == 0xEEEE) { appendUppdateInfo("设置锁具串口波特率为 " + CommBautrate_Update + "成功!\n"); dt_change_commBautrate = true; break; } } else { //切换波特率失败 Thread.sleep(500); } } } if(!dt_change_commBautrate) { appendUppdateInfo("切换锁具波特率失败,SystemUpdate Fial !!!\n"); dt_dfu_en = false; continue; } try { appendUppdateInfo("设置连接串口的波特率为 " + CommBautrate_Update + "\n"); setCommBautrate(CommBautrate_Update); Thread.sleep(6000); } catch (Exception e) { e.printStackTrace(); } boolean prog_ok = false; FileInputStream fis = null; try { File f = new File(dt_dfuFileName); long file_len = f.length(); byte[] buf_to_flash = new byte[Power_ComBase.DFU_BUF_LEN]; Thread.sleep(100); fis = new FileInputStream(f); int dfu_datablock_num = 1; int percent = 0; while(true) { //====================================// if((false == dt_dfu_en) || (false == CommThreadRunning)) { dfu_text_inf = "DFU Manual Stop . . .\n"; appendUppdateInfo(dfu_text_inf); break; } //====================================// for(int n=0; n<buf_to_flash.length; n++) { buf_to_flash[n] = (byte) 0xFF; } //====================================// int data_len_towrite = fis.read(buf_to_flash); if(data_len_towrite > 0) { Thread.sleep(1); for(int cnt_t=0; cnt_t<3; cnt_t++) { //构造发送数据 makeSendFileData(buf_to_flash,dfu_datablock_num); dt_user_cmd = MyModBusRtu.CMD_TYPE_WRITE_SysUpdate; dt_user_cmd_regaddr = Power_ComBase.PWD_TransUpdateFile_RegAddr_Start; makeCommTxData(); tr_Msg(CommTxBuffer, CommRxBuffer, true); if(true == processRxData(CommRxBuffer)) { if(rtu_rx.result == dfu_datablock_num) { prog_ok = true; break; } } else { prog_ok = false; Thread.sleep(500); } } if(false == prog_ok) { dfu_text_inf = "DFU Write Error!\n"; appendUppdateInfo(dfu_text_inf); break; } else { dfu_datablock_num += 1; } int tran_len_t = dfu_datablock_num*FBS9100_DFU.DFU_BUF_LEN; if(percent < (tran_len_t*100)/file_len) { percent = (int) ((tran_len_t*100)/file_len); if(percent > 100) { percent = 100; } appendUppdateInfo(String.format("DFU Write: %d%% Done.\n", percent)); } } else { dfu_text_inf = "DFU Write: 100% Done!\n"; appendUppdateInfo(dfu_text_inf); //System.out.println(dfu_text_inf); break; } } } catch (IOException | InterruptedException e1) { e1.printStackTrace(); } finally { try { fis.close(); } catch (IOException e1) { e1.printStackTrace(); } } if((true == prog_ok) && (true == dt_dfu_en) && (true == CommThreadRunning)) { boolean check_ok = false; FileInputStream fis_ck = null; try { File f_ck = new File(dt_dfuFileName); long file_len_ck = f_ck.length(); byte[] buf_check = new byte[Power_ComBase.DFU_BUF_LEN]; Thread.sleep(100); fis_ck = new FileInputStream(f_ck); int check_datablock_num = 1; int percent = 0; while(true) { //====================================// if((false == dt_dfu_en) || (false == CommThreadRunning)) { dfu_text_inf = "DFU Check Manual Stop . . .\n"; appendUppdateInfo(dfu_text_inf); break; } //====================================// for(int n=0; n<buf_check.length; n++) { buf_check[n] = (byte) 0xFF; } //====================================// int len_buf_check = fis_ck.read(buf_check); if(len_buf_check > 0) { Thread.sleep(1); for(int cnt_t=0; cnt_t<3; cnt_t++) { //构造发送数据 dt_databuffer = electlock_util.createSysUpdateControlByteBuffer(check_datablock_num); dt_user_cmd = MyModBusRtu.CMD_TYPE_Read_UpdateFile; dt_user_cmd_regaddr = Power_ComBase.PWD_TransUpdateFile_RegAddr_Start; makeCommTxData(); tr_Msg(CommTxBuffer, CommRxBuffer, true); if(true == processRxData(CommRxBuffer)) { if(rtu_rx.result == check_datablock_num) { if(true == checkDfuReadAckBuf(CommRxBuffer, buf_check)) { check_ok = true; } else { check_ok = false; Thread.sleep(500); } if(true == check_ok) { break; } } } } if(false == check_ok) { dfu_text_inf = "DFU File Check Error!\n "; appendUppdateInfo(dfu_text_inf); break; } else { check_datablock_num += 1; } int tran_len_t = check_datablock_num*FBS9100_DFU.DFU_BUF_LEN; if(percent < (tran_len_t*100)/file_len_ck) { percent = (int) ((tran_len_t*100)/file_len_ck); if(percent > 100) { percent = 100; } appendUppdateInfo(String.format("DFU File Check: %d%% Done.\n", percent)); } } else { dfu_text_inf = "DFU File Check: 100% Done!\n"; appendUppdateInfo(dfu_text_inf); setCommCmd(MyModBusRtu.CMD_TYPE_WRITE_SysUpdate, Power_ComBase.PWD_StartUpdate_RegAddr_Start, electlock_util.createSysUpdateControlByteBuffer(0xDFDF)); //setCommCmd(FBS9100_ComBase.CMD_SystemUpdate, ByteBuffer.allocate(0)); break; } } } catch (IOException | InterruptedException e1) { e1.printStackTrace(); } finally { try { fis_ck.close(); } catch (IOException e1) { e1.printStackTrace(); } } } //---------------------------------------------------------------------------------// dt_dfu_en = false; //---------------------------------------------------------------------------------// } } catch (InterruptedException e) { e.printStackTrace(); CloseCommPort(); JOptionPane.showMessageDialog(null, "ZDHJ CommPort 串口异常: " + e.getMessage()); } } /******************************************/ closeSPCommPort(); /******************************************/ dt_debug_inf.addDebugInf(Com.get_DTF(new Date(), Com.DTF_YMDhms_S) + " ZDHJ CommPort is quit," + " COMM_PORT_TYPE: " + m_COMM_PORT_TYPE + "\n"); /******************************************/ } public void makeSendFileData(byte[] data,int block_num) { dt_databuffer = ByteBuffer.allocate(data.length + 2); dt_databuffer.order(ByteOrder.BIG_ENDIAN); dt_databuffer.putShort(FBS9100_ComBase.changeIntToShort(block_num)); dt_databuffer.put(data); dt_databuffer.flip(); } public void setCommCmd_DFU(boolean dfu_en, String dfu_file, JTextArea show_area) { dt_dfu_en = dfu_en; dt_show_msg = show_area; dt_dfuFileName = dfu_file; } public boolean checkDfuReadAckBuf(ByteBuffer bf,byte[] data) { boolean check_ok = false; if(data.length <= bf.remaining()) { check_ok = true; for(int k = 0 ;k< data.length;k++) { if(data[k] != bf.get()) { System.err.println("校验字节:" + k + "失败"); check_ok = false; break; } } }else { //System.err.println("bf:"+ComFn.bytesToHexString(bf.array(), bf.array().length)); //System.err.println("data:"+ComFn.bytesToHexString(data, data.length)); //System.err.println("data.length:" + data.length + "\tbf.remaining():"+bf.remaining()); } return check_ok; } public void appendUppdateInfo(String msg) { StringBuffer buffer = new StringBuffer(dt_show_msg.getText()); dt_show_msg.setText(msg); dt_show_msg.append(buffer.toString()); } } Device_Simulator_DTS_Tester/src/com/dev/electlock/data/ElectLock_ComBase.java
New file @@ -0,0 +1,76 @@ package com.dev.electlock.data; public class ElectLock_ComBase { public static final int Lock_Model_OffLine = 0; //离线模式 public static final int Lock_Model_OnLine = 1; //在线模式 public static final int CMD_Fail = -1; //失败 public static final int CMD_ClearIdCard = 0x10; //清空所有授权卡 public static final int CMD_ClearIdCard_Ack = 0x11; //清空所有授权卡成功 public static final int CMD_REMOTE_OPEN_Lock = 0x12; //远程开锁 public static final int CMD_REMOTE_OPEN_Lock_Ack = 0x13; //远程开锁成功 public static final int CMD_REMOTE_ReStart = 0x14; //远程重启 public static final int CMD_REMOTE_ReStart_Ack = 0x15; //远程重启成功 public static final int CMD_SetLockAddr = 0x16; //设置锁具地址 public static final int CMD_SetLockAddr_Ack = 0x17; //设置锁具地址成功 public static final int CMD_AddIdCard = 0x18; //添加授权卡ID public static final int CMD_AddIdCard_Ack = 0x19; //添加授权卡ID成功 public static final int CMD_RemoveIdCard = 0x20; //移除授权卡ID public static final int CMD_RemoveIdCard_Ack = 0x21; //移除授权卡ID成功 public static final int Auth_Fail = 0; //授权失败 public static final int Auth_Success = 1; //授权成功 public static final int LOCK_REAL_ADDR = 0; //实时数据地址 public static final int LOCK_CLEAR_AUTH_ADDR = 0; //清空所有授权地址 public static final int LOCK_REMOTE_OPEN_ADDR = 1; //远程开锁地址 public static final int LOCK_RESTART_ADDR = 2; //远程重启地址 public static final int LOCK_SET_ADDR_ADDR = 0; //设置设备地址 public static final int LOCK_Add_ID_AUTH_ADDR = 1; //授权ID卡地址 public static final int LOCK_Clear_ID_AUTH_ADDR = 3; //取消授权ID卡地址 public static final int LOCK_SET_Model_ADDR = 5; //设置锁具工作模式 public static final int RegCount_Sigle = 1; //单点控制时点位 public static final int RegCount_Double = 2; //ID卡控制时点位 public static final int Control_Value = 0xFF00; //控制时写入值 /***************** 操作日志类型 *******************************************************************/ public static final int CtlType_ClearIdCard = 1; //清空所有授权卡 public static final int CtlType_REMOTE_OPEN_Lock = 2; //远程开锁 public static final int CtlType_REMOTE_ReStart = 3; //远程重启 public static final int CtlType_SetLockAddr = 4; //设置锁具地址 public static final int CtlType_AddIdCard = 5; //添加授权卡ID public static final int CtlType_RemoveIdCard = 6; //移除授权卡ID public static final int CtlType_Bluetooth = 7; //蓝牙开锁 public static final int CtlType_IDCardOpen = 8; //ID开锁 /************************************************************************************/ /***************** 锁具告警相关 *******************************************************************/ public static final int ALM_CommErr_ID = 119001; //通信故障 public static final int ALM_OpenLockErr_ID = 119002; //开锁失败 /************************************************************************************/ public static final int ALM_Source_PlatForm = 1; //平台触发 public static final int ALM_Source_App = 2; //手机APP触发 public static final int ALM_Source_Lock = 3; //锁具触发 /************************************************************************************/ } Device_Simulator_DTS_Tester/src/com/dev/electlock/data/ElectLock_State.java
New file @@ -0,0 +1,399 @@ package com.dev.electlock.data; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.Date; import com.ComBase; public class ElectLock_State { public static final int Unlock_Type_485 = 0; //485 public static final int Unlock_Type_ID = 1; //ID卡 public static final int Unlock_Type_Bluetooth = 2; //蓝牙 public static final int Unlock_Type_DI = 3; //DI // public static int Reg_Count_Real = 8; //寄存器数量 // public static int Reg_Count_Real = 11; //寄存器数量 public static int Reg_Count_Real = 12; //寄存器数量 private Date record_time = new Date(0); //'更新时间', private String gprs_sn; //'gprs模块SN码', private String client_ip; //'设备IP地址', private int already_id_count; //'当前锁已授权卡数量', private int max_id_count; //'授权卡数量存储上限', private int lock_state; //'电子锁状态[0-关 1-开]', private String lock_version = ""; //'软件版本号', private int unlock_type; //'上一次开锁方式[0-485开锁 1-刷卡开锁 2-蓝牙开锁 3-DI开锁]', private int unlock_id; //'上一次刷开开锁卡号[仅刷开开锁时有效]', private int lock_addr; //'设备地址', private int comm_count; //'通信计数', private int err_tol_count; //'总错误计数', private int err_count; //'连续错误计数', private int op_cmd; //'控制命令', private int id_card_set; //'授权ID卡号', private int lock_addr_set; //'设置设备地址[慎用]', private int workmodel; //工作模式【0-离线模式 1-在线模式】 private int lock_online; //锁具在线状态[0-离线 1-在线] private boolean isIDOpen = false; //是否是ID开锁 private int last_unlock_type; //'上一次开锁方式[0-485开锁 1-刷卡开锁 2-蓝牙开锁 3-DI开锁]', private int last_unlock_id; //'上一次刷开开锁卡号[仅刷开开锁时有效]', private int[] mac_addr = new int[6]; //锁具蓝牙MAC地址 private String ctl_uname = ""; //操作用户名 private int lock_open_count; //'锁具总开启次数' private Date last_update_time; //上一次锁具开启或关闭时间 public ElectLock_State() { } public boolean putByteBuffer(ByteBuffer buffer) { if(buffer.limit() < (Reg_Count_Real*2)) { System.out.println("实时信息返回长度错误" + buffer.limit()); return false; } buffer.order(ByteOrder.BIG_ENDIAN); buffer.position(0); this.already_id_count = ComBase.changeShortToInt(buffer.getShort()); //'当前锁已授权卡数量', this.max_id_count = ComBase.changeShortToInt(buffer.getShort()); //'授权卡数量存储上限', int tmp_lock_state = lock_state; this.lock_state = ComBase.changeShortToInt(buffer.getShort()); //'电子锁状态[0-关 1-开]', int ver = ComBase.changeShortToInt(buffer.getShort()); this.lock_version = " V"+ ver; //'软件版本号', this.unlock_type = ComBase.changeShortToInt(buffer.getShort()); //'上一次开锁方式[0-485开锁 1-刷卡开锁 2-蓝牙开锁 3-DI开锁]', this.unlock_id = (buffer.getInt()&0xFFFFFFFF); //'上一次刷开开锁卡号[仅刷开开锁时有效]', this.lock_addr = ComBase.changeShortToInt(buffer.getShort()); //'设备地址', for(int k =0;k<mac_addr.length;k++) { mac_addr[k] = ComBase.changeByteToInt(buffer.get()); } workmodel = ComBase.changeShortToInt(buffer.getShort()); System.out.println("工作模式:" + workmodel); // System.out.println("BlutoothMAC:" + getLockMacAddr()); //System.out.println("this.lock_state:"+tmp_lock_state+"********lock_state:"+lock_state); if(this.lock_state != tmp_lock_state) { if(this.lock_state == 1) { //锁具状态变化;锁从关闭变为打开 if(this.unlock_type == Unlock_Type_ID) { //ID最近ID卡开锁 isIDOpen = true; last_unlock_type = unlock_type; //'上一次开锁方式[0-485开锁 1-刷卡开锁 2-蓝牙开锁 3-DI开锁]', last_unlock_id = unlock_id; //'上一次刷开开锁卡号[仅刷开开锁时有效]', } this.lock_open_count ++; } //锁具状态变化 this.last_update_time = new Date(); } record_time = new Date(); buffer.compact(); return true; } public String getLockMacAddr() { return String.format("%02x:%02x:%02x:%02x:%02x:%02x", mac_addr[0],mac_addr[1],mac_addr[2],mac_addr[3],mac_addr[4],mac_addr[5]).toUpperCase(); } public void resetLockMacAddr() { for(int n=0;n<mac_addr.length;n++) { mac_addr[n] = 0xFF; } } public String getLockState() { String str = "闭锁"; if(lock_state == 1) { str = "开锁"; } return str; } public String getWorkModel() { String str = "δ֪ģʽ"; if(workmodel == 1) { str = "在线模式"; }else if(workmodel == 0){ str = "离线模式"; } return str; } public Object getUnlockType() { String str = "δ֪-" + unlock_type; switch (unlock_type) { case Unlock_Type_485:{ str = "RS485开锁"; }break; case Unlock_Type_ID:{ str = "刷卡开锁"; }break; case Unlock_Type_Bluetooth:{ str = "蓝牙开锁"; }break; case Unlock_Type_DI:{ str = "DI开锁"; }break; } return str; } public int getLockDevId() { return 10000000 + this.lock_addr; } public Date getRecord_time() { return record_time; } public String getGprs_sn() { return gprs_sn; } public String getClient_ip() { return client_ip; } public int getAlready_id_count() { return already_id_count; } public String getCtl_uname() { return ctl_uname; } public int getLock_open_count() { return lock_open_count; } public Date getLast_update_time() { return last_update_time; } public void setLock_open_count(int lock_open_count) { this.lock_open_count = lock_open_count; } public void setLast_update_time(Date last_update_time) { this.last_update_time = last_update_time; } public void setCtl_uname(String ctl_uname) { this.ctl_uname = ctl_uname; } public int getWorkmodel() { return workmodel; } public void setWorkmodel(int workmodel) { this.workmodel = workmodel; } public int getMax_id_count() { return max_id_count; } public int getLock_state() { return lock_state; } public String getLock_version() { return lock_version; } public int getUnlock_type() { return unlock_type; } public int getUnlock_id() { return unlock_id; } public int getLock_addr() { return lock_addr; } public int getComm_count() { return comm_count; } public int getErr_tol_count() { return err_tol_count; } public int getErr_count() { return err_count; } public int getLock_online() { return lock_online; } public void setLock_online(int lock_online) { this.lock_online = lock_online; } public int getOp_cmd() { return op_cmd; } public int getId_card_set() { return id_card_set; } public int getLock_addr_set() { return lock_addr_set; } public void setRecord_time(Date record_time) { this.record_time = record_time; } public void setGprs_sn(String gprs_sn) { this.gprs_sn = gprs_sn; } public void setClient_ip(String client_ip) { this.client_ip = client_ip; } public void setAlready_id_count(int already_id_count) { this.already_id_count = already_id_count; } public void setMax_id_count(int max_id_count) { this.max_id_count = max_id_count; } public void setLock_state(int lock_state) { this.lock_state = lock_state; } public void setLock_version(String lock_version) { this.lock_version = lock_version; } public void setUnlock_type(int unlock_type) { this.unlock_type = unlock_type; } public void setUnlock_id(int unlock_id) { this.unlock_id = unlock_id; } public void setLock_addr(int lock_addr) { this.lock_addr = lock_addr; } public void setComm_count(int comm_count) { this.comm_count = comm_count; } public void setErr_tol_count(int err_tol_count) { this.err_tol_count = err_tol_count; } public void setErr_count(int err_count) { this.err_count = err_count; } public void setOp_cmd(int op_cmd) { this.op_cmd = op_cmd; } public void setId_card_set(int id_card_set) { this.id_card_set = id_card_set; } public void setLock_addr_set(int lock_addr_set) { this.lock_addr_set = lock_addr_set; } public boolean isIDOpen() { return isIDOpen; } public int getLast_unlock_type() { return last_unlock_type; } public int getLast_unlock_id() { return last_unlock_id; } public void setIDOpen(boolean isIDOpen) { this.isIDOpen = isIDOpen; } public void setLast_unlock_type(int last_unlock_type) { this.last_unlock_type = last_unlock_type; } public void setLast_unlock_id(int last_unlock_id) { this.last_unlock_id = last_unlock_id; } public void addCommCount() { this.comm_count ++ ; if(this.comm_count > 999990000) { this.comm_count = 0; } } public void clearErrorCount() { this.err_count = 0; } public void addErrorCount() { this.err_tol_count ++ ; if(this.err_tol_count > 999990000) { this.err_tol_count = 0; } err_count++; } @Override public String toString() { return "ElectLock_State [record_time=" + record_time + ", gprs_sn=" + gprs_sn + ", client_ip=" + client_ip + ", already_id_count=" + already_id_count + ", max_id_count=" + max_id_count + ", lock_state=" + lock_state + ", lock_version=" + lock_version + ", unlock_type=" + unlock_type + ", unlock_id=" + unlock_id + ", lock_addr=" + lock_addr + ", comm_count=" + comm_count + ", err_tol_count=" + err_tol_count + ", err_count=" + err_count + ", op_cmd=" + op_cmd + ", id_card_set=" + id_card_set + ", lock_addr_set=" + lock_addr_set + "]"; } public static void main(String[] args) { int[] ss = new int[] {1,58,65,21,54,23}; System.out.println(String.format("%02x:%02x:%02x:%02x:%02x:%02x", ss[0],ss[1],ss[2],ss[3],ss[4],ss[5]).toUpperCase()); } } Device_Simulator_DTS_Tester/src/com/dev/electlock/electlock_page_base.java
New file Diff too large Device_Simulator_DTS_Tester/src/com/dev/electlock/electlock_util.java
New file @@ -0,0 +1,69 @@ package com.dev.electlock; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.ArrayList; import java.util.List; import com.dev.bts.data.FBS9100_ComBase; import com.dev.simpower.dev.Power_ComBase; public class electlock_util { /** * 构造电源告警名称数组 * @return */ public static List<String> createPowerAlmName() { List<String> power_almname = new ArrayList<>(); power_almname.add("交流停电告警"); power_almname.add("门禁开启告警"); power_almname.add("水浸告警"); power_almname.add("防雷器告警"); power_almname.add("锂电池BMS通信异常告警"); power_almname.add("电源模块通信异常告警"); power_almname.add("交流输入告警"); power_almname.add("组端电压告警"); for(int n = 0;n<Power_ComBase.LIBMSDATA_MAX_COUNT;n++) { for(int k = 0;k<Power_ComBase.MON_MAX_COUNT;k++) { power_almname.add("锂电池包"+(n+1)+"=>#"+(k+1)+"单体电压告警"); } } power_almname.add("电池放电电流大告警"); power_almname.add("电池充电电流大告警"); power_almname.add("直流输出电流大告警"); power_almname.add("设备温度高告警"); return power_almname; } public static ByteBuffer createControlByteBuffer(boolean control) { ByteBuffer buffer = ByteBuffer.allocate(2); buffer.order(ByteOrder.BIG_ENDIAN); buffer.position(0); buffer.putShort(FBS9100_ComBase.changeIntToShort(control?1:0)); buffer.flip(); return buffer; } public static ByteBuffer createSysUpdateControlByteBuffer(int control) { ByteBuffer buffer = ByteBuffer.allocate(2); buffer.order(ByteOrder.BIG_ENDIAN); buffer.position(0); buffer.putShort(FBS9100_ComBase.changeIntToShort(control)); buffer.flip(); return buffer; } // public static void main(String[] args) { // System.out.println(createPowerAlmName()); // System.out.println(createPowerAlmName().size()); // } } Device_Simulator_DTS_Tester/src/com/dev/modbus/MyModBusRtu.java
@@ -9,6 +9,7 @@ public static final int BYTE_LEN = 5; public static final short CMD_TYPE_READ = 0x03; //读 public static final short CMD_TYPE_READ_INPUT = 0x04; //读输入寄存器 public static final short CMD_TYPE_WRITE_YC = 0x05; public static final short CMD_TYPE_WRITE_STD = 0x06; //单点写入 @@ -70,7 +71,9 @@ if(CMD_TYPE_READ == this.Cmd) { this.data_count = tmpbuf.get()&0xFF; }else if(CMD_TYPE_WRITE_STD == this.Cmd || CMD_TYPE_WRITE_MULTY == this.Cmd || CMD_TYPE_WRITE_SysUpdate == this.Cmd){ }else if(CMD_TYPE_READ_INPUT == this.Cmd){ this.data_count = tmpbuf.get()&0xFF; }else if(CMD_TYPE_WRITE_STD == this.Cmd || CMD_TYPE_WRITE_YC == this.Cmd || CMD_TYPE_WRITE_MULTY == this.Cmd || CMD_TYPE_WRITE_SysUpdate == this.Cmd){ this.reg_addr = tmpbuf.getShort()&0xFFFF; //寄存器地址 this.result = tmpbuf.getShort()&0xFFFF; Device_Simulator_DTS_Tester/src/main/main_window_computer.java
@@ -50,6 +50,7 @@ import com.dev.btsm.bts_page_base; import com.dev.bybb.bybb_page_base; import com.dev.dummyload.DummyLoad_page_base; import com.dev.electlock.electlock_page_base; import com.dev.fbo4830.fbo4830_page_base; import com.dev.fbs9600_curr.module_curr_page; import com.dev.fbs9600_groupvol.FCF651_groupvol_page; @@ -136,7 +137,7 @@ public static final boolean APP_ICA_200KW_EN = true; //ICA-200KW public static final boolean APP_Elect_Lock_EN = true; //电子锁调试工具 public int CommDevType = 4; //默认显示tab选项卡 public int CommDevType = 9; //默认显示tab选项卡 public static final int DebugMode_TYPE_Debug = 0; //调试模拟 public static final int DebugMode_TYPE_Package = 1; //电脑打包模式 @@ -182,6 +183,7 @@ private JPanel main_TabbedTopPane14; private JPanel main_TabbedTopPane15; private JPanel main_TabbedTopPane16; private JPanel main_TabbedTopPane17; private JPanel main_TabbedRightPane0; private JPanel main_TabbedRightPane1; @@ -200,6 +202,7 @@ private JPanel main_TabbedRightPane14; private JPanel main_TabbedRightPane15; private JPanel main_TabbedRightPane16; private JPanel main_TabbedRightPane17; private JButton btn_renew_commport; @@ -239,7 +242,8 @@ private power_page_base panel_power_page_base; //极简化电源 private iac_600kw_page panel_ica_600kw_page; //ICA-200KW private iac_600kw_page panel_ica_600kw_page; //ICA-200KW private electlock_page_base panel_elect_lock_page; //蓝牙电子锁 private List<JPanel> pre_panels = new ArrayList<>(); //前置面板空白面板 @@ -788,6 +792,8 @@ main_TabbedTopPane15.setLayout(new BoxLayout(main_TabbedTopPane15, BoxLayout.X_AXIS)); main_TabbedTopPane16 = new JPanel(); main_TabbedTopPane16.setLayout(new BoxLayout(main_TabbedTopPane16, BoxLayout.X_AXIS)); main_TabbedTopPane17 = new JPanel(); main_TabbedTopPane17.setLayout(new BoxLayout(main_TabbedTopPane17, BoxLayout.X_AXIS)); main_TabbedRightPane0 = new JPanel(); @@ -824,6 +830,8 @@ main_TabbedRightPane15.setLayout(new BorderLayout()); main_TabbedRightPane16 = new JPanel(); main_TabbedRightPane16.setLayout(new BorderLayout()); main_TabbedRightPane17 = new JPanel(); main_TabbedRightPane17.setLayout(new BorderLayout()); top_panel1 = new JPanel(); top_panel1.setLayout(new BoxLayout(top_panel1, BoxLayout.X_AXIS)); @@ -1127,8 +1135,18 @@ //客户端通信 int tcp_type = cb_tcp_udp.getSelectedIndex(); System.out.println("tcp_type:" + tcp_type); } } } else if(main_window_computer.CommDevType_Elect_Lock == main_DevType) { if(SPCommMon.COMM_PORT_TYPE_Serial == comm_type) { //串口通信 int dev_addr = Integer.parseInt(tf_target_addr.getText().trim()); comm_open_res = panel_elect_lock_page.openCommPort(comm_type, spname_or_ipaddr, bitrate_or_ipport, dev_addr, m_Log); }else if(SPCommMon.COMM_PORT_TYPE_Socket == comm_type){ //客户端通信 int tcp_type = cb_tcp_udp.getSelectedIndex(); System.out.println("tcp_type:" + tcp_type); } } if(true == comm_open_res) { @@ -1219,6 +1237,9 @@ } if(null != panel_ica_600kw_page) { panel_ica_600kw_page.closeCommPort(); } if(null != panel_elect_lock_page) { panel_elect_lock_page.closeCommPort(); } tf_target_addr.setEditable(true); btn_renew_commport.setEnabled(true); @@ -1831,7 +1852,7 @@ main_TabbedPane.setIconAt(CommDevType_ICA_200KW, new ImageIcon(main_window_computer.class.getResource("/png_16x16/layer_treansparent.png"))); if(DebugMode == DebugMode_TYPE_Package) { //设置软件打开时默认软件全屏 frmSerialport.setExtendedState(JFrame.MAXIMIZED_BOTH); //frmSerialport.setExtendedState(JFrame.MAXIMIZED_BOTH); } } @@ -1851,6 +1872,40 @@ pre_panels.add(new JPanel()); } if(APP_Elect_Lock_EN) { CommDevType_Elect_Lock = jtable_index++; String bybb_title = "智能电子锁"; panel_elect_lock_page = new electlock_page_base(); if(DebugMode == DebugMode_TYPE_Screen) { main_TabbedPane.add(bybb_title, new JPanel()); }else { main_TabbedPane.add(bybb_title, main_TabbedRightPane17); main_TabbedPane.setIconAt(CommDevType_Elect_Lock, new ImageIcon(main_window_computer.class.getResource("/png_16x16/layer_treansparent.png"))); if(DebugMode == DebugMode_TYPE_Package) { //设置软件打开时默认软件全屏 //frmSerialport.setExtendedState(JFrame.MAXIMIZED_BOTH); } } main_TabbedRightPane17.add(main_TabbedTopPane17,BorderLayout.NORTH); main_TabbedRightPane17.add(panel_elect_lock_page,BorderLayout.CENTER); tabbedTopPanes.add(main_TabbedTopPane17); tabbedRightPanes.add(main_TabbedRightPane17); if(CommDevType == CommDevType_Elect_Lock) { //当默认是 cb_comm_bitrate.setSelectedIndex(3); //默认波特率9600 tf_target_addr.setText("1"); //默认设备地址1 } }else { pre_panels.add(new JPanel()); } if(pre_panels.size() > 0) { for (JPanel jPanel : pre_panels) { @@ -1956,6 +2011,9 @@ }else if(CommDevType_ICA_200KW == CommDevType) { frmSerialport.getContentPane().add(top_panel1, BorderLayout.NORTH); mTitle = "ICA-600KW调试工具"; }else if(CommDevType_Elect_Lock == CommDevType) { frmSerialport.getContentPane().add(top_panel1, BorderLayout.NORTH); mTitle = "智能电子锁"; } } else if(DebugMode == DebugMode_TYPE_Screen){ //btn_back = null; @@ -2078,6 +2136,11 @@ tf_rxcnt.setText(String.format("RX:%d", panel_ica_600kw_page.Comm_ICA.comm_rx_cnt)); panel_ica_600kw_page.updateData(); } else if(CommDevType_Elect_Lock == main_DevType) { tf_txcnt.setText(String.format("TX:%d", panel_elect_lock_page.Comm_Lock.comm_tx_cnt)); tf_rxcnt.setText(String.format("RX:%d", panel_elect_lock_page.Comm_Lock.comm_rx_cnt)); panel_elect_lock_page.updateData(); } } catch (Exception e) { m_Log.error(e.toString(), e); Device_Simulator_DTS_Tester/src/version.txt
@@ -1,5 +1,11 @@ 智能电子锁 V1.107 edit by lijun 2025-04-10 1.基本完成智能电子锁遥信,遥测,遥调,遥控基本功能 全功能假负载调试工具 V1.101 edit by lijun 2024-02-21