|
@@ -1,6 +1,5 @@
|
|
<!DOCTYPE html>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<html>
|
|
-
|
|
|
|
<head>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta charset="utf-8">
|
|
<title>华力机电SIMANC</title>
|
|
<title>华力机电SIMANC</title>
|
|
@@ -12,132 +11,7 @@
|
|
<!--App自定义的css-->
|
|
<!--App自定义的css-->
|
|
<link rel="stylesheet" type="text/css" href="css/app.css" />
|
|
<link rel="stylesheet" type="text/css" href="css/app.css" />
|
|
<link rel="stylesheet" type="text/css" href="css/iconfont.css" />
|
|
<link rel="stylesheet" type="text/css" href="css/iconfont.css" />
|
|
- <style>
|
|
|
|
- .mui-btn-block{
|
|
|
|
- margin-bottom: 0;
|
|
|
|
- }
|
|
|
|
- .mui-content-padded{
|
|
|
|
- margin: 2px;
|
|
|
|
- }
|
|
|
|
- .mui-col{
|
|
|
|
- display: inline-block;
|
|
|
|
- padding: 2px;
|
|
|
|
- }
|
|
|
|
- /*滚动条样式*/
|
|
|
|
- ::-webkit-scrollbar {
|
|
|
|
- width: 0;
|
|
|
|
- background-color: #F5F5F5;
|
|
|
|
- }
|
|
|
|
- /*定义滚动条轨道 内阴影+圆角*/
|
|
|
|
- ::-webkit-scrollbar-track {
|
|
|
|
- background-color: #2e3342;
|
|
|
|
- }
|
|
|
|
- /*定义滑块 内阴影+圆角*/
|
|
|
|
- ::-webkit-scrollbar-thumb {
|
|
|
|
- background-color: #2e3342;
|
|
|
|
- }
|
|
|
|
- .mui-btn-royal{
|
|
|
|
- background-color: rgba(141, 157, 199, 0.5);
|
|
|
|
- border:1px solid rgba(141, 157, 199, 0.5)
|
|
|
|
- }
|
|
|
|
- .active {
|
|
|
|
- background-color: #d4d4d4;
|
|
|
|
- color:white;
|
|
|
|
- }
|
|
|
|
- .up{
|
|
|
|
- background: #0087c5 url(img/top.svg) no-repeat 50% 10%;
|
|
|
|
- }
|
|
|
|
- .down{
|
|
|
|
- background: #0087c5 url(img/bottom.svg) no-repeat 50% 10%;
|
|
|
|
- }
|
|
|
|
- .mui-plus .plus{
|
|
|
|
- display: inline;
|
|
|
|
- }
|
|
|
|
- .plus{
|
|
|
|
- display: none;
|
|
|
|
- }
|
|
|
|
- #topPopover {
|
|
|
|
- position: fixed;
|
|
|
|
- top: 16px;
|
|
|
|
- right: 6px;
|
|
|
|
- }
|
|
|
|
- #topPopover .mui-popover-arrow {
|
|
|
|
- left: auto;
|
|
|
|
- right: 6px;
|
|
|
|
- }
|
|
|
|
- p {
|
|
|
|
- text-indent: 22px;
|
|
|
|
- }
|
|
|
|
- span.mui-icon {
|
|
|
|
- font-size: 14px;
|
|
|
|
- color: #007aff;
|
|
|
|
- margin-left: -15px;
|
|
|
|
- padding-right: 10px;
|
|
|
|
- }
|
|
|
|
- .mui-popover {
|
|
|
|
- color:#fff;
|
|
|
|
- height: 260px;
|
|
|
|
- width: 130px;
|
|
|
|
- background-color: rgba(141, 157, 199, 0.9);
|
|
|
|
- }
|
|
|
|
- .mui-content {
|
|
|
|
- padding: 10px;
|
|
|
|
- }
|
|
|
|
- .mui-scroll-wrapper{
|
|
|
|
- background-color:transparent;
|
|
|
|
- }
|
|
|
|
- .mui-popover .mui-table-view{
|
|
|
|
- background-color: transparent;
|
|
|
|
- }
|
|
|
|
- .history tr{
|
|
|
|
- background-color: #ffffff;
|
|
|
|
- border-radius:5px 0 0 5px;
|
|
|
|
- }
|
|
|
|
- .history td:first-child{
|
|
|
|
- border-radius:5px 0 0 5px;
|
|
|
|
- }
|
|
|
|
- .history td:last-child{
|
|
|
|
- border-radius: 0 5px 5px 0;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .grid-task >div{
|
|
|
|
- display: grid;
|
|
|
|
- grid-template-columns: 60px 1fr 1fr 100px;
|
|
|
|
- grid-gap: 1px;
|
|
|
|
- }
|
|
|
|
- .grid-task >div>span{
|
|
|
|
- color: #fff;
|
|
|
|
- font-size: 15px;
|
|
|
|
- background-color: rgba(141, 157, 199, 0.5);
|
|
|
|
- padding:5px 5px 2px 10px;
|
|
|
|
- }
|
|
|
|
- .mui-bar{
|
|
|
|
- height:35px
|
|
|
|
- }
|
|
|
|
- .mui-bar-nav{
|
|
|
|
- top: 0;
|
|
|
|
- box-shadow: 0 1px 6px #2e3342;
|
|
|
|
- }
|
|
|
|
- .mui-title {
|
|
|
|
- line-height:35px
|
|
|
|
- }
|
|
|
|
- .mui-bar .mui-icon {
|
|
|
|
- padding-top:5px
|
|
|
|
- }
|
|
|
|
- .mui-bar-nav~.mui-content{
|
|
|
|
- padding-top: 30px;
|
|
|
|
- }
|
|
|
|
- .text-success{
|
|
|
|
- color:#27c24c
|
|
|
|
- }
|
|
|
|
- .mui-bar .mui-btn-link {
|
|
|
|
- line-height: 36px;
|
|
|
|
- }
|
|
|
|
- .mui-col-xs-3{
|
|
|
|
- width: 22%;
|
|
|
|
- }
|
|
|
|
- * { touch-action: none; }
|
|
|
|
- </style>
|
|
|
|
|
|
+ <link rel="stylesheet" type="text/css" href="css/style.css" />
|
|
</head>
|
|
</head>
|
|
<body style="background: url(img/bg.png) no-repeat 0px -0px;width:99%;">
|
|
<body style="background: url(img/bg.png) no-repeat 0px -0px;width:99%;">
|
|
<div id="title" style="height: 4%;text-align: center;padding-top: 10px;padding-bottom: 5px;background: url(img/title_bg.png) no-repeat 0 17px;background-size:100%;">
|
|
<div id="title" style="height: 4%;text-align: center;padding-top: 10px;padding-bottom: 5px;background: url(img/title_bg.png) no-repeat 0 17px;background-size:100%;">
|
|
@@ -146,15 +20,15 @@
|
|
<div id="top" style="height: 30%;text-align: center;padding-top: 1px;background: url(img/top_bg.png) no-repeat 0 0px;background-size:100%;">
|
|
<div id="top" style="height: 30%;text-align: center;padding-top: 1px;background: url(img/top_bg.png) no-repeat 0 0px;background-size:100%;">
|
|
<div class="mui-row">
|
|
<div class="mui-row">
|
|
<div class="mui-col mui-col-xs-12">
|
|
<div class="mui-col mui-col-xs-12">
|
|
- <div id="speed" style="height: 10%;width: 50%;padding-top: 10px;float: left;">
|
|
|
|
- <img src="img/sd.png" style="margin-left: -80px;width: 13%;">
|
|
|
|
|
|
+ <div style="height: 10%;width: 50%;padding-top: 10px;float: left;">
|
|
|
|
+ <img id="speed" src="img/speed-high.png" style="margin-left: -80px;width: 13%;">
|
|
</div>
|
|
</div>
|
|
- <div id="battery" style="height: 10%;width: 50%;padding-top: 10px;float: left;">
|
|
|
|
- <img src="img/battery.png" style="margin-right: -80px;width: 23%;">
|
|
|
|
|
|
+ <div style="height: 10%;width: 50%;padding-top: 10px;float: left;">
|
|
|
|
+ <img id="battery" src="img/battery-100.png" style="margin-right: -80px;width: 23%;">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="mui-col mui-col-xs-12">
|
|
<div class="mui-col mui-col-xs-12">
|
|
- <div id="jacking" style="width: 120px;height:90px;border-radius: 12px;border: 2px solid #298890;float: left;margin-left: 23px;">
|
|
|
|
|
|
+ <div id="tgts" style="width: 120px;height:90px;border-radius: 12px;border: 2px solid #298890;float: left;margin-left: 23px;">
|
|
<div style="margin-left: -60px;margin-top: 15px;">
|
|
<div style="margin-left: -60px;margin-top: 15px;">
|
|
<a style="color: #FFFFFF;font-size: 18px;">目标</a><br>
|
|
<a style="color: #FFFFFF;font-size: 18px;">目标</a><br>
|
|
</div>
|
|
</div>
|
|
@@ -162,10 +36,10 @@
|
|
<a style="color: #FFFFFF;font-size: 18px;">站点</a><br>
|
|
<a style="color: #FFFFFF;font-size: 18px;">站点</a><br>
|
|
</div>
|
|
</div>
|
|
<div style="margin-left: 40px;margin-top: -40px;">
|
|
<div style="margin-left: 40px;margin-top: -40px;">
|
|
- <a style="color: #FFFFFF;font-size: 50px;">7</a><br>
|
|
|
|
|
|
+ <a id="tgtstation" style="color: #FFFFFF;font-size: 50px;"></a><br>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div id="jacking" style="width: 120px;height:90px;border-radius: 12px;border: 2px solid #298890;float: right;margin-right: 20px;">
|
|
|
|
|
|
+ <div id="jack" style="width: 120px;height:90px;border-radius: 12px;border: 2px solid #298890;float: right;margin-right: 20px;">
|
|
<div style="margin-left: -60px;margin-top: 15px;">
|
|
<div style="margin-left: -60px;margin-top: 15px;">
|
|
<a style="color: #FFFFFF;font-size: 18px;">顶升</a><br>
|
|
<a style="color: #FFFFFF;font-size: 18px;">顶升</a><br>
|
|
</div>
|
|
</div>
|
|
@@ -173,59 +47,22 @@
|
|
<a style="color: #FFFFFF;font-size: 18px;">状态</a><br>
|
|
<a style="color: #FFFFFF;font-size: 18px;">状态</a><br>
|
|
</div>
|
|
</div>
|
|
<div style="margin-left: 60px;margin-top: -55px;">
|
|
<div style="margin-left: 60px;margin-top: -55px;">
|
|
- <img src="img/ds.png" width="60%">
|
|
|
|
|
|
+ <img id="liftstatus" src="img/liftstatus.png" width="60%">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
- <div style="width: 94%;height: 50px;margin-top: 100px;margin-left: 20px;">
|
|
|
|
- <div style="width: 22%;height: 40px;line-height:40px;float: left;margin-left: 5px;background: url(img/btn4_bg.png);color: #FFFFFF;text-align: center;">停止</div>
|
|
|
|
- <div style="width: 22%;height: 40px;line-height:40px;float: left;margin-left: 5px;background: url(img/btn4_bg.png);color: #FFFFFF;text-align: center;">运行</div>
|
|
|
|
- <div style="width: 22%;height: 40px;line-height:40px;float: left;margin-left: 5px;background: url(img/btn4_bg.png);color: #FFFFFF;text-align: center;">注意</div>
|
|
|
|
- <div id="details" style="width: 22%;height: 40px;line-height:40px;float: left;margin-left: 5px;background: url(img/btn4_bg.png);color: #FFFFFF;text-align: center;">详情</div>
|
|
|
|
|
|
+ <div style="width: 100%;height: 50px;margin-top: 100px;margin-left: 20px;">
|
|
|
|
+ <div id="stop" style="width: 28%;height: 40px;line-height:40px;float: left;margin-left: 5px;background: url(img/btn4_bg.png);color: #FFFFFF;text-align: center;">停止</div>
|
|
|
|
+ <div id="run" style="width: 28%;height: 40px;line-height:40px;float: left;margin-left: 5px;background: url(img/btn4_bg.png);color: #FFFFFF;text-align: center;">运行</div>
|
|
|
|
+ <div id="warning" style="width: 28%;height: 40px;line-height:40px;float: left;margin-left: 5px;background: url(img/btn4_bg.png);color: #FFFFFF;text-align: center;">注意</div>
|
|
</div>
|
|
</div>
|
|
- <div style="width: 87%;height: 30px;margin-left: 25px;background-color: #0b6d78;border-radius: 3px;"></div>
|
|
|
|
|
|
+ <div id="info" style="width: 87%;height: 30px;margin-left: 25px;color:#ccc;font-size:4px;line-height: 30px;background-color: #0b6d78;border-radius: 3px;text-align: left;padding-left: 5px;"></div>
|
|
<div class="mui-content-padded" style="background: url(img/btlist5_bg.png) no-repeat 10px 0;margin-top: 25px;width: 100%;height: auto;">
|
|
<div class="mui-content-padded" style="background: url(img/btlist5_bg.png) no-repeat 10px 0;margin-top: 25px;width: 100%;height: auto;">
|
|
<div class="mui-row">
|
|
<div class="mui-row">
|
|
- <div class="mui-col mui-col-xs-12" id="BtnList" style="padding-top:10px;overflow-y:auto;">
|
|
|
|
- <div class="mui-col mui-col-xs-3">
|
|
|
|
- <button type="button" value="1" id="1" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">1</button>
|
|
|
|
- </div>
|
|
|
|
- <div class="mui-col mui-col-xs-3">
|
|
|
|
- <button type="button" value="2" id="2" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">2</button>
|
|
|
|
- </div>
|
|
|
|
- <div class="mui-col mui-col-xs-3">
|
|
|
|
- <button type="button" value="3" id="3" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">3</button>
|
|
|
|
- </div>
|
|
|
|
- <div class="mui-col mui-col-xs-3">
|
|
|
|
- <button type="button" value="4" id="4" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">4</button>
|
|
|
|
- </div>
|
|
|
|
- <div class="mui-col mui-col-xs-3">
|
|
|
|
- <button type="button" value="5" id="5" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">5</button>
|
|
|
|
- </div>
|
|
|
|
- <div class="mui-col mui-col-xs-3">
|
|
|
|
- <button type="button" value="6" id="6" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">6</button>
|
|
|
|
- </div>
|
|
|
|
- <div class="mui-col mui-col-xs-3">
|
|
|
|
- <button type="button" value="7" id="7" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">7</button>
|
|
|
|
- </div>
|
|
|
|
- <div class="mui-col mui-col-xs-3">
|
|
|
|
- <button type="button" value="8" id="8" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">8</button>
|
|
|
|
- </div>
|
|
|
|
- <div class="mui-col mui-col-xs-3">
|
|
|
|
- <button type="button" value="9" id="9" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">9</button>
|
|
|
|
- </div>
|
|
|
|
- <div class="mui-col mui-col-xs-3">
|
|
|
|
- <button type="button" value="10" id="10" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">10</button>
|
|
|
|
- </div>
|
|
|
|
- <div class="mui-col mui-col-xs-3">
|
|
|
|
- <button type="button" value="11" id="11" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">11</button>
|
|
|
|
- </div>
|
|
|
|
- <div class="mui-col mui-col-xs-3">
|
|
|
|
- <button type="button" value="12" id="12" name="Site" class="mui-btn mui-btn-royal mui-btn-block" style="float: left;">12</button>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div class="mui-col mui-col-xs-12" id="btlist" style="padding-top:10px;min-height:285px;overflow-y:auto;max-height:285px"></div>
|
|
|
|
+
|
|
<div class="mui-col mui-col-xs-12" style="text-align: center;padding-bottom: 13px;">
|
|
<div class="mui-col mui-col-xs-12" style="text-align: center;padding-bottom: 13px;">
|
|
<div class="mui-col mui-col-xs-3" id="gomoving">
|
|
<div class="mui-col mui-col-xs-3" id="gomoving">
|
|
<button type="button" class="mui-btn mui-btn-royal mui-btn-block operation" id="moving" style="border:1px solid #4a5a6a;">移动</button>
|
|
<button type="button" class="mui-btn mui-btn-royal mui-btn-block operation" id="moving" style="border:1px solid #4a5a6a;">移动</button>
|
|
@@ -245,176 +82,327 @@
|
|
</body>
|
|
</body>
|
|
<script src="js/jquery.min.js"></script>
|
|
<script src="js/jquery.min.js"></script>
|
|
<script src="js/mui.min.js"></script>
|
|
<script src="js/mui.min.js"></script>
|
|
|
|
+ <script src="js/msg.js"></script>
|
|
|
|
+ <script src="js/lodash.js"></script>
|
|
|
|
+ <script src="js/backbone.js"></script>
|
|
|
|
+ <script src="js/rappid.min.js"></script>
|
|
|
|
+ <script src="js/models/joint.shapes.smcr.js"></script>
|
|
|
|
+ <script src="js/map.js"></script>
|
|
|
|
+ <script src="js/models/joint.shapes.app.js"></script>
|
|
<script type="text/javascript">
|
|
<script type="text/javascript">
|
|
- var windowHeight = $(window).height(),
|
|
|
|
- $body = $("body");
|
|
|
|
- // $body.css("height", windowHeight); //重要代码
|
|
|
|
- $("body").on("touchstart", function(e) {
|
|
|
|
- e.preventDefault();
|
|
|
|
- startX = e.originalEvent.changedTouches[0].pageX,
|
|
|
|
- startY = e.originalEvent.changedTouches[0].pageY;
|
|
|
|
- });
|
|
|
|
- $("body").on("touchmove", function(e) {
|
|
|
|
- e.preventDefault();
|
|
|
|
- moveEndX = e.originalEvent.changedTouches[0].pageX,
|
|
|
|
- moveEndY = e.originalEvent.changedTouches[0].pageY,
|
|
|
|
- X = moveEndX - startX,
|
|
|
|
- Y = moveEndY - startY;
|
|
|
|
- if ( Math.abs(X) > Math.abs(Y) && X > 0 ) {
|
|
|
|
- window.location.href = "settings.html"; //right
|
|
|
|
- }
|
|
|
|
- else if ( Math.abs(X) > Math.abs(Y) && X < 0 ) {
|
|
|
|
- window.location.href = "remote.html"; //left
|
|
|
|
- }
|
|
|
|
- else if ( Math.abs(Y) > Math.abs(X) && Y > 0) {
|
|
|
|
- return //bottom
|
|
|
|
- }
|
|
|
|
- else if ( Math.abs(Y) > Math.abs(X) && Y < 0 ) {
|
|
|
|
- return //top
|
|
|
|
- }
|
|
|
|
- else{
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ var $btlist = $('#btlist');
|
|
$(function() {
|
|
$(function() {
|
|
|
|
+ //获取保存的ip、agvid、mapid等,如果没有数据,则设置为默认
|
|
if (localStorage.getItem("ip") == "" || localStorage.getItem("ip") == null) {
|
|
if (localStorage.getItem("ip") == "" || localStorage.getItem("ip") == null) {
|
|
- ip = "http://192.168.0.118:8899";
|
|
|
|
- }else{
|
|
|
|
- ip = "http://" + localStorage.getItem("ip") + ":8899";
|
|
|
|
|
|
+ ip = "192.168.1.92:8888";
|
|
|
|
+ url = "http://192.168.1.92:8888"
|
|
|
|
+ } else {
|
|
|
|
+ ip = localStorage.getItem("ip") + ":8888";
|
|
|
|
+ url = "http://" + localStorage.getItem("ip") + ":8888";
|
|
}
|
|
}
|
|
if (localStorage.getItem("agvid") == "" || localStorage.getItem("agvid") == null) {
|
|
if (localStorage.getItem("agvid") == "" || localStorage.getItem("agvid") == null) {
|
|
agvid = 1;
|
|
agvid = 1;
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
agvid = parseInt(localStorage.getItem("agvid"))
|
|
agvid = parseInt(localStorage.getItem("agvid"))
|
|
}
|
|
}
|
|
if (localStorage.getItem("mapid") == "" || localStorage.getItem("mapid") == null) {
|
|
if (localStorage.getItem("mapid") == "" || localStorage.getItem("mapid") == null) {
|
|
- mapid = "1";
|
|
|
|
- }else{
|
|
|
|
|
|
+ mapid = "2019081410472902";
|
|
|
|
+ } else {
|
|
mapid = localStorage.getItem("mapid")
|
|
mapid = localStorage.getItem("mapid")
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ //获取按钮
|
|
|
|
+ createList();
|
|
|
|
+
|
|
|
|
+ //获取状态
|
|
|
|
+ startLog();
|
|
|
|
+ setInterval(function() {
|
|
|
|
+ if (ws.readyState === 3) {
|
|
|
|
+ startLog();
|
|
|
|
+ }
|
|
|
|
+ }, 1000);
|
|
|
|
+
|
|
|
|
+ //设置操作按钮
|
|
$("#gostart").addClass("mui-hidden");
|
|
$("#gostart").addClass("mui-hidden");
|
|
$("#moving").attr("disabled", true);
|
|
$("#moving").attr("disabled", true);
|
|
$("#start").attr("disabled", true);
|
|
$("#start").attr("disabled", true);
|
|
- $("button[name]").on("touchstart", onSelectStation);
|
|
|
|
- })
|
|
|
|
- $("#11814").click(function() {
|
|
|
|
- var s = 1
|
|
|
|
- var d = 4
|
|
|
|
- var strone = {
|
|
|
|
- "t": "AddTsk",
|
|
|
|
- "id": agvid,
|
|
|
|
- "s": s,
|
|
|
|
- "d": d
|
|
|
|
- }
|
|
|
|
- var ss = JSON.stringify(strone)
|
|
|
|
- $.post(ip, ss);
|
|
|
|
- })
|
|
|
|
- $("#11841").click(function() {
|
|
|
|
- var s = 4
|
|
|
|
- var d = 1
|
|
|
|
- var strone = {
|
|
|
|
- "t": "AddTsk",
|
|
|
|
- "id": agvid,
|
|
|
|
- "s": s,
|
|
|
|
- "d": d
|
|
|
|
- }
|
|
|
|
- var ss = JSON.stringify(strone)
|
|
|
|
- $.post(ip, ss);
|
|
|
|
- })
|
|
|
|
- $("#200").click(function() {
|
|
|
|
- var s = 4
|
|
|
|
- var d = 1
|
|
|
|
- var strone = {
|
|
|
|
- "t": "AddTsk",
|
|
|
|
- "id": agvid,
|
|
|
|
- "s": s,
|
|
|
|
- "d": d
|
|
|
|
- }
|
|
|
|
- var ss = JSON.stringify(strone)
|
|
|
|
- $.post(ip, ss);
|
|
|
|
- })
|
|
|
|
- $("151").click(function() {
|
|
|
|
- var s = 1
|
|
|
|
- var d = 4
|
|
|
|
- var strone = {
|
|
|
|
- "t": "AddTsk",
|
|
|
|
- "id": agvid,
|
|
|
|
- "s": s,
|
|
|
|
- "d": d
|
|
|
|
- }
|
|
|
|
- var ss = JSON.stringify(strone)
|
|
|
|
- $.post(ip, ss);
|
|
|
|
|
|
+
|
|
|
|
+ //设置页面可以左滑右滑跳转页面
|
|
|
|
+ var windowHeight = $(window).height(),
|
|
|
|
+ $body = $("body");
|
|
|
|
+ $("body").on("touchstart", function(e) {
|
|
|
|
+ e.preventDefault();
|
|
|
|
+ startX = e.originalEvent.changedTouches[0].pageX,
|
|
|
|
+ startY = e.originalEvent.changedTouches[0].pageY;
|
|
|
|
+ });
|
|
|
|
+ $("body").on("touchmove", function(e) {
|
|
|
|
+ e.preventDefault();
|
|
|
|
+ moveEndX = e.originalEvent.changedTouches[0].pageX,
|
|
|
|
+ moveEndY = e.originalEvent.changedTouches[0].pageY,
|
|
|
|
+ X = moveEndX - startX,
|
|
|
|
+ Y = moveEndY - startY;
|
|
|
|
+ if (Math.abs(X) > Math.abs(Y) && X > 0) {
|
|
|
|
+ window.location.href = "internet.html"; //right
|
|
|
|
+ } else if (Math.abs(X) > Math.abs(Y) && X < 0) {
|
|
|
|
+ window.location.href = "remote.html"; //left
|
|
|
|
+ } else if (Math.abs(Y) > Math.abs(X) && Y > 0) {
|
|
|
|
+ return //bottom
|
|
|
|
+ } else if (Math.abs(Y) > Math.abs(X) && Y < 0) {
|
|
|
|
+ return //top
|
|
|
|
+ } else {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ });
|
|
})
|
|
})
|
|
|
|
+ //按钮点击事件
|
|
function onSelectStation(evt) {
|
|
function onSelectStation(evt) {
|
|
var $this = $(this);
|
|
var $this = $(this);
|
|
- if ($("div[id='BtnList']").is(':active')) {
|
|
|
|
|
|
+ if ($("div[id='btlist']").is(':active')) {
|
|
$this.removeClass('active');
|
|
$this.removeClass('active');
|
|
} else {
|
|
} else {
|
|
$this.addClass('active');
|
|
$this.addClass('active');
|
|
}
|
|
}
|
|
- if ($("div[id='BtnList']").find(".active").length == 1) {
|
|
|
|
|
|
+ if ($("div[id='btlist']").find(".active").length == 1) {
|
|
$("#moving").attr("disabled", false);
|
|
$("#moving").attr("disabled", false);
|
|
$this.addClass('up');
|
|
$this.addClass('up');
|
|
$("#start").removeAttr("disabled");
|
|
$("#start").removeAttr("disabled");
|
|
$("#cancel").removeAttr("disabled");
|
|
$("#cancel").removeAttr("disabled");
|
|
- } else if ($("div[id='BtnList']").find(".active").length == 2) {
|
|
|
|
|
|
+ } else if ($("div[id='btlist']").find(".active").length == 2) {
|
|
$("#gomoving").addClass("mui-hidden");
|
|
$("#gomoving").addClass("mui-hidden");
|
|
$("#gostart").removeClass("mui-hidden");
|
|
$("#gostart").removeClass("mui-hidden");
|
|
$this.addClass('down');
|
|
$this.addClass('down');
|
|
$('#start').attr("disabled", false);
|
|
$('#start').attr("disabled", false);
|
|
$("#handling").removeAttr("disabled");
|
|
$("#handling").removeAttr("disabled");
|
|
}
|
|
}
|
|
- if ($("div[id='BtnList']").find(".active").length >= 2) {
|
|
|
|
- $("button[name='Site']").css("pointer-events", "none")
|
|
|
|
|
|
+ if ($("div[id='btlist']").find(".active").length >= 2) {
|
|
|
|
+ $("button[name='stbtn']").css("pointer-events", "none")
|
|
} else {
|
|
} else {
|
|
- $("button[name='Site']").css("pointer-events", "auto")
|
|
|
|
|
|
+ $("button[name='stbtn']").css("pointer-events", "auto")
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
+ //取消按钮操作
|
|
function Reset(evt) {
|
|
function Reset(evt) {
|
|
- if ($("div[id='BtnList']").find(".active")) {
|
|
|
|
|
|
+ if ($("div[id='btlist']").find(".active")) {
|
|
$("#gostart").addClass("mui-hidden");
|
|
$("#gostart").addClass("mui-hidden");
|
|
$("#gomoving").removeClass("mui-hidden");
|
|
$("#gomoving").removeClass("mui-hidden");
|
|
- $("button[name='Site']").removeClass('up');
|
|
|
|
- $("button[name='Site']").removeClass('down');
|
|
|
|
- $("button[name='Site']").removeClass('active');
|
|
|
|
- $("button[name='Site']").css("pointer-events", "auto");
|
|
|
|
|
|
+ $("button[name='stbtn']").removeClass('up');
|
|
|
|
+ $("button[name='stbtn']").removeClass('down');
|
|
|
|
+ $("button[name='stbtn']").removeClass('active');
|
|
|
|
+ $("button[name='stbtn']").css("pointer-events", "auto");
|
|
$('#start').attr("disabled", true);
|
|
$('#start').attr("disabled", true);
|
|
$('#cancel').attr("disabled", true);
|
|
$('#cancel').attr("disabled", true);
|
|
$('#moving').attr("disabled", true);
|
|
$('#moving').attr("disabled", true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- //移动
|
|
|
|
|
|
+ //移动按钮
|
|
$("#moving").click(function() {
|
|
$("#moving").click(function() {
|
|
- var bt_value = [];
|
|
|
|
- $("div[id='BtnList']").find(".up").each(function(evt) {
|
|
|
|
- parseInt(bt_value.push($(this).val()));
|
|
|
|
|
|
+ let to;
|
|
|
|
+ $("div[id='btlist']").find(".up").each(function(evt){
|
|
|
|
+ to = parseInt(($(this).context).id);
|
|
|
|
+ });
|
|
|
|
+ SendCmd(AgvId, msgTypeToStation, {"Stn":to}, function(d) {
|
|
|
|
+ console.log("AddTransTask", d);
|
|
|
|
+ Reset()
|
|
})
|
|
})
|
|
- Reset()
|
|
|
|
});
|
|
});
|
|
- //搬运
|
|
|
|
|
|
+ //搬运按钮
|
|
$("#start").click(function() {
|
|
$("#start").click(function() {
|
|
var bt_value = [];
|
|
var bt_value = [];
|
|
- $("div[id='BtnList']").find(".up").each(function(evt) {
|
|
|
|
|
|
+ $("div[id='btlist']").find(".up").each(function(evt) {
|
|
bt_value.push($(this).val());
|
|
bt_value.push($(this).val());
|
|
});
|
|
});
|
|
- $("div[id='BtnList']").find(".down").each(function(evt) {
|
|
|
|
|
|
+ $("div[id='btlist']").find(".down").each(function(evt) {
|
|
bt_value.push($(this).val());
|
|
bt_value.push($(this).val());
|
|
});
|
|
});
|
|
- var strone = {
|
|
|
|
- "t": "AddTsk",
|
|
|
|
- "id": agvid,
|
|
|
|
- "s": parseInt(bt_value[0]),
|
|
|
|
- "d": parseInt(bt_value[1])
|
|
|
|
- }
|
|
|
|
- var ss = JSON.stringify(strone)
|
|
|
|
- $.post(ip, ss);
|
|
|
|
- Reset()
|
|
|
|
|
|
+ AddTransTask(AgvId, bt_value[0], bt_value[1], function(d) {
|
|
|
|
+ //console.log("AddTransTask", d);
|
|
|
|
+ Reset()
|
|
|
|
+ })
|
|
});
|
|
});
|
|
- //取消
|
|
|
|
|
|
+
|
|
|
|
+ function AddTransTask(agvId, from, to, callback){
|
|
|
|
+ $.post(url+"/task", {
|
|
|
|
+ id:agvId,
|
|
|
|
+ from: from,
|
|
|
|
+ to: to
|
|
|
|
+ }, callback);
|
|
|
|
+ };
|
|
|
|
+ function SendCmd(agvId, cmd, opt, func) {
|
|
|
|
+ let param = {"t":cmd};
|
|
|
|
+ opt = _.extend(param, opt);
|
|
|
|
+ //console.log("param", opt);
|
|
|
|
+ $.post(url+"/agv/SendString/" + agvId,
|
|
|
|
+ JSON.stringify(opt),
|
|
|
|
+ func
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ //取消按钮
|
|
$("#cancel").on("click", Reset);
|
|
$("#cancel").on("click", Reset);
|
|
- $("#details").click(function() {
|
|
|
|
- window.location.href = "details.html";
|
|
|
|
- })
|
|
|
|
|
|
+ //填充按钮列表
|
|
|
|
+ function createList() {
|
|
|
|
+ $.get(url + "/map/getStations/" + mapid, function(data) {
|
|
|
|
+ trs = "";
|
|
|
|
+ for (i in data) {
|
|
|
|
+ if (data[i].Name != "") {
|
|
|
|
+ trs += '<div class="mui-col mui-col-xs-3" drag-id="' + data[i].Id + '">' +
|
|
|
|
+ '<button type="button" class="mui-btn mui-btn-royal mui-btn-block" name="stbtn" id="' + data[i].Id +
|
|
|
|
+ '" value="' + data[i].Id + '">' +
|
|
|
|
+ data[i].Name + '</button></div>'
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ $btlist.append(trs);
|
|
|
|
+ //注册按钮点击事件
|
|
|
|
+ $("button[name]").on("touchstart", onSelectStation);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //新建ws连接,获取agv的状态
|
|
|
|
+ let ws;
|
|
|
|
+ function startLog() {
|
|
|
|
+ ws = new WebSocket("ws://" + ip + "/ws/msg/" + agvid);
|
|
|
|
+ ws.onmessage = function(e) {
|
|
|
|
+ let result;
|
|
|
|
+ let msg = JSON.parse(e.data);
|
|
|
|
+ switch (msg.type) {
|
|
|
|
+ case msgTypeStatus:
|
|
|
|
+ // 每秒一次状态
|
|
|
|
+ let stMap = JSON.parse(msg.data);
|
|
|
|
+ //根据状态设置图标等
|
|
|
|
+ showStatusValue(stMap);
|
|
|
|
+ //当前站点按钮文字闪烁
|
|
|
|
+ if (agvid == msg.id) {
|
|
|
|
+ let stMap = JSON.parse(msg.data);
|
|
|
|
+ $("#" + stMap.Station + "").toggleClass("text-success");
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ //读取设置状态,可以获得电池伏数
|
|
|
|
+ case msgTypeGetCfg:
|
|
|
|
+ //console.log(msg.type, msg.data);
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ console.log(msg.type, msg.data);
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //根据获取到的agv状态,设置速度、电量、站点、顶升、提示信息、运行按钮等的颜色和文字显示
|
|
|
|
+ function showStatusValue(status) {
|
|
|
|
+ for (let k in status) {
|
|
|
|
+ let v = status[k];
|
|
|
|
+ //速度显示
|
|
|
|
+ if (k == "Speed") {
|
|
|
|
+ if (v >= "30") { //SpeedHigh
|
|
|
|
+ document.getElementById("speed").src = "img/speed-high.png";
|
|
|
|
+ }
|
|
|
|
+ if (v >= "20") { //SpeedMid
|
|
|
|
+ document.getElementById("speed").src = "img/speed-medium.png";
|
|
|
|
+ }
|
|
|
|
+ if (v <= "10") { //SpeedLow
|
|
|
|
+ document.getElementById("speed").src = "img/speed-low.png";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //电量显示
|
|
|
|
+ if (k == "BatteryVolt") {
|
|
|
|
+ if (v >= "52") { //BatteryVoltFull
|
|
|
|
+ document.getElementById("battery").src = "img/battery-100.png";
|
|
|
|
+ }
|
|
|
|
+ if ("52" < v >= "50") { //BatteryVoltHigh
|
|
|
|
+ document.getElementById("battery").src = "img/battery-80.png";
|
|
|
|
+ }
|
|
|
|
+ if ("50" < v >= "48") { //BatteryVoltMid
|
|
|
|
+ document.getElementById("battery").src = "img/battery-60.png";
|
|
|
|
+ }
|
|
|
|
+ if ("48" < v >= "47") { //BatteryVoltLow
|
|
|
|
+ document.getElementById("battery").src = "img/battery-40.png";
|
|
|
|
+ }
|
|
|
|
+ if ("47" < v >= "45") { //BatteryVoltWarn
|
|
|
|
+ document.getElementById("battery").src = "img/battery-20.png";
|
|
|
|
+ }
|
|
|
|
+ if (v <= "45") { //BatteryVoltStop
|
|
|
|
+ document.getElementById("battery").src = "img/battery-0.png";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //目标站点
|
|
|
|
+ if (k == "TgtStation") {
|
|
|
|
+ if (v == "65535") {
|
|
|
|
+ $("#tgtstation").text("0");
|
|
|
|
+ } else {
|
|
|
|
+ $("#tgtstation").text(v);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //顶升状态
|
|
|
|
+ if (k == "liftstatus") {
|
|
|
|
+ if (v == "1" || v == "3" || v == "5" || v == "7") {
|
|
|
|
+ document.getElementById("liftstatus").src = "img/liftstatus-up.png";
|
|
|
|
+ } else if (v == "0") {
|
|
|
|
+ document.getElementById("liftstatus").src = "img/liftstatus.png";
|
|
|
|
+ } else {
|
|
|
|
+ document.getElementById("liftstatus").src = "img/liftstatus-down.png";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //停止运行注意按钮及信息提示框
|
|
|
|
+ if (k == "Status") {
|
|
|
|
+ if (v == "1") {
|
|
|
|
+ $("#info").text("未设置状态");
|
|
|
|
+ }
|
|
|
|
+ if (v == "2") {
|
|
|
|
+ document.getElementById("run").style.backgroundImage = "url('img/btn2_bg.png')";
|
|
|
|
+ }
|
|
|
|
+ if (v == "3" || v == "4" || v == "9") {
|
|
|
|
+ if (v == "3") {
|
|
|
|
+ $("#info").text("停止状态");
|
|
|
|
+ }
|
|
|
|
+ if (v == "4") {
|
|
|
|
+ $("#info").text("急停按钮急停状态");
|
|
|
|
+ }
|
|
|
|
+ if (v == "9") {
|
|
|
|
+ $("#info").text("手动控制状态");
|
|
|
|
+ }
|
|
|
|
+ document.getElementById("stop").style.backgroundImage = "url('img/btn3_bg.png')";
|
|
|
|
+ }
|
|
|
|
+ if (v == "6") {
|
|
|
|
+ $("#info").text("驱动器错误");
|
|
|
|
+ }
|
|
|
|
+ if (v == "7") {
|
|
|
|
+ $("#info").text("导航错误");
|
|
|
|
+ }
|
|
|
|
+ if (v == "8") {
|
|
|
|
+ $("#info").text("任务错误");
|
|
|
|
+ }
|
|
|
|
+ if (v == "11" || v == "22") {
|
|
|
|
+ if (v == "11") {
|
|
|
|
+ $("#info").text("遇到障碍物停止 或者 冲突区域");
|
|
|
|
+ }
|
|
|
|
+ if (v == "22") {
|
|
|
|
+ $("#info").text("车辆遇到障碍物靠近");
|
|
|
|
+ }
|
|
|
|
+ document.getElementById("warning").style.backgroundImage = "url('img/btn1_bg.png')";
|
|
|
|
+ }
|
|
|
|
+ if (v == "12") {
|
|
|
|
+ $("#info").text("防撞条紧急停止");
|
|
|
|
+ }
|
|
|
|
+ if (v == "15") {
|
|
|
|
+ $("#info").text("电压低");
|
|
|
|
+ }
|
|
|
|
+ if (v == "21") {
|
|
|
|
+ $("#info").text("车辆低电压运行");
|
|
|
|
+ }
|
|
|
|
+ if (v == "31") {
|
|
|
|
+ $("#info").text("正方向磁导航脱线");
|
|
|
|
+ }
|
|
|
|
+ if (v == "32") {
|
|
|
|
+ $("#info").text("反方向磁导航脱线");
|
|
|
|
+ }
|
|
|
|
+ if (v == "33") {
|
|
|
|
+ $("#info").text("正方向磁导航脱线");
|
|
|
|
+ }
|
|
|
|
+ if (v == "34") {
|
|
|
|
+ $("#info").text("反方向磁导航脱线");
|
|
|
|
+ }
|
|
|
|
+ if (v == "71" || v == "72" || v == "73") {
|
|
|
|
+ $("#info").text("取货物时举升不为空");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</script>
|
|
</script>
|
|
</html>
|
|
</html>
|