Junjie
2023-10-15 badc6b0a84fd57360341eca49839d074b355c588
#plc2
4个文件已修改
3个文件已添加
1048 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/ConsoleController.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/ServerBootstrap.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensDevpThread2.java 318 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/plc2.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/index.html 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/plc2.html 661 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/ConsoleController.java
@@ -41,6 +41,10 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.*;
/**
@@ -322,6 +326,50 @@
    }
    /**
     * 获取PLC2数据
     */
    @GetMapping("/plc2/auth")
    @ManagerAuth
    public R getMapFromPlc2() {
        try {
            String mapFilename = "plc2.json";
            String fileName = this.getClass().getClassLoader().getResource(mapFilename).getPath();//获取文件路径
            File file = new File(fileName);
            StringBuffer stringBuffer = new StringBuffer();
            if (file.isFile() && file.exists()) {
                InputStreamReader isr = new InputStreamReader(new FileInputStream(file), "GBK");
                BufferedReader br = new BufferedReader(isr);
                String lineTxt = null;
                while ((lineTxt = br.readLine()) != null) {
                    stringBuffer.append(lineTxt);
                }
                br.close();
            }
            NavigateMapData navigateMapData = new NavigateMapData();
            //解析json地图数据
            ArrayList arrayList = JSON.parseObject(stringBuffer.toString(), ArrayList.class);
            List<List<MapNode>> lists = new ArrayList<>();
            //重建数据格式
            for (int i = 0; i < arrayList.size(); i++) {
                Object obj = arrayList.get(i);
                List<MapNode> list = JSON.parseArray(obj.toString(), MapNode.class);
                for (int j = 0; j < list.size(); j++) {
                    MapNode mapNode = list.get(j);
                    list.set(j, mapNode);
                }
                lists.add(list);
            }
            return R.ok().add(lists);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return R.error();
    }
    /**
     * 重置redis中的地图,将占用的库位全部解除
     */
    @GetMapping("/map/resetMap/auth")
src/main/java/com/zy/core/ServerBootstrap.java
@@ -79,9 +79,15 @@
        // 初始化输送线线程
        News.info("初始化输送线线程...................................................");
        for (DevpSlave devp : slaveProperties.getDevp()) {
            DevpThread devpThread = new SiemensDevpThread(devp);
            new Thread((Runnable) devpThread).start();
            SlaveConnection.put(SlaveType.Devp, devp.getId(), devpThread);
            if (devp.getId() == 1) {
                DevpThread devpThread = new SiemensDevpThread(devp);
                new Thread((Runnable) devpThread).start();
                SlaveConnection.put(SlaveType.Devp, devp.getId(), devpThread);
            }else {
                DevpThread devpThread = new SiemensDevpThread2(devp);
                new Thread((Runnable) devpThread).start();
                SlaveConnection.put(SlaveType.Devp, devp.getId(), devpThread);
            }
        }
        // 初始化提升机
        News.info("初始化提升机........................................................");
src/main/java/com/zy/core/thread/SiemensDevpThread2.java
New file
@@ -0,0 +1,318 @@
package com.zy.core.thread;
import HslCommunication.Core.Types.OperateResult;
import HslCommunication.Core.Types.OperateResultExOne;
import HslCommunication.Profinet.Siemens.SiemensPLCS;
import HslCommunication.Profinet.Siemens.SiemensS7Net;
import com.alibaba.fastjson.JSON;
import com.core.common.Cools;
import com.core.common.DateUtils;
import com.core.common.SpringUtils;
import com.zy.asrs.entity.BasDevp;
import com.zy.asrs.service.BasDevpService;
import com.zy.core.DevpThread;
import com.zy.core.News;
import com.zy.core.cache.MessageQueue;
import com.zy.core.cache.OutputQueue;
import com.zy.core.cache.SlaveConnection;
import com.zy.core.enums.SlaveType;
import com.zy.core.model.DevpSlave;
import com.zy.core.model.Task;
import com.zy.core.model.protocol.StaProtocol;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
 * 输送线线程
 * Created by vincent on 2020/8/4
 */
@Data
@Slf4j
public class SiemensDevpThread2 implements Runnable, DevpThread {
    private DevpSlave slave;
    private SiemensS7Net siemensS7Net;
    private Map<Integer, StaProtocol> station = new ConcurrentHashMap<>();
    private short heartBeatVal = 1;
    private int barcodeSize = 1;
    public static final ArrayList<Integer> staNos = new ArrayList<Integer>() {{
        add(106);add(107);
        add(108);add(209);
        add(210);add(347);
        add(348);add(349);
    }};
    public SiemensDevpThread2(DevpSlave slave) {
        this.slave = slave;
    }
    @Override
    @SuppressWarnings("InfiniteLoopStatement")
    public void run() {
        connect();
        while (true) {
            try {
                int step = 1;
                Task task = MessageQueue.poll(SlaveType.Devp, slave.getId());
                if (task != null) {
                    step = task.getStep();
                }
                switch (step) {
                    // 读数据
                    case 1:
                        read();
                        break;
                    // 写数据 ID+目标站
                    case 2:
                        write((StaProtocol) task.getData());
                        read();
                        break;
                    default:
                        break;
                }
                // 心跳
//                heartbeat();
                Thread.sleep(400);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
    @Override
    public boolean connect() {
        boolean result = false;
        siemensS7Net = new SiemensS7Net(SiemensPLCS.S1200, slave.getIp());
        siemensS7Net.setRack(slave.getRack().byteValue());
        siemensS7Net.setSlot(slave.getSlot().byteValue());
        OperateResult connect = siemensS7Net.ConnectServer();
        if(connect.IsSuccess){
            result = true;
            OutputQueue.DEVP.offer(MessageFormat.format( "【{0}】输送线plc连接成功 ===>> [id:{1}] [ip:{2}] [port:{3}] [rack:{4}] [slot:{5}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()));
            News.info("输送线plc连接成功 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
        } else {
            OutputQueue.DEVP.offer(MessageFormat.format( "【{0}】输送线plc连接失败!!! ===>> [id:{1}] [ip:{2}] [port:{3}]  [rack:{4}] [slot:{5}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()));
            News.error("输送线plc连接失败!!! ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
        }
        siemensS7Net.ConnectClose();
        return result;
    }
    /**
     * 读取状态 ====> 整块plc
     */
    private void read() throws InterruptedException {
        OperateResultExOne<byte[]> result = siemensS7Net.Read("DB1000.0", (short) (staNos.size()*4));
        if (result.IsSuccess) {
            for (int i = 0; i < staNos.size(); i++) {
                Integer siteId = staNos.get(i); // 站点编号
                StaProtocol staProtocol = station.get(siteId);
                if (null == staProtocol) {
                    staProtocol = new StaProtocol();
                    staProtocol.setSiteId(siteId);
                    station.put(siteId, staProtocol);
                }
                staProtocol.setWorkNo(siemensS7Net.getByteTransform().TransInt16(result.Content, i*4));     // 工作号
                staProtocol.setStaNo(siemensS7Net.getByteTransform().TransInt16(result.Content, i*4+2));   // 目标站
            }
        }
        Thread.sleep(200);
        OperateResultExOne<byte[]> result1 = siemensS7Net.Read("DB1001.0", (short) (staNos.size()*2));
        if (result1.IsSuccess) {
            for (int i = 0; i < staNos.size(); i++) {
                Integer siteId = staNos.get(i); // 站点编号
                boolean[] status = siemensS7Net.getByteTransform().TransBool(result1.Content, i*2, 1);
                StaProtocol staProtocol = station.get(siteId);
                staProtocol.setAutoing(status[0]);  // 自动
                staProtocol.setLoading(status[1]);  // 有物
                staProtocol.setInEnable(status[2]); // 可入
                staProtocol.setOutEnable(status[3]);// 可出
                staProtocol.setEmptyMk(status[4]);  // 空板信号
                staProtocol.setFullPlt(status[5]);  // 满托盘
                staProtocol.setLiftArrival(status[6]);     // 提升机到位信号
                staProtocol.setShuttleTakeEnable(status[7]);      // 提升机可取信号
                if (!staProtocol.isPakMk() && !staProtocol.isLoading()) {
                    staProtocol.setPakMk(true);
                }
            }
        }
        if (result.IsSuccess && result1.IsSuccess) {
            OutputQueue.DEVP.offer(MessageFormat.format("【{0}】[id:{1}] <<<<< 实时数据更新成功",DateUtils.convert(new Date()), slave.getId()));
            // 根据实时信息更新数据库
            try {
                List<BasDevp> basDevps = new ArrayList<>();
                for (Integer siteId : staNos) {
                    StaProtocol staProtocol = station.get(siteId);
                    basDevps.add(staProtocol.toSqlModel());
                }
                BasDevpService basDevpService = SpringUtils.getBean(BasDevpService.class);
                if (!basDevpService.updateBatchById(basDevps)) {
                    throw new Exception("更新数据库数据失败");
                }
            } catch (Exception e) {
                OutputQueue.DEVP.offer(MessageFormat.format("【{0}】更新数据库数据失败 ===>> [id:{1}] [ip:{2}] [port:{3}] [rack:{4}] [slot:{5}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()));
                News.error("更新数据库数据失败 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot());
            }
        } else {
            OutputQueue.DEVP.offer(MessageFormat.format("【{0}】读取输送线plc状态信息失败 ===>> [id:{1}] [ip:{2}] [port:{3}] [rack:{4}] [slot:{5}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()));
//            News.error("读取输送线plc状态信息失败 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot());
        }
    }
    /**
     * 写入 ID+目标站 =====> 单站点写入
     */
    private void write(StaProtocol staProtocol) throws InterruptedException {
        if (null == staProtocol) {
            return;
        }
        int index = staNos.indexOf(staProtocol.getSiteId());
        short[] array = new short[2];
        array[0] = staProtocol.getWorkNo();
        array[1] = staProtocol.getStaNo();
//        OperateResult write = siemensS7Net.Write("DB100." + index*4, staProtocol.getWorkNo());    // 工作号
//        Thread.sleep(500);
//        OperateResult write1 = siemensS7Net.Write("DB100." + (index*4+2), staProtocol.getStaNo());    // 目标站
        OperateResult writeResult;
        //任务下发次数
        int writeCount = 0;
        //任务下发成功标识
        boolean writeFlag = false;
        while(writeCount < 5){
            writeResult = siemensS7Net.Write("DB1000." + index*4, array);    // 工作号、目标站
            if(writeResult.IsSuccess){
                Thread.sleep(200);
                OperateResultExOne<byte[]> readResult = siemensS7Net.Read("DB1000." + index*4, (short)4);
                if(readResult.IsSuccess){
                    short workNo = siemensS7Net.getByteTransform().TransInt16(readResult.Content, 0);
                    short staNo = siemensS7Net.getByteTransform().TransInt16(readResult.Content, 2);
                    if(staProtocol.getWorkNo().equals(workNo) && staProtocol.getStaNo().equals(staNo)){
                        //任务命令写入成功
                        writeFlag = true;
                        log.info("写入输送线命令后返回成功,并且回读成功。输送线plc编号={},{},写入次数={}", slave.getId(), JSON.toJSON(staProtocol), writeCount);
                        break;
                    } else {//返回结果是成功了,但是真实值不相同
                        writeCount++;
                        OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线命令后返回成功,但是读取任务值不一致。输送线plc编号={1},站点数据={2},写入次数={3}",
                                slave.getId(), JSON.toJSON(staProtocol),writeCount));
                        log.error("写入输送线命令后返回成功,但是读取任务值不一致。输送线plc编号={},{},写入次数={}", slave.getId(), JSON.toJSON(staProtocol), writeCount);
                    }
                } else {
                    writeCount++;
                    OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线命令后读取失败。输送线plc编号={1},站点数据={2},写入次数={3}",
                            slave.getId(), JSON.toJSON(staProtocol), writeCount));
                    log.error("写入输送线命令后读取失败。输送线plc编号={},站点数据={},写入次数={}", slave.getId(), JSON.toJSON(staProtocol), writeCount);
                }
            } else {
                writeCount++;
                OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线命令失败。输送线plc编号={1},站点数据={2},写入次数={3}",
                        slave.getId(), JSON.toJSON(staProtocol),writeCount));
                log.error("写入输送线命令失败。输送线plc编号={},站点数据={},写入次数={}", slave.getId(), JSON.toJSON(staProtocol), writeCount);
            }
            Thread.sleep(200);
        }
        //写命令尝试了5次还是失败了
        if(!writeFlag){
            staProtocol = station.get(staProtocol.getSiteId());
            if (staProtocol.getWorkNo() == 0 && staProtocol.getStaNo() ==0) {
                staProtocol.setPakMk(true);
            }
            OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线命令尝试5次失败。输送线plc编号={1},站点数据={2}", slave.getId(), JSON.toJSON(staProtocol)));
            log.error("写入输送线命令尝试5次失败。输送线plc编号={},站点数据={}", slave.getId(), JSON.toJSON(staProtocol));
            //重新添加数据到任务队列
            boolean result = MessageQueue.offer(SlaveType.Devp, slave.getId(), new Task(2, staProtocol));
            read();//读取1次设备状态
            return;
        } else {
            OutputQueue.DEVP.offer(MessageFormat.format("【{0}】 输送线命令下发成功 [id:{1}] >>>>> {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(staProtocol)));
            log.info("输送线命令下发 [id:{}] >>>>> 命令下发成功: {}",  slave.getId(), JSON.toJSON(staProtocol));
            Integer siteId = staProtocol.getSiteId();
            staProtocol = station.get(siteId);
            if ((siteId == 101 || siteId == 201)&&(staProtocol.getWorkNo() == 0 && staProtocol.getStaNo() ==0)) {
                staProtocol.setPakMk(true);
            }
        }
    }
    /**
     * 心跳
     */
    private void heartbeat(){
        if (heartBeatVal == 1) {
            heartBeatVal = 2;
        } else {
            heartBeatVal = 1;
        }
        OperateResult write = siemensS7Net.Write("DB100.50", heartBeatVal);
        if (!write.IsSuccess) {
            News.error("输送线plc编号={} 心跳失败", slave.getId());
        }
    }
    /**
     * 设置入库标记
     */
    @Override
    public void setPakMk(Integer siteId, boolean pakMk) {
        StaProtocol staProtocol = station.get(siteId);
        if (null != staProtocol) {
            staProtocol.setPakMk(pakMk);
        }
    }
    @Override
    public void close() {
        siemensS7Net.ConnectClose();
    }
    public static void main(String[] args) {
//        System.out.println(staNos.indexOf(129));
        System.out.println(staNos.size());
        for (int i = 0; i<staNos.size(); i++) {
//            System.out.println(i*2);
//            System.out.println(i*2 + 200);
//            System.out.println(i);
        }
//        int index = staNos.indexOf(128);
//        System.out.println(index*2);
//        System.out.println(index*2 + 200);
    }
//    public static void main(String[] args) throws Exception {
//        DevpSlave slave = new DevpSlave();
//        slave.setIp("192.168.2.125");
//        SiemensDevpThread devpThread = new SiemensDevpThread(slave);
//        devpThread.connect();
//        devpThread.read();
//        // 写
//        StaProtocol staProtocol = devpThread.getStation().get(1);
//        staProtocol.setWorkNo((short) 232);
//        staProtocol.setStaNo((short) 6);
//        staProtocol.setAutoing(true);
//        staProtocol.setEmptyMk(true);
//        staProtocol.setInEnable(true);
//        devpThread.write(staProtocol);
//        System.out.println("----------------------------------------");
//        // 读
//        devpThread.read();
//        System.out.println(JSON.toJSONString(devpThread.station));
//
//    }
}
src/main/resources/application.yml
@@ -293,6 +293,13 @@
#      row: 4
#      bay: 6
#      lev: 6
  # 输送线2
  devp[1]:
    id: 2
    ip: 10.10.10.58
    port: 102
    rack: 0
    slot: 0
  # 条码扫描仪
  barcode[0]:
src/main/resources/plc2.json
New file
@@ -0,0 +1 @@
[ [ { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 } ], [ { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": 4, "data": "106", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": 4, "data": "107", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": 4, "data": "108", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": 4, "data": "210", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": 4, "data": "209", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": 4, "data": "349", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": 4, "data": "348", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 } ], [ { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 }, { "value": -1, "data": "", "top": 1000, "bottom": 1000, "left": 1000, "right": 1000 } ] ]
src/main/webapp/views/index.html
@@ -23,6 +23,7 @@
            <li><a id="lift" onclick="nav(this.id)" class="nav-unselect" href="#">提升机</a></li>
<!--            <li><a id="ste" onclick="nav(this.id)" class="nav-unselect" href="#">穿梭车</a></li>-->
            <li><a id="shuttle" onclick="nav(this.id)" class="nav-unselect" href="#">四向穿梭车</a></li>
            <li><a id="plc2" onclick="nav(this.id)" class="nav-unselect" href="#">PLC2</a></li>
        </ul>
    </div>
</div>
src/main/webapp/views/plc2.html
New file
@@ -0,0 +1,661 @@
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>WCS控制中心</title>
    <link rel="stylesheet" href="../static/css/animate.min.css">
    <link rel="stylesheet" href="../static/vue/element/element.css">
    <link rel="stylesheet" href="../static/css/console_vue.css">
    <link rel="stylesheet" href="../static/css/toggle-switch.css">
    <script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="../static/layui/layui.js"></script>
    <script type="text/javascript" src="../static/js/handlebars/handlebars-v4.5.3.js"></script>
    <script type="text/javascript" src="../static/js/common.js"></script>
    <script type="text/javascript" src="../static/vue/js/vue.min.js"></script>
    <script type="text/javascript" src="../static/vue/element/element.js"></script>
</head>
<body>
<div id="app">
    <div style="display: flex;justify-content: center;align-items: center;width: 100%;margin-top: 150px;">
        <div id="mapDataId" style="zoom: 0.7;position: relative;">
            <div class="pointContainer" v-for="(row,index) in map" :key="index">
                <div v-for="(col,idx) in row" :key="idx">
                    <div v-if="col.value == 0">
                        <!-- 子轨道 路径为穿梭车预计路径则显示穿梭车颜色和穿梭车号 -->
                        <div :style="{background: checkAdvancePath(index,idx).length == 0 ? '':shuttleColorList[checkAdvancePath(index,idx)[0]]}" class="item" v-if="col.data.length > 0">{{col.data}}</div>
                        <div :style="{background: checkAdvancePath(index,idx).length == 0 ? '':shuttleColorList[checkAdvancePath(index,idx)[0]]}" class="item" v-else>{{checkAdvancePath(index,idx).length == 0 ? idx:checkAdvancePath(index,idx)}}</div>
                    </div>
                    <div v-else-if="col.value == 3">
                        <!-- 母轨道 路径为穿梭车预计路径则显示穿梭车颜色和穿梭车号 -->
                        <div :style="{background: checkAdvancePath(index,idx).length == 0 ? '#5af':shuttleColorList[checkAdvancePath(index,idx)[0]]}" class="item">{{checkAdvancePath(index,idx).length == 0 ? '&#x21c5;&#x21c4;':checkAdvancePath(index,idx)}}</div>
                    </div>
                    <div v-else-if="col.value == 4">
                        <!-- 站点 -->
                        <div class="site" :id="'site-' + col.data" @click="openSite(col.data)">{{col.data}}</div>
                    </div>
                    <div v-else-if="col.value == 5">
                        <!-- 充电桩 -->
                        <div class="item" style="font-size: 24px">&#9889;</div>
                    </div>
                    <div v-else-if="col.value == -999">
                        <!-- 路径占用区域 -->
                        <div class="item" style="background:#f83333;color: #fff;">{{idx}}</div>
                    </div>
                    <div v-else-if="col.value < 0">
                        <!-- 禁止显示区域 -->
                        <div class="item" style="visibility: hidden">{{idx}}</div>
                    </div>
                    <div v-else>
                        <div class="item" v-if="col.data.length > 0">{{col.data}}</div>
                        <div class="item" v-else>{{idx}}-{{col.value}}</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="footer">
        <!-- 总开关 -->
        <div class="line-status">
            <div class="body-head">总开关</div>
            <div class="switch" @click="systemSwitch">
                <label id="system-toggle" class="toggle-switch" style="margin-left: 20px;">
                    <input id="system-toggle-checked" disabled type="checkbox">
                    <div class="button">
                        <div class="light"></div>
                        <div class="dots"></div>
                        <div class="characters"></div>
                        <div class="shine"></div>
                        <div class="shadow"></div>
                    </div>
                </label>
                <div class="switch_r">
                    <p>系统状态</p>
                    <p id="system-run-desc">系统运行中</p>
                </div>
            </div>
        </div>
        <!-- 四向穿梭车状态 -->
        <div class="line-status">
            <div class="body-head">穿梭车状态</div>
            <div class="shuttle-status-box">
                <div v-for="(item,idx) in shuttleList" class="state">
                    <span :style="{color: shuttleColorList[item.shuttleNo]}">四向穿梭车 {{item.shuttleNo}}</span>
                    <span v-if="item.protocolStatus == 1"
                          class="state-ss shuttle-idle">{{item.protocolStatus$}}</span>
                    <span v-else-if="item.protocolStatus == 2"
                          class="state-ss shuttle-working">{{item.protocolStatus$}}</span>
                    <span v-else-if="item.protocolStatus == 3"
                          class="state-ss shuttle-waiting">{{item.protocolStatus$}}</span>
                    <span v-else-if="item.protocolStatus == 4"
                          class="state-ss shuttle-charging">{{item.protocolStatus$}}</span>
                    <span v-else-if="item.protocolStatus == 5"
                          class="state-ss shuttle-charging-waiting">{{item.protocolStatus$}}</span>
                    <span v-else-if="item.protocolStatus == 6"
                          class="state-ss shuttle-fixing">{{item.protocolStatus$}}</span>
                    <span v-else-if="item.protocolStatus == 7"
                          class="state-ss shuttle-offline">{{item.protocolStatus$}}</span>
                    <span v-else class="state-ss shuttle-offline">{{item.protocolStatus$}}</span>
                </div>
            </div>
            <div class="allStatus"><span>所有状态</span></div>
            <div class="allStatus item-group">
                <span class="shuttle-idle">空闲</span>
                <span class="shuttle-working">作业中</span>
                <span class="shuttle-waiting">等待确认</span>
                <span class="shuttle-charging">充电中</span>
                <span class="shuttle-charging-waiting">充电任务等待确认</span>
                <span class="shuttle-fixing">故障修复中</span>
                <span class="shuttle-offline">离线</span>
            </div>
        </div>
        <!-- 提升机状态 -->
        <div class="line-status">
            <div class="body-head">提升机状态</div>
            <div class="lift-status-box">
                <div v-for="(item,idx) in liftList" class="state states">
                    <span>提升机 {{item.liftNo}}</span>
                    <span v-if="item.protocolStatus == 1"
                          class="state-ss lift-idle">{{item.protocolStatus$}}</span>
                    <span v-else-if="item.protocolStatus == 2"
                          class="state-ss lift-working">{{item.protocolStatus$}}</span>
                    <span v-else-if="item.protocolStatus == 3"
                          class="state-ss lift-waiting">{{item.protocolStatus$}}</span>
                    <span v-else-if="item.protocolStatus == 4"
                          class="state-ss lift-offline">{{item.protocolStatus$}}</span>
                    <span v-else class="state-ss lift-offline">{{item.protocolStatus$}}</span>
                </div>
            </div>
            <div class="allStatus"><span>所有状态</span></div>
            <div class="allStatus item-group">
                <span class="lift-idle">空闲</span>
                <span class="lift-working">作业中</span>
                <span class="lift-waiting">等待确认</span>
                <span class="lift-offline">离线</span>
            </div>
        </div>
        <!-- 输送线状态 -->
        <div class="line-status">
            <div class="body-head">输送线状态</div>
            <div class="state states">
                <span>运输线总数</span>
                <span class="line-ss">9</span>
            </div>
            <div class="allStatus"><span>所有状态</span></div>
            <div class="allStatus item-group">
                <span class="site-auto-run-id">自动+有物+ID</span>
                <span class="site-auto-run">自动+有物</span>
                <span class="site-auto-id">自动+ID</span>
                <span class="site-auto">自动</span>
                <span class="site-unauto">非自动/手动</span>
            </div>
        </div>
        <!-- 条码表格 -->
        <div class="bar-code">
            <div class="body-head" id="code">条码扫描器</div>
            <div class="tablebox">
                <div class="table-head">
                    <li><span>条码名称</span><span class="right">扫码时间</span></li>
                </div>
                <div id="barcode1" class="table-body">
                    <li v-for="(item,index) in codeList1" :key="index"><span>{{item.barcode}}</span><span class="right">{{item.time}}</span></li>
                </div>
            </div>
            <div class="tablebox">
                <div class="table-head">
                    <li><span>条码名称</span><span class="right">扫码时间</span></li>
                </div>
                <div id="barcode2" class="table-body">
                    <li v-for="(item,index) in codeList2" :key="index"><span>{{item.barcode}}</span><span class="right">{{item.time}}</span></li>
                </div>
            </div>
        </div>
    </div>
    <!-- 输送设备弹窗 -->
    <div id="siteWindow" :style="{display:siteWindow?'block':'none'}" class="animate__animated animate__fadeIn">
        <!-- 表头 -->
        <div id="siteWindow-head">
            <div class="detailed"></div>
            <button @click="siteWindow = false"></button>
        </div>
        <!-- 表内容 -->
        <div class="siteWindow-body">
            <form>
                <!-- 设备号 -->
                <div class="form-item">
                    <div class="form-item-label">
                        <span>设备号:</span>
                    </div>
                    <div class="form-item-input">
                        <input type="text" name="siteId" value="">
                    </div>
                </div>
                <!-- 工作号 -->
                <div class="form-item">
                    <div class="form-item-label">
                        <span>工作号:</span>
                    </div>
                    <div class="form-item-input">
                        <input type="text" name="workNo" value="">
                    </div>
                </div>
                <!-- 工作状态 -->
                <div class="form-item">
                    <div class="form-item-label">
                        <span>工作状态:</span>
                    </div>
                    <div class="form-item-input">
                        <input type="text" name="wrkSts" value="">
                    </div>
                </div>
                <div class="form-item">
                    <!-- 自动 -->
                    <div class="form-item-checkbox">
                        <div class="form-item-label-checkbox">
                            <span>自动</span>
                        </div>
                        <div class="form-item-input-checkbox">
                            <input type="checkbox" name="autoing">
                        </div>
                    </div>
                    <!-- 有物 -->
                    <div class="form-item-checkbox">
                        <div class="form-item-label-checkbox">
                            <span>有物</span>
                        </div>
                        <div class="form-item-input-checkbox">
                            <input type="checkbox" name="loading">
                        </div>
                    </div>
                    <!-- 能入 -->
                    <div class="form-item-checkbox">
                        <div class="form-item-label-checkbox">
                            <span>能入</span>
                        </div>
                        <div class="form-item-input-checkbox">
                            <input type="checkbox" name="canining">
                        </div>
                    </div>
                    <!-- 能出 -->
                    <div class="form-item-checkbox">
                        <div class="form-item-label-checkbox">
                            <span>能出</span>
                        </div>
                        <div class="form-item-input-checkbox">
                            <input type="checkbox" name="canouting">
                        </div>
                    </div>
                </div>
                <!-- 出入类型 -->
                <div class="form-item">
                    <div class="form-item-label">
                        <span>出入类型:</span>
                    </div>
                    <div class="form-item-input">
                        <input type="text" name="ioType" value="">
                    </div>
                </div>
                <!-- 源站 -->
                <div class="form-item">
                    <div class="form-item-label">
                        <span>源站:</span>
                    </div>
                    <div class="form-item-input">
                        <input type="text" name="sourceStaNo" value="">
                    </div>
                </div>
                <!-- 目标站 -->
                <div class="form-item">
                    <div class="form-item-label">
                        <span>目标站:</span>
                    </div>
                    <div class="form-item-input">
                        <input type="text" name="staNo" value="">
                    </div>
                </div>
                <!-- 源库位 -->
                <div class="form-item">
                    <div class="form-item-label">
                        <span>源库位:</span>
                    </div>
                    <div class="form-item-input">
                        <input type="text" name="sourceLocNo" value="">
                    </div>
                </div>
                <!-- 目标库位 -->
                <div class="form-item">
                    <div class="form-item-label">
                        <span>目标库位:</span>
                    </div>
                    <div class="form-item-input">
                        <input type="text" name="locNo" value="">
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            map: [],//地图数据
            currentLev: 1,//地图当前楼层
            siteWindow: false, //站点弹窗显示默认不显示
            floorList: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], //当前项目楼层
            shuttleList: [], //四向穿梭车集合
            currentLevShuttleList: [],//当前楼层四向穿梭车集合
            shuttleColorList: [],//四向穿梭车颜色集合
            liftList: [], //提升机集合
            systemStatus: true,//系统运行状态
            consoleInterval: null,//定时器存储变量
            codeList1: [],//条码List
            codeList2: [],//条码List
        },
        created() {
            this.init()
        },
        watch: {
        },
        methods: {
            init() {
                this.getMap(this.currentLev)
                this.getSystemRunningStatus() //获取系统运行状态
                this.consoleInterval = setInterval(() => {
                    this.getShuttleStateInfo() //获取四向穿梭车信息
                    this.getLiftStateInfo() //获取提升机信息
                    this.getSiteInfo() //获取输送站点数据
                    this.getMap(this.currentLev) //获取实时地图数据
                    this.getCodeData()//获取条码
                }, 1000)
            },
            //获取地图数据
            getMap(lev) {
                $.ajax({
                    type: "get",
                    url: baseUrl + "/console/plc2/auth",
                    headers: {
                        'token': localStorage.getItem('token')
                    },
                    success: (res) => {
                        let data = res.data
                        let tmp = []
                        for (let i = 1; i < data.length - 1; i++) {
                            tmp.push(data[i])
                        }
                        // console.log(tmp)
                        this.map = tmp
                    }
                })
            },
            openSite(id) {
                this.siteWindow = true; //打开站点信息弹窗
                $(".detailed").empty();
                $('.detailed').append(id + '站点详细信息');
                $.ajax({
                    url: baseUrl + "/console/site/detail",
                    headers: {
                        'token': localStorage.getItem('token')
                    },
                    data: {
                        siteId: id
                    },
                    method: 'post',
                    success: function(res) {
                        for (var val in res.data) {
                            var find = $("#siteWindow").find(":input[name='" + val + "']");
                            if (find[0].type === 'text') {
                                find.val(res.data[val]);
                            } else if (find[0].type === 'checkbox') {
                                find.attr("checked", res.data[val] === 'Y');
                            }
                        }
                    }
                })
            },
            getSiteInfo() {
                //获取输送站点数据
                $.ajax({
                    url: baseUrl+ "/console/latest/data/site",
                    headers: {'token': localStorage.getItem('token')},
                    method: 'POST',
                    success: function (res) {
                        if (res.code === 200){
                            var sites = res.data;
                            for (var i = 0; i < sites.length; i++){
                                var siteEl = $("#site-"+sites[i].siteId);
                                siteEl.attr("class", "site " + sites[i].siteStatus);
                                if (sites[i].workNo != null && sites[i].workNo>0) {
                                    siteEl.html(sites[i].siteId + "[" + sites[i].workNo + "]");
                                } else {
                                    siteEl.html(sites[i].siteId);
                                }
                            }
                        } else if (res.code === 403){
                            parent.location.href = baseUrl+"/login";
                        }  else {
                            console.log(res.msg);
                        }
                    }
                });
            },
            changFloor(lev) {
                this.currentLev = lev
                this.currentLevShuttleList = []
                this.getMap(lev)
            },
            getShuttleStateInfo() {
                // 四向穿梭车信息表获取
                let that = this
                $.ajax({
                    url: baseUrl + "/shuttle/table/shuttle/state",
                    headers: {
                        'token': localStorage.getItem('token')
                    },
                    method: 'POST',
                    success: function(res) {
                        if (res.code == 200) {
                            let currentLevShuttle = []//当前楼层小车集合
                            res.data.forEach((item,idx) => {
                                if (item != null && item.point != undefined && item.point != null) {
                                    if (item.point.z == that.currentLev) {
                                        currentLevShuttle.push(item);
                                    }
                                }
                            })
                            that.currentLevShuttleList = currentLevShuttle
                            that.shuttleList = res.data
                            if (that.shuttleColorList.length == 0) {
                                let colorList = []//随机小车颜色
                                res.data.forEach((item,idx) => {
                                    colorList[item.shuttleNo] = that.colorRGB()
                                })
                                that.shuttleColorList = colorList
                            }
                        }
                    }
                });
            },
            getLiftStateInfo() {
                // 提升机信息表获取
                let that = this
                $.ajax({
                    url: baseUrl + "/lift/table/lift/state",
                    headers: {
                        'token': localStorage.getItem('token')
                    },
                    method: 'POST',
                    success: function(res) {
                        if (res.code == 200) {
                            that.liftList = res.data
                        }
                    }
                });
            },
            systemSwitch() {
                // 系统开关
                let that = this
                if (this.systemStatus) {
                    this.$prompt('请输入口令,并停止WCS系统', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                    }).then(({
                                 value
                             }) => {
                        that.doSwitch(0, value)
                    }).catch(() => {
                    });
                } else {
                    this.doSwitch(1)
                }
            },
            doSwitch(operatorType, password) {
                let that = this
                $.ajax({
                    url: baseUrl + "/console/system/switch",
                    headers: {
                        'token': localStorage.getItem('token')
                    },
                    data: {
                        operatorType: operatorType,
                        password: password
                    },
                    method: 'POST',
                    success: function(res) {
                        if (res.code === 200) {
                            if (res.data.status) {
                                $('#system-toggle-checked').attr("checked", true);
                                $('#system-run-desc').html("系统运行中...");
                                that.systemStatus = true;
                                parent.systemRunning = true;
                            } else {
                                $('#system-toggle-checked').attr("checked", false);
                                $('#system-run-desc').html("系统已停止!");
                                that.systemStatus = false;
                                parent.systemRunning = false;
                            }
                        } else if (res.code === 403) {
                            parent.location.href = baseUrl + "/login";
                        } else {
                            that.$message({
                                message: res.msg,
                                type: 'error'
                            });
                        }
                    }
                });
            },
            getSystemRunningStatus() {
                // 获取wcs系统运行状态
                let that = this
                $.ajax({
                    url: baseUrl + "/console/system/running/status",
                    headers: {
                        'token': localStorage.getItem('token')
                    },
                    method: 'POST',
                    success: function(res) {
                        if (res.code === 200) {
                            if (res.data.status) {
                                $('#system-toggle-checked').attr("checked", true);
                                $('#system-run-desc').html("系统运行中...");
                                that.systemStatus = true;
                                parent.systemRunning = true;
                            } else {
                                $('#system-toggle-checked').attr("checked", false);
                                $('#system-run-desc').html("系统已停止!");
                                that.systemStatus = false;
                                parent.systemRunning = false;
                            }
                        } else if (res.code === 403) {
                            parent.location.href = baseUrl + "/login";
                        } else {
                            that.$message({
                                message: res.msg,
                                type: 'error'
                            });
                        }
                    }
                });
            },
            getCarPosition(x,y) {
                //计算四向穿梭车图标位置
                let top = (x * 35 - 35) + "px" //需要减去小车自己所占高度
                let left = (y * 35) + "px" //需要减去小车自己所占宽度
                return [top,left];
            },
            testMove() {
                let that = this
                clearInterval(this.consoleInterval)//清理定时器
                let shuttleList = this.currentLevShuttleList
                $.ajax({
                    url: baseUrl + "/static/testMoveData.json",
                    headers: {
                        'token': localStorage.getItem('token')
                    },
                    method: 'GET',
                    success: function(res) {
                        shuttleList[0].moveAdvancePath = res
                        that.currentLevShuttleList = shuttleList
                        let index = 0
                        let tmp = null
                        tmp = setInterval(() => {
                            if (index < res.length) {
                                that.currentLevShuttleList[0].wcsPoint.y = res[index].y
                                that.currentLevShuttleList[0].wcsPoint.x = res[index].x
                                index++
                            }else {
                                clearInterval(tmp)
                                that.init()
                            }
                        },1000)
                    }
                });
            },
            colorRGB(){
                //随机颜色
                const r = Math.floor(Math.random()*256);
                const g = Math.floor(Math.random()*256);
                const b = Math.floor(Math.random()*256);
                return `rgb(${r},${g},${b})`;
            },
            checkAdvancePath(x,y) {
                //检测路径是否为穿梭车预计路径,如x和y路径是穿梭车预计路径,则返回小车号
                this.currentLevShuttleList.forEach((item,idx) => {
                    if (item.moveAdvancePath != null) {
                        item.moveAdvancePath.forEach((path,index) => {
                            if (path.x === x && path.y === y) {
                                return item.shuttleNo;
                            }
                        })
                    }
                })
                let data = []
                let shuttleList = this.currentLevShuttleList;
                for (var i = 0; i < shuttleList.length; i++) {
                    let shuttle = shuttleList[i]
                    let moveAdvancePath = shuttle.moveAdvancePath
                    if (moveAdvancePath != null) {
                        for (var j = 0; j < moveAdvancePath.length; j++) {
                            let path = moveAdvancePath[j]
                            if (path.x-1 === x && path.y === y) {//路径符合
                                data.push(shuttle.shuttleNo)
                                continue;
                            }
                        }
                    }
                }
                return data;//返回小车号集合
            },
            resetMap() {
                //重置地图
                let that = this
                $.ajax({
                    url:baseUrl+"/console/map/resetMap/auth",
                    headers:{
                        'token': localStorage.getItem('token')
                    },
                    data:{},
                    method:'get',
                    success:function (res) {
                        that.$message({
                            message: '重置完成',
                            type: 'success'
                        });
                    }
                })
            },
            getCodeData(){
                let that = this
                $.ajax({
                    url:baseUrl +'/console/barcode/output/site',
                    method:'GET',
                    success:function (res) {
                        if(res.code === 200){
                            let data = JSON.parse(res.data)
                            if(data.length<=5){
                                that.codeList1 = data
                            } else {
                                tData1 = data.slice(0,5)
                                tData2 = data.splice(5,10)
                            }
                        }
                    }
                })
            }
        }
    })
</script>
</body>
</html>