| | |
| | | private JTextField tf_lock_addr; //锁具地址
|
| | | private JTextField tf_mac_addr; //锁具mac地址
|
| | | private JTextField tf_work_model; //工作模式
|
| | |
|
| | | private JTextField tf_bluetooth_st_state; //蓝牙开关状态
|
| | | private JTextField tf_bluetooth_state; //蓝牙状态
|
| | |
|
| | | private JTextField tf_set_lock_addr; //设置锁具地址
|
| | | private JButton btn_set_lock_addr; //设置锁具地址
|
| | |
| | | private JButton btn_remote_open; //远程开锁
|
| | | private JButton btn_remote_restart; //远程重启
|
| | | private JButton btn_clear_allid; //清空所有授权卡
|
| | |
|
| | | private JButton btn_open_bluetooth; //开启蓝牙
|
| | | private JButton btn_close_bluetooth; //关闭蓝牙
|
| | |
|
| | |
|
| | |
|
| | |
| | | panel_109.add(tf_mac_addr);
|
| | | tf_mac_addr.setColumns(10);
|
| | |
|
| | | //环境温度
|
| | | //工作模式
|
| | | JPanel panel_110 = new JPanel();
|
| | | panel_110.setBorder(new TitledBorder(null, "工作模式", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
| | | panel_102.add(panel_110);
|
| | |
| | | tf_work_model = new JTextField();
|
| | | panel_110.add(tf_work_model);
|
| | | tf_work_model.setColumns(10);
|
| | | |
| | | //蓝牙开关状态
|
| | | JPanel panel_111 = new JPanel();
|
| | | panel_111.setBorder(new TitledBorder(null, "蓝牙开关状态", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
| | | panel_102.add(panel_111);
|
| | | panel_111.setLayout(new BorderLayout(0, 0));
|
| | | |
| | | tf_bluetooth_st_state = new JTextField();
|
| | | panel_111.add(tf_bluetooth_st_state);
|
| | | tf_bluetooth_st_state.setColumns(10);
|
| | | |
| | | //蓝牙状态
|
| | | JPanel panel_112 = new JPanel();
|
| | | panel_112.setBorder(new TitledBorder(null, "蓝牙状态", TitledBorder.LEADING, TitledBorder.TOP, null, null));
|
| | | panel_102.add(panel_112);
|
| | | panel_112.setLayout(new BorderLayout(0, 0));
|
| | | |
| | | tf_bluetooth_state = new JTextField();
|
| | | panel_112.add(tf_bluetooth_state);
|
| | | tf_bluetooth_state.setColumns(10);
|
| | |
|
| | | //
|
| | | JPanel panel_800 = new JPanel();
|
| | |
| | | });
|
| | | btn_clear_allid.setFont(new Font("宋体", Font.PLAIN, 12));
|
| | | panel_805.add(btn_clear_allid);
|
| | | |
| | | btn_open_bluetooth = new JButton("开启蓝牙");
|
| | | btn_open_bluetooth.setEnabled(false);
|
| | | btn_open_bluetooth.addActionListener(new ActionListener() {
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | Comm_Lock.setCommCmd(MyModBusRtu.CMD_TYPE_WRITE_STD, ElectLock_ComBase.LOCK_SET_Bluetooth_ADDR, ComBase.mkUInt16Buffer(ElectLock_ComBase.Lock_Bluetooth_Open));
|
| | | //Comm_Lock.setCommCmd(MyModBusRtu.CMD_TYPE_READ, Power_ComBase.PWD_PowerParam_RegAddr_Start, ByteBuffer.allocate(0)); |
| | | }
|
| | | });
|
| | | btn_open_bluetooth.setFont(new Font("宋体", Font.PLAIN, 12));
|
| | | panel_805.add(btn_open_bluetooth);
|
| | | |
| | | btn_close_bluetooth = new JButton("关闭蓝牙");
|
| | | btn_close_bluetooth.setEnabled(false);
|
| | | btn_close_bluetooth.addActionListener(new ActionListener() {
|
| | | public void actionPerformed(ActionEvent e) {
|
| | | Comm_Lock.setCommCmd(MyModBusRtu.CMD_TYPE_WRITE_STD, ElectLock_ComBase.LOCK_SET_Bluetooth_ADDR, ComBase.mkUInt16Buffer(ElectLock_ComBase.Lock_Bluetooth_Close));
|
| | | //Comm_Lock.setCommCmd(MyModBusRtu.CMD_TYPE_READ, Power_ComBase.PWD_PowerParam_RegAddr_Start, ByteBuffer.allocate(0)); |
| | | }
|
| | | });
|
| | | btn_close_bluetooth.setFont(new Font("宋体", Font.PLAIN, 12));
|
| | | panel_805.add(btn_close_bluetooth);
|
| | |
|
| | |
|
| | |
|
| | |
| | | this.btn_remote_restart.setEnabled(state); //远程重启
|
| | | this.btn_clear_allid.setEnabled(state); //清空所有授权卡
|
| | |
|
| | | this.btn_open_bluetooth.setEnabled(state); //开启蓝牙
|
| | | this.btn_close_bluetooth.setEnabled(state); //关闭蓝牙
|
| | | |
| | |
|
| | | this.btn_param_read.setEnabled(state); //读取
|
| | | this.btn_param_write.setEnabled(state); //设置
|
| | |
| | | tf_lock_addr.setText(String.format("%d", Comm_Lock.m_ElectLock_State.getLock_addr()));;
|
| | | tf_mac_addr.setText(String.format("%s", Comm_Lock.m_ElectLock_State.getLockMacAddr()));;
|
| | | tf_work_model.setText(String.format("%s", Comm_Lock.m_ElectLock_State.getWorkModel()));;
|
| | |
|
| | | tf_bluetooth_st_state.setText(String.format("%s", Comm_Lock.m_ElectLock_State.getbluetooth_st_stateStr()));; |
| | | tf_bluetooth_state.setText(String.format("%s", Comm_Lock.m_ElectLock_State.getbluetooth_stateStr()));; |
| | |
|
| | | }
|
| | |
|