Browse Source

update

tags/v0
zhaohe 1 year ago
parent
commit
deff0962ee
  1. 46
      src/main/java/a8k/appbean/cfg/LargeBottleBufferPos.java
  2. 8
      src/main/java/a8k/service/hardware/HbotControlService.java
  3. 2
      src/main/java/a8k/utils/HbotScanerPosComputer.java

46
src/main/java/a8k/appbean/cfg/LargeBottleBufferPos.java

@ -8,12 +8,15 @@ import java.security.PublicKey;
* 大瓶缓冲液位置信息
*/
public class LargeBottleBufferPos {
public Pos2d topLelf;
public Pos2d topLelf = new Pos2d(0, 0);
public Integer xSpacing; //x间隔
public Integer ySpacing; //y间隔
public Pos2d hole0 = new Pos2d(0, 0);
public Integer holeXSpacing = 0; //x间隔
public Integer holeYSpacing = 0; //y间隔
public Integer scancodeRelaPos; //扫码相对每个大屏缓冲液的位置第一排 -dy第二排dy
public Pos2d scan0 = new Pos2d(0, 0);
public Integer scanPosXSpacing = 0; //扫码位置x间隔
public Integer scanPosYSpacing = 0; //扫码位置y间隔
public Integer cgetCOL() {
@ -29,39 +32,36 @@ public class LargeBottleBufferPos {
}
public LargeBottleBufferPos() {
topLelf = new Pos2d(0, 0);
xSpacing = 0;
ySpacing = 0;
scancodeRelaPos = 0;
}
public LargeBottleBufferPos(Pos2d topLelf, Integer xSpacing, Integer ySpacing, Integer scancodeRelaPos) {
public LargeBottleBufferPos(Pos2d topLelf, Pos2d hole0, Integer holeXSpacing, Integer holeYSpacing, Pos2d scan0, Integer scanPosXSpacing, Integer scanPosYSpacing) {
this.topLelf = topLelf;
this.xSpacing = xSpacing;
this.ySpacing = ySpacing;
this.scancodeRelaPos = scancodeRelaPos;
this.holeXSpacing = holeXSpacing;
this.holeYSpacing = holeYSpacing;
this.scanPosXSpacing = scanPosXSpacing;
this.scanPosYSpacing = scanPosYSpacing;
this.hole0 = hole0;
this.scan0 = scan0;
}
public Pos2d cgetBottlePos(Integer bottleIndex) {
Integer row = bottleIndex / cgetCOL();
Integer col = bottleIndex % cgetCOL();
Integer x = topLelf.x + col * xSpacing;
Integer y = topLelf.y + row * ySpacing;
Integer x = topLelf.x + hole0.x + col * holeXSpacing;
Integer y = topLelf.y + hole0.y + row * holeYSpacing;
return new Pos2d(x, y);
}
public Pos2d cgetScanPos(Integer bottleIndex) {
int row = bottleIndex / cgetCOL();
Integer dy = 0;
if (row == 0) {
dy = -scancodeRelaPos;
} else if (row == 1) {
dy = scancodeRelaPos;
}
Integer row = bottleIndex / cgetCOL();
Integer col = bottleIndex % cgetCOL();
Integer x = topLelf.x + scan0.x + col * scanPosXSpacing;
Integer y = topLelf.y + scan0.y + row * scanPosYSpacing;
return HbotScanerPosComputer.getScanPos(new Pos2d(x, y));
Pos2d bottlePos = cgetBottlePos(bottleIndex);
return HbotScanerPosComputer.getScanPos(bottlePos);
}
}

8
src/main/java/a8k/service/hardware/HbotControlService.java

@ -138,10 +138,13 @@ public class HbotControlService implements HardwareCtrlModule {
public LargeBottleBufferPos getLargeBottleBufferPosInfo() {
return settingReader.getObject("LargeBottleBufferPosInfo", LargeBottleBufferPos.class,
new LargeBottleBufferPos(
new Pos2d(4594, 1350),
new Pos2d(4474, 1172),
new Pos2d(109, 182),
280,
280,
165
new Pos2d(60, 30),
280,
580
));
}
@ -340,7 +343,6 @@ public class HbotControlService implements HardwareCtrlModule {
}
@HardwareServiceAction(name = "HBot移动到探测物质X孔", group = "单步测试")
public void hbotMoveToDetectMaterialPos(ConsumableGroup group, Integer Xhole) throws HardwareException, InterruptedException {
BottleGroupsPosInfo posInfo = getBottleBufferPosInfo();

2
src/main/java/a8k/utils/HbotScanerPosComputer.java

@ -4,6 +4,6 @@ import a8k.appbean.cfg.Pos2d;
public class HbotScanerPosComputer {
static public Pos2d getScanPos(Pos2d tipPos) {
return new Pos2d(tipPos.x + 359, tipPos.y + 29);
return new Pos2d(tipPos.x + 333, tipPos.y + 29);
}
}
Loading…
Cancel
Save