| | |
| | | import chushihua.Chushihua; |
| | | import chushihua.SlotManager; |
| | | import chushihua.lunxun; |
| | | import chushihua.lunxunzaixian; |
| | | import jiekou.lunxunkazhuangtai; |
| | | |
| | | public class Homein { |
| | | public static void main(String[] args) { |
| | |
| | | */ |
| | | private static void startApplication() { |
| | | try { |
| | | System.out.println("开始应用程序主流程..."); |
| | | |
| | | // 3. 运行串口连接对话框,等待串口连接成功 |
| | | System.out.println("步骤3: 启动串口连接..."); |
| | | boolean serialConnected = initializeSerialPort(); |
| | | |
| | | if (serialConnected) { |
| | | // 4. 串口连接成功后,启动轮询 |
| | | System.out.println("步骤4: 启动轮询查询..."); |
| | | boolean pollingStarted = startPollingService(); |
| | | |
| | | if (pollingStarted) { |
| | | // 5. 进入主界面 |
| | | System.out.println("步骤5: 启动主界面..."); |
| | | showMainInterface(); |
| | | //启动轮询卡状态给服务器发数据 |
| | | lunxunkazhuangtai.startPolling(); |
| | | //启动在线的卡状态轮询 |
| | | lunxunzaixian.startOnlinePolling(); |
| | | } else { |
| | | System.err.println("轮询服务启动失败"); |
| | | JOptionPane.showMessageDialog(null, |