|
@ -8,12 +8,15 @@ import java.security.PublicKey; |
|
|
* 大瓶缓冲液位置信息 |
|
|
* 大瓶缓冲液位置信息 |
|
|
*/ |
|
|
*/ |
|
|
public class LargeBottleBufferPos { |
|
|
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() { |
|
|
public Integer cgetCOL() { |
|
@ -29,39 +32,36 @@ public class LargeBottleBufferPos { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public 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.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) { |
|
|
public Pos2d cgetBottlePos(Integer bottleIndex) { |
|
|
Integer row = bottleIndex / cgetCOL(); |
|
|
Integer row = bottleIndex / cgetCOL(); |
|
|
Integer col = 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); |
|
|
return new Pos2d(x, y); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public Pos2d cgetScanPos(Integer bottleIndex) { |
|
|
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); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |