lisai17@sina.com 2021-03-08 19:31:36 +08:00
parent f54734c197
commit 5bfea9b517
4 changed files with 103 additions and 92 deletions

View File

@ -59,7 +59,7 @@ public class KeLiScale extends AbsScale {
ArrayList<String> list = new ArrayList<>(); ArrayList<String> list = new ArrayList<>();
AtomicBoolean run = new AtomicBoolean(true); AtomicBoolean run = new AtomicBoolean(true);
InputStream inputStream = socket.getInputStream(); try (InputStream inputStream = socket.getInputStream()) {
byte[] clearBuf = new byte[inputStream.available()]; byte[] clearBuf = new byte[inputStream.available()];
inputStream.read(clearBuf); inputStream.read(clearBuf);
int errCount = 0; int errCount = 0;
@ -99,6 +99,10 @@ public class KeLiScale extends AbsScale {
// System.out.println("读一次耗时:" + (System.currentTimeMillis() - st) + ", " + Double.parseDouble(flip(weight))); // System.out.println("读一次耗时:" + (System.currentTimeMillis() - st) + ", " + Double.parseDouble(flip(weight)));
list.add(weight); list.add(weight);
} }
} catch (Exception e) {
log.error(e.getMessage(), e);
}
String max = "0"; String max = "0";
if (list.size() > 0) { if (list.size() > 0) {

View File

@ -52,7 +52,7 @@ public class XiShuiScale extends AbsScale {
ArrayList<String> list = new ArrayList<>(); ArrayList<String> list = new ArrayList<>();
AtomicBoolean run = new AtomicBoolean(true); AtomicBoolean run = new AtomicBoolean(true);
InputStream inputStream = socket.getInputStream(); try (InputStream inputStream = socket.getInputStream()) {
byte[] clearBuf = new byte[inputStream.available()]; byte[] clearBuf = new byte[inputStream.available()];
inputStream.read(clearBuf); inputStream.read(clearBuf);
int errCount = 0; int errCount = 0;
@ -92,6 +92,10 @@ public class XiShuiScale extends AbsScale {
// System.out.println("读一次耗时:" + (System.currentTimeMillis() - st) + ", " + Double.parseDouble(flip(weight))); // System.out.println("读一次耗时:" + (System.currentTimeMillis() - st) + ", " + Double.parseDouble(flip(weight)));
list.add(weight); list.add(weight);
} }
} catch (Exception e) {
log.error(e.getMessage(), e);
}
String max = "0"; String max = "0";
if (list.size() > 0) { if (list.size() > 0) {

View File

@ -55,7 +55,7 @@ public class YaoHuaScale extends AbsScale {
ArrayList<String> list = new ArrayList<>(); ArrayList<String> list = new ArrayList<>();
AtomicBoolean run = new AtomicBoolean(true); AtomicBoolean run = new AtomicBoolean(true);
InputStream inputStream = socket.getInputStream(); try (InputStream inputStream = socket.getInputStream()) {
byte[] clearBuf = new byte[inputStream.available()]; byte[] clearBuf = new byte[inputStream.available()];
inputStream.read(clearBuf); inputStream.read(clearBuf);
int errCount = 0; int errCount = 0;
@ -94,6 +94,9 @@ public class YaoHuaScale extends AbsScale {
// System.out.println("读一次耗时:" + (System.currentTimeMillis() - st) + ", " + Double.parseDouble(flip(weight))); // System.out.println("读一次耗时:" + (System.currentTimeMillis() - st) + ", " + Double.parseDouble(flip(weight)));
list.add(weight); list.add(weight);
} }
} catch (Exception e) {
log.error(e.getMessage(), e);
}
String max = "0"; String max = "0";
if (list.size() > 0) { if (list.size() > 0) {

View File

@ -95,7 +95,7 @@ public class Config extends JFinalConfig {
public static DeviceThread deviceThread = new DeviceThread(); public static DeviceThread deviceThread = new DeviceThread();
public static SocketIOService socketio = null; public static SocketIOService socketio = null;
private static boolean client_run = true; private static boolean client_run = true;
public static final String CLINET_VERSION = "20210307"; public static final String CLINET_VERSION = "20210308";
public static String getRootPath() { public static String getRootPath() {
return PathKit.getWebRootPath() return PathKit.getWebRootPath()