fix: 显示召唤数据信息

This commit is contained in:
rainerosion 2023-03-30 10:59:55 +08:00
parent a380f75718
commit 73197d7227

View File

@ -153,21 +153,17 @@ public class Swing extends JFrame {
public void actionPerformed(ActionEvent arg0) { public void actionPerformed(ActionEvent arg0) {
btnStart.setEnabled(false); btnStart.setEnabled(false);
new Thread(new Runnable() { new Thread(() -> {
String paramFilePath = System.getProperty( "user.dir" ).concat("/libs/param.dat");
rsServer = RSServer.Initiate(Integer.parseInt(txtPort.getText()), paramFilePath);// 初始化
@Override rsServer.addDataListener(listener);// 添加数据监听事件
public void run() { try {
String paramFilePath = System.getProperty( "user.dir" ).concat("/libs/param.dat"); rsServer.start();
rsServer = RSServer.Initiate(Integer.parseInt(txtPort.getText()), paramFilePath);// 初始化 } catch (InterruptedException e) {
// TODO Auto-generated catch block
rsServer.addDataListener(listener);// 添加数据监听事件 e.printStackTrace();
try { } // 启动监听服务
rsServer.start();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} // 启动监听服务
}
}).start(); }).start();
} }
@ -211,7 +207,8 @@ public class Swing extends JFrame {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
int deviceId = Integer.parseInt(txtDeviceId.getText()); int deviceId = Integer.parseInt(txtDeviceId.getText());
rsServer.callStoreData(deviceId); boolean b = rsServer.callStoreData(deviceId);
System.out.println("log -> " + b);
} }
}); });