#
LSH
2023-06-03 352c66676507d76fedb6f7332a138391baf85937
#
7个文件已修改
129 ■■■■ 已修改文件
src/main/java/com/zy/core/enums/CrnModeType.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensCrnThread.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensDevpThread.java 86 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/common.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/console.map.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/crn.html 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/enums/CrnModeType.java
@@ -7,6 +7,7 @@
    HAND(1, "手动"),
    HALF_AUTO(2, "半自动"),
    AUTO(3, "自动"),
    AUTO2(100, "异常"),
    ;
    public Integer id;
src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -149,7 +149,7 @@
     */
    private void readStatus(){
        try {
            OperateResultExOne<byte[]> result = siemensNet.Read("DB101.0", (short) 56);
            OperateResultExOne<byte[]> result = siemensNet.Read("DB100.0", (short) 56);
            if (result.IsSuccess) {
                if (null == crnProtocol) {
                    crnProtocol = new CrnProtocol();
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -47,18 +47,18 @@
//
//    }};
    public static final ArrayList<Integer> staNos1 = new ArrayList<Integer>() {{
        add(100);add(101);add(102);add(103);
        add(104);add(105);add(106);add(107);
        add(101);add(102);add(103);
        add(104);add(105);add(106);
    }};
    public static final ArrayList<Integer> staNos2 = new ArrayList<Integer>() {{
        add(200);add(201);add(202);add(203);
        add(204);add(205);add(206);add(207);
        add(201);add(202);add(203);
        add(204);add(205);add(206);
    }};
    public static final ArrayList<Integer> staNos3 = new ArrayList<Integer>() {{
        add(300);add(301);add(302);add(303);
        add(304);add(305);add(306);add(307);
        add(301);add(302);add(303);
        add(304);add(305);add(306);
    }};
@@ -191,7 +191,7 @@
        ArrayList<Integer> staNos = getStaNo();
        int staNoSize = staNos.size();
        OperateResultExOne<byte[]> result = siemensS7Net.Read("DB100.0", (short) (staNoSize*2));
        OperateResultExOne<byte[]> result4 = siemensS7Net.Read("DB101.0", (short) (staNoSize*2));
        OperateResultExOne<byte[]> result4 = siemensS7Net.Read("DB100.0", (short) (staNoSize*2));
        if (result.IsSuccess && result4.IsSuccess) {
            for (int i = 0; i < staNoSize; i++) {
                Integer siteId = staNos.get(i); // 站点编号
@@ -222,10 +222,10 @@
//        }
        //条码扫描器
        Thread.sleep(200);
        OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB100.200",(short)(barcodeSize/2*8));
        if (result2.IsSuccess) {
        OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB100.0",(short)(barcodeSize/3*8));
        if (result2.IsSuccess && 1!=1) {
            if (slave.getId()==1){
                for (int i = 0; i < barcodeSize/2; i++) {
                for (int i = 0; i < barcodeSize/3; i++) {
                    String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*8,8, "UTF-8");
                    BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1);
                    if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)){
@@ -234,8 +234,17 @@
                    }
                }
            }else if (slave.getId()==2){
                for (int i = barcodeSize/2; i < barcodeSize; i++) {
                    String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,(i-barcodeSize/2)*8,8, "UTF-8");
                for (int i = barcodeSize/3; i < barcodeSize; i++) {
                    String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,(i-barcodeSize/3)*8,8, "UTF-8");
                    BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1);
                    if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)){
//                            && !Cools.isEmpty(barcode) && Cools.isEmpty(barcodeThread.getBarcode())) {
                        barcodeThread.setBarcode(barcode);
                    }
                }
            }else if (slave.getId()==3){
                for (int i = barcodeSize/3+1; i < barcodeSize; i++) {
                    String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,(i-(barcodeSize/3)*2)*8,8, "UTF-8");
                    BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1);
                    if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)){
//                            && !Cools.isEmpty(barcode) && Cools.isEmpty(barcodeThread.getBarcode())) {
@@ -246,7 +255,7 @@
        }
        Thread.sleep(200);
        OperateResultExOne<byte[]> result1 = siemensS7Net.Read("DB102.100", (short) (staNoSize * 2));
        OperateResultExOne<byte[]> result1 = siemensS7Net.Read("DB100.0", (short) (staNoSize * 2));
        if (result1.IsSuccess) {
            for (int i = 0; i < staNoSize; i++) {
                Integer siteId = staNos.get(i); // 站点编号
@@ -271,59 +280,8 @@
                    //lfd入库印记  当stamp>=2时才入库
                    staProtocol.setStamp(staProtocol.getStamp()+1);
                }
//                //20230110,日志打印,确认收到入库站可入信号时,对应条码数据是否已有
//                if ((siteId==101 || siteId==109 || siteId==117 || siteId==201 || siteId==207 || siteId==213)
//                        && staProtocol.isInEnable()){
//                    Integer barcodeId = 0;
//                    switch (siteId){
//                        case 101:
//                            barcodeId=1;
//                            break;
//                        case 109:
//                            barcodeId=2;
//                            break;
//                        case 117:
//                            barcodeId=3;
//                            break;
//                        case 201:
//                            barcodeId=4;
//                            break;
//                        case 207:
//                            barcodeId=5;
//                            break;
//                        case 213:
//                            barcodeId=6;
//                            break;
//                    }
//                    BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, barcodeId);
//                    if(barcodeThread!=null){
//                        //lfd入库印记  当stamp>=2时才入库
//                        staProtocol.setStamp(staProtocol.getStamp()+1);
//                        News.info("{}站有可入信号时,条码值为{}", siteId, barcodeThread.getBarcode());
//                        if(Cools.isEmpty(barcodeThread.getBarcode())){
//                            staProtocol.setInEnable(false);//条码数据为空时,先清一次内存的站点可入信号,等待下一次获取可入信号
//                        }
//                    }
//                }
            }
        }
//        //RGV小车
//        Thread.sleep(200);
//        OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB100.160",(short)2);
//        if (result3.IsSuccess) {
//            Integer siteId = 16;
//            StaProtocol staProtocol = station.get(siteId);
//            if (null == staProtocol) {
//                staProtocol = new StaProtocol();
//                staProtocol.setSiteId(siteId);
//                station.put(siteId, staProtocol);
//            }
//            staProtocol.setNearbySta(String.valueOf(siemensS7Net.getByteTransform().TransInt16(result3.Content, 0)));
//        }
        if (result.IsSuccess && result1.IsSuccess) {
src/main/resources/application.yml
@@ -34,21 +34,21 @@
  enable: false
wms:
  url: 192.168.0.17:8080/lktwms
  url: 127.0.0.1:8080/lktwms
# 下位机配置
wcs-slave:
  # 双深
  doubleDeep: true
  # 双深库位排号
  doubleLocs: 9,12,15,18
  doubleLocs: 1,4,11,14,21,24
  # 一个堆垛机负责的货架排数
  groupCount: 4
  # 堆垛机1
  crn[0]:
    id: 1
    ip: 192.168.4.250
    port: 6000
    port: 102
    rack: 0
    slot: 0
    # 偏移量,当堆垛机站点列号=1时,偏移量=2
@@ -72,7 +72,7 @@
  crn[1]:
    id: 2
    ip: 192.168.4.250
    port: 6000
    port: 102
    rack: 0
    slot: 0
    # 偏移量,当堆垛机站点列号=1时,偏移量=2
@@ -96,7 +96,7 @@
  crn[2]:
    id: 3
    ip: 192.168.4.250
    port: 6000
    port: 102
    rack: 0
    slot: 0
    # 偏移量,当堆垛机站点列号=1时,偏移量=2
src/main/webapp/static/js/common.js
@@ -1,4 +1,4 @@
var baseUrl = "/lfdwcs";
var baseUrl = "/lktwcs";
// 赋值
function setVal(el, val) {
src/main/webapp/static/js/console.map.js
@@ -1,5 +1,5 @@
mapInfo = {
    "mapName": "LFDWCS",
    "mapName": "LKTWCS",
    "rackCount": 18,
    "crnCount": 7,
    "stbCount": 77,
src/main/webapp/views/crn.html
@@ -71,18 +71,6 @@
                    <!--            <span>&nbsp;</span>-->
                    <input id="crn3" disabled="disabled">
                </div>
                <div class="crn-command-item">
                    <label>4#</label>
                    <button id="demoBtn-4" class="demoBtn" onclick="demoSwitch(this.id)"> - </button>
                    <!--            <span>&nbsp;</span>-->
                    <input id="crn4" disabled="disabled">
                </div>
                <div class="crn-command-item">
                    <label>5#</label>
                    <button id="demoBtn-5" class="demoBtn" onclick="demoSwitch(this.id)"> - </button>
                    <!--            <span>&nbsp;</span>-->
                    <input id="crn5" disabled="disabled">
                </div>
            </div>
            <!-- 堆垛机状态位信息 -->
            <div class="crn-state">
@@ -151,8 +139,6 @@
                        <label><input type="radio" name="crnSelect" value="1" checked>&nbsp;1号堆垛机</label>
                        <label><input type="radio" name="crnSelect" value="2">&nbsp;2号堆垛机</label>
                        <label><input type="radio" name="crnSelect" value="3">&nbsp;3号堆垛机</label>
                        <label><input type="radio" name="crnSelect" value="4">&nbsp;4号堆垛机</label>
                        <label><input type="radio" name="crnSelect" value="5">&nbsp;5号堆垛机</label>
                    </div>
                </div>
                <!-- 源站/源库位 选择 -->
@@ -206,18 +192,18 @@
                <fieldset>
                    <legend>手动操作</legend>
                    <div class="button-group">
                        <button class="item" onclick="put()">入库</button>
                        <button class="item" onclick="take()">出库</button>
                        <button class="item" onclick="stockMove()">库位转移</button>
                        <button class="item" onclick="siteMove()">站到站</button>
<!--                        <button class="item" onclick="put()">入库</button>-->
<!--                        <button class="item" onclick="take()">出库</button>-->
<!--                        <button class="item" onclick="stockMove()">库位转移</button>-->
<!--                        <button class="item" onclick="siteMove()">站到站</button>-->
                        <!--                <button class="item" onclick="bacOrigin()">回原点</button>-->
                        <!--                <button class="item" onclick="reverseOrigin()">反原点</button>-->
                        <!--                <button class="item" onclick="coorMove()">坐标移行</button>-->
                        <button class="item" onclick="taskComplete()">任务完成</button>
                        <!--                <button class="item" onclick="pause()">暂停</button>-->
                        <!--                <button class="item" onclick="boot()">启动</button>-->
                        <button class="item" onclick="clearCommand()">清除命令</button>
                        <button class="item" onclick="handleReset()">复位</button>
<!--                        <button class="item" onclick="clearCommand()">清除命令</button>-->
<!--                        <button class="item" onclick="handleReset()">复位</button>-->
                    </div>
                </fieldset>
            </div>