Commit e882aea1 authored by qizhiqiang's avatar qizhiqiang

中文提示变英文

parent 73fcce46
......@@ -56,7 +56,7 @@ public class RxtxUtils extends Thread implements SerialPortEventListener {
msgQueue.add(new String(readBuffer,"gbk"));
readBuffer = new byte[1024];// 重新构造缓冲对象,否则有可能会影响接下来接收的数据
} else {
msgQueue.add("额------没有读到数据");
msgQueue.add("!------No data read");
}
}
} catch (IOException e) {
......@@ -80,8 +80,8 @@ public class RxtxUtils extends Thread implements SerialPortEventListener {
// 获取相应串口对象
portId = (CommPortIdentifier) portList.nextElement();
System.out.println("设备类型:--->" + portId.getPortType());
System.out.println("设备名称:---->" + portId.getName());
System.out.println("Equipment type:--->" + portId.getPortType());
System.out.println("Device Name:---->" + portId.getName());
// 判断端口类型是否为串口
if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
// 判断如果COM7串口存在,就打开该串口
......@@ -138,7 +138,7 @@ public class RxtxUtils extends Thread implements SerialPortEventListener {
// 如果堵塞队列中存在数据就将其输出
if (msgQueue.size() > 0) {
weightings = Double.parseDouble(msgQueue.take());
System.out.println("接收到的消息:"+weightings);
System.out.println("Received messages:"+weightings);
WebSocket webSocket = new WebSocket();
webSocket.sendAllToUserMessage(String.valueOf(weightings));
// sendDate(weightings);
......
......@@ -29,9 +29,9 @@ public class ServerStart implements CommandLineRunner {
int i = cRead.startComPort(portName,bitRate,dataBits,stopBit,parityBit);
if (i == 1) {
cRead.start();
System.out.println("打开端口");
System.out.println("open port");
} else {
System.out.println("端口打开失败!");
System.out.println("Port opening failed!");
}
}
......
......@@ -21,7 +21,7 @@ public class WebSocket {
this.session = session;
//加入set中
webSocketSet.add(this);
System.out.println("建立连接:"+webSocketSet.size());
System.out.println("Establishing a connection:"+webSocketSet.size());
}
//给所有当前连接的用户发送消息
......@@ -31,7 +31,7 @@ public class WebSocket {
for (WebSocket item:
webSocketSet) {
item.session.getBasicRemote().sendText(message);
System.out.println("服务端发送的消息:"+message);
System.out.println("Messages sent by the server:"+message);
}
}
}catch (Exception e){
......@@ -43,7 +43,7 @@ public class WebSocket {
@OnClose
public void onClose(Session session){
webSocketSet.remove(this);
System.out.println("建立连接:"+webSocketSet.size());
System.out.println("Establishing a connection:"+webSocketSet.size());
}
//接收前端发送的消息
......@@ -56,7 +56,7 @@ public class WebSocket {
//发送错误时调用
@OnError
public void onError(Session session,Throwable error){
System.out.println("webSocket发送错误!!!");
System.out.println("webSocket Sending error!!!");
error.printStackTrace();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment