Browse Source

耗材卸载

master
sige 2 years ago
parent
commit
32312af4bb
  1. 13
      src/main/java/com/dreamworks/boditech/controller/DeviceController.java
  2. 10
      src/main/java/com/dreamworks/boditech/driver/consumable/CsmBufferTubeManager.java
  3. 10
      src/main/java/com/dreamworks/boditech/driver/consumable/CsmLargeBufferTubeManager.java
  4. 23
      src/main/java/com/dreamworks/boditech/driver/consumable/CsmTestCardManager.java
  5. 19
      src/main/java/com/dreamworks/boditech/service/DeviceService.java

13
src/main/java/com/dreamworks/boditech/controller/DeviceController.java

@ -29,6 +29,13 @@ public class DeviceController extends BaseController {
return this.success();
}
@ResponseBody
@PostMapping("/api/device/unload")
public ApiResponse unload() {
this.deviceService.unload();
return this.success();
}
@ -274,11 +281,7 @@ public class DeviceController extends BaseController {
@ResponseBody
@PostMapping("/api/device/unload")
public ApiResponse unload() {
return this.success();
}
@ResponseBody
@PostMapping("/api/device/trash-box-status-get")

10
src/main/java/com/dreamworks/boditech/driver/consumable/CsmBufferTubeManager.java

@ -37,6 +37,16 @@ public class CsmBufferTubeManager {
box.tubeAmount = param.tubeAmount;
}
// clear all test cards
public void clear() {
this.bufferTubeBoxes.clear();
for ( int i=0; i<6; i++ ) {
CsmBufferTubeBox box = new CsmBufferTubeBox();
box.index = i;
this.bufferTubeBoxes.add(box);
}
}
/**
* append buffer tube by box code string
* code example : 01CAGGB66U

10
src/main/java/com/dreamworks/boditech/driver/consumable/CsmLargeBufferTubeManager.java

@ -31,6 +31,16 @@ public class CsmLargeBufferTubeManager {
return this.device;
}
// clear all test cards
public void clear() {
this.largeBufferTubes.clear();
for ( int i=0; i<6; i++ ) {
CsmLargeBufferTube tube = new CsmLargeBufferTube(this);
tube.index = i;
this.largeBufferTubes.add(tube);
}
}
/**
* append large buffer tube by box code string
* code example : 01CAGGB66U

23
src/main/java/com/dreamworks/boditech/driver/consumable/CsmTestCardManager.java

@ -31,6 +31,16 @@ public class CsmTestCardManager {
return this.testCardBoxes;
}
// clear all test cards
public void clear() {
this.testCardBoxes.clear();
for ( int i=0; i<6; i++ ) {
CsmTestCardBox box = new CsmTestCardBox();
box.index = i;
this.testCardBoxes.add(box);
}
}
/**
* update test cards by box
* @param update update info
@ -83,6 +93,19 @@ public class CsmTestCardManager {
// @TODO : 删除下面这个属性使用box代替
// list of test cards
private final List<CsmTestCard> testCards = new ArrayList<>();

19
src/main/java/com/dreamworks/boditech/service/DeviceService.java

@ -47,6 +47,25 @@ public class DeviceService {
}
/**
* unload consumable resources
*/
public void unload() {
if ( this.isExecutorRunning() ) {
throw new RuntimeException("DEVICE_STILL_RUNNING");
}
this.actionLog.log("device.unload");
this.device.testCards.clear();
this.device.bufferTubes.clear();
this.device.largeBufferTubes.clear();
}
/**
* 复位设备 如果设备未正常复位 需要给个警告弹框然后再执行错误复位
* @throws RuntimeException 设备未正常复位
*/

Loading…
Cancel
Save