#
yxFwq
2025-01-08 aa759e28b7f93b16c3d8dc5d3313e4bd485e4401
src/main/webapp/views/rgv.html
@@ -90,18 +90,17 @@
                    <thead>
                    <tr>
                        <th>RGV</th>
                        <th>模式</th>
                        <th>状态</th>
                        <th>任务号1</th>
                        <th>状态1</th>
                        <th>有物1</th>
                        <th>RGV位置</th>
                        <th>走行定位</th>
                        <th>任务号2</th>
                        <th>状态2</th>
                        <th>有物2</th>
                        <th>故障代码</th>
                        <th>故障描述</th>
                        <th>自动</th>
                        <th>有物</th>
                        <th>小车目标位</th>
                        <th>小车当前位</th>
                        <th>任务号</th>
                        <th>无货空闲</th>
                        <th>取货到位</th>
                        <th>运行中</th>
                        <th>状态4</th>
                        <th>状态5</th>
                        <th>状态6</th>
                    </tr>
                    </thead>
                    <tbody>
@@ -114,13 +113,13 @@
            <table id="rgv-msg-table">
                <thead>
                <tr>
                    <th>RGV</th>
                    <th>工作号</th>
                    <th>状态</th>
                    <th>源站</th>
                    <th>目标站</th>
                    <th>源库位</th>
                    <th>目标库位</th>
<!--                    <th>RGV</th>-->
<!--                    <th>工作号</th>-->
<!--                    <th>状态</th>-->
<!--                    <th>源站</th>-->
<!--                    <th>目标站</th>-->
<!--                    <th>源库位</th>-->
<!--                    <th>目标库位</th>-->
<!--                    <th>走行速度(m/min)</th>-->
<!--                    <th>升降速度(m/min)</th>-->
<!--                    <th>叉牙速度(m/min)</th>-->
@@ -156,46 +155,46 @@
                </div>
                <!-- 源站/源库位 选择 -->
                <div id="source-select" class="operator-item">
                    <span class="select-title">源站/源库位</span>
                    <span class="select-title">源站</span>
                    <div class="select-container">
                        <div class="select-container-item">
                            <span>站</span>
                            <span>工位1源站</span>
                            <label><input id="sourceStaNo" type="number" name="points" min="0" /></label>
                        </div>
<!--                        <div class="select-container-item">-->
<!--                            <span>排</span>-->
<!--                            <label><input id="sourceRow" type="number" name="points" min="1" style="background-color: #a9eeff" value="1" /></label>-->
<!--                        </div>-->
                        <div class="select-container-item">
                            <span>排</span>
                            <label><input id="sourceRow" type="number" name="points" min="1" style="background-color: #a9eeff" value="1" /></label>
                        </div>
                        <div class="select-container-item">
                            <span>列</span>
                            <span>工位2源站</span>
                            <label><input id="sourceBay" type="number" name="points" min="0" style="background-color: #a9eeff" value="0" /></label>
                        </div>
                        <div class="select-container-item">
                            <span>层</span>
                            <label><input id="sourceLev" type="number" name="points" min="1" style="background-color: #a9eeff" value="1" /></label>
                        </div>
<!--                        <div class="select-container-item">-->
<!--                            <span>层</span>-->
<!--                            <label><input id="sourceLev" type="number" name="points" min="1" style="background-color: #a9eeff" value="1" /></label>-->
<!--                        </div>-->
                    </div>
                </div>
                <!-- 目标站/目标库位 选择 -->
                <div id="target-select" class="operator-item">
                    <span class="select-title">目标站/目标库位</span>
                    <span class="select-title">目标站</span>
                    <div class="select-container">
                        <div class="select-container-item">
                            <span>站</span>
                            <span>工位1目标站</span>
                            <label><input id="staNo" type="number" name="points" min="0" /></label>
                        </div>
<!--                        <div class="select-container-item">-->
<!--                            <span>排</span>-->
<!--                            <label><input id="row" type="number" name="points" min="1" style="background-color: #a9eeff" value="1" /></label>-->
<!--                        </div>-->
                        <div class="select-container-item">
                            <span>排</span>
                            <label><input id="row" type="number" name="points" min="1" style="background-color: #a9eeff" value="1" /></label>
                        </div>
                        <div class="select-container-item">
                            <span>列</span>
                            <span>工位2目标站</span>
                            <label><input id="bay" type="number" name="points" min="0" style="background-color: #a9eeff" value="0" /></label>
                        </div>
                        <div class="select-container-item">
                            <span>层</span>
                            <label><input id="lev" type="number" name="points" min="1" style="background-color: #a9eeff" value="1" /></label>
                        </div>
<!--                        <div class="select-container-item">-->
<!--                            <span>层</span>-->
<!--                            <label><input id="lev" type="number" name="points" min="1" style="background-color: #a9eeff" value="1" /></label>-->
<!--                        </div>-->
                    </div>
                </div>
            </div>
@@ -205,18 +204,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="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="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>
@@ -239,7 +238,7 @@
    // 初始化
    var rgvOutputDom = document.getElementById("rgv-output");
    $(document).ready(function() {
        getCommandLog();
        // getCommandLog();
        initRgvStateTable();
        getRgvStateInfo();
        initRgvMsgTable();
@@ -250,12 +249,12 @@
    setInterval(function () {
        getRgvStateInfo();
        getRgvMsgInfo();
        getCommandLog();
        // getCommandLog();
    },1000);
    setInterval(function () {
        getRgvOutput();
        operatorBlockShow();
        initDemo();
        // initDemo();
    },500);
    // 判断手动操作模块是否可用
@@ -271,7 +270,7 @@
        }
    }
    // 获取堆垛机执行中的命令
    // 获取RGV执行中的命令
    function getCommandLog() {
        $.ajax({
            url: baseUrl + "/rgv/command/ongoing",
@@ -312,16 +311,15 @@
                        setVal(tr.children("td").eq(0), table[i-1].rgvNo);
                        setVal(tr.children("td").eq(1), table[i-1].statusType);
                        setVal(tr.children("td").eq(2), table[i-1].status);
                        setVal(tr.children("td").eq(3), table[i-1].workNo1);
                        setVal(tr.children("td").eq(4), table[i-1].status1);
                        setVal(tr.children("td").eq(5), table[i-1].loading1);
                        setVal(tr.children("td").eq(6), table[i-1].rgvPos);
                        setVal(tr.children("td").eq(7), table[i-1].walkPos);
                        setVal(tr.children("td").eq(8), table[i-1].workNo2);
                        setVal(tr.children("td").eq(9), table[i-1].status2);
                        setVal(tr.children("td").eq(10), table[i-1].loading2);
                        setVal(tr.children("td").eq(11), table[i-1].warnCode);
                        setVal(tr.children("td").eq(12), table[i-1].alarm);
                        setVal(tr.children("td").eq(3), table[i-1].endRow);
                        setVal(tr.children("td").eq(4), table[i-1].nowRow);
                        setVal(tr.children("td").eq(5), table[i-1].workNo1);
                        setVal(tr.children("td").eq(6), table[i-1].status11);
                        setVal(tr.children("td").eq(7), table[i-1].status12);
                        setVal(tr.children("td").eq(8), table[i-1].status13);
                        setVal(tr.children("td").eq(9), table[i-1].status14);
                        setVal(tr.children("td").eq(10), table[i-1].status15);
                        setVal(tr.children("td").eq(11), table[i-1].status16);
                    }
                } else if (res.code === 403){
                    window.location.href = baseUrl+"/login";
@@ -575,73 +573,6 @@
    function rgvOutput(content){
        rgvOutputDom.value += content;
        rgvOutputDom.scrollTop = rgvOutputDom.scrollHeight;
    }
    var rgvDemoData;
    function initDemo() {
        $.ajax({
            url: baseUrl+"/rgv/demo/status",
            async: false,
            method: 'GET',
            success: function (res) {
                if (res.code === 200) {
                    rgvDemoData = res.data;
                    rgvDemoData.forEach(function (e) {
                        $("#demoBtn-"+e.rgvNo).html(e.demo?'停止':'演示');
                    })
                } else if (res.code === 403){
                    parent.location.href = baseUrl+"/login";
                }  else {
                    layer.msg(res.msg, {icon: 2});
                }
            }
        })
    }
    function demoSwitch(el) {
        var rgvId = el.split("-")[1];
        var opt;
        if (rgvDemoData == null) {
            initDemo();
        }
        for (var i = 0; i<rgvDemoData.length; i++) {
            if (Number(rgvDemoData[i].rgvNo) === Number(rgvId)) {
                opt = !rgvDemoData[i].demo;
            }
        }
        layer.confirm(rgvId + ' 号堆垛机确定'+ (opt?'开始':'停止') + '演示吗?', function(){
            doDemo(rgvId, 'root', opt); // 停止wcs系统
        });
    }
    function doDemo(rgvId, password, opt) {
        // 加载tips
        var index = layer.load(1, {
            shade: [0.1,'#fff']
        });
        $.ajax({
            url: baseUrl+ "/rgv/demo/switch",
            headers: {'token': localStorage.getItem('token')},
            // async: false,
            data: {
                rgvId: Number(rgvId),
                password: password,
                opt: opt
            },
            method: 'POST',
            success: function (res) {
                layer.close(index);
                if (res.code === 200){
                    layer.msg(res.msg, {icon: 1});
                } else if (res.code === 403){
                    window.location.href = baseUrl+"/login";
                }  else {
                    layer.msg(res.msg, {icon: 2});
                }
            }
        });
    }
</script>