Browse Source

update

tags/v0
zhaohe 10 months ago
parent
commit
71c677841f
  1. BIN
      app.db
  2. 13
      pom.xml
  3. 2
      src/main/java/a8k/BoditechA800Application.java
  4. 1
      src/main/java/a8k/SpringBootBeanUtil.java
  5. 3
      src/main/java/a8k/extapi_controler/pagecontrol/ExtApiTabConfig.java
  6. 17
      src/main/java/a8k/service/app/devicedriver/calibration/HbotConsumablePosCalibration.java
  7. 6
      src/main/java/a8k/service/app/devicedriver/ctrl/HbotControler.java
  8. 68
      src/main/java/a8k/service/app/devicedriver/pos/HbotConsumablePosMgr.java
  9. 55
      src/main/java/a8k/type/HbotConsumablePos.java
  10. 4
      src/main/java/a8k/type/cfg/Pos3d.java
  11. 10
      src/main/java/a8k/utils/ZJsonHelper.java

BIN
app.db

13
pom.xml

@ -22,6 +22,18 @@
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.45.2.0</version>
@ -57,6 +69,7 @@
<artifactId>lombok</artifactId>
<scope>annotationProcessor</scope>
</dependency>
</dependencies>
<build>

2
src/main/java/a8k/BoditechA800Application.java

@ -3,8 +3,10 @@ package a8k;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
@SpringBootApplication
@EnableAspectJAutoProxy
public class BoditechA800Application {
public static void main(String[] args) {
SpringApplication.run(BoditechA800Application.class, args);

1
src/main/java/a8k/SpringBootBeanUtil.java

@ -3,6 +3,7 @@ package a8k;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Component;
import java.io.File;

3
src/main/java/a8k/extapi_controler/pagecontrol/ExtApiTabConfig.java

@ -18,11 +18,12 @@ public enum ExtApiTabConfig {
TubeFeedingModulePosCalibration("校准.试管入料校准", true),
TubePreProcesPosCalibration("校准.试管预处理校准", true),
ReactionPlatesTransmitControlerCalibration("校准.反应板相关位置校准", true),
HbotConsumablePosCalibration("校准.耗材位置校准", true),
ActionReactorService("底层调试.单步调试", false),//OK
Hbot2DCodeScanPos("参数.Hbot二维码扫描坐标参数", false),
//底层硬件
A8kPipetteCtrlModule("A8kPipetteCtrlModule", false),
A8kPipetteCtrlModule("A8kPipetteCtrlModule", true),
SampleTransportParam("参数.样本出入料&扫描参数", false),
PosParam("PosParam", false),

17
src/main/java/a8k/service/app/devicedriver/calibration/HbotConsumablePosCalibration.java

@ -26,13 +26,17 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import jakarta.annotation.Resource;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.slf4j.Logger;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import java.util.Map;
@ExtApiTab(cfg = ExtApiTabConfig.Hbot2DCodeScanPosCalibration)
@ExtApiTab(cfg = ExtApiTabConfig.HbotConsumablePosCalibration)
@Component
@Aspect
public class HbotConsumablePosCalibration {
static Logger logger = org.slf4j.LoggerFactory.getLogger(HbotConsumablePosCalibration.class);
@ -71,10 +75,6 @@ public class HbotConsumablePosCalibration {
return hbotConsumablePosMgr.getParams();
}
@ExtApiFn(name = "获取所有坐标中文说明", group = "基础", order = 2)
public Object getPossChName() throws AppException {
return hbotConsumablePosMgr.getParamsChName();
}
// 测试工具
@ -102,12 +102,15 @@ public class HbotConsumablePosCalibration {
//
@ExtApiFn(name = "标定HBOT坐标", group = "标定", order = 21)
void calibratePos(HbotConsumablePos hbotConsumablePos) throws AppException {
public void calibratePos(HbotConsumablePos hbotConsumablePos) 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();
}
}
@ -170,4 +173,6 @@ public class HbotConsumablePosCalibration {
public void stopTest() throws AppException {
setStopFlag();
}
}

6
src/main/java/a8k/service/app/devicedriver/ctrl/HbotControler.java

@ -60,9 +60,9 @@ public class HbotControler {
//取tip
pipetteCtrlModule.zMotorMoveToBlock(tipPos.z - 100);
if (!pipetteCtrlModule.isHasTip()) {
throw new AppException(A8kEcode.APPE_TAKE_TIP_FAIL);
}
// if (!pipetteCtrlModule.isHasTip()) {
// throw new AppException(A8kEcode.APPE_TAKE_TIP_FAIL);
// }
//丢tip
pipetteCtrlModule.putTipBlock();

68
src/main/java/a8k/service/app/devicedriver/pos/HbotConsumablePosMgr.java

@ -10,12 +10,18 @@ import a8k.type.HbotConsumablePos;
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;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
/**
@ -31,7 +37,7 @@ public class HbotConsumablePosMgr {
LowerDeviceParameterDBService lowerDeviceParameterDBService;
PosParameterReader posReader = null;
static Integer nowParaVersion = 0;
static Integer nowParaVersion = 2;
@PostConstruct
void initialize() {
@ -45,36 +51,46 @@ public class HbotConsumablePosMgr {
public void paramReset() {
logger.info("init param");
posReader.setVersion(nowParaVersion);
posReader.updatePos(HbotConsumablePos.Tip00_000Pos.name(), new Pos3d(0, 0, 0));
posReader.updatePos(HbotConsumablePos.Tip00_119Pos.name(), new Pos3d(0, 0, 0));
posReader.updatePos(HbotConsumablePos.Tip01_000Pos.name(), new Pos3d(0, 0, 0));
posReader.updatePos(HbotConsumablePos.Tip01_119Pos.name(), new Pos3d(0, 0, 0));
posReader.updatePos(HbotConsumablePos.Tip02_000Pos.name(), new Pos3d(0, 0, 0));
posReader.updatePos(HbotConsumablePos.Tip02_119Pos.name(), new Pos3d(0, 0, 0));
posReader.updatePos(HbotConsumablePos.LittleBufferPos00_00.name(), new Pos3d(0, 0, 0));
posReader.updatePos(HbotConsumablePos.LittleBufferPos05_24.name(), new Pos3d(0, 0, 0));
posReader.updatePos(HbotConsumablePos.ProbeSubstance00_00.name(), new Pos3d(0, 0, 0));
posReader.updatePos(HbotConsumablePos.ProbeSubstance05_24.name(), new Pos3d(0, 0, 0));
}
public Map<String, Pos3d> getParams() {
Map<String, Pos3d> map = new java.util.HashMap<>();
for (HbotConsumablePos param : HbotConsumablePos.values()) {
map.put(param.name(), posReader.getPos(param.name(), Pos3d.class));
}
return map;
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());
}
public Map<String, String> getParamsChName() {
Map<String, String> map = new java.util.HashMap<>();
public List<ObjectNode> getParams() {
List<ObjectNode> list = new java.util.ArrayList<>();
for (HbotConsumablePos param : HbotConsumablePos.values()) {
map.put(param.name(), param.chName);
ObjectNode posNode = ZJsonHelper.createObjectNode();
posNode.put("pos", ZJsonHelper.createObjectNode(posReader.getPos(param.name(), Pos3d.class)));
posNode.put("name", param.name());
posNode.put("chName", param.chName);
list.add(posNode);
}
return map;
return list;
}
public void setParam(HbotConsumablePos param, Pos3d pos) {
posReader.updatePos(param.name(), pos);
}
@ -109,9 +125,9 @@ public class HbotConsumablePosMgr {
assert tip119 != null;
//水平方向
double dx = (tip119.x - tip000.x) / 12.0;
double dx = (tip119.x - tip000.x) / 11.0;
//前后方向
double dy = (tip119.y - tip000.y) / 10.0;
double dy = (tip119.y - tip000.y) / 9.0;
int xoff = tipoff % 12;
int yoff = tipoff / 12;

55
src/main/java/a8k/type/HbotConsumablePos.java

@ -1,36 +1,37 @@
package a8k.type;
public enum HbotConsumablePos {
Tip00_000Pos("Tip00_000Pos"),
Tip00_011Pos("Tip00_011Pos"),
Tip00_108Pos("Tip00_108Pos"),
Tip00_119Pos("Tip00_119Pos"),
Tip01_000Pos("Tip01_000Pos"),
Tip01_011Pos("Tip01_011Pos"),
Tip01_108Pos("Tip01_108Pos"),
Tip01_119Pos("Tip01_119Pos"),
Tip02_000Pos("Tip02_000Pos"),
Tip02_011Pos("Tip02_011Pos"),
Tip02_108Pos("Tip02_108Pos"),
Tip02_119Pos("Tip02_119Pos"),
LittleBufferPos00_00("LittleBufferPos00_00"),
LittleBufferPos00_24("LittleBufferPos00_24"),
LittleBufferPos05_00("LittleBufferPos05_00"),
LittleBufferPos05_24("LittleBufferPos05_24"),
ProbeSubstance00_00("ProbeSubstance00_00"),
ProbeSubstance00_24("ProbeSubstance00_24"),
ProbeSubstance05_00("ProbeSubstance05_00"),
ProbeSubstance05_24("ProbeSubstance05_24"),
LargeBufferPos00("LargeBufferPos00"),
LargeBufferPos05("LargeBufferPos05"),
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;
}

4
src/main/java/a8k/type/cfg/Pos3d.java

@ -14,10 +14,6 @@ public class Pos3d {
this.z = z;
}
public Pos2d getXYPos() {
return new Pos2d(x, y);
}
public String toString() {
return String.format("(%d, %d, %d)", x, y, z);
}

10
src/main/java/a8k/utils/ZJsonHelper.java

@ -1,6 +1,9 @@
package a8k.utils;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
public class ZJsonHelper {
public static String objectToJson(Object obj) {
@ -13,5 +16,12 @@ public class ZJsonHelper {
}
}
public static ObjectNode createObjectNode() {
return new ObjectMapper().createObjectNode();
}
public static ObjectNode createObjectNode(Object obj) {
ObjectMapper ObjectMapper = new ObjectMapper();
return ObjectMapper.valueToTree(obj);
}
}
Loading…
Cancel
Save