From 781f25a9374cea4133ea8e3efcd555578744ea3f Mon Sep 17 00:00:00 2001 From: sige Date: Wed, 24 Jul 2024 18:41:03 +0800 Subject: [PATCH] 1 --- .../a8k/service/db/dao/HbotControlParamsDao.java | 87 +++++++++++++--------- 1 file changed, 51 insertions(+), 36 deletions(-) diff --git a/src/main/java/a8k/service/db/dao/HbotControlParamsDao.java b/src/main/java/a8k/service/db/dao/HbotControlParamsDao.java index af3ddbf..eeb409b 100644 --- a/src/main/java/a8k/service/db/dao/HbotControlParamsDao.java +++ b/src/main/java/a8k/service/db/dao/HbotControlParamsDao.java @@ -1,40 +1,55 @@ package a8k.service.db.dao; - import a8k.appbean.cfg.*; - -/** - * XY机械臂控制相关参数访问 - */ +import a8k.service.db.entity.HardwareServiceSetting; +import a8k.service.hardware.HbotControlService; +import a8k.utils.HardwareServiceParam; +import a8k.utils.HardwareServiceParams; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.stereotype.Component; +@Component +@HardwareServiceParams(service = HbotControlService.class) public class HbotControlParamsDao { - - Pos3d getReactionPos() { - return null; - } //滴液反应位 - - TipPickUpPosInfo TipPickUpPosInfo() { - return null; - } //TIP组0 位置信息 - - - SmallBottleBufferPos getSmallBottleBufferPosInfo() { - return null; - }//小瓶缓冲液位置 - - - Plates2dCodeScanPos getPlates2dCodeScanPosInfo() { - return null; - }//反应板夹仓位置 - - LargeBottleBufferPos getLargeBottleBufferPosInfo() { - return null; - }//大瓶缓冲液位置 - - Pos3d getEmergencyPos() { - return null; - } //急诊位 - - Pos3d getTipDropPos() { - return null; - } //tip丢弃位置 - + @HardwareServiceParam(name="滴液反应位", group="滴液反应位") + public Pos3d getReactionPos() throws Exception { + return this.getOption("ReactionPos", Pos3d.class); + } + + @HardwareServiceParam(name="TIP组位置信息", group="TIP组位置信息") + public TipPickUpPosInfo getTipPickUpPosInfo() throws Exception { + return this.getOption("TipPickUpPosInfo", TipPickUpPosInfo.class); + } + + @HardwareServiceParam(name="小瓶缓冲液位置", group="小瓶缓冲液位置") + public SmallBottleBufferPos getSmallBottleBufferPosInfo() throws Exception { + return this.getOption("SmallBottleBufferPosInfo", SmallBottleBufferPos.class); + } + + @HardwareServiceParam(name="反应板夹仓位置", group="反应板夹仓位置") + public Plates2dCodeScanPos getPlates2dCodeScanPosInfo() throws Exception { + return this.getOption("Plates2dCodeScanPosInfo", Plates2dCodeScanPos.class); + } + + @HardwareServiceParam(name="大瓶缓冲液位置", group="大瓶缓冲液位置") + public LargeBottleBufferPos getLargeBottleBufferPosInfo() throws Exception { + return this.getOption("LargeBottleBufferPosInfo", LargeBottleBufferPos.class); + } + + @HardwareServiceParam(name="急诊位", group="急诊位") + public Pos3d getEmergencyPos() throws Exception { + return this.getOption("EmergencyPos", Pos3d.class); + } + + @HardwareServiceParam(name="Tip丢弃位置", group="Tip丢弃位置") + public Pos3d getTipDropPos() throws Exception { + return this.getOption("TipDropPos", Pos3d.class); + } + + private T getOption( String key, Class clazz) throws Exception { + var option = HardwareServiceSetting.getOption("HbotControlService", key); + if ( option.isNewRecord ) { + return clazz.getDeclaredConstructor().newInstance(); + } + ObjectMapper mapper = new ObjectMapper(); + return mapper.readValue(option.val, clazz); + } }