*
lsh
2 天以前 98ba81630f3192aaa4b7fbb67596c3154d05d7d3
src/main/java/com/zy/core/thread/RgvThread.java
@@ -84,6 +84,14 @@
    private void taskIssued() {
        while (true) {
            try {
                if(!connectRgv){
                    try {
                        Thread.sleep(1000L);
                    } catch (Exception e){
                    }
                    continue;
                }
                int step = 1;
                Task task = MessageQueue.poll(SlaveType.Rgv, slave.getId());
                if (task != null) {
@@ -126,6 +134,10 @@
                        command4.setDestinationStaNo1((short)0);     // 目标站
                        write3(command4);
                        break;
                    // 漫游
                    case 5:
                        write5();
                        break;
                    default:
                        break;
                }
@@ -162,6 +174,15 @@
    private void readStatusRgv() {
        while (true) {
            try {
                if(!connectRgv){
                    try {
                        Thread.sleep(1000L);
                    } catch (Exception e){
                    }
                    initRgv();
                    continue;
                }
                Thread.sleep(40);
                readStatus();
@@ -340,6 +361,11 @@
            return false;
        }
    }
    private void write5(){
        try {
            siemensNet.Write("DB24.10.0", false);
        } catch (Exception ignore) {}
    }
    private boolean write3(RgvCommand command) throws InterruptedException {
        if (null == command) {
            log.error("RGV写入命令为空");
@@ -407,18 +433,18 @@
    /******************************************************************************************/
    /**************************************** 测试专用 *****************************************/
    /*****************************************************************************************/
    public static void main(String[] args) throws InterruptedException {
        RgvSlave slave = new RgvSlave();
        slave.setId(1);
        slave.setIp("192.168.6.9");
        slave.setRack(0);
        slave.setSlot(0);
        RgvThread rgvThread = new RgvThread(slave);
        rgvThread.connect();
        rgvThread.readStatus();
        System.out.println(JSON.toJSONString(rgvThread.rgvProtocol));
        Thread.sleep(3000L);
    }
//    public static void main(String[] args) throws InterruptedException {
//        RgvSlave slave = new RgvSlave();
//        slave.setId(1);
//        slave.setIp("192.168.6.9");
//        slave.setRack(0);
//        slave.setSlot(0);
//        RgvThread rgvThread = new RgvThread(slave);
//        rgvThread.connect();
//        rgvThread.readStatus();
//        System.out.println(JSON.toJSONString(rgvThread.rgvProtocol));
//        Thread.sleep(3000L);
//
//    }
}