Browse Source

增加批量扫码功能

master
HSZ_HeSongZhen 3 months ago
parent
commit
fc23c26d6c
  1. 2
      src/main/java/a8k/OS.java
  2. 34
      src/main/java/a8k/extui/page/test/verification/HbotCodeScanPosVerificationPage.java

2
src/main/java/a8k/OS.java

@ -15,7 +15,7 @@ public class OS {
}
}
private static void threadSleep(Integer mills) {
public static void threadSleep(Integer mills) {
try {
Thread.sleep(mills);
} catch (InterruptedException ignored) {

34
src/main/java/a8k/extui/page/test/verification/HbotCodeScanPosVerificationPage.java

@ -24,6 +24,8 @@ import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import static a8k.OS.threadSleep;
@Component
@Slf4j
@RequiredArgsConstructor
@ -56,6 +58,34 @@ public class HbotCodeScanPosVerificationPage {
codeScanerDriver.pipetteModCodeScannerStopScan();
}
public void testCodeScan(Integer times, Integer overtime) throws AppException {
if(overtime < 0){
overtime = 0;
}
if(times < 1){
times = 1;
}
if(times > 100){
times = 100;
}
log.info("testCodeScan times:{} overtime:{}", times, overtime);
for (int i = 0; i < times; i++) {
log.info("testCodeScan times:{}", i);
hbotMoveExCtrlService.moveQuickToZero();
for(var cg: ConsumableGroup.values()){
moveToPBScanPos(cg);
threadSleep(overtime);
String result = codeScanerDriver.pipetteModCodeScannerScanCode();
if(result == null || result.isEmpty()){
log.info("cg {} 扫码失败", cg);
}
log.info("cg {} 扫码结果:{}", cg, result);
}
}
}
@PostConstruct
void init() {
@ -66,6 +96,10 @@ public class HbotCodeScanPosVerificationPage {
cfg.addFunction("移动到大瓶扫码位置", this::moveToLargeBSCodeScanPos);
cfg.addFunction("扫码", this::startCodeScan);
cfg.addFunction("停止扫码", this::stopCodeScan);
cfg.newGroup("扫描测试");
cfg.addFunction("批量扫码", this::testCodeScan);
extApiPageMgr.addPage(cfg);
}
}
Loading…
Cancel
Save