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