sige 1 year ago
parent
commit
fd704d4f47
  1. BIN
      app.db
  2. 7
      src/main/java/com/iflytop/digester/StartResetTaskThread.java
  3. 2
      src/main/java/com/iflytop/digester/StopResetTaskThread.java
  4. 49
      src/main/java/com/iflytop/digester/deviceinstance/LiquidAdditionInstance.java
  5. 2
      src/main/java/com/iflytop/digester/underframework/connection/UfZcancmderWebsocket.java
  6. 3
      src/main/resources/application-dev.yml

BIN
app.db

7
src/main/java/com/iflytop/digester/StartResetTaskThread.java

@ -56,7 +56,8 @@ public class StartResetTaskThread extends Thread {
UfCmdSnippetExecutor.execute(String.format("PeristalticPumpEnable.%d",i));
}
Boolean enableSetup = UfApplication.getApp().getEnv().getProperty("app.liquidPeristalticPumpPipeSetupEnable",Boolean.class);
var env = UfApplication.getApp().getEnv();
Boolean enableSetup = env.getProperty("app.liquidPeristalticPumpPipeSetupEnable",Boolean.class);
assert enableSetup != null;
if ( !enableSetup ) {
return ;
@ -69,13 +70,15 @@ public class StartResetTaskThread extends Thread {
UfCmdSnippetExecutor.execute("DoorClose");
// 加液管充满
Integer liquidPipeVolume = env.getProperty("app.liquidPipeVolumn", Integer.class);
assert liquidPipeVolume != null;
Device device = Device.getInstance();
var tubes = List.of(0,4, 3,2, 15,11, 12,13, 1,5, 6,7, 14,10, 9,8);
for ( int i=0; i<8; i++ ) {
this.setProgressMessage("设备初始化 : 初始化加液管路 " + (i+1) + "/8");
var tubeList = tubes.subList(i*2, i*2+2);
var pumpList = List.of(2*i, 2*i+1);
device.liquidAddition.addLiquidToTubes(tubeList, pumpList, 10000);
device.liquidAddition.addLiquidToTubes(tubeList, pumpList, liquidPipeVolume);
}
// 加液管充满, 需要取出试管架

2
src/main/java/com/iflytop/digester/StopResetTaskThread.java

@ -5,7 +5,9 @@ import java.util.HashMap;
public class StopResetTaskThread extends Thread {
@Override
public void run() {
UfCmdSnippetExecutor.execute("StatusLampError");
UfCmdSnippetExecutor.execute("StopResetSetup");
UfCmdSnippetExecutor.execute("StatusLampRunning");
UfMdbNotification.action("StopResetFinished", new HashMap<>());
}
}

49
src/main/java/com/iflytop/digester/deviceinstance/LiquidAdditionInstance.java

@ -45,28 +45,37 @@ public class LiquidAdditionInstance {
for ( int batchIndex=0; batchIndex<4; batchIndex++ ) {
// 外圈
UfCmdSnippetExecutor.execute("LiquidAdditionPrepare.Out." + batchIndex);
if ( this.checkTubeExists("GOUT", batchIndex, "TOUT", tubes) ) {
var snippetKey = "LiquidAdditionPump." + pumpGroupOutIndex;
Map<String,Object> snippetParams = Map.of("volume", rotateDistance);
UfCmdSnippetExecutor.execute(snippetKey, snippetParams);
}
if ( this.checkTubeExists("GOUT", batchIndex, "TIN", tubes) ) {
var snippetKey = "LiquidAdditionPump." + pumpGroupInIndex;
Map<String,Object> snippetParams = Map.of("volume", rotateDistance);
UfCmdSnippetExecutor.execute(snippetKey, snippetParams);
Boolean hasGoutTout = this.checkTubeExists("GOUT", batchIndex, "TOUT", tubes);
Boolean hasGoutTin = this.checkTubeExists("GOUT", batchIndex, "TIN", tubes);
if ( hasGoutTout || hasGoutTin ) {
UfCmdSnippetExecutor.execute("LiquidAdditionPrepare.Out." + batchIndex);
if ( hasGoutTout ) {
var snippetKey = "LiquidAdditionPump." + pumpGroupOutIndex;
Map<String,Object> snippetParams = Map.of("volume", rotateDistance);
UfCmdSnippetExecutor.execute(snippetKey, snippetParams);
}
if ( hasGoutTin ) {
var snippetKey = "LiquidAdditionPump." + pumpGroupInIndex;
Map<String,Object> snippetParams = Map.of("volume", rotateDistance);
UfCmdSnippetExecutor.execute(snippetKey, snippetParams);
}
}
// 内圈
UfCmdSnippetExecutor.execute("LiquidAdditionPrepare.In." + batchIndex);
if ( this.checkTubeExists("GIN", batchIndex, "TOUT", tubes) ) {
var snippetKey = "LiquidAdditionPump." + pumpGroupOutIndex;
Map<String,Object> snippetParams = Map.of("volume", rotateDistance);
UfCmdSnippetExecutor.execute(snippetKey, snippetParams);
}
if ( this.checkTubeExists("GIN", batchIndex, "TIN", tubes) ) {
var snippetKey = "LiquidAdditionPump." + pumpGroupInIndex;
Map<String,Object> snippetParams = Map.of("volume", rotateDistance);
UfCmdSnippetExecutor.execute(snippetKey, snippetParams);
Boolean hasGinTout = this.checkTubeExists("GIN", batchIndex, "TOUT", tubes);
Boolean hasGinTin = this.checkTubeExists("GIN", batchIndex, "TIN", tubes);
if ( hasGinTout || hasGinTin ) {
UfCmdSnippetExecutor.execute("LiquidAdditionPrepare.In." + batchIndex);
if ( hasGinTout ) {
var snippetKey = "LiquidAdditionPump." + pumpGroupOutIndex;
Map<String,Object> snippetParams = Map.of("volume", rotateDistance);
UfCmdSnippetExecutor.execute(snippetKey, snippetParams);
}
if ( hasGinTin ) {
var snippetKey = "LiquidAdditionPump." + pumpGroupInIndex;
Map<String,Object> snippetParams = Map.of("volume", rotateDistance);
UfCmdSnippetExecutor.execute(snippetKey, snippetParams);
}
}
}

2
src/main/java/com/iflytop/digester/underframework/connection/UfZcancmderWebsocket.java

@ -157,7 +157,7 @@ public class UfZcancmderWebsocket extends UfConnectionBase {
String cmd = this.buildCommand(actuatorCmd);
UfMdbActuator actuator = UfMdbActuator.findOne(UfMdbActuator.class, actuatorCmd.actuatorId);
LOG.info("[Command-Executor:{}] {}({}) => {}", actuator.name, actuatorCmd.cmdKey, actuatorCmd.parameters, cmd);
LOG.info(" [Command-Executor:{}] {}({}) => {}", actuator.name, actuatorCmd.cmdKey, actuatorCmd.parameters, cmd);
if ( !this.client.isOpen() ) {
try {
this.client.connectBlocking();

3
src/main/resources/application-dev.yml

@ -9,7 +9,7 @@ spring:
driver-class-name: org.sqlite.JDBC
device:
snippet-execute-log-enable : false
snippet-execute-log-enable : true
connections:
- name : zcancmder
key : zcancmder
@ -35,6 +35,7 @@ mqtt-broker:
app :
errorSlotIndex : 4
liquidPeristalticPumpPipeSetupEnable : true
liquidPipeVolumn : 1
opencv-library-path: D:/ProgramFiles/OpenCV/opencv/build/java/x64/opencv_java490.dll
pylon-library-path: D:/ProgramFiles/Pylon5/Runtime/x64/PylonC_v5_2.dll
pylon-wrapper-path: D:/Sige5193/digester/src/main/java/com/iflytop/digester/camera/x64/Debug/baslerCamera.dll
Loading…
Cancel
Save