#
zwl
2 天以前 b2141320243f2be393236a3c4f53376583179325
src/main/java/com/zy/core/network/fake/ZyCrnFakeConnect.java
@@ -29,6 +29,7 @@
    @Override
    public boolean disconnect() {
        try { executor.shutdownNow(); } catch (Exception ignore) {}
        return true;
    }
@@ -52,6 +53,16 @@
        }
        response.setResult(true);
        return response;
    }
    @Override
    public CommandResponse sendCommand2(CrnCommand command) {
        return null;
    }
    @Override
    public CommandResponse sendCommand3(CrnCommand command) {
        return null;
    }
    private void commandTaskComplete(CrnCommand command) {
@@ -90,6 +101,9 @@
        moveZ(this.crnStatus.getLevel(), sourcePosZ);
        this.crnStatus.setStatus(CrnStatusType.FETCHING.id);
        sleep(2000);
        if (Thread.currentThread().isInterrupted()) {
            return;
        }
        this.crnStatus.setLoaded(1);
        this.crnStatus.setStatus(CrnStatusType.PUT_MOVING.id);
@@ -97,6 +111,9 @@
        moveZ(this.crnStatus.getLevel(), destinationPosZ);
        this.crnStatus.setStatus(CrnStatusType.PUTTING.id);
        sleep(2000);
        if (Thread.currentThread().isInterrupted()) {
            return;
        }
        this.crnStatus.setLoaded(0);
        this.crnStatus.setStatus(CrnStatusType.WAITING.id);
    }
@@ -109,6 +126,9 @@
                initSourcePosZ++;
                this.crnStatus.setLevel(initSourcePosZ);
                sleep(1000);
                if (Thread.currentThread().isInterrupted()) {
                    return;
                }
            }
        }else {
            int moveLength = sourcePosZ - destinationPosZ;
@@ -117,6 +137,9 @@
                initSourcePosZ--;
                this.crnStatus.setLevel(initSourcePosZ);
                sleep(1000);
                if (Thread.currentThread().isInterrupted()) {
                    return;
                }
            }
        }
    }
@@ -129,6 +152,9 @@
                initSourcePosY++;
                this.crnStatus.setBay(initSourcePosY);
                sleep(1000);
                if (Thread.currentThread().isInterrupted()) {
                    return;
                }
            }
        }else {
            int moveLength = sourcePosY - destinationPosY;
@@ -137,15 +163,18 @@
                initSourcePosY--;
                this.crnStatus.setBay(initSourcePosY);
                sleep(1000);
                if (Thread.currentThread().isInterrupted()) {
                    return;
                }
            }
        }
    }
        private void sleep(long ms) {
    private void sleep(long ms) {
        try {
            Thread.sleep(ms);
        } catch (InterruptedException e) {
            e.printStackTrace();
            Thread.currentThread().interrupt();
        }
    }
}