diff --git a/src/main/java/a8k/appbean/HardwareException.java b/src/main/java/a8k/appbean/HardwareException.java index bd0019b..79e28f9 100644 --- a/src/main/java/a8k/appbean/HardwareException.java +++ b/src/main/java/a8k/appbean/HardwareException.java @@ -10,6 +10,7 @@ public class HardwareException extends Exception { A8kEcode errorCode; MId moduleId; CmdId cmdId; + String extmessage; public HardwareException() { super(); @@ -29,6 +30,14 @@ public class HardwareException extends Exception { this.cmdId = cmd; } + public HardwareException(A8kEcode ecode, String extmessage) { + super(String.format("Error code %s", ecode)); + this.errorCode = ecode; + this.moduleId = null; + this.cmdId = null; + this.extmessage = extmessage; + } + public HardwareException(A8kEcode ecode) { super(String.format("Error code %s", ecode)); this.errorCode = ecode; @@ -48,4 +57,7 @@ public class HardwareException extends Exception { return cmdId; } + public String getExtMessage() { + return extmessage; + } } diff --git a/src/main/java/a8k/appbean/cfg/SmallBottleBufferPos.java b/src/main/java/a8k/appbean/cfg/SmallBottleBufferPos.java index 276d92f..693841d 100644 --- a/src/main/java/a8k/appbean/cfg/SmallBottleBufferPos.java +++ b/src/main/java/a8k/appbean/cfg/SmallBottleBufferPos.java @@ -42,7 +42,13 @@ public class SmallBottleBufferPos { public Integer smallBottleBufDistributeZPos; //小瓶缓冲液吐液高度 public Integer detectMaterialDistributeZpos; //探测物质吐液高度 - public SmallBottleBufferPos(){ + public Integer cgetMAX_COL() {return 5;} + + public Integer cgetMAX_ROW() {return 5;} + + public Integer cgetBottomNum() {return 5 * 5;} + + public SmallBottleBufferPos() { g0TopLelf = new Pos2d(0, 0); g1TopLelf = new Pos2d(0, 0); g2TopLelf = new Pos2d(0, 0); @@ -90,4 +96,39 @@ public class SmallBottleBufferPos { this.detectMaterialDistributeZpos = detectMaterialDistributeZpos; } + Pos2d cgetTopLelf(Integer group) { + return switch (group) { + case 0 -> g0TopLelf; + case 1 -> g1TopLelf; + case 2 -> g2TopLelf; + case 3 -> g3TopLelf; + case 4 -> g4TopLelf; + case 5 -> g5TopLelf; + default -> null; + }; + } + + Pos2d cgetScanPos(Integer group) { + Pos2d topLelf = cgetTopLelf(group); + if (topLelf == null) { + return null; + } + return new Pos2d(topLelf.x + scanRelaPos.x, topLelf.y + scanRelaPos.y); + } + + Pos2d cgetBottlePos(Integer group, Integer bottleIndex) { + Pos2d topLelf = cgetTopLelf(group); + assert topLelf != null; + int col = bottleIndex % 5; + int row = bottleIndex / 5; + return new Pos2d(topLelf.x + col * xSpacing, topLelf.y + row * ySpacing); + } + + Pos3d cgetBottlePiercedPos(Integer group, Integer bottleIndex) { + Pos2d bottlePos = cgetBottlePos(group, bottleIndex); + return new Pos3d(bottlePos.x, bottlePos.y, piercedZPos); + } + + + } diff --git a/src/main/java/a8k/appbean/ecode/AppRet.java b/src/main/java/a8k/appbean/ecode/AppRet.java index 0d5a4fd..07da8d5 100644 --- a/src/main/java/a8k/appbean/ecode/AppRet.java +++ b/src/main/java/a8k/appbean/ecode/AppRet.java @@ -116,8 +116,8 @@ public class AppRet { r.success = false; r.ecode = new AppRetEcodeInfo(hexcep.getErrorCode(), hexcep.getModuleId(), hexcep.getCmdId()); r.data = null; - r.traceInfo = trace; - r.message = r.ecode.toDisPlayString(); + r.traceInfo = r.ecode.toDisPlayString()+hexcep.getExtMessage(); + r.message = r.ecode.toDisPlayString()+hexcep.getExtMessage(); } else { r.success = false; r.ecode = new AppRetEcodeInfo(A8kEcode.CodeException, null, null); diff --git a/src/main/java/a8k/service/hardware/HbotControlService.java b/src/main/java/a8k/service/hardware/HbotControlService.java index 9c2953c..9212c5a 100644 --- a/src/main/java/a8k/service/hardware/HbotControlService.java +++ b/src/main/java/a8k/service/hardware/HbotControlService.java @@ -76,7 +76,7 @@ public class HbotControlService implements HardwareCtrlModule { new Pos2d(3947, -15), 92.4, 92.4, - 585)); + 590)); } @@ -360,6 +360,8 @@ public class HbotControlService implements HardwareCtrlModule { var posInfo = getSmallBottleBufferPosInfo(); + + return null; }