src/main/java/com/zy/asrs/controller/ShuttleController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/asrs/domain/vo/ShuttleMsgTableVo.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/asrs/entity/BasShuttle.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/core/thread/ShuttleThread.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/webapp/static/css/console.css | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/webapp/static/css/shuttle.css | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/webapp/static/css/toggle-switch.css | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/webapp/views/console.html | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/webapp/views/shuttle.html | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/zy/asrs/controller/ShuttleController.java
@@ -165,6 +165,8 @@ vo.setPakMk(shuttleProtocol.getPakMk()?"Y" : "N"); // 作业标记 vo.setLocNo(shuttleProtocol.getLocNo());//四向穿梭车当前库位号 vo.setLev(Utils.getLev(shuttleProtocol.getLocNo()));//四向穿梭车当前层高 vo.setRunSpeed(basShuttle.getRunSpeed());//四向穿梭车运行速度(设置) vo.setChargeLine(basShuttle.getChargeLine());//充电阈值 } return R.ok().add(list); } @@ -267,6 +269,22 @@ return R.ok(); } @PostMapping("/runSpeed/{shuttleNo}") @ManagerAuth public R setRunSpeed(@PathVariable("shuttleNo") String shuttleNo, @RequestParam("runSpeed") Integer runSpeed, @RequestParam("chargeLine") Integer chargeLine) { BasShuttle basShuttle = basShuttleService.selectById(shuttleNo); if (basShuttle == null) { return R.error("四向穿梭车不存在"); } basShuttle.setRunSpeed(runSpeed); basShuttle.setChargeLine(chargeLine); if (!basShuttleService.updateById(basShuttle)) { return R.error(); } return R.ok(); } /****************************************************************/ /************************** 手动操作 ******************************/ /****************************************************************/ src/main/java/com/zy/asrs/domain/vo/ShuttleMsgTableVo.java
@@ -1,5 +1,6 @@ package com.zy.asrs.domain.vo; import com.sun.xml.internal.fastinfoset.algorithm.IntEncodingAlgorithm; import lombok.Data; @Data @@ -76,4 +77,14 @@ */ private Integer lev; /** * 四向穿梭车运行速度 */ private Integer runSpeed; /** * 充电阈值 */ private Integer chargeLine; } src/main/java/com/zy/asrs/entity/BasShuttle.java
@@ -244,6 +244,13 @@ @TableField("current_move_servo_load") private Integer currentMoveServoLoad; /** * 小车运行速度 */ @ApiModelProperty(value= "小车运行速度") @TableField("run_speed") private Integer runSpeed; public BasShuttle() {} public BasShuttle(Integer shuttleNo,Integer status,Integer shuttleStatus,Integer wrkNo,String idleLoc,Integer autoCharge,Integer chargeLine,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo,Integer liftNo,Boolean pakMk,Integer busyStatus,Integer currentCode,Integer batteryPower,Integer batteryTemp,Integer errorCode,Integer plcOutputStatusIo,Integer statusErrorCode,Integer plcInputStatus,Integer currentOrBeforeCode,Integer codeOffsetX,Integer codeOffsetY,Integer currentVoltage,Integer currentAnalogValue,Integer currentLiftServoSpeed,Integer currentMoveServoSpeed,Integer currentLiftServoLoad,Integer currentMoveServoLoad) { src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -606,115 +606,6 @@ } } // /** // * 入库 ===>> 四向穿梭车入库作业下发 // */ // public synchronized void shuttleIoInExecute() { // // 根据输送线plc遍历 // for (DevpSlave devp : slaveProperties.getDevp()) { // // 遍历入库站 // for (DevpSlave.StaRack rackInStn : devp.getRackInStn()) { // // 获取入库站信息 // DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); // // StaProtocol staProtocol = devpThread.getStation().get(rackInStn.getStaNo()); // StaProtocol staProtocol105 = devpThread.getStation().get(105); // staProtocol105.setWorkNo((short) 752); // staProtocol105.setStaNo((short) 100); // // StaProtocol staProtocol106 = devpThread.getStation().get(106); // staProtocol106.setWorkNo((short) 753); // staProtocol106.setStaNo((short) 100); // // if (staProtocol == null) { // continue; // } else { // staProtocol = staProtocol.clone(); // } // Short workNo = staProtocol.getWorkNo(); // // // 判断是否满足入库条件 // if (true || staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable()) { // WrkMast wrkMast = wrkMastMapper.selectRackInStep48(workNo, staProtocol.getSiteId()); // if (wrkMast != null) { // if (wrkMast.getWrkSts() == 4 || wrkMast.getWrkSts() == 8) { // ShuttleThread shuttleThread = null; // HashMap<String, Object> searchIdleShuttle = null; // if (wrkMast.getWrkSts() == 4) { // //寻找最近且空闲的四向穿梭车 // searchIdleShuttle = this.searchIdleShuttle(wrkMast); // shuttleThread = (ShuttleThread) searchIdleShuttle.get("result"); // }else { // //状态8,四向穿梭车已在提升机口,等待命令进行入库搬运动作 // Integer shuttleNo = wrkMast.getShuttleNo();//四向穿梭车号 // shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttleNo); // } // // if (shuttleThread == null) { // continue; // } // // ShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol(); // if (!shuttleProtocol.isIdle()) { // continue; // } // // wrkMast.setShuttleNo(shuttleProtocol.getShuttleNo().intValue());//给工作档分配四向穿梭车号 // // //分配任务号 // shuttleProtocol.setTaskNo(wrkMast.getWrkNo().shortValue()); // //分配源库位 // shuttleProtocol.setSourceLocNo(wrkMast.getSourceLocNo()); // // ShuttleAssignCommand assignCommand = new ShuttleAssignCommand(); // //四向穿梭车号 // assignCommand.setShuttleNo(shuttleProtocol.getShuttleNo()); // //任务号 // assignCommand.setTaskNo(wrkMast.getWrkNo().shortValue()); // //入出库模式 // assignCommand.setTaskMode(ShuttleTaskModeType.PAK_IN.id.shortValue()); // //源库位(小车当前位置) // String currentLocNo = shuttleProtocol.getCurrentLocNo(); // assignCommand.setSourceLocNo(currentLocNo); // // if (wrkMast.getWrkSts() == 8 || Boolean.parseBoolean(searchIdleShuttle.get("sameLay").toString())) { // //同一层 // //分配目标库位 // shuttleProtocol.setLocNo(wrkMast.getLocNo()); // //目标库位 // assignCommand.setLocNo(wrkMast.getLocNo()); // wrkMast.setWrkSts(9L);//小车入库中 // // //获取从小车 // }else { // //不同层,将目标库位分配成提升机库位号 // // //小车当前层高 // Integer currentLev = Integer.parseInt(currentLocNo.substring(currentLocNo.length() - 2, currentLocNo.length())); // // //获取提升机 // LiftSlave liftSlave = slaveProperties.getLift().get(0); // //提升机库位号 // String liftLocNo = liftSlave.getLiftLocNo(currentLev); // shuttleProtocol.setLocNo(liftLocNo); // //目标库位 // assignCommand.setLocNo(liftLocNo); // wrkMast.setWrkSts(5L);//小车迁移状态 // } // // if (wrkMastMapper.updateById(wrkMast) > 0) { // //下发任务 // MessageQueue.offer(SlaveType.Shuttle, assignCommand.getShuttleNo().intValue(), new Task(3, assignCommand)); // } // } // // } // } // // } // } // // } /** * 入库 ===>> 四向穿梭车入库作业下发 @@ -807,7 +698,6 @@ moveCommand.setStartToDistDistance(1300); moveCommand.setMiddleToDistDistance(0); moveCommand.setRunDirection(commands.get(0).getRunDirection()); moveCommand.setRunSpeed((short) 1000); moveCommand.setCommandEnd((short) 1); commands.add(0, moveCommand);//将该指令添加到队头 } @@ -883,7 +773,6 @@ command.setForceMoveDistance(0); command.setChargeSwitch((short) 2); command.setIOControl((short) 0); command.setRunSpeed((short) 1000); command.setRadarTmp((short) 0); command.setCommandEnd((short) 1); commands.add(command); @@ -930,7 +819,6 @@ command.setForceMoveDistance(0); command.setChargeSwitch((short) 2); command.setIOControl((short) 0); command.setRunSpeed((short) 1000); command.setRadarTmp((short) 0); command.setCommandEnd((short) 1); commands.add(command); @@ -978,7 +866,6 @@ command.setForceMoveDistance(0); command.setChargeSwitch((short) 2); command.setIOControl((short) 0); command.setRunSpeed((short) 1000); command.setRadarTmp((short) 0); command.setCommandEnd((short) 1); commands.add(command); @@ -1103,7 +990,6 @@ moveCommand.setStartToDistDistance(1300); moveCommand.setMiddleToDistDistance(0); moveCommand.setRunDirection(commands.get(0).getRunDirection()); moveCommand.setRunSpeed((short) 1000); moveCommand.setCommandEnd((short) 1); commands.add(0, moveCommand);//将该指令添加到队头 src/main/java/com/zy/core/thread/ShuttleThread.java
@@ -290,6 +290,18 @@ return false; } BasShuttleService shuttleService = SpringUtils.getBean(BasShuttleService.class); if (shuttleService == null) { News.error("系统错误"); return false; } BasShuttle basShuttle = shuttleService.selectById(slave.getId().shortValue()); if (basShuttle == null) { News.error("四向穿梭车不存在"); return false; } command.setShuttleNo(slave.getId().shortValue()); // 开始任务 short[] array = new short[17]; @@ -324,6 +336,7 @@ array[7] = middleToDistDistances[1]; } array[8] = basShuttle.getRunSpeed().shortValue();//四向穿梭车运行速度,从系统数据库读出 if (command.getRunDirection() != null) { //小车运行方向 array[8] = command.getRunDirection(); src/main/webapp/static/css/console.css
@@ -106,7 +106,7 @@ display: inline-block; float: left; position: fixed; width: 49%; width: 34%; height: 23%; background-color: rgba(0, 0, 0, 0.3); border-radius: 15px; @@ -281,6 +281,42 @@ .site-unauto { background-color: rgb(184,184,184); } /*空闲*/ .shuttle-idle { background-color: rgb(120,255,129); } /*作业中*/ .shuttle-working { background-color: rgb(196,196,0); } /*等待确认*/ .shuttle-waiting { background-color: rgb(184,184,184); } /*充电中*/ .shuttle-charging { background-color: rgb(250,81,246); } /*充电任务等待确认*/ .shuttle-charging-waiting { background-color: rgb(58,77,249); } /*故障修复中*/ .shuttle-fixing { background-color: rgb(252,48,48); } /*空闲*/ .lift-idle { background-color: rgb(120,255,129); } /*作业中*/ .lift-working { background-color: rgb(196,196,0); } /*等待确认*/ .lift-waiting { background-color: rgb(184,184,184); } #code { background-image: url(../images/status_bar_2.png); background-repeat: no-repeat; src/main/webapp/static/css/shuttle.css
@@ -227,7 +227,7 @@ border: 1px solid #333; font-size: 13px; padding: 1px 1px 1px 1px; width: 100px; width: 110px; height: 40px; outline: none; cursor: pointer; src/main/webapp/static/css/toggle-switch.css
New file @@ -0,0 +1,138 @@ .toggle-switch { display: inline-block; background-color: black; width: 60px; height: 105px; box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.2), 0 0 1px 2px black, inset 0 2px 2px -2px white, inset 0 0 2px 15px #47434c, inset 0 0 2px 22px black; border-radius: 5px; padding: 20px; perspective: 700px; } .toggle-switch input { display: none; } .toggle-switch input:checked + .button { transform: translateZ(20px) rotateX(25deg); box-shadow: 0 -10px 20px #ff1818; } .toggle-switch input:checked + .button .light { animation: flicker 0.2s infinite 0.3s; } .toggle-switch input:checked + .button .shine { opacity: 1; } .toggle-switch input:checked + .button .shadow { opacity: 0; } .toggle-switch .button { display: block; transition: all 0.3s cubic-bezier(1, 0, 1, 1); transform-origin: center center -20px; transform: translateZ(20px) rotateX(-25deg); transform-style: preserve-3d; background-color: #9b0621; height: 100%; position: relative; cursor: pointer; background: linear-gradient(#980000 0%, #6f0000 30%, #6f0000 70%, #980000 100%); background-repeat: no-repeat; } .toggle-switch .button::before { content: ""; background: linear-gradient(rgba(255, 255, 255, 0.8) 10%, rgba(255, 255, 255, 0.3) 30%, #650000 75%, #320000) 50% 50%/97% 97%, #b10000; background-repeat: no-repeat; width: 100%; height: 50px; transform-origin: top; transform: rotateX(-90deg); position: absolute; top: 0; } .toggle-switch .button::after { content: ""; background-image: linear-gradient(#650000, #320000); width: 100%; height: 50px; transform-origin: top; transform: translateY(50px) rotateX(-90deg); position: absolute; bottom: 0; box-shadow: 0 50px 8px 0px black, 0 80px 20px 0px rgba(0, 0, 0, 0.5); } .toggle-switch .light { opacity: 0; animation: light-off 1s; position: absolute; width: 100%; height: 100%; background-image: radial-gradient(#ffc97e, #ff1818 40%, transparent 70%); } .toggle-switch .dots { position: absolute; width: 100%; height: 100%; background-image: radial-gradient(transparent 30%, rgba(101, 0, 0, 0.7) 70%); background-size: 10px 10px; } .toggle-switch .characters { position: absolute; width: 100%; height: 100%; background: linear-gradient(white, white) 50% 20%/5% 20%, radial-gradient(circle, transparent 50%, white 52%, white 70%, transparent 72%) 50% 80%/33% 25%; background-repeat: no-repeat; } .toggle-switch .shine { transition: all 0.3s cubic-bezier(1, 0, 1, 1); opacity: 0.3; position: absolute; width: 100%; height: 100%; background: linear-gradient(white, transparent 3%) 50% 50%/97% 97%, linear-gradient(rgba(255, 255, 255, 0.5), transparent 50%, transparent 80%, rgba(255, 255, 255, 0.5)) 50% 50%/97% 97%; background-repeat: no-repeat; } .toggle-switch .shadow { transition: all 0.3s cubic-bezier(1, 0, 1, 1); opacity: 1; position: absolute; width: 100%; height: 100%; background: linear-gradient(transparent 70%, rgba(0, 0, 0, 0.8)); background-repeat: no-repeat; } @keyframes flicker { 0% { opacity: 1; } 80% { opacity: 0.8; } 100% { opacity: 1; } } @keyframes light-off { 0% { opacity: 1; } 80% { opacity: 0; } } src/main/webapp/views/console.html
@@ -5,6 +5,7 @@ <title>WCS控制中心</title> <link rel="stylesheet" href="../static/css/console.css"> <link rel="stylesheet" href="../static/css/animate.min.css"> <link rel="stylesheet" href="../static/css/toggle-switch.css"> <script src="../static/js/jquery/jquery-3.3.1.min.js"></script> <script src="../static/js/layer/layer.js"></script> <script type="text/javascript" src="../static/js/common.js"></script> @@ -38,35 +39,56 @@ <div class="system-state"> <div class="body-head">总开关</div> <div class="switch"> <div id="system-icon" class="system-icon-open" onclick="systemSwitch()"></div> <label id="system-toggle" class="toggle-switch" style="margin-left: 20px;"> <input id="system-toggle-checked" checked="checked" 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="machine-status"> <div class="body-head">堆垛机状态</div> <!-- 四向穿梭车状态 --> <div class="line-status"> <div class="body-head">穿梭车状态</div> <div class="state"> <span>堆垛机 1</span> <span class="state-ss machine-put-flag ">入库</span> <span>四向穿梭车 1</span> <span class="state-ss shuttle-idle">空闲</span> </div> <!-- <div class="state">--> <!-- <span>堆垛机 2</span>--> <!-- <span class="state-ss machine-auto-flag ">自动</span>--> <!-- </div>--> <div class="state"> <span>四向穿梭车 2</span> <span class="state-ss shuttle-idle">空闲</span> </div> <div class="button"><span>所有状态</span></div> <div class="button item-group"> <span class="machine-put-flag">入库</span> <span class="machine-take-flag">出库</span> <span class="machine-stock-move-flag">库到库</span> <span class="machine-site-move-flag">站到站</span> <span class="machine-p-move-flag">PToP</span> <span class="machine-error-flag">异常</span> <span class="machine-auto-flag">自动</span> <span class="machine-unauto-flag">非自动/手动</span> <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> </div> </div> <!-- 提升机状态 --> <div class="line-status"> <div class="body-head">提升机状态</div> <div class="state states"> <span>提升机</span> <span class="state-ss shuttle-idle">空闲</span> </div> <div class="button"><span>所有状态</span></div> <div class="button item-group"> <span class="lift-idle">空闲</span> <span class="lift-working">作业中</span> <span class="lift-waiting">等待确认</span> </div> </div> <!-- 输送线状态 --> @@ -101,14 +123,6 @@ <li><span>条码名称</span><span class="right">扫码时间</span></li> </div> <div id="barcode2" class="table-body"> </div> </div> <div class="tablebox"> <div class="table-head"> <li><span>条码名称</span><span class="right">扫码时间</span></li> </div> <div id="barcode3" class="table-body"> </div> </div> @@ -758,7 +772,6 @@ }) var crn1Position = 0; var crn2Position = 0; var crn3Position = 0; @@ -781,6 +794,12 @@ setInterval(function () { getSitesInfo(); }, 3000); $("#system-toggle").on("click",(e) => { systemSwitch() e.stopPropagation();//表示阻止向父元素冒泡 e.preventDefault();//阻止 方法阻止元素发生默认的行为(例如,当点击提交按钮时阻止对表单的提交或者a标签)。 }) // 系统运行开关 function systemSwitch() { @@ -813,11 +832,11 @@ layer.close(index); if (res.code === 200){ if (res.data.status) { $('#system-icon').attr("class", "system-icon-open"); $('#system-toggle-checked').attr("checked", true); $('#system-run-desc').html("系统运行中..."); parent.systemRunning = true; } else { $('#system-icon').attr("class", "system-icon-close"); $('#system-toggle-checked').attr("checked", false); $('#system-run-desc').html("系统已停止!"); parent.systemRunning = false; } src/main/webapp/views/shuttle.html
@@ -101,42 +101,82 @@ <!-- 设备任务操作 --> <div class="task-operator"> <div style="display: flex;"> <div class="task-operator" style="height: auto;width: 100%;"> <div class="operator-item" style="height: auto"> <span class="select-title">源库位/目标库位</span> <div class="select-container" style="height: auto"> <div class="select-container-item"> <span>源库位</span> <label><input id="sourceLocNo" type="text" name="sourceLocNo" /></label> </div> <div class="select-container-item"> <span>目标库位</span> <label><input id="distLocNo" type="text" name="distLocNo" /></label> <fieldset style="height: auto;padding-bottom: 20px;"> <legend>手动操作</legend> <div style="display: flex;"> <div style="width: 30%;"> <div class="operator-item" style="height: auto;width: 100%;"> <span class="select-title">源库位/目标库位</span> <div class="select-container" style="height: auto;padding: 30px 10px 20px 10px;"> <div class="select-container-item"> <span>源库位</span> <label><input id="sourceLocNo" type="text" name="sourceLocNo" /></label> </div> <div class="select-container-item"> <span>目标库位</span> <label><input id="distLocNo" type="text" name="distLocNo" /></label> </div> <div style="margin-top: 10px;"> <button class="item" onclick="shuttleOperator(1)">入库</button> <button class="item" onclick="shuttleOperator(2)">出库</button> <button class="item" onclick="shuttleOperator(14)">移动到目标库位</button> </div> </div> </div> </div> </div> </div> <fieldset style="height: auto;padding-bottom: 20px;"> <legend>手动操作</legend> <div class="button-group"> <button class="item" onclick="shuttleOperator(1)">入库</button> <button class="item" onclick="shuttleOperator(2)">出库</button> <button class="item" onclick="shuttleOperator(3)">托盘顶升</button> <button class="item" onclick="shuttleOperator(4)">托盘下降</button> <button class="item" onclick="shuttleOperator(5)">左移</button> <button class="item" onclick="shuttleOperator(6)">右移</button> <button class="item" onclick="shuttleOperator(7)">后移</button> <button class="item" onclick="shuttleOperator(8)">前移</button> <button class="item" onclick="shuttleOperator(9)">复位</button> <button class="item" onclick="shuttleOperator(10)">正方向(左)寻库位</button> <button class="item" onclick="shuttleOperator(11)">负方向(右)寻库位</button> <button class="item" onclick="shuttleOperator(12)">正方向(前)寻库位</button> <button class="item" onclick="shuttleOperator(13)">负方向(后)寻库位</button> <button class="item" onclick="shuttleOperator(14)">移动到目标库位</button> <button class="item" onclick="shuttleOperator(15)">充电开关</button> <div style="width: 40%;"> <div class="operator-item" style="height: auto;width: 100%;"> <span class="select-title">相关指令</span> <div class="select-container" style="height: auto;padding: 30px 10px 10px 10px;"> <div class="button-group"> <button class="item" onclick="shuttleOperator(3)">托盘顶升</button> <button class="item" onclick="shuttleOperator(4)">托盘下降</button> <button class="item" onclick="shuttleOperator(5)">左移</button> <button class="item" onclick="shuttleOperator(6)">右移</button> <button class="item" onclick="shuttleOperator(7)">后移</button> <button class="item" onclick="shuttleOperator(8)">前移</button> <button class="item" onclick="shuttleOperator(9)">复位</button> <button class="item" onclick="shuttleOperator(10)">正方向(左)寻库位</button> <button class="item" onclick="shuttleOperator(11)">负方向(右)寻库位</button> <button class="item" onclick="shuttleOperator(12)">正方向(前)寻库位</button> <button class="item" onclick="shuttleOperator(13)">负方向(后)寻库位</button> <button class="item" onclick="shuttleOperator(15)">充电开关</button> </div> </div> </div> </div> <div style="width: 20%;"> <div class="operator-item" style="height: auto;width: 100%;"> <span class="select-title">设置配置参数</span> <div class="select-container" style="height: auto;padding: 30px 10px 10px 10px;"> <div class="select-container-item"> <span>运行速度</span> <label><input id="runSpeed" type="text" name="runSpeed" /></label> </div> <div class="select-container-item"> <span>充电阈值</span> <label><input id="chargeLine" type="text" name="runSpeed" /></label> </div> <div> <button class="item" onclick="shuttleParamSave()">保存</button> </div> </div> </div> </div> <div style="width: 15%;"> <div class="operator-item" style="height: auto;width: 100%;"> <span class="select-title">配置参数</span> <div class="select-container" style="height: auto;padding: 30px 10px 10px 10px;"> <div>运行速度:<span id="runSpeedText"></span></div> <div>充电阈值:<span id="chargeLineText"></span></div> </div> </div> </div> </div> </fieldset> </div> @@ -430,38 +470,6 @@ console.log(shuttleNo) http.get(baseUrl+ "/shuttle/sensor/detl/"+shuttleNo, null, function (res) { $('#shuttleNo1').val(res.data.shuttleNo); // getColor(res.data.liftErr,'#liftErr'); // getColor(res.data.inFetchErr,'#inFetchErr'); // getColor(res.data.outFetchErr,'#outFetchErr'); // getColor(res.data.antiErr,'#antiErr'); // getColor(res.data.liftSwitchErr,'#liftSwitchErr'); // getColor(res.data.trackErr,'#trackErr'); // getColor(res.data.timeoutErr,'#timeoutErr'); // getColor(res.data.connectErr,'#connectErr'); // getColor(res.data.emergencyErr,'#emergencyErr'); // getColor(res.data.taskTypeErr,'#taskTypeErr'); // getColor(res.data.taskNoErr,'#taskNoErr'); // getColor(res.data.newTaskErr,'#newTaskErr'); // getColor(res.data.errTaskErr,'#errTaskErr'); // getColor(res.data.stopErr,'#stopErr'); // getColor(res.data.offlineTaskErr,'#offlineTaskErr'); // getColor(res.data.startTaskErr,'#startTaskErr'); // getColor(res.data.voltageTaskErr,'#voltageTaskErr'); // getColor(res.data.devpErr,'#devpErr'); // getColor(res.data.online,'#online'); // getColor(res.data.notOnTrack,'#notOnTrack'); // getColor(res.data.lowVoltage,'#lowVoltage'); // getColor(res.data.electricityLoss,'#electricityLoss'); // getColor(res.data.forcedTravel,'#forcedTravel'); // getColor(res.data.demoMode,'#demoMode'); // getColor(res.data.brushConnect,'#brushConnect'); // getColor(res.data.taskManualForbid,'#taskManualForbid'); // getColor(res.data.onlineManualForbid,'#onlineManualForbid'); // getColor(res.data.devpEmergency,'#devpEmergency'); // getColor(res.data.taskInterrupt,'#taskInterrupt'); // getColor(res.data.taskClear,'#taskClear'); // getColor(res.data.taskConfirmTimeout,'#taskConfirmTimeout'); // getColor(res.data.taskWithCharge,'#taskWithCharge'); getColor(res.data.pakInTask,'#pakInTask'); getColor(res.data.pakOutTask,'#pakOutTask'); getColor(res.data.pakMoveTask,'#pakMoveTask'); @@ -477,8 +485,6 @@ getColor(res.data.goOHpAvoidFinish,'#goOHpAvoidFinish'); getColor(res.data.goHpAvoidErr,'#goHpAvoidErr'); getColor(res.data.goOHpAvoidErr,'#goOHpAvoidErr'); // getColor(res.data.autoMode,'#autoMode'); // getColor(res.data.voltageLow,'#voltageLow'); }) }, end: function () { @@ -495,36 +501,6 @@ $(e).attr("style", "color: #00FF00;"); } } // $(document).on('click ','.mode-btn', function () { // let shuttleNo = Number($(this).parent().attr("data-shuttleNo")); // layer.confirm("改变" + shuttleNo + ' 号穿梭车在线状态吗?', function(){ // var index = layer.load(1, { // shade: [0.1,'#fff'] // }); // $.ajax({ // url: baseUrl+ "/shuttle/mode/switch", // headers: {'token': localStorage.getItem('token')}, // data: { // shuttleNo: Number(shuttleNo), // password: 'root' // }, // 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}); // } // } // }); // }); // }) $(document).on('click ','#save', function () { http.post(baseUrl+ "/shuttle/detl/update", { @@ -653,6 +629,11 @@ setVal(tr.children("td").eq(9), table[i-1].pakMk); setVal(tr.children("td").eq(10), table[i-1].locNo); setVal(tr.children("td").eq(11), table[i-1].lev); if (table[i-1].shuttleNo == parseInt($('input[name="shuttleSelect"]:checked').val())) { $("#runSpeedText").text(table[i-1].runSpeed) $("#chargeLineText").text(table[i-1].chargeLine + "%") } } } else if (res.code === 403){ window.location.href = baseUrl+"/login"; @@ -777,4 +758,26 @@ shuttleOutputDom.scrollTop = shuttleOutputDom.scrollHeight; } //四向穿梭车配置参数保存 function shuttleParamSave() { $.ajax({ url: baseUrl+ "/shuttle/runSpeed/" + $('input[name="shuttleSelect"]:checked').val(), headers: {'token': localStorage.getItem('token')}, method: 'POST', data: { runSpeed: $("#runSpeed").val(), chargeLine: $("#chargeLine").val(), }, success: function (res) { if (res.code === 200){ layer.msg("配置已保存", {icon: 1,}); } else if (res.code === 403){ window.location.href = baseUrl+"/login"; } else { console.log(res.msg); } } }); } </script>