zhaohe 1 year ago
parent
commit
9876dd6fa2
  1. 2
      src/main/java/a8k/controler/engineer/EngineerPageControler.java
  2. 1
      src/main/java/a8k/controler/engineer/utils/EnginnerPageStatu.java
  3. 3
      src/main/java/a8k/db/AppSetting.java
  4. 2
      src/main/java/a8k/service/appsettings/AppSettingsMgr.java
  5. 5
      src/main/java/a8k/service/appsettings/settingenum/AutoLogoutTime.java
  6. 104
      src/main/java/a8k/service/devicectrl/ctrl/HbotControlService.java
  7. 6
      src/main/java/com/iflytop/a800/device/IdChipReader.java
  8. 5
      src/main/resources/static/test/css/app.8750cb6d.css
  9. 2
      src/main/resources/static/test/index.html
  10. 2
      src/main/resources/static/test/js/app.2b116387.js
  11. 1
      src/main/resources/static/test/js/app.2b116387.js.map

2
src/main/java/a8k/controler/engineer/EngineerPageControler.java

@ -151,6 +151,8 @@ public class EngineerPageControler {
var status = new HashMap<String,Object>();
status.put("name", statusAnnotation.name());
status.put("group", statusAnnotation.group());
status.put("order", statusAnnotation.order());
var value = method.invoke(service);
status.put("value", value);
statusList.add(status);

1
src/main/java/a8k/controler/engineer/utils/EnginnerPageStatu.java

@ -9,4 +9,5 @@ import java.lang.annotation.Target;
public @interface EnginnerPageStatu {
String name();
String group() default "";
int order() default 0;
}

3
src/main/java/a8k/db/AppSetting.java

@ -6,6 +6,7 @@ import a8k.service.appsettings.base.AppSettingType;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.iflytop.uf.UfActiveRecord;
import com.iflytop.uf.UfActiveRecordField;
import com.iflytop.uf.util.UfJsonHelper;
import java.util.Arrays;
@ -174,7 +175,7 @@ public class AppSetting extends UfActiveRecord {
option.type = AppSettingType.ENUM.name();
option.tab = currentBuildGroup.name();
option.name = name.name();
option.valueEnumRange = Arrays.toString(valueEnumRange);
option.valueEnumRange = UfJsonHelper.objectToJson(valueEnumRange);
option.value = value;
option.priority = buildPriority++;
option.save();

2
src/main/java/a8k/service/appsettings/AppSettingsMgr.java

@ -34,7 +34,7 @@ public class AppSettingsMgr {
static final int setOptionVal = 5;
}
static Integer settingPageVersion = 2;
static Integer settingPageVersion = 3;
@PostConstruct

5
src/main/java/a8k/service/appsettings/settingenum/AutoLogoutTime.java

@ -2,10 +2,11 @@ package a8k.service.appsettings.settingenum;
public enum AutoLogoutTime {
T00_00,
T00_10,
T00_30,
T01_00,
T02_00,
T03_00,
T04_00,
T03_00
;

104
src/main/java/a8k/service/devicectrl/ctrl/HbotControlService.java

@ -19,7 +19,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
/**
* Hbot控制服务
*/
@ -29,43 +28,43 @@ import org.springframework.stereotype.Component;
public class HbotControlService {
static Logger logger = LoggerFactory.getLogger(HbotControlService.class);
@Resource
A8kCanBusService canBus;
A8kCanBusService canBus;
@Resource
HardwareCommonCtrl hcc;
@Resource
TimeParam timep;
TimeParam timep;
@Resource
PosParam pp;
PosParam pp;
@Resource
DebugParam dp;
DebugParam dp;
//
public Integer getGripperZeroYPos() {
//之所以这样写是因为是为了放置两个类之间的循环依赖
// assert appCxt != null;
// TODO
// return appCxt.getBean(SamplesPreProcessModuleCtrlService.class).getGripperZeroYPos();
// 之所以这样写是因为是为了放置两个类之间的循环依赖
// assert appCxt != null;
// TODO
// return
// appCxt.getBean(SamplesPreProcessModuleCtrlService.class).getGripperZeroYPos();
return 0;
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// 基础控制
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// 基础控制
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
private void checkPublicArea() throws HardwareException {
if (canBus.miniServoReadPos(MId.ShakeModGripperYSV) > getGripperZeroYPos() + 20) {
logger.error("ShakeModGripperYSV Pos:{} > {}", canBus.miniServoReadPos(MId.ShakeModGripperYSV), getGripperZeroYPos() + 20);
logger.error("ShakeModGripperYSV Pos:{} > {}", canBus.miniServoReadPos(MId.ShakeModGripperYSV),
getGripperZeroYPos() + 20);
throw new HardwareException(A8kEcode.ShakeModGripperYSVInXYPublicArea);
}
}
/**
* Hboot 移动
*
* @param targetPos 目标位置
* @throws HardwareException e
* @throws HardwareException e
* @throws InterruptedException e
*/
public void hbotCheckAndMoveTo(Pos3d targetPos) throws HardwareException, InterruptedException {
@ -74,7 +73,7 @@ public class HbotControlService {
throw new HardwareException(A8kEcode.PlateBoxNotCover);
}
boolean zEnable = true;
boolean zEnable = true;
boolean hbotEnable = canBus.moduleGetReg(MId.HbotM, RegIndex.kreg_xyrobot_is_enable) == 1;
if (canBus.moduleGetReg(MId.PipetteModZM, RegIndex.kreg_step_motor_is_enable) == 0) {
canBus.stepMotorEnable(MId.PipetteModZM, 1);
@ -82,31 +81,30 @@ public class HbotControlService {
zEnable = false;
}
//Z轴归零
// Z轴归零
if (!getZPPS()) {
canBus.stepMotorEnable(MId.PipetteModZM, 1);
canBus.stepMotorEasyMoveToZeroPointQuickBlock(MId.PipetteModZM, timep.getActionOvertime());
}
if (!getZPPS()) {
throw new HardwareException(A8kEcode.ZMNotAtZPosWhenHbotTryMove);
}
Pos2d nowHbotPos = canBus.hbotReadPos(MId.HbotM);
Pos2d nowHbotPos = canBus.hbotReadPos(MId.HbotM);
HbotLimitArea sampleArea = pp.getSampleCollectionArea();
//检查采样区域是否有障碍
// 检查采样区域是否有障碍
if (sampleArea.checkIsInArea(nowHbotPos) || sampleArea.checkIsInArea(targetPos.getXYPos())) {
checkPublicArea();
}
//HBot移动
// HBot移动
canBus.hbotEnable(MId.HbotM, 1);
canBus.hbotMoveToBlock(MId.HbotM, targetPos.x - 20, targetPos.y - 20, timep.getActionOvertime());
canBus.hbotMoveToBlock(MId.HbotM, targetPos.x, targetPos.y, timep.getActionOvertime());
canBus.hbotMoveToBlock(MId.HbotM, targetPos.x, targetPos.y, timep.getActionOvertime());
//Z轴移动
// Z轴移动
if (targetPos.z != 0) {
canBus.stepMotorEnable(MId.PipetteModZM, 1);
canBus.stepMotorEasyMoveToZeroPointQuickBlock(MId.PipetteModZM, timep.getActionOvertime());
@ -116,7 +114,6 @@ public class HbotControlService {
canBus.hbotEnable(MId.HbotM, hbotEnable ? 1 : 0);
}
public void zMoveTo(Integer z) throws HardwareException, InterruptedException {
if (z == 0) {
canBus.stepMotorEasyMoveToZeroPointQuickBlock(MId.PipetteModZM, timep.getActionOvertime());
@ -125,18 +122,16 @@ public class HbotControlService {
}
}
private void hbotCheckAndMoveTo(Pos2d targetPos) throws HardwareException, InterruptedException {
hbotCheckAndMoveTo(new Pos3d(targetPos.x, targetPos.y, 0));
}
private void modGroupMoveToZero() throws HardwareException, InterruptedException {
if (!canBus.getIOState(IOId.PlateBoxCoverClosurePPS)) {
throw new HardwareException(A8kEcode.PlateBoxNotCover);
}
//归零前检查
// 归零前检查
checkPublicArea();
canBus.stepMotorEnable(MId.PipetteModZM, 1);
canBus.hbotEnable(MId.HbotM, 1);
@ -144,12 +139,12 @@ public class HbotControlService {
canBus.stepMotorEasyMoveToZeroBlock(MId.PipetteModZM, timep.getActionOvertime());
canBus.hbotMoveToZeroBlock(MId.HbotM, timep.getHbotRuntoZeroActionOvertime());
//丢弃tip
// 丢弃tip
Pos3d dropPos = pp.getTipDropPos();
hbotCheckAndMoveTo(dropPos);
canBus.pipetteCtrlInitDeviceBlock(MId.PipetteMod, timep.getActionOvertime());
//快速归零
// 快速归零
modGroupMoveToZeroQuick();
}
@ -157,9 +152,9 @@ public class HbotControlService {
hbotCheckAndMoveTo(new Pos2d(0, 0));
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// 单步测试
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// 单步测试
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@EnginnerPageAction(name = "丢Tip", group = "单步测试")
public void dropTip() throws HardwareException, InterruptedException {
@ -182,7 +177,7 @@ public class HbotControlService {
}
TipPickUpPosInfo tipPos = pp.getTipPickUpPosInfo();
Pos2d pos = tipPos.getTipPos(groupId, index);
Pos2d pos = tipPos.getTipPos(groupId, index);
hbotMoveTo(pos.x, pos.y);
Integer zCompensate = 0;
@ -190,8 +185,8 @@ public class HbotControlService {
zCompensate = 2;
}
canBus.stepMotorEasyMoveToBlock(MId.PipetteModZM, tipPos.getPickUpZPos(groupId) + zCompensate, timep.getActionOvertime());
canBus.stepMotorEasyMoveToBlock(MId.PipetteModZM, tipPos.getPickUpZPos(groupId) + zCompensate,
timep.getActionOvertime());
canBus.stepMotorEasyMoveToZeroPointQuickBlock(MId.PipetteModZM, timep.getActionOvertime());
Boolean isGetTip = canBus.moduleGetReg(MId.PipetteMod, RegIndex.kreg_pipette_tip_state) == 1;
@ -207,7 +202,8 @@ public class HbotControlService {
}
@EnginnerPageAction(name = "HBot移动到小瓶缓冲液X孔", group = "单步测试")
public void hbotMoveToSmallBottleGroup(ConsumableGroup group, Integer Xhole) throws HardwareException, InterruptedException {
public void hbotMoveToSmallBottleGroup(ConsumableGroup group, Integer Xhole)
throws HardwareException, InterruptedException {
BottleGroupsPosInfo posInfo = pp.getBottleBufferPosInfo();
if (Xhole < 0 || Xhole > BottlesPosInfo.cgetMAX()) {
throw new HardwareException(A8kEcode.ParamOutOfRange);
@ -216,9 +212,9 @@ public class HbotControlService {
hbotCheckAndMoveTo(pos);
}
@EnginnerPageAction(name = "HBot移动到探测物质X孔", group = "单步测试")
public void hbotMoveToDetectMaterialPos(ConsumableGroup group, Integer Xhole) throws HardwareException, InterruptedException {
public void hbotMoveToDetectMaterialPos(ConsumableGroup group, Integer Xhole)
throws HardwareException, InterruptedException {
BottleGroupsPosInfo posInfo = pp.getBottleBufferPosInfo();
if (Xhole < 0 || Xhole > BottlesPosInfo.cgetMAX()) {
throw new HardwareException(A8kEcode.ParamOutOfRange);
@ -230,7 +226,7 @@ public class HbotControlService {
@EnginnerPageAction(name = "HBot移动到大瓶缓冲液X孔", group = "单步测试")
public void hbotMoveToLargeBottleGroup(ConsumableGroup ch) throws HardwareException, InterruptedException {
LargeBottleBufferPos posInfo = pp.getLargeBottleBufferPosInfo();
Pos2d pos = posInfo.cgetBottlePos(ch.off);
Pos2d pos = posInfo.cgetBottlePos(ch.off);
hbotCheckAndMoveTo(pos);
}
@ -239,9 +235,9 @@ public class HbotControlService {
hbotCheckAndMoveTo(pp.getEmergencyPos());
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// 坐标获取工具
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// 坐标获取工具
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@EnginnerPageAction(name = "Hbot使能", group = "坐标获取工具")
public void hBotEnable() throws HardwareException, InterruptedException {
@ -285,9 +281,9 @@ public class HbotControlService {
hbotRefPos.y = y;
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// hbot移动到并扫码
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// hbot移动到并扫码
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
private AppRet<String> hBotMoveToAndScan(Pos2d pos) throws HardwareException, InterruptedException {
hbotCheckAndMoveTo(pos);
@ -296,31 +292,31 @@ public class HbotControlService {
return AppRet.success(result);
}
//扫描板夹仓二维码
// 扫描板夹仓二维码
@EnginnerPageAction(name = "扫描板夹仓二维码", group = "扫码")
public AppRet<String> scanPlatesCode(ConsumableGroup ch) throws HardwareException, InterruptedException {
var posInfo = pp.getPlates2dCodeScanPosInfo();
return hBotMoveToAndScan(posInfo.cgetScanPos(ch.off));
}
//扫描缓冲液二维码
// 扫描缓冲液二维码
@EnginnerPageAction(name = "扫描缓冲液区二维码", group = "扫码")
public AppRet<String> scanBottleBuffersCode(ConsumableGroup group) throws HardwareException, InterruptedException {
BottleGroupsPosInfo posInfo = pp.getBottleBufferPosInfo();
return hBotMoveToAndScan(posInfo.cgetScanPos(group.ordinal()));
}
//扫描大缓冲液二维码
// 扫描大缓冲液二维码
@EnginnerPageAction(name = "扫描大缓冲液二维码", group = "扫码")
public AppRet<String> scanBigBottleBufferCode(ConsumableGroup group) throws HardwareException, InterruptedException {
public AppRet<String> scanBigBottleBufferCode(ConsumableGroup group)
throws HardwareException, InterruptedException {
LargeBottleBufferPos posInfo = pp.getLargeBottleBufferPosInfo();
return hBotMoveToAndScan(posInfo.cgetScanPos(group.off));
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// hbot取样品
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// hbot取样品
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
public Boolean getZPPS() throws HardwareException {
return canBus.stepMotorReadIoState(MId.PipetteModZM, 0);

6
src/main/java/com/iflytop/a800/device/IdChipReader.java

@ -21,9 +21,9 @@ public class IdChipReader {
// 事件处理
public void handleZCanCmderWebSocketEvent(Object ... args) {
Integer eventId = (Integer)args[0];
if ( 0x71C8 == eventId ) { // ID 卡插入
UfMdbNotification.action("IdChipInsert");
}
// if ( 0x71C8 == eventId ) { // ID 卡插入
// UfMdbNotification.action("IdChipInsert");
// }
// if ( 0x71C9 == eventId ) { // ID 拔出
// UfMdbNotification.action("IdChipPullout");
// }

5
src/main/resources/static/test/css/app.8750cb6d.css
File diff suppressed because it is too large
View File

2
src/main/resources/static/test/index.html

@ -1 +1 @@
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>a8k_webui</title><script defer="defer" src="js/chunk-vendors.ce3623b2.js"></script><script defer="defer" src="js/app.231e7193.js"></script><link href="css/app.34c997bb.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but a8k_webui doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>a8k_webui</title><script defer="defer" src="js/chunk-vendors.ce3623b2.js"></script><script defer="defer" src="js/app.2b116387.js"></script><link href="css/app.8750cb6d.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but a8k_webui doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

2
src/main/resources/static/test/js/app.2b116387.js
File diff suppressed because it is too large
View File

1
src/main/resources/static/test/js/app.2b116387.js.map
File diff suppressed because it is too large
View File

Loading…
Cancel
Save