From 6a2a4da3f493f66a8413bec5d961e61b32a2800b Mon Sep 17 00:00:00 2001 From: sige Date: Wed, 5 Jun 2024 11:12:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B7=E6=9C=AC=E6=B5=8B=E8=AF=95=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iflytop/a800/task/TubeTestTask.java | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/iflytop/a800/task/TubeTestTask.java b/src/main/java/com/iflytop/a800/task/TubeTestTask.java index a773570..cfb7962 100644 --- a/src/main/java/com/iflytop/a800/task/TubeTestTask.java +++ b/src/main/java/com/iflytop/a800/task/TubeTestTask.java @@ -6,6 +6,7 @@ import com.iflytop.a800.TaskBase; import com.iflytop.a800.device.Device; import com.iflytop.a800.model.MdbIdChip; import com.iflytop.a800.model.MdbProject; +import com.iflytop.a800.model.MdbTest; import com.iflytop.a800.resource.*; import com.iflytop.a800.utils.ScanResultAnalysisAlgo; import com.iflytop.uf.UfCmdSnippetExecutor; @@ -13,12 +14,16 @@ import com.iflytop.uf.util.UfCommon; import com.iflytop.uf.util.UfJsonHelper; import java.util.*; public class TubeTestTask extends TaskBase { + // 测试试管 + public TestTube tube; // 测试项目 public MdbProject project; + public TestTubeRack tubeRack; - public TestTube tube; public String status; + // 测试记录 + private MdbTest test; // 缓冲液试管 private BufferTube bufferTube; // 大容量缓冲液试管 @@ -32,7 +37,9 @@ public class TubeTestTask extends TaskBase { public void prepare() { var device = Device.getInstance(); this.bufferTube = device.bufferTube.alloc(); - this.largeBufferTube = device.largeBufferTube.getTube(); + if ("yes".equals(this.project.isLargeBufferRequired)) { + this.largeBufferTube = device.largeBufferTube.getTube(); + } this.testCard = device.testCard.alloc(); this.idChip = new MdbIdChip(); this.idChip.peakCount = 3; @@ -47,6 +54,10 @@ public class TubeTestTask extends TaskBase { "wb", Map.of("a", 1.0, "b", 2.0, "c", 3.0, "d", 4.0) ) ))); + + // 测试记录 + this.test = new MdbTest(); + this.test.save(); } @Override @@ -103,7 +114,6 @@ public class TubeTestTask extends TaskBase { Device device = Device.getInstance(); var pipette = device.pipette; pipette.tipPickUp(); - String source = stepNode.get("source").asText(); Integer volume = stepNode.get("volume").asInt(); if ( "LargeBufferTube".equals(source) ) { @@ -222,8 +232,8 @@ public class TubeTestTask extends TaskBase { results.add(Map.of("name",itemName,"value",value,"unit","xx/xx")); } - String testResult = UfJsonHelper.objectToJson(results); - System.out.println(testResult); + this.test.result = UfJsonHelper.objectToJson(results); + this.test.save(); } /**