| | |
| | | private JRadioButton hexRadio; |
| | | private JRadioButton asciiRadio; |
| | | private JCheckBox hexSendCheckBox; |
| | | private JCheckBox pairCheckBox; |
| | | |
| | | // 表格模型 - 只有1行 |
| | | private Object[][] tableData = new Object[1][7]; |
| | |
| | | ButtonGroup formatGroup = new ButtonGroup(); |
| | | hexRadio = new JRadioButton(getString("hex"), true); // 默认选中HEX |
| | | asciiRadio = new JRadioButton(getString("ascii")); |
| | | |
| | | pairCheckBox = new JCheckBox(getString("pair"), false); // 默认不勾选 |
| | | pairCheckBox.addItemListener(e -> { |
| | | if (pairCheckBox.isSelected()) { |
| | | sendField.setText("55AA030304F5FF"); |
| | | } else { |
| | | sendField.setText(""); |
| | | } |
| | | }); |
| | | |
| | | |
| | | formatGroup.add(hexRadio); |
| | | formatGroup.add(asciiRadio); |
| | | |
| | | formatPanel.add(hexRadio); |
| | | formatPanel.add(asciiRadio); |
| | | formatPanel.add(pairCheckBox); |
| | | |
| | | |
| | | // 将格式选择面板添加到日志面板的底部 |
| | | logPanel.add(formatPanel, BorderLayout.SOUTH); |
| | |
| | | Dell55AA1FParser.ParseResult result = Dell55AA1FParser.parse(displayText, "127.0.0.1", 0); |
| | | if (result != null) { |
| | | updateTable(result); |
| | | visualizationPanel.updatePosition(result.distance, result.angle); |
| | | visualizationPanel.updatePosition(result.distance, result.angle,result.signalQuality); |
| | | visualizationPanel.setTagId(result.tagId); |
| | | } |
| | | }else if(displayText.startsWith("55AA01")) { |
| | | ParseResult result=Dell55AA01Parser.parse(displayText, "127.0.0.1", 0); |
| | | visualizationPanel.updatePosition(result.distance,270); |
| | | visualizationPanel.updatePosition(result.distance,270,0); |
| | | visualizationPanel.setTagId(result.tagId); |
| | | |
| | | } |
| | |
| | | hexRadio.setText(getString("hex")); |
| | | asciiRadio.setText(getString("ascii")); |
| | | hexSendCheckBox.setText(getString("hex_send")); |
| | | pairCheckBox.setText(getString("pair")); |
| | | |
| | | // 更新边框标题 |
| | | updateBorderTitles(this); |