11 changed files with 114 additions and 250 deletions
-
2src/main/java/com/dreamworks/boditech/controller/DeviceController.java
-
62src/main/java/com/dreamworks/boditech/driver/consumable/CsmBufferTube.java
-
37src/main/java/com/dreamworks/boditech/driver/consumable/CsmBufferTubeA.java
-
37src/main/java/com/dreamworks/boditech/driver/consumable/CsmBufferTubeB.java
-
129src/main/java/com/dreamworks/boditech/driver/consumable/CsmBufferTubeManager.java
-
2src/main/java/com/dreamworks/boditech/driver/entity/ParamBufferTubeUpdateByBox.java
-
5src/main/java/com/dreamworks/boditech/driver/task/TaskBatchTubePrepare.java
-
16src/main/java/com/dreamworks/boditech/driver/task/TaskBufferTubeLoad.java
-
4src/main/java/com/dreamworks/boditech/driver/task/step/StepBase.java
-
19src/main/java/com/dreamworks/boditech/driver/task/step/StepPuncture.java
-
51src/main/java/com/dreamworks/boditech/service/DeviceService.java
@ -1,11 +1,63 @@ |
|||
package com.dreamworks.boditech.driver.consumable; |
|||
public interface CsmBufferTube { |
|||
import com.dreamworks.boditech.driver.Device; |
|||
import java.util.Objects; |
|||
public class CsmBufferTube { |
|||
// tube type : db rack cover 500μl |
|||
public static final String COVER_TYPE_500 = "DBRC500"; |
|||
// tube type : db rack cover 150μl |
|||
public static final String COVER_TYPE_150 = "DBRC150"; |
|||
|
|||
// project name |
|||
public String projectName; |
|||
// area index |
|||
public Integer areaIndex; |
|||
// position |
|||
public Integer position; |
|||
// tube type |
|||
public String coverType = CsmBufferTube.COVER_TYPE_500; |
|||
// manager |
|||
private final CsmBufferTubeManager manager; |
|||
|
|||
// constructor |
|||
public CsmBufferTube( CsmBufferTubeManager manager ) { |
|||
this.manager = manager; |
|||
} |
|||
|
|||
// get location x |
|||
public Integer getLocationX(); |
|||
public Integer getLocationX() { |
|||
Device device = this.manager.getDevice(); |
|||
String keyPrefix = "bufferTube" + this.coverType; |
|||
String lineKeyPrefix = keyPrefix + "Line" + (Integer.toString(this.areaIndex / 3)); |
|||
Integer areaStartX = device.getLocationByName(lineKeyPrefix+"Start.x"); |
|||
Integer areaDistanceX = device.getLocationByName(keyPrefix+"BoxDistance"); |
|||
Integer tubeDistanceX = device.getLocationByName(keyPrefix+"TubeDistanceX"); |
|||
return areaStartX - areaDistanceX * (this.areaIndex%3) - tubeDistanceX * (this.position % 5); |
|||
} |
|||
|
|||
// get location y |
|||
public Integer getLocationY(); |
|||
public Integer getLocationY() { |
|||
Device device = this.manager.getDevice(); |
|||
String keyPrefix = "bufferTube" + this.coverType; |
|||
String lineKeyPrefix = keyPrefix + "Line" + (Integer.valueOf(this.areaIndex / 3).toString()); |
|||
Integer areaStartY = device.getLocationByName(lineKeyPrefix+"Start.y"); |
|||
Integer tubeDistanceY = device.getLocationByName(keyPrefix+"TubeDistanceY"); |
|||
return areaStartY - tubeDistanceY * (this.position / 5); |
|||
} |
|||
|
|||
// get puncture depth |
|||
public Integer getPunctureDepth() { |
|||
Device device = this.manager.getDevice(); |
|||
if (Objects.equals(this.coverType, CsmBufferTube.COVER_TYPE_500)) { |
|||
return device.getLocationByName("bufferTubeDBRC500PunctureDepth"); |
|||
} else if (Objects.equals(this.coverType, CsmBufferTube.COVER_TYPE_150)) { |
|||
return device.getLocationByName("bufferTubeDBRC150PunctureDepth"); |
|||
} else { |
|||
throw new RuntimeException("unknown cover type " + this.coverType); |
|||
} |
|||
} |
|||
|
|||
// get location z |
|||
public Integer getLocationZ(); |
|||
public Integer getLocationZ() { |
|||
// @TODO : 这里没法判断是那种盖子,所以都做 500μl 处理 |
|||
return 0; |
|||
} |
|||
} |
@ -1,37 +0,0 @@ |
|||
package com.dreamworks.boditech.driver.consumable; |
|||
public class CsmBufferTubeA implements CsmBufferTube { |
|||
// project name |
|||
public String projectName; |
|||
// area index |
|||
public Integer areaIndex; |
|||
// position |
|||
public Integer position; |
|||
// manager |
|||
private final CsmBufferTubeManager manager; |
|||
|
|||
// constructor |
|||
public CsmBufferTubeA( CsmBufferTubeManager manager ) { |
|||
this.manager = manager; |
|||
} |
|||
|
|||
// get location x |
|||
public Integer getLocationX() { |
|||
Integer areaStartX = this.manager.getDevice().getLocationByName("bufferTubeAStart.x"); |
|||
Integer areaDistanceX = this.manager.getDevice().getLocationByName("bufferTubeABoxDistance"); |
|||
Integer tubeDistanceX = this.manager.getDevice().getLocationByName("bufferTubeATubeDistanceX"); |
|||
return areaStartX - areaDistanceX * this.areaIndex - tubeDistanceX * (this.position % 5); |
|||
} |
|||
|
|||
// get location y |
|||
public Integer getLocationY() { |
|||
Integer areaStartY = this.manager.getDevice().getLocationByName("bufferTubeAStart.y"); |
|||
Integer tubeDistanceY = this.manager.getDevice().getLocationByName("bufferTubeATubeDistanceY"); |
|||
return areaStartY - tubeDistanceY * (this.position / 5); |
|||
} |
|||
|
|||
// get location z |
|||
public Integer getLocationZ() { |
|||
// @TODO : 需要根据探测距离计算出z坐标 |
|||
return 850; |
|||
} |
|||
} |
@ -1,37 +0,0 @@ |
|||
package com.dreamworks.boditech.driver.consumable; |
|||
public class CsmBufferTubeB implements CsmBufferTube { |
|||
// project name |
|||
public String projectName; |
|||
// area index |
|||
public Integer areaIndex; |
|||
// position |
|||
public Integer position; |
|||
// manager |
|||
private final CsmBufferTubeManager manager; |
|||
|
|||
// constructor |
|||
public CsmBufferTubeB( CsmBufferTubeManager manager ) { |
|||
this.manager = manager; |
|||
} |
|||
|
|||
// get location x |
|||
public Integer getLocationX() { |
|||
Integer areaStartX = this.manager.getDevice().getLocationByName("bufferTubeBStart.x"); |
|||
Integer areaDistanceX = this.manager.getDevice().getLocationByName("bufferTubeBBoxDistance"); |
|||
Integer tubeDistanceX = this.manager.getDevice().getLocationByName("bufferTubeBTubeDistanceX"); |
|||
return areaStartX - areaDistanceX * this.areaIndex - tubeDistanceX * (this.position % 5); |
|||
} |
|||
|
|||
// get location y |
|||
public Integer getLocationY() { |
|||
Integer areaStartY = this.manager.getDevice().getLocationByName("bufferTubeBStart.y"); |
|||
Integer tubeDistanceY = this.manager.getDevice().getLocationByName("bufferTubeBTubeDistanceY"); |
|||
return areaStartY - tubeDistanceY * (this.position / 5); |
|||
} |
|||
|
|||
// get location z |
|||
public Integer getLocationZ() { |
|||
// @TODO : 需要根据探测距离计算出z坐标 |
|||
return 850; |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue