自动化立体仓库 - WCS系统
#
lsh
2024-09-14 178a4bc1610e4548c2afe8ad9d162aa47e61d9ea
#
1个文件已添加
5个文件已修改
183 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/RgvController.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/domain/param/EnergyGatheringRingParam.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/domain/param/RingThroughParam.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/enums/RgvModeType.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/enums/RgvStatusType.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/index.html 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/RgvController.java
@@ -5,6 +5,7 @@
import com.core.common.R;
import com.core.exception.CoolException;
import com.zy.asrs.domain.enums.RgvStatusType;
import com.zy.asrs.domain.param.EnergyGatheringRingParam;
import com.zy.asrs.domain.param.RgvOperatorParam;
import com.zy.asrs.domain.param.RingThroughParam;
import com.zy.asrs.domain.vo.*;
@@ -320,58 +321,39 @@
        return false;
    }
    @PostMapping("/console/rgv/site/data")
    @ManagerAuth(memo = "小车实时位置")
    public R scaleLatestData(){
        List<Map> result = new ArrayList<>();
        for (RgvSlave rgv : slaveProperties.getRgv()) {
            // 获取RGV信息
            RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgv.getId());
            if (rgvThread == null) {
                throw new CoolException("RGV不在线");
            }
            RgvProtocol rgvProtocol = rgvThread.getRgvProtocol();
            if (rgvProtocol == null) {
                throw new CoolException("RGV不在线");
            }
            Map<String, Object> rgvMap = new HashMap<>();
            rgvMap.put("title", rgvProtocol.getRgvPosI());
            rgvMap.put("id", rgvProtocol.getRgvNo());
            result.add(rgvMap);
        }
        return R.ok().add(result);
    }
    @PostMapping("/ring/through/rgv/position/data")
//    @ManagerAuth(memo = "环穿位置信息")
    public R ringThroughRgv(){
        List<RingThroughParam> result = new ArrayList<>();
//        for (RgvSlave rgv : slaveProperties.getRgv()) {
        for (int i = 1;i<2;i++) {
        for (RgvSlave rgv : slaveProperties.getRgv()) {
//        for (int i = 1;i<2;i++) {
//            // 获取RGV信息
//            RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgv.getId());
//            if (rgvThread == null) {
//                continue;
//            }
//            RgvProtocol rgvProtocol = rgvThread.getRgvProtocol();
//            if (rgvProtocol == null) {
//                continue;
//            }
            RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgv.getId());
            if (rgvThread == null) {
                continue;
            }
            RgvProtocol rgvProtocol = rgvThread.getRgvProtocol();
            if (rgvProtocol == null) {
                continue;
            }
            RingThroughParam ringThroughParam = new RingThroughParam();
//            ringThroughParam.setIndex(rgv.getId());
            ringThroughParam.setIndex(i);
            ringThroughParam.setIndex(rgv.getId());
//            ringThroughParam.setIndex(i);
            double[] doubles = Utils.RingThroughXY2(183.0, NumUtils.GetRandomIntInRange(183));
//            double[] doubles = Utils.RingThroughXY2(183.0, 100*i );
            ringThroughParam.setValueX(doubles[0]-2.94);
            ringThroughParam.setValueY(doubles[1]-2.94);
            ringThroughParam.setModeColor(rgvProtocol.modeType.color);
            ringThroughParam.setStatusColor(rgvProtocol.statusType.color);
            result.add(ringThroughParam);
        }
        return R.ok().add(result);
    }
    @PostMapping("/ring/through/dev/position/data")
//    @ManagerAuth(memo = "环穿位置信息")
//    @ManagerAuth(memo = "站点信息")
    public R ringThroughDev(){
        List<RingThroughParam> result = new ArrayList<>();
//        for (RgvSlave rgv : slaveProperties.getRgv()) {
@@ -397,4 +379,15 @@
        return R.ok().add(result);
    }
    @PostMapping("/ring/through/track/position/data")
//    @ManagerAuth(memo = "轨道PLC状态信息")
    public R wnergyGatheringRingParamTrack(){
        List<EnergyGatheringRingParam> result = new ArrayList<>();
        EnergyGatheringRingParam energyGatheringRingParam = new EnergyGatheringRingParam();
        energyGatheringRingParam.setTrackColor("rgba(0, 230, 118, 0.5)");
        energyGatheringRingParam.setRadiationColor("rgba(0, 230, 118, 0.5)");
        result.add(energyGatheringRingParam);
        return R.ok().add(result);
    }
}
src/main/java/com/zy/asrs/domain/param/EnergyGatheringRingParam.java
New file
@@ -0,0 +1,11 @@
package com.zy.asrs.domain.param;
import lombok.Data;
@Data
public class EnergyGatheringRingParam {
    private String trackColor;
    private String radiationColor;
}
src/main/java/com/zy/asrs/domain/param/RingThroughParam.java
@@ -10,4 +10,8 @@
    private Double valueX;
    private Double valueY;
    private String modeColor;
    private String statusColor;
}
src/main/java/com/zy/core/enums/RgvModeType.java
@@ -2,42 +2,45 @@
public enum RgvModeType {
    NONE(-1, "离线"),
    STOP(0, "维修"),
    HAND(1, "手动"),
    HALF_AUTO(2, "半自动"),
    AUTO(3, "自动"),
    AUTO2(100, "其它"),
    NONE(-1, "离线","#4A4035"),
    STOP(0, "维修","#E2C027"),
    HAND(1, "手动","#2196F3"),
    HALF_AUTO(2, "半自动","#E2C027"),
    AUTO(3, "自动","#4B5CC4"),
    AUTO2(100, "其它","#2196F3"),
    SOS(999, "其它","#2196F3")
    ;
    public Integer id;
    public String desc;
    RgvModeType(Integer id, String desc) {
    public String color;
    RgvModeType(Integer id, String desc, String color) {
        this.id = id;
        this.desc = desc;
        this.color = color;
    }
    public static RgvModeType get(Short id) {
        if (null == id) {
            return null;
            return SOS;
        }
        for (RgvModeType type : RgvModeType.values()) {
            if (type.id.equals(id.intValue())) {
                return type;
            }
        }
        return null;
        return SOS;
    }
    public static RgvModeType get(RgvModeType type) {
        if (null == type) {
            return null;
            return SOS;
        }
        for (RgvModeType rgvModeType : RgvModeType.values()) {
            if (rgvModeType == type) {
                return rgvModeType;
            }
        }
        return null;
        return SOS;
    }
}
src/main/java/com/zy/core/enums/RgvStatusType.java
@@ -2,28 +2,31 @@
public enum RgvStatusType {
    NONE(-1, "离线"),
    IDLE(0, "空闲"),
    WORKING(1, "作业中"),
    SOS(2, "报警"),
    FETCHING(11, "取货中"),
    PUTTING(12, "放货中"),
    WAITING(90, "任务完成等待WCS确认"),
    FETCHWAITING(91, "取货任务完成等待WCS确认"),
    SOS99(99, "报警99"),
    SOS100(100, "其它100")
    NONE(-1, "离线","#4A4035"),
    IDLE(0, "空闲","#1F3696"),
    WORKING(1, "作业中","#2196F3"),
    SOS(2, "报警","#2196F3"),
    FETCHING(11, "取货中","#2196F3"),
    PUTTING(12, "放货中","#2196F3"),
    WAITING(90, "任务完成等待WCS确认","#E2C027"),
    FETCHWAITING(91, "取货任务完成等待WCS确认","#2196F3"),
    SOS99(99, "报警99","#2196F3"),
    SOS100(100, "其它100","#2196F3"),
    SOSSUPER(999, "其它","#2196F3")
    ;
    public Integer id;
    public String desc;
    RgvStatusType(Integer id, String desc) {
    public String color;
    RgvStatusType(Integer id, String desc,String color) {
        this.id = id;
        this.desc = desc;
        this.color = color;
    }
    public static RgvStatusType get(Short id) {
        if (null == id) {
            return null;
            return SOSSUPER;
        }
        for (RgvStatusType type : RgvStatusType.values()) {
            if (type.id.equals(id.intValue())) {
@@ -35,13 +38,13 @@
    public static RgvStatusType get(RgvStatusType type) {
        if (null == type) {
            return null;
            return SOSSUPER;
        }
        for (RgvStatusType rgvStatusType : RgvStatusType.values()) {
            if (rgvStatusType == type) {
                return rgvStatusType;
            }
        }
        return null;
        return SOSSUPER;
    }
}
src/main/webapp/views/index.html
@@ -63,13 +63,12 @@
            line-height: 24px;
            font-weight: bold;
            transition: transform 0.3s ease;
            background-color: #FF5722;
            background-color: #ab1839;
            transform: scale(1.2);
        }
        .bus {
            background-color: #2196F3;
            border: 20px solid;
            border-color: #2196F3;
            border: 20px solid #ffffff;
            position: absolute;
            width: 24px;
            height: 24px;
@@ -89,36 +88,24 @@
    <!--    环形穿梭车智能系统-->
    <!--</header>-->
    <div id="app" class="map">
        <div class="inner-ring"></div>
        <div class="outer-ring"></div>
<!--        <div class="inner-ring"></div>-->
<!--        <div class="outer-ring"></div>-->
        <div v-for="track in energyGatheringRing" class="inner-ring" :style="{  borderColor: track.trackColor , boxShadow :  'inset 0 0 30px '+track.radiationColor+', 0 0 20px '+track.radiationColor}"></div>
        <div v-for="track in energyGatheringRing" class="outer-ring" :style="{  borderColor: track.trackColor , boxShadow :  'inset 0 0 30px '+track.radiationColor+', 0 0 20px '+track.radiationColor}"></div>
        <!-- Stations on outer ring -->
<!--        <div class="station" style="top: 49%; left: 99%;">1</div>-->
<!--        <div class="station" style="top: 30%; left: 100%;">2</div>-->
<!--        <div class="station" style="top: 70%; left: 100%;">3</div>-->
<!--        <div class="station" style="top: 110%; left: 50%;">4</div>-->
<!--        <div class="station" style="top: 70%; left: 0;">5</div>-->
<!--        <div class="station" style="top: 30%; left: 0;">6</div>-->
        <!-- Stations on inner ring -->
        <div class="station" style="top: 0%; left: 0%;">500</div>
<!--        <div class="station" style="top: 25%; left: 80%;">8</div>-->
<!--        <div class="station" style="top: 75%; left: 80%;">9</div>-->
<!--        <div class="station" style="top: 95%; left: 50%;">10</div>-->
<!--        <div class="station" style="top: 75%; left: 20%;">11</div>-->
<!--        <div class="station" style="top: 25%; left: 20%;">12</div>-->
<!--        <div v-for="station in tableDataDev" class="station" :style="{ top: station.valueX + '%', left: station.valueY + '%' }">{{ station.index }}</div>-->
        <div v-for="station in tableDataDev" class="station" :style="{ top: station.valueX + '%', left: station.valueY + '%' }">{{ station.index }}</div>
        <!-- Buses -->
        <div v-for="bus in tableDataRgv" class="bus" :style="{ top: bus.valueX + '%', left: bus.valueY + '%' }">{{ bus.index }}</div>
        <div v-for="bus in tableDataRgv" class="bus" :style="{ top: bus.valueX + '%', left: bus.valueY + '%' , borderColor: bus.modeColor, backgroundColor: bus.statusColor}">{{ bus.index }}</div>
    </div>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                tableDataRgv: [],
                tableDataDev: []
                tableDataDev: [],
                energyGatheringRing: []
            },
            created(){
                this.init();
@@ -130,10 +117,12 @@
                init(){
                    this.getTableDataRgv()
                    this.getTableDataDev()
                    this.getTableDataTrack()
                    setInterval(() => {
                        this.getTableDataRgv()
                        this.getTableDataDev()
                        this.getTableDataTrack()
                    }, 1000)
                },
                getTableDataRgv() {
@@ -167,6 +156,22 @@
                            that.tableDataDev = res.data
                        }
                    });
                },
                getTableDataTrack() {
                    let that = this;
                    $.ajax({
                        url: baseUrl + "/rgv/ring/through/track/position/data",
                        headers: {
                            'token': localStorage.getItem('token')
                        },
                        data: {},
                        dataType: 'json',
                        contentType: 'application/json;charset=UTF-8',
                        method: 'post',
                        success: function (res) {
                            that.energyGatheringRing = res.data
                        }
                    });
                }
            }
        })