From 2cba21c62d5479cbceaee2969fcc39d311423e2d Mon Sep 17 00:00:00 2001 From: zhaohe Date: Thu, 17 Oct 2024 10:36:54 +0800 Subject: [PATCH] update --- app.db | Bin 225280 -> 225280 bytes .../a8k/hardware/type/a8kcanprotocol/A8kEcode.java | 5 + .../devicedriver/basectrl/PipetteCtrlModule.java | 5 +- .../calibration/HbotConsumablePosCalibration.java | 113 ++++++++++++++--- .../app/devicedriver/pos/HbotConsumablePosMgr.java | 133 ++++++++++----------- src/main/java/a8k/type/HbotConsumablePos.java | 38 ------ src/main/java/a8k/type/HbotConsumablePosParam.java | 35 ++++++ src/main/java/a8k/type/TipColumnNum.java | 16 +++ src/main/java/a8k/type/TipRefPoint.java | 23 ++++ src/main/java/a8k/type/TipRowNum.java | 14 +++ src/main/java/a8k/utils/ZSimplAlgo.java | 21 ++++ 11 files changed, 279 insertions(+), 124 deletions(-) delete mode 100644 src/main/java/a8k/type/HbotConsumablePos.java create mode 100644 src/main/java/a8k/type/HbotConsumablePosParam.java create mode 100644 src/main/java/a8k/type/TipColumnNum.java create mode 100644 src/main/java/a8k/type/TipRefPoint.java create mode 100644 src/main/java/a8k/type/TipRowNum.java create mode 100644 src/main/java/a8k/utils/ZSimplAlgo.java diff --git a/app.db b/app.db index f739c7f8a3f7bab7d716222a38add1ab3446f611..e902213856a617f247fcb993ee6ca625f8bd9bab 100644 GIT binary patch delta 583 zcmZp8z}xVEcY>6VUJwHVgE3e3lfu4GxO3TT=GkSwp$wMnV2F$bB`jRCf(_KEtn-)!CIz!TQExt z8(QcnRVi7SS{T)uRf3Hb1{*66R%3*2tbv|^Qw7){Lo;ScE~p{{1B2-SX3WwYX5~mm zNT3-J32~W$-u6ZlW?g1h3!on$mdSxtV)y}QnSpB>8^d%)OJ@D);ug#zY}~30EGPF delta 369 zcmZp8z}xVEcY>6V?qUW826G@b17Z~h296UGb&S}6qIzXr8&me2=j*6s7dJL$Y>6#N zOv*`}?07+Vv*QIjMy8I6&5akOnV34tH_yBL3&=0qJnQNMAYHn-=K4`~rjE*H=lku> z_Zhc4-)A})z@pC5#4w%1fZ1=epulowj)+1w22)+}`00k$%p%k0nK1KD-)hM$G5vxq zvp5HbHiI^* tipRefPosList; + Pos3d tip000 = new Pos3d(0, 0, 0); + Double tipdx; + Double tipdy; + + // TipRefPoint findTipRefPoint(TipRowNum row, TipColumnNum col) { + // for (TipRefPoint tipRefPoint : tipRefPosList) { + // if (tipRefPoint.row == row && tipRefPoint.col == col) { + // return tipRefPoint; + // } + // } + // return null; + // } + + @ExtApiFn(name = "开始标定Tip坐标", group = "标定TIP坐标", order = 20) + public void startCalibrateTipPos(TipGroup tipGroup) { + this.tipGroup = tipGroup; + tipRefPosList = new java.util.ArrayList<>(); + } + + + @ExtApiFn(name = "添加Tip参考点", group = "标定TIP坐标", order = 21) + public void addTipPosRefPoint(TipRowNum row, TipColumnNum columnNum) throws AppException { enableModule(); Pos2d xypos = hbotModule.readPos(); pipetteCtrlModule.zMotorMeasureDistance(); Integer z = pipetteCtrlModule.zMotorReadMeasureDistanceResult(); - hbotConsumablePosMgr.setParam(hbotConsumablePos, new Pos3d(xypos.x, xypos.y, z)); - if (hbotConsumablePos.ordinal() <= HbotConsumablePos.Tip02_119Pos.ordinal()) { - pipetteCtrlModule.putTipBlock(); + pipetteCtrlModule.putTipBlock(); + tipRefPosList.add(new TipRefPoint(row, columnNum, new Pos3d(xypos.x, xypos.y, z))); + disableModule(); + } + + @ExtApiFn(name = "获取Tip参考点", group = "标定TIP坐标", order = 22) + public List getTipRefPosList() { + return tipRefPosList; + } + + @ExtApiFn(name = "计算Tip坐标", group = "标定TIP坐标", order = 23) + public ObjectNode computeTipGroupPos() throws AppException { + TipRefPoint tip_ref_01_01 = tipRefPosList.stream().filter(tipRefPoint -> tipRefPoint.eq(TipRowNum.ROW01, TipColumnNum.Colu01)).findFirst().orElse(null); + + if (tip_ref_01_01 == null) { + throw new AppException(A8kEcode.CALIBRATION_TIP_REF_POINT_NOT_ENOUGH); } + + + //计算tip01_01_x,取所有第一列tip坐标x的平局值 + Double tip01_01_x = ZSimplAlgo.computeAverage( + tipRefPosList.stream().filter(tipRefPoint -> tipRefPoint.col == TipColumnNum.Colu01). + map(tipRefPoint -> Double.valueOf(tipRefPoint.pos.x)).toList() + ); + + //计算tip01_01_y,取所有第1行tip坐标y的平局值 + Double tip01_01_y = ZSimplAlgo.computeAverage( + tipRefPosList.stream().filter(tipRefPoint -> tipRefPoint.row == TipRowNum.ROW01). + map(tipRefPoint -> Double.valueOf(tipRefPoint.pos.y)).toList() + ); + + //计算z,取所有tip坐标z的平局值 + Double tip01_01_z = ZSimplAlgo.computeAverage( + tipRefPosList.stream().map(tipRefPoint -> Double.valueOf(tipRefPoint.pos.z)).toList() + ); + //计算dx,所有点到tip01_01的距离除以行数 之后的平均值 + Double dx = ZSimplAlgo.computeAverage( + tipRefPosList.stream().filter(point -> !point.col.equals(TipColumnNum.Colu01)). + map(point -> Math.abs(point.pos.x - Double.valueOf(tip_ref_01_01.pos.x)) / point.col.ordinal()).toList() + ); + //计算dy,所有点到tip01_01的距离除以列数 之后的平均值 + Double dy = ZSimplAlgo.computeAverage( + tipRefPosList.stream().filter(point -> !point.row.equals(TipRowNum.ROW01)). + map(point -> Math.abs(point.pos.y - Double.valueOf(tip_ref_01_01.pos.y)) / point.row.ordinal()).toList() + ); + + tip01_01_z += 3; + + tip000 = new Pos3d(tip01_01_x.intValue(), tip01_01_y.intValue(), tip01_01_z.intValue()); + tipdx = dx; + tipdy = dy; + + + ObjectNode node = new ObjectMapper().createObjectNode(); + node.put("tip000", ZJsonHelper.createObjectNode(tip000)); + node.put("tipdx", tipdx); + node.put("tipdy", tipdy); + return node; + } + + @ExtApiFn(name = "保存计算结果", group = "标定TIP坐标", order = 24) + public void saveTipGroupPos() throws AppException { + hbotConsumablePosMgr.setTipGroupParam(tipGroup, tip000, tipdx, tipdy); } @@ -118,17 +200,14 @@ public class HbotConsumablePosCalibration { // 校验 // @ExtApiFn(name = "校验Tip坐标", group = "校验", order = 30) - public void testTakeTip() throws AppException { + public void testTakeTip(TipGroup tipGroup) throws AppException { resetStopFlag(); enableModule(); - for (TipGroup tipGroup : TipGroup.values()) { - for (int i = 0; i < AppConstant.TIP_NUM; i++) { - hbotControler.testTakeTip(tipGroup, i); - if (checkStopFlag()) - return; - } + for (int i = 0; i < AppConstant.TIP_NUM; i++) { + hbotControler.testTakeTip(tipGroup, i); + if (checkStopFlag()) + return; } - } @ExtApiFn(name = "校验小瓶缓冲液坐标", group = "校验", order = 31) diff --git a/src/main/java/a8k/service/app/devicedriver/pos/HbotConsumablePosMgr.java b/src/main/java/a8k/service/app/devicedriver/pos/HbotConsumablePosMgr.java index fd2f161..a815baa 100644 --- a/src/main/java/a8k/service/app/devicedriver/pos/HbotConsumablePosMgr.java +++ b/src/main/java/a8k/service/app/devicedriver/pos/HbotConsumablePosMgr.java @@ -6,14 +6,10 @@ import a8k.extapi_controler.utils.ExtApiTab; import a8k.service.db.LowerDeviceParameterDBService; import a8k.service.db.utils.PosParameterReader; import a8k.type.ConsumableGroup; -import a8k.type.HbotConsumablePos; +import a8k.type.HbotConsumablePosParam; import a8k.type.cfg.Pos3d; import a8k.type.type.TipGroup; -import a8k.utils.PlaneUtils; import a8k.utils.ZJsonHelper; -import a8k.utils.ZSqliteJdbcHelper; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; import jakarta.annotation.PostConstruct; import jakarta.annotation.Resource; @@ -22,7 +18,6 @@ import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import java.util.List; -import java.util.Map; /** * HBOT二维码扫描坐标参数 @@ -37,7 +32,7 @@ public class HbotConsumablePosMgr { LowerDeviceParameterDBService lowerDeviceParameterDBService; PosParameterReader posReader = null; - static Integer nowParaVersion = 2; + static Integer nowParaVersion = 3; @PostConstruct void initialize() { @@ -52,35 +47,24 @@ public class HbotConsumablePosMgr { logger.info("init param"); posReader.setVersion(nowParaVersion); - posReader.updatePos(HbotConsumablePos.Tip00_000Pos, new Pos3d()); - posReader.updatePos(HbotConsumablePos.Tip00_011Pos, new Pos3d()); - posReader.updatePos(HbotConsumablePos.Tip00_108Pos, new Pos3d()); - posReader.updatePos(HbotConsumablePos.Tip00_119Pos, new Pos3d()); - posReader.updatePos(HbotConsumablePos.Tip01_000Pos, new Pos3d()); - posReader.updatePos(HbotConsumablePos.Tip01_011Pos, new Pos3d()); - posReader.updatePos(HbotConsumablePos.Tip01_108Pos, new Pos3d()); - posReader.updatePos(HbotConsumablePos.Tip01_119Pos, new Pos3d()); - posReader.updatePos(HbotConsumablePos.Tip02_000Pos, new Pos3d()); - posReader.updatePos(HbotConsumablePos.Tip02_011Pos, new Pos3d()); - posReader.updatePos(HbotConsumablePos.Tip02_108Pos, new Pos3d()); - posReader.updatePos(HbotConsumablePos.Tip02_119Pos, new Pos3d()); - posReader.updatePos(HbotConsumablePos.LittleBufferPos00_00, new Pos3d()); - posReader.updatePos(HbotConsumablePos.LittleBufferPos00_24, new Pos3d()); - posReader.updatePos(HbotConsumablePos.LittleBufferPos05_00, new Pos3d()); - posReader.updatePos(HbotConsumablePos.LittleBufferPos05_24, new Pos3d()); - posReader.updatePos(HbotConsumablePos.ProbeSubstance00_00, new Pos3d()); - posReader.updatePos(HbotConsumablePos.ProbeSubstance00_24, new Pos3d()); - posReader.updatePos(HbotConsumablePos.ProbeSubstance05_00, new Pos3d()); - posReader.updatePos(HbotConsumablePos.ProbeSubstance05_24, new Pos3d()); - posReader.updatePos(HbotConsumablePos.LargeBufferPos00, new Pos3d()); - posReader.updatePos(HbotConsumablePos.LargeBufferPos05, new Pos3d()); + posReader.updatePos(HbotConsumablePosParam.TipGroup0_000Pos, new Pos3d()); + posReader.updatePos(HbotConsumablePosParam.TipGroup0_SpaceingX, 0.0); + posReader.updatePos(HbotConsumablePosParam.TipGroup0_SpaceingY, 0.0); + + posReader.updatePos(HbotConsumablePosParam.TipGroup1_000Pos, new Pos3d()); + posReader.updatePos(HbotConsumablePosParam.TipGroup1_SpaceingX, 0.0); + posReader.updatePos(HbotConsumablePosParam.TipGroup2_SpaceingY, 0.0); + + posReader.updatePos(HbotConsumablePosParam.TipGroup2_000Pos, new Pos3d()); + posReader.updatePos(HbotConsumablePosParam.TipGroup2_SpaceingX, 0.0); + posReader.updatePos(HbotConsumablePosParam.TipGroup2_SpaceingY, 0.0); } public List getParams() { List list = new java.util.ArrayList<>(); - for (HbotConsumablePos param : HbotConsumablePos.values()) { + for (HbotConsumablePosParam param : HbotConsumablePosParam.values()) { ObjectNode posNode = ZJsonHelper.createObjectNode(); posNode.put("pos", ZJsonHelper.createObjectNode(posReader.getPos(param.name(), Pos3d.class))); posNode.put("name", param.name()); @@ -91,50 +75,65 @@ public class HbotConsumablePosMgr { } - public void setParam(HbotConsumablePos param, Pos3d pos) { - posReader.updatePos(param.name(), pos); + public void setParam(HbotConsumablePosParam param, Object val) { + posReader.updatePos(param.name(), val); } + public void setTipGroupParam(TipGroup tipGroup, Pos3d tip000, Double dx, Double dy) { + HbotConsumablePosParam tip000Pos = null; + HbotConsumablePosParam tipDxPos = null; + HbotConsumablePosParam tipDyPos = null; + + if (tipGroup == TipGroup.GROUP0) { + tip000Pos = HbotConsumablePosParam.TipGroup0_000Pos; + tipDxPos = HbotConsumablePosParam.TipGroup0_SpaceingX; + tipDyPos = HbotConsumablePosParam.TipGroup0_SpaceingY; + } else if (tipGroup == TipGroup.GROUP1) { + tip000Pos = HbotConsumablePosParam.TipGroup1_000Pos; + tipDxPos = HbotConsumablePosParam.TipGroup1_SpaceingX; + tipDyPos = HbotConsumablePosParam.TipGroup2_SpaceingY; + } else if (tipGroup == TipGroup.GROUP2) { + tip000Pos = HbotConsumablePosParam.TipGroup2_000Pos; + tipDxPos = HbotConsumablePosParam.TipGroup2_SpaceingX; + tipDyPos = HbotConsumablePosParam.TipGroup2_SpaceingY; + } + + assert tip000Pos != null; + + posReader.updatePos(tip000Pos, tip000); + posReader.updatePos(tipDxPos, dx); + posReader.updatePos(tipDyPos, dy); + } public Pos3d getTipPos(TipGroup tipGroup, Integer tipoff) { - Pos3d tip000 = null; - Pos3d tip011 = null; - Pos3d tip108 = null; - Pos3d tip119 = null; + Pos3d tip000 = null; + Double dx = 0.0; + Double dy = 0.0; if (tipGroup == TipGroup.GROUP0) { - tip000 = posReader.getPos(HbotConsumablePos.Tip00_000Pos.name(), Pos3d.class); - tip011 = posReader.getPos(HbotConsumablePos.Tip00_011Pos.name(), Pos3d.class); - tip108 = posReader.getPos(HbotConsumablePos.Tip00_108Pos.name(), Pos3d.class); - tip119 = posReader.getPos(HbotConsumablePos.Tip00_119Pos.name(), Pos3d.class); + tip000 = posReader.getPos(HbotConsumablePosParam.TipGroup0_000Pos, Pos3d.class); + dx = posReader.getPos(HbotConsumablePosParam.TipGroup0_SpaceingX, Double.class); + dy = posReader.getPos(HbotConsumablePosParam.TipGroup0_SpaceingY, Double.class); } else if (tipGroup == TipGroup.GROUP1) { - tip000 = posReader.getPos(HbotConsumablePos.Tip01_000Pos.name(), Pos3d.class); - tip011 = posReader.getPos(HbotConsumablePos.Tip01_011Pos.name(), Pos3d.class); - tip108 = posReader.getPos(HbotConsumablePos.Tip01_108Pos.name(), Pos3d.class); - tip119 = posReader.getPos(HbotConsumablePos.Tip01_119Pos.name(), Pos3d.class); + tip000 = posReader.getPos(HbotConsumablePosParam.TipGroup1_000Pos, Pos3d.class); + dx = posReader.getPos(HbotConsumablePosParam.TipGroup1_SpaceingX, Double.class); + dy = posReader.getPos(HbotConsumablePosParam.TipGroup2_SpaceingY, Double.class); } else if (tipGroup == TipGroup.GROUP2) { - tip000 = posReader.getPos(HbotConsumablePos.Tip02_000Pos.name(), Pos3d.class); - tip011 = posReader.getPos(HbotConsumablePos.Tip02_011Pos.name(), Pos3d.class); - tip108 = posReader.getPos(HbotConsumablePos.Tip02_108Pos.name(), Pos3d.class); - tip119 = posReader.getPos(HbotConsumablePos.Tip02_119Pos.name(), Pos3d.class); + tip000 = posReader.getPos(HbotConsumablePosParam.TipGroup2_000Pos, Pos3d.class); + dx = posReader.getPos(HbotConsumablePosParam.TipGroup2_SpaceingX, Double.class); + dy = posReader.getPos(HbotConsumablePosParam.TipGroup2_SpaceingY, Double.class); } assert tip000 != null; - assert tip011 != null; - assert tip108 != null; - assert tip119 != null; - - //水平方向 - double dx = (tip119.x - tip000.x) / 11.0; - //前后方向 - double dy = (tip119.y - tip000.y) / 9.0; + assert dx != null; + assert dy != null; int xoff = tipoff % 12; int yoff = tipoff / 12; double x = tip000.x + xoff * dx; double y = tip000.y + yoff * dy; - double z = PlaneUtils.calculateZ(tip000, tip011, tip119, x, y); + double z = tip000.z; return new Pos3d((int) x, (int) y, (int) z); } @@ -183,24 +182,24 @@ public class HbotConsumablePosMgr { } public Pos3d getLittleBufferPos(ConsumableGroup group, Integer off) { - Pos3d pos00_00 = posReader.getPos(HbotConsumablePos.LittleBufferPos00_00.name(), Pos3d.class); - Pos3d pos00_24 = posReader.getPos(HbotConsumablePos.LittleBufferPos00_24.name(), Pos3d.class); - Pos3d pos05_00 = posReader.getPos(HbotConsumablePos.LittleBufferPos05_00.name(), Pos3d.class); - Pos3d pos05_24 = posReader.getPos(HbotConsumablePos.LittleBufferPos05_24.name(), Pos3d.class); + Pos3d pos00_00 = posReader.getPos(HbotConsumablePosParam.LittleBufferPos00_00.name(), Pos3d.class); + Pos3d pos00_24 = posReader.getPos(HbotConsumablePosParam.LittleBufferPos00_24.name(), Pos3d.class); + Pos3d pos05_00 = posReader.getPos(HbotConsumablePosParam.LittleBufferPos05_00.name(), Pos3d.class); + Pos3d pos05_24 = posReader.getPos(HbotConsumablePosParam.LittleBufferPos05_24.name(), Pos3d.class); return getLittleBufferOrProbeSubstancePos(pos00_00, pos00_24, pos05_00, pos05_24, group, off); } public Pos3d getProbeSubstancePos(ConsumableGroup group, Integer off) { - Pos3d pos00_00 = posReader.getPos(HbotConsumablePos.ProbeSubstance00_00.name(), Pos3d.class); - Pos3d pos00_24 = posReader.getPos(HbotConsumablePos.ProbeSubstance00_24.name(), Pos3d.class); - Pos3d pos05_00 = posReader.getPos(HbotConsumablePos.ProbeSubstance05_00.name(), Pos3d.class); - Pos3d pos05_24 = posReader.getPos(HbotConsumablePos.ProbeSubstance05_24.name(), Pos3d.class); + Pos3d pos00_00 = posReader.getPos(HbotConsumablePosParam.ProbeSubstance00_00.name(), Pos3d.class); + Pos3d pos00_24 = posReader.getPos(HbotConsumablePosParam.ProbeSubstance00_24.name(), Pos3d.class); + Pos3d pos05_00 = posReader.getPos(HbotConsumablePosParam.ProbeSubstance05_00.name(), Pos3d.class); + Pos3d pos05_24 = posReader.getPos(HbotConsumablePosParam.ProbeSubstance05_24.name(), Pos3d.class); return getLittleBufferOrProbeSubstancePos(pos00_00, pos00_24, pos05_00, pos05_24, group, off); } public Pos3d getLargeBufferPos(ConsumableGroup group) { - Pos3d pos00 = posReader.getPos(HbotConsumablePos.LargeBufferPos00.name(), Pos3d.class); - Pos3d pos05 = posReader.getPos(HbotConsumablePos.LargeBufferPos05.name(), Pos3d.class); + Pos3d pos00 = posReader.getPos(HbotConsumablePosParam.LargeBufferPos00.name(), Pos3d.class); + Pos3d pos05 = posReader.getPos(HbotConsumablePosParam.LargeBufferPos05.name(), Pos3d.class); int xoff = group.off % 3; int yoff = group.off / 3; diff --git a/src/main/java/a8k/type/HbotConsumablePos.java b/src/main/java/a8k/type/HbotConsumablePos.java deleted file mode 100644 index 04a0602..0000000 --- a/src/main/java/a8k/type/HbotConsumablePos.java +++ /dev/null @@ -1,38 +0,0 @@ -package a8k.type; - -public enum HbotConsumablePos { - Tip00_000Pos("第0组TIP的第0个位置"), - Tip00_011Pos("第0组TIP的第11个位置"), - Tip00_108Pos("第0组TIP的第108个位置"), - Tip00_119Pos("第0组TIP的第119个位置"), - - Tip01_000Pos("第1组TIP的第0个位置"), - Tip01_011Pos("第1组TIP的第11个位置"), - Tip01_108Pos("第1组TIP的第108个位置"), - Tip01_119Pos("第1组TIP的第119个位置"), - - Tip02_000Pos("第2组TIP的第0个位置"), - Tip02_011Pos("第2组TIP的第11个位置"), - Tip02_108Pos("第2组TIP的第108个位置"), - Tip02_119Pos("第2组TIP的第119个位置"), - - LittleBufferPos00_00("第0组小瓶的第0个位置"), - LittleBufferPos00_24("第0组小瓶的第24个位置"), - LittleBufferPos05_00("第5组小瓶的第0个位置"), - LittleBufferPos05_24("第5组小瓶的第24个位置"), - - ProbeSubstance00_00("第0组探针的第0个位置"), - ProbeSubstance00_24("第0组探针的第24个位置"), - ProbeSubstance05_00("第5组探针的第0个位置"), - ProbeSubstance05_24("第5组探针的第24个位置"), - - LargeBufferPos00("左上角大瓶位置"), - LargeBufferPos05("右下角大瓶位置"), - - ; - final public String chName; - - HbotConsumablePos(String chName) { - this.chName = chName; - } -} diff --git a/src/main/java/a8k/type/HbotConsumablePosParam.java b/src/main/java/a8k/type/HbotConsumablePosParam.java new file mode 100644 index 0000000..226a2fa --- /dev/null +++ b/src/main/java/a8k/type/HbotConsumablePosParam.java @@ -0,0 +1,35 @@ +package a8k.type; + +public enum HbotConsumablePosParam { + LittleBufferPos00_00("第0组小瓶的第0个位置"), + LittleBufferPos00_24("第0组小瓶的第24个位置"), + LittleBufferPos05_00("第5组小瓶的第0个位置"), + LittleBufferPos05_24("第5组小瓶的第24个位置"), + + ProbeSubstance00_00("第0组探针的第0个位置"), + ProbeSubstance00_24("第0组探针的第24个位置"), + ProbeSubstance05_00("第5组探针的第0个位置"), + ProbeSubstance05_24("第5组探针的第24个位置"), + + LargeBufferPos00("左上角大瓶位置"), + LargeBufferPos05("右下角大瓶位置"), + + + TipGroup0_000Pos("第1组TIP的第1个位置"), + TipGroup0_SpaceingX("第1组TIP的X间距"), + TipGroup0_SpaceingY("第1组TIP的Y间距"), + + TipGroup1_000Pos("第2组TIP的第1个位置"), + TipGroup1_SpaceingX("第2组TIP的X间距"), + TipGroup1_SpaceingY("第2组TIP的Y间距"), + + TipGroup2_000Pos("第3组TIP的第1个位置"), + TipGroup2_SpaceingX("第3组TIP的X间距"), + TipGroup2_SpaceingY("第3组TIP的Y间距"), + ; + final public String chName; + + HbotConsumablePosParam(String chName) { + this.chName = chName; + } +} diff --git a/src/main/java/a8k/type/TipColumnNum.java b/src/main/java/a8k/type/TipColumnNum.java new file mode 100644 index 0000000..592b0e8 --- /dev/null +++ b/src/main/java/a8k/type/TipColumnNum.java @@ -0,0 +1,16 @@ +package a8k.type; + +public enum TipColumnNum { + Colu01, + Colu02, + Colu03, + Colu04, + Colu05, + Colu06, + Colu07, + Colu08, + Colu09, + Colu10, + Colu11, + Colu12, +} diff --git a/src/main/java/a8k/type/TipRefPoint.java b/src/main/java/a8k/type/TipRefPoint.java new file mode 100644 index 0000000..59ac0a4 --- /dev/null +++ b/src/main/java/a8k/type/TipRefPoint.java @@ -0,0 +1,23 @@ +package a8k.type; + +import a8k.type.cfg.Pos3d; + +public class TipRefPoint { + public TipRowNum row; // 行 + public TipColumnNum col; // 列 + public Pos3d pos; + + public TipRefPoint(TipRowNum rowNum, TipColumnNum colNum, Pos3d pos) { + this.row = rowNum; + this.col = colNum; + this.pos = pos; + } + + public Boolean eq(TipRowNum row, TipColumnNum col) { + return this.row == row && this.col == col; + } + + public Boolean neq(TipRowNum row, TipColumnNum col) { + return this.row != row || this.col != col; + } +} diff --git a/src/main/java/a8k/type/TipRowNum.java b/src/main/java/a8k/type/TipRowNum.java new file mode 100644 index 0000000..6f1efea --- /dev/null +++ b/src/main/java/a8k/type/TipRowNum.java @@ -0,0 +1,14 @@ +package a8k.type; + +public enum TipRowNum { + ROW01, + ROW02, + ROW03, + ROW04, + ROW05, + ROW06, + ROW07, + ROW08, + ROW09, + ROW10, +} diff --git a/src/main/java/a8k/utils/ZSimplAlgo.java b/src/main/java/a8k/utils/ZSimplAlgo.java new file mode 100644 index 0000000..8843e1e --- /dev/null +++ b/src/main/java/a8k/utils/ZSimplAlgo.java @@ -0,0 +1,21 @@ +package a8k.utils; + +import java.util.List; + +public class ZSimplAlgo { + public static Double computeAverage(List data) { + Double sum = 0.0; + for (Double datum : data) { + sum += datum; + } + return sum / data.size(); + } + + public static Double computeAverage(Double[] data) { + Double sum = 0.0; + for (Double datum : data) { + sum += datum; + } + return sum / data.length; + } +}