#
Junjie
1 天以前 98d120bd0633e4e0717d584cae5514132a18516b
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;
    }
@@ -84,14 +85,14 @@
        int taskNo = command.getTaskNo().intValue();
        this.crnStatus.setTaskNo(taskNo);
        this.crnStatus.setMode(taskMode);
        this.crnStatus.setStatus(CrnStatusType.FETCH_MOVING.id);
        moveY(this.crnStatus.getBay(), sourcePosY);
        moveZ(this.crnStatus.getLevel(), sourcePosZ);
        this.crnStatus.setStatus(CrnStatusType.FETCHING.id);
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        sleep(2000);
        if (Thread.currentThread().isInterrupted()) {
            return;
        }
        this.crnStatus.setLoaded(1);
@@ -99,10 +100,9 @@
        moveY(this.crnStatus.getBay(), destinationPosY);
        moveZ(this.crnStatus.getLevel(), destinationPosZ);
        this.crnStatus.setStatus(CrnStatusType.PUTTING.id);
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        sleep(2000);
        if (Thread.currentThread().isInterrupted()) {
            return;
        }
        this.crnStatus.setLoaded(0);
        this.crnStatus.setStatus(CrnStatusType.WAITING.id);
@@ -115,10 +115,9 @@
            for(int i = 0; i < moveLength; i++) {
                initSourcePosZ++;
                this.crnStatus.setLevel(initSourcePosZ);
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                sleep(1000);
                if (Thread.currentThread().isInterrupted()) {
                    return;
                }
            }
        }else {
@@ -127,10 +126,9 @@
            for(int i = 0; i < moveLength; i++) {
                initSourcePosZ--;
                this.crnStatus.setLevel(initSourcePosZ);
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                sleep(1000);
                if (Thread.currentThread().isInterrupted()) {
                    return;
                }
            }
        }
@@ -143,10 +141,9 @@
            for(int i = 0; i < moveLength; i++) {
                initSourcePosY++;
                this.crnStatus.setBay(initSourcePosY);
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                sleep(1000);
                if (Thread.currentThread().isInterrupted()) {
                    return;
                }
            }
        }else {
@@ -155,12 +152,19 @@
            for(int i = 0; i < moveLength; i++) {
                initSourcePosY--;
                this.crnStatus.setBay(initSourcePosY);
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                sleep(1000);
                if (Thread.currentThread().isInterrupted()) {
                    return;
                }
            }
        }
    }
    private void sleep(long ms) {
        try {
            Thread.sleep(ms);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        }
    }
}