Files
apt-nl-map/static/Magic4/HMI_Cmd.html
2024-12-04 10:21:04 +08:00

1101 lines
40 KiB
HTML

<!DOCTYPE html>
<html lang="en" id="container" onmousedown="startDrag(event)" onmouseup="stopDrag(event)" onmousemove="dragging(event)" style="overflow-x: hidden;
overflow-y: hidden; ">
<head>
<meta charset="UTF-8" >
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/bootstrap.min.css"/>
<!-- <link rel="stylesheet" href="NumberPad/css/bootstrap.min.css">-->
<!-- <link rel="stylesheet" href="NumberPad/css/bootstrap-theme.min.css">-->
<!-- <link rel="stylesheet" type="text/css" href="NumberPad/css/htmleaf-demo.css">-->
<!-- <link rel="stylesheet" href="NumberPad/css/jquery.numpad.css">-->
<style type="text/css">
.nmpd-grid {
border: none;
padding: 20px;
}
.nmpd-grid>tbody>tr>td {
border: none;
}
/* Some custom styling for Bootstrap */
.qtyInput {
display: block;
width: 100%;
padding: 6px 12px;
color: #555;
background-color: white;
border: 1px solid #ccc;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
table {
margin: 3px 0px;
}
input {
display: inline-block;
margin: 0px 5px;
}
.btn {
color: white;
}
.form-control {
height: 60px;
width: 900px;
}
/* #output{
/* margin-bottom: 100px; */
/* display: flex;
justify-content: center; */
}
/* p input{
margin: 0px auto;
} */
/* .fix{
position: relative;
margin-right: 10px;
margin-bottom: 10px;
}
*/
body {
position: relative;
}
.table1 {
position: absolute;
right: 10px;
bottom: 10px;
}
.task {
height: 100px !important;
padding: 20px 70px !important;
font-size: 40px !important;
margin: 10px 30px 40px 5px !important;
}
.btn {
padding: 10px 20px;
font-size: 30px;
margin: 5px 30px 5px 5px;
height: 70px;
}
.btn1 {
padding: 10px 30px;
font-size: 40px;
margin: 5px 30px 5px 5px;
height: 90px;
}
.disabledBtn{
pointer-events: none; /* 阻止鼠标事件 */
opacity: 0.5; /* 使按钮看起来不可点击 */
}
.remindBtn{
background-color: darkgrey !important;
}
</style>
<script src="jquery-2.1.0.min.js"></script>
<script src="jquery.cookie.js"></script>
<script type="text/javascript" src="eventemitter2.min.js"></script>
<script type="text/javascript" src="roslib.min.js"></script>
<!--<script type="text/javascript" src="http://static.robotwebtools.org/EventEmitter2/current/eventemitter2.min.js"></script>-->
<!--<script type="text/javascript" src="http://static.robotwebtools.org/roslibjs/current/roslib.min.js"></script>-->
<!--<script type="text/javascript" src="Lu_ROS_Driver.js"></script>-->
<script type="text/javascript" src="Lu_Math_Driver.js"></script>
<script type="text/javascript" src="Lu_Scroll_Driver.js"></script>
<script type="text/javascript" src="Lu_MySQL_Driver_StationFloorIndexTable.js"></script>
<script type="text/javascript" src="Lu_MySQL_Driver_SimulationVehicleTable.js"></script>
<script src="NumberPad/js/bootstrap.min.js"></script>
<script src="NumberPad/js/jquery.numpad.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" type="text/javascript">
var lifting = false;
var takeOrPlace = 0;
var floorIndexStr1 = "";
function client_request(str) {
window.parent.postMessage({
event_id: 'client_request',
data: {
v1: str
}
},
"*" //or "www.parentpage.com"
);
}
function receiveMessage(event) {
//console.log(event.data);
switch (event.data.event_id) {
case "client_response": {
var data = event.data.data;
var result = data.v1;
var ROS_String_Output = data.v2;
var Rec_HMI_String_Input = data.v3;
var Client_Request_Cmd = Rec_HMI_String_Input.split(':');
//console.log(data);
switch (Client_Request_Cmd[0]) {
case "GetSimulationVehicleTable":{
console.log("GetSimulationVehicleTable:"+ROS_String_Output);
Lu_Parse_SimulationVehicleTable(ROS_String_Output);
//output_rest_charge
var MyDiv =document.getElementById("output_rest_charge");
var button_charge = document.createElement("input");
button_charge.setAttribute("type", "button");
button_charge.setAttribute("class", "input btn task")
button_charge.setAttribute("value", SimulationVehicleTable.Default_Charge_NodeID.toString()+":AGV"+SimulationVehicleTable.AGV_ID.toString()+"Charge");
//button_charge.style.width = "200px";
//button_charge.style.height = "50px";
button_charge.style.background="lightgreen";
button_charge.setAttribute("onclick", "Lu_Set_ChargeRestEndNode(this.value)");
MyDiv.appendChild(button_charge);
var button_rest = document.createElement("input");
button_rest.setAttribute("type", "button");
button_rest.setAttribute("class", "input btn task")
button_rest.setAttribute("value", SimulationVehicleTable.Default_Rest_NodeID.toString()+":AGV"+SimulationVehicleTable.AGV_ID.toString()+"Rest");
//button_rest.style.width = "200px";
//button_rest.style.height = "50px";
button_rest.style.background="Pink";
button_rest.setAttribute("onclick", "Lu_Set_ChargeRestEndNode(this.value)");
MyDiv.appendChild(button_rest);
}
break;
case "GetStationFloorIndexTable": {
console.log("GetStationFloorIndexTable:"+ROS_String_Output);
Lu_Parse_StationFloorIndexTable(ROS_String_Output);
console.log("Node_Map:"+Node_Map.get(1));
var arrayObj = Array.from(Node_Map);
for (var i = 0; i < arrayObj.length - 1; i++) {
for (var j = 0; j < arrayObj.length - 1 - i; j++) {
if (arrayObj[j][1].NodeName.length > arrayObj[j + 1][1].NodeName.length) {
var temp = arrayObj[j];
arrayObj[j] = arrayObj[j + 1];
arrayObj[j + 1] = temp;
}
if (arrayObj[j][1].NodeName.length == arrayObj[j + 1][1].NodeName.length) {
if (parseInt(arrayObj[j][1].NodeName.split(/[^0-9]/).pop() || 0) >
parseInt(arrayObj[j + 1][1].NodeName.split(/[^0-9]/).pop() || 0)) {
var temp = arrayObj[j];
arrayObj[j] = arrayObj[j + 1];
arrayObj[j + 1] = temp;
}
}
}
}
let itemnum1 = 0;
for (var [key, value] of arrayObj) {
var MyDiv = document.getElementById("output");
var button = document.createElement("input");
button.setAttribute("type", "button");
button.setAttribute("class", "input btn task")
// button.setAttribute("value", key+":"+map.get(key).NodeName);
button.setAttribute("value", value.NodeName);
// button.style.width = "150px";
// button.style.height = "80px";
if (itemnum1 % 2 == 0) {
button.style.background = "#FD4F00FF";
} else {
button.style.background = "#31869B";
}
button.setAttribute("onclick", 'Lu_Set_RouterEndNode("' + key + ':' + value.NodeName + '")');
// if (itemnum1 >= 2) {
// var newline = document.createElement("br");
// MyDiv.appendChild(newline);
// itemnum1 = 0;
// }
itemnum1++;
MyDiv.appendChild(button);
}
}
break;
case "HMIRouter":{
if(lifting){
lifting = false
pickUpTaskList(data);
}else{
console.log(data);
}
}break;
case "HMIStepOrRTPathFollowPropChooseInsertPath":
case "HMIStepOrRTPathFollowProp":
case "HMIStepOrRTPathFollow": {
document.getElementById('StepStartNode').value = "";
document.getElementById('StepEndNode').value = "";
document.getElementById('RouterStartNode').value = "";
document.getElementById('RouterEndNode').value = "";
//console.log(data);
if (data.v1 == 0) {
//alert("发送成功");
document.getElementById('Info').innerText = "发送成功" + data.v3;
} else if (data.v1 == -1) {
//alert("发送失败");
document.getElementById('Info').innerText = "无法找到起点" + data.v3;
} else if (data.v1 == -2) {
document.getElementById('Info').innerText = "无法规划路径" + data.v3;
} else if (data.v1 == -3) {
document.getElementById('Info').innerText = "无法导出任务" + data.v3;
} else if (data.v1 == -4) {
document.getElementById('Info').innerText = "无法搜索PathID" + data.v3;
} else if (data.v1 == -5) {
document.getElementById('Info').innerText = "起点等于终点,无法规划路径" + data.v3;
} else if (data.v1 == -100) {
document.getElementById('Info').innerText = "未知异常" + data.v3;
} else if (data.v1 == -200) {
document.getElementById('Info').innerText = "手动状态,显示屏无法控制" + data.v3;
} else if (data.v1 == -201) {
document.getElementById('Info').innerText = "固定流程使能,无法采用显示屏控制" + data.v3;
} else if (data.v1 == -202) {
document.getElementById('Info').innerText = "上位机调度使能,无法采用显示屏控制" + data.v3;
} else if (data.v1 == -203) {
document.getElementById('Info').innerText = "任务正在执行,无法下达新任务" + data.v3;
} else if (data.v1 == -204) {
document.getElementById('Info').innerText = "任务包非空,无法下达新任务" + data.v3;
}
else if(data.v1==-300){
document.getElementById('Info').innerText="无法搜索ChooseInsertPath1"+data.v3;
}
else if(data.v1==-301){
document.getElementById('Info').innerText="无法搜索ChooseInsertPath2"+data.v3;
}
else if(data.v1==-302){
document.getElementById('Info').innerText="无法规划路径ChooseInsertPath"+data.v3;
}
else if(data.v1==-303){
document.getElementById('Info').innerText="无法导出任务ChooseInsertPath"+data.v3;
}
}
break;
}
}
break;
}
}
window.addEventListener("message", receiveMessage, false);
client_request("GetStationFloorIndexTable");
client_request("GetSimulationVehicleTable");
function Lu_Set_RouterEndNode(str) {
var item_arr = str.split(':');
if (item_arr.length < 2) return;
var key = parseInt(item_arr[0], 10);
document.getElementById('RouterEndNode').value = key;
//document.getElementById('RouterEndNode').setAttribute("value",key);
//alert(key);
}
function Lu_Set_ChargeRestEndNode(str){
var item_arr=str.split(':');
if(item_arr.length<2)return;
var key=parseInt(item_arr[0],10);
if(key>0) {
document.getElementById('RouterEndNode').value = key;
}
}
function talker(canframeid, data0, data1, data2, data3, data4, data5, data6, data7) {
window.parent.postMessage({
event_id: 'talker',
data: {
v1: canframeid,
v2: data0,
v3: data1,
v4: data2,
v5: data3,
v6: data4,
v7: data5,
v8: data6,
v9: data7
}
},
"*" //or "www.parentpage.com"
);
}
var Get_Nav350_Curr_Layer = 0;
function Timer() {
Get_Nav350_Curr_Layer = $.cookie('Get_Nav350_Curr_Layer');
document.getElementById('AGV_Text_Info1').innerText = 'NAV350Layer:' + Get_Nav350_Curr_Layer;
if (ClearAltitudeDeviationErrOK_display) {
document.getElementById('ClearAltitudeDeviationErrOKNow').style.display = "";
} else {
times1 = 0;
document.getElementById('ClearAltitudeDeviationErrOKNow').style.display = "none";
}
times1 = times1 + 1;
if (times1 > 20) {
ClearAltitudeDeviationErrOK_display = false;
}
/*
if(ClearGantryYDeviationErrOK_display){
document.getElementById('ClearGantryYDeviationErrOKNow').style.display="";
}
else{
times2=0;
document.getElementById('ClearGantryYDeviationErrOKNow').style.display="none";
}
times2=times2+1;
if(times2>20){
ClearGantryYDeviationErrOK_display=false;
}
if(ClearGantryXDeviationErrOK_display){
document.getElementById('ClearGantryXDeviationErrOKNow').style.display="";
}
else{
times3=0;
document.getElementById('ClearGantryXDeviationErrOKNow').style.display="none";
}
times3=times3+1;
if(times3>20){
ClearGantryXDeviationErrOK_display=false;
}
*/
}
function HMI_Ctrl_Enable(Enable) {
if (Enable) talker(0x101, 0x10, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00);
else talker(0x101, 0x10, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00);
}
function HMI_Ctrl_Enable_srv(Enable){
if(Enable)client_request("Remote_Or_HMI_Ctrl:true#");
else client_request("Remote_Or_HMI_Ctrl:false#");
}
function TCS_Ctrl_Enable_srv(Enable){
if(Enable)client_request("CAD_Or_TCS_Ctrl:true#");
else client_request("CAD_Or_TCS_Ctrl:false#");
}
function HMI_Ctrl_SkipRequest_srv(){
client_request("HMI_Ctrl_SkipRequest");
}
function HMI_Ctrl_SkipRelease_srv(){
client_request("HMI_Ctrl_SkipRelease");
}
function HMI_Ctrl_ChooseInsertPath_srv(){
client_request("HMI_Ctrl_ChooseInsertPath");
}
function TCS_Ctrl_Enable(Enable) {
if (Enable) talker(0x101, 0x10, 0x01, 0x04, 0x01, 0x01, 0x00, 0x00, 0x00);
else talker(0x101, 0x10, 0x01, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00);
}
function HMI_Ctrl_StepEnable(StartNode, EndNode) {
talker(0x101, 0x10, 0x01, 0x03, 0x00, (StartNode >> 8) & 0x00ff, StartNode & 0x00ff, (EndNode >> 8) & 0x00ff,
EndNode & 0x00ff);
}
function HMI_Ctrl_RouterInfo_By_Srv(StartNode,EndNode){
if(StartNode=="")StartNode=0;
if(EndNode=="")EndNode=0;
client_request("HMIRouter:"+StartNode+";"+EndNode+";#");
}
function HMI_Ctrl_StepEnable_By_Srv(StartNode, EndNode) {
if (StartNode == "") StartNode = 0;
if (EndNode == "") EndNode = 0;
client_request("HMI_Ctrl_Clear_Auto_Mode_Schedule");
sleep(1);
client_request("HMIStepOrRTPathFollow:" + StartNode + ";" + EndNode + ";0#");
}
function HMI_Ctrl_StepEnableReachCheck_By_Srv(StartNode, EndNode) {
if (StartNode == "") StartNode = 0;
if (EndNode == "") EndNode = 0;
client_request("HMI_Ctrl_Clear_Auto_Mode_Schedule");
sleep(1);
client_request("HMIStepOrRTPathFollowProp:" + StartNode + ";" + EndNode + ";0;1#");
}
function HMI_Ctrl_StepEnablePlateCheck_By_Srv(StartNode,EndNode){
if(StartNode=="")StartNode=0;
if(EndNode=="")EndNode=0;
client_request("HMI_Ctrl_Clear_Auto_Mode_Schedule");
sleep(1);
client_request("HMIStepOrRTPathFollowProp:"+StartNode+";"+EndNode+";0;1;1#");
}
function HMI_Ctrl_RouterEnable(StartNode, EndNode) {
talker(0x101, 0x10, 0x01, 0x03, 0x01, (StartNode >> 8) & 0x00ff, StartNode & 0x00ff, (EndNode >> 8) & 0x00ff,
EndNode & 0x00ff);
}
function HMI_Ctrl_RouterEnable_By_Srv(StartNode, EndNode) {
if (StartNode == "") StartNode = 0;
if (EndNode == "") EndNode = 0;
client_request("HMI_Ctrl_Clear_Auto_Mode_Schedule");
sleep(1);
client_request("HMIStepOrRTPathFollow:" + StartNode + ";" + EndNode + ";1#");
}
function HMI_Ctrl_RouterEnableReachCheck_By_Srv(StartNode, EndNode) {
if (StartNode == "") StartNode = 0;
if (EndNode == "") EndNode = 0;
client_request("HMI_Ctrl_Clear_Auto_Mode_Schedule");
sleep(1);
client_request("HMIStepOrRTPathFollowProp:" + StartNode + ";" + EndNode + ";1;1#");
}
function HMI_Ctrl_RouterEnablePlateCheck_By_Srv(StartNode,EndNode){
if(StartNode=="")StartNode=0;
if(EndNode=="")EndNode=0;
client_request("HMI_Ctrl_Clear_Auto_Mode_Schedule");
sleep(1);
client_request("HMIStepOrRTPathFollowProp:"+StartNode+";"+EndNode+";1;1;1#");
}
function HMI_Ctrl_RouterEnableChooseInsertPath_By_Srv(StartNode,EndNode){
if(StartNode=="")StartNode=0;
if(EndNode=="")EndNode=0;
client_request("HMI_Ctrl_Clear_Auto_Mode_Schedule");
sleep(1);
client_request("HMIStepOrRTPathFollowPropChooseInsertPath:"+StartNode+";"+EndNode+";1;0;0;1#");
}
function HMI_Ctrl_SetLanguage_By_Srv(Language){
if(Language=="")Language=0;
client_request("HMISetLanguage:"+Language+";#");
}
var ClearAltitudeDeviationErrOK_display = false;
var ClearGantryYDeviationErrOK_display = false;
var ClearGantryXDeviationErrOK_display = false;
var times1 = 0;
var times2 = 0;
var times3 = 0;
function HMI_Ctrl_ClearAltitudeDeviationErrOK_request() {
if (ClearAltitudeDeviationErrOK_display) {
ClearAltitudeDeviationErrOK_display = false;
} else {
ClearAltitudeDeviationErrOK_display = true;
}
}
function HMI_Ctrl_ClearGantryYDeviationErrOK_request() {
if (ClearGantryYDeviationErrOK_display) {
ClearGantryYDeviationErrOK_display = false;
} else {
ClearGantryYDeviationErrOK_display = true;
}
}
function HMI_Ctrl_ClearGantryXDeviationErrOK_request() {
if (ClearGantryXDeviationErrOK_display) {
ClearGantryXDeviationErrOK_display = false;
} else {
ClearGantryXDeviationErrOK_display = true;
}
}
function HMI_Ctrl_StartCheckOK() {
talker(0x101, 0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01);
}
function HMI_Ctrl_RebornInitOK() {
talker(0x101, 0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02);
window.parent.taskListbak = [];
window.parent.resultCode = 0;
let taskListString = $.cookie("taskList");
console.log("清除taskListString",taskListString)
if(typeof(taskListString) != "undefined" && taskListString != "[]"){
$.cookie("taskList", "[]");
}
}
function HMI_Ctrl_ReachEndOK() {
talker(0x101, 0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03);
}
function HMI_Ctrl_ObstacleTouchConfirmOK() {
talker(0x101, 0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04);
}
function HMI_Ctrl_ClearAltitudeDeviationErrOK() {
talker(0x101, 0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05);
}
function HMI_Ctrl_ClearGantryYDeviationErrOK() {
talker(0x101, 0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07);
}
function HMI_Ctrl_ClearGantryXDeviationErrOK() {
talker(0x101, 0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06);
}
function HMI_Ctrl_SkipPlateCheckOK() {
talker(0x101, 0x20, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08);
}
function HMI_Ctrl_GetNav350CurrLayer() {
talker(0x101, 0x10, 0x01, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00);
}
function HMI_Ctrl_SetNav350CurrLayer(SetNav350CurrLayer) {
talker(0x101, 0x10, 0x01, 0x05, 0x00, (SetNav350CurrLayer >> 8) & 0x00ff, SetNav350CurrLayer & 0x00ff, 0x00,
0x00);
}
var T1 = window.setInterval("Timer()", 100);
</script>
<script type="text/javascript">
// Set NumPad defaults for jQuery mobile.
// These defaults will be applied to all NumPads within this document!
$.fn.numpad.defaults.gridTpl = '<table class="table modal-content"></table>';
$.fn.numpad.defaults.backgroundTpl = '<div class="modal-backdrop in"></div>';
$.fn.numpad.defaults.displayTpl = '<input type="text" class="form-control" />';
$.fn.numpad.defaults.buttonNumberTpl =
'<button type="button" class="btn btn-default" style="width: 80px; height: 80px"></button>';
$.fn.numpad.defaults.buttonFunctionTpl =
'<button type="button" class="btn" style="width: 80px; height: 80px"></button>';
//$.fn.numpad.defaults.buttonNumberTpl = '<button type="button" class="btn btn-default"></button>';
//$.fn.numpad.defaults.buttonFunctionTpl = '<button type="button" class="btn" style="width: 100%;"></button>';
$.fn.numpad.defaults.onKeypadCreate = function() {
$(this).find('.done').addClass('btn-primary');
};
// Instantiate NumPad once the page is ready to be shown
$(document).ready(function() {
// $('#StepStartNode').numpad();
// $('#StepEndNode').numpad();
// $('#RouterStartNode').numpad();
// $('#RouterEndNode').numpad();
// $('#SetNav350CurrLayer').numpad({
// hidePlusMinusButton: true,
// hideDecimalButton: true
// });
/*
$('#password').numpad({
displayTpl: '<input class="form-control" type="password" />',
hidePlusMinusButton: true,
hideDecimalButton: true
});
$('#numpadButton-btn').numpad({
target: $('#numpadButton')
});
$('#numpad4div').numpad();
$('#numpad4column .qtyInput').numpad();
$('#numpad4column tr').on('click', function(e){
$(this).find('.qtyInput').numpad('open');
});
*/
});
function fullScreen() {
if (window.parent.document.fullscreenElement) {
window.parent.document.mozCancelFullScreen()
} else {
window.parent.document.documentElement.mozRequestFullScreen()
}
}
// aps 堆高车版
// function pickUp(StartNode, EndNode, takeOrPlace1){
// takeOrPlace = takeOrPlace1
// if(StartNode=="")StartNode=0;
// if(EndNode=="")EndNode=0;
// if(! Node_Map.has(parseInt(EndNode))){
// document.getElementById('Info').innerText = "此站点未设置抬升高度!" + EndNode;
// console.log("此站点未设置抬升高度!"+EndNode)
// return;
// }
// if(parseInt(EndNode) == parseInt($.cookie("CurNodeID"))){
// document.getElementById('Info').innerText = "起点等于终点,无法规划路径!" + EndNode;
// console.log("起点等于终点,无法规划路径!"+EndNode)
// return;
// }
// if(Node_Map.get(parseInt(EndNode)).FloorOperationInfos.size > 1){
// $("#exampleModalCmd .modal-body").html("");
// Node_Map.get(parseInt(EndNode)).FloorOperationInfos.forEach (function(value, key) {
// var but = document.createElement("input");
// but.setAttribute("type", "button");
// but.setAttribute("class", "input btn task")
// but.setAttribute("value", key);
// but.style.background = "#FD4F00FF";
// but.setAttribute("onclick", 'selectFloorIndexStr1('+key+')');
// $("#exampleModalCmd .modal-body").append(but)
// })
// $("#exampleModalCmd").modal('show');
// return;
// }
// lifting = true
// HMI_Ctrl_RouterInfo_By_Srv(StartNode,EndNode)
// }
// function pickUpTaskList(data){
// //console.log("data=====",data)
// var startNode = $("#RouterStartNode").val()
// var endNode = $("#RouterEndNode").val()
// if (startNode == "") startNode = 0;
// if (endNode == "") endNode = 0;
// var nodes = data.v2.substring(data.v2.indexOf("Export_NodeIDPath:\n")+"Export_NodeIDPath:\n".length,data.v2.indexOf(" \nExport_NodeIDPath_End"))
// //console.log("nodes",nodes);
// var nodeList = nodes.split(" ");
// //console.log("nodeList",nodeList);
// var taskList = [];
// if(nodeList.length > 2){
// var task = {};
// //运行到前一个点
// taskList.push(createTask("HMIStepOrRTPathFollow:" + startNode + ";" + nodeList[nodeList.length-2] + ";1#"
// ,startNode,nodeList[nodeList.length-2],""));
// }
// var heights = ""
// var heightsBehind = ""
// var endNodekey = parseInt(endNode)
// var floorOperationInfo = Node_Map.get(endNodekey).FloorOperationInfo;
// if(floorIndexStr1 != ""){
// floorOperationInfo = Node_Map.get(endNodekey).FloorOperationInfos.get(floorIndexStr1.toString());
// }
// if(takeOrPlace == 1){
// heights = floorOperationInfo.Operation_Param_List[0].Format.split(" ")
// heightsBehind = floorOperationInfo.Operation_Param_List[1].Format.split(" ")
// }else if(takeOrPlace == 2){
// heights = floorOperationInfo.Operation_Param_List[2].Format.split(" ")
// heightsBehind = floorOperationInfo.Operation_Param_List[3].Format.split(" ")
// }
// //取货前抬升
// taskList.push(createTask("HMIStepOrRTPathFollow:" + 0 + ";" + parseInt(heights[0])/10 + ";0#"
// ,"","",heights[0]));
// //运行至终点
// //taskList.push(createTask("HMIStepOrRTPathFollowProp:"+nodeList[nodeList.length-2]+";"+endNode+";1;1;1#"
// //,nodeList[nodeList.length-2],endNode,""));
// taskList.push(createTask("HMIStepOrRTPathFollow:" + nodeList[nodeList.length-2] + ";" + endNode + ";1#"
// ,nodeList[nodeList.length-2],endNode,""));
// //抬升货物
// taskList.push(createTask("HMIStepOrRTPathFollow:" + 0 + ";" + parseInt(heights[1])/10 + ";0#"
// ,"","",heights[1]));
// //校准之前抬升
// taskList.push(createTask("HMIStepOrRTPathFollow:" + 0 + ";" + parseInt(heightsBehind[0])/10 + ";0#"
// ,"","", heightsBehind[0]));
// //运动到前一个点
// taskList.push(createTask("HMIStepOrRTPathFollow:" + endNode + ";" + nodeList[nodeList.length-2] + ";0#"
// ,endNode,nodeList[nodeList.length-2],""));
// //调整运行时货叉高度
// taskList.push(createTask("HMIStepOrRTPathFollow:" + 0 + ";" + parseInt(heightsBehind[1])/10 + ";0#"
// ,"","", heightsBehind[1]));
// $.cookie("taskList",JSON.stringify(taskList))
// }
// apt 版本
function pickUp(StartNode, EndNode, takeOrPlace1){
takeOrPlace = takeOrPlace1
if(StartNode=="")StartNode=0;
if(EndNode=="")EndNode=0;
if(parseInt(EndNode) == parseInt($.cookie("CurNodeID"))){
document.getElementById('Info').innerText = "起点等于终点,无法规划路径!" + EndNode;
console.log("起点等于终点,无法规划路径!"+EndNode)
return;
}
lifting = true
HMI_Ctrl_RouterInfo_By_Srv(StartNode,EndNode)
}
function pickUpTaskList(data){
//console.log("data=====",data)
var startNode = $("#RouterStartNode").val()
var endNode = $("#RouterEndNode").val()
if (startNode == "") startNode = 0;
if (endNode == "") endNode = 0;
var nodes = data.v2.substring(data.v2.indexOf("Export_NodeIDPath:\n")+"Export_NodeIDPath:\n".length,data.v2.indexOf(" \nExport_NodeIDPath_End"))
//console.log("nodes",nodes);
var nodeList = nodes.split(" ");
//console.log("nodeList",nodeList);
var taskList = [];
let heightStart;
let heightValue;
if(takeOrPlace == 1){
heightStart = 2;
heightValue = 20;
}else if(takeOrPlace == 2){
heightStart = 1;
heightValue = 10;
}
//到达取货点
taskList.push(createTask("HMIStepOrRTPathFollow:" +startNode + ";" + endNode + ";1#"
,nodeList[nodeList.length-2],endNode,""));
//抬升货物
taskList.push(createTask("HMIStepOrRTPathFollow:" + 0 + ";" + heightStart + ";0#"
,"","",heightValue));
//校准之前抬升
// taskList.push(createTask("HMIStepOrRTPathFollow:" + 0 + ";" + heightStart + ";0#"
// ,"","", ""));
//运动到前一个点
taskList.push(createTask("HMIStepOrRTPathFollow:" + endNode + ";" + nodeList[nodeList.length-2] + ";1#"
,endNode,nodeList[nodeList.length-2],""));
$.cookie("taskList",JSON.stringify(taskList))
}
function createTask(str,startNode,endNode,height){
let task = {};
task["str"] = str
task["startNode"] = startNode
task["endNode"] = endNode
task["height"] = height
return task;
}
function closeModal(){
lifting = false
$("#exampleModalCmd").modal('hide');
}
function selectFloorIndexStr1(key){
console.log(key)
floorIndexStr1 = key;
$("#exampleModalCmd").modal('hide');
lifting = true
var startNode = $("#RouterStartNode").val()
var endNode = $("#RouterEndNode").val()
if (startNode == "") startNode = 0;
if (endNode == "") endNode = 0;
HMI_Ctrl_RouterInfo_By_Srv(startNode,endNode)
}
</script>
</head>
<body>
<table>
<tr>
<div id='AGV_Text_Info1'> </div>
</tr>
<div style="margin: 40px 0px">
<div style="margin: 10px 0px">
<div id="output">
</div>
<div id="output_rest_charge">
</div>
</div>
<p><input type=text class="input form-control" id="RouterStartNode" name=RouterStartNode></input></p>
<p><input type=text class="input form-control" id="RouterEndNode" name=RouterEndNode></input></p>
<p>
<input type=button class="btn setting" value="路由使能" style="background:green"
onclick=HMI_Ctrl_RouterEnable(RouterStartNode.value,RouterEndNode.value)></input>
<input type=button class="btn setting1" value="路由使能Srv" data-i18n-value="cmd.routeSrv" style="background:green"
onclick=HMI_Ctrl_RouterEnable_By_Srv(RouterStartNode.value,RouterEndNode.value)></input>
<input type=button class="btn setting" value="路由使能到位检测Srv" style="background:green"
onclick=HMI_Ctrl_RouterEnableReachCheck_By_Srv(RouterStartNode.value,RouterEndNode.value)></input>
<input type=button class="btn setting" value="路由使能PlateCheckSrv" style="background:green"
onclick=HMI_Ctrl_RouterEnablePlateCheck_By_Srv(RouterStartNode.value,RouterEndNode.value)></input>
<input type=button class="btn setting" value="路由使能ChooseInsertPathSrv" style="background:green"
onclick=HMI_Ctrl_RouterEnableChooseInsertPath_By_Srv(RouterStartNode.value,RouterEndNode.value)></input>
<input type=button class="btn setting1" value="取货" data-i18n-value="cmd.pickUp" style="background:green"
onclick=pickUp(RouterStartNode.value,RouterEndNode.value,1)></input>
<input type=button class="btn setting1" value="放货" data-i18n-value="cmd.ReleaseGoods" style="background:green"
onclick=pickUp(RouterStartNode.value,RouterEndNode.value,2)></input>
</p>
<p>
<div id="Info"></div>
</p>
</div>
</table>
<table style="margin: 10px 0px" class="tb1 table1">
<tr>
<td>
<input type=button class="btn setting" value="跳过起点" style="background:#31869B"
onclick=HMI_Ctrl_StartCheckOK()></input>
</td>
<td>
<input type=button class="btn setting" value="提前到位" style="background:#31869B"
Onclick=HMI_Ctrl_ReachEndOK()></input>
</td>
<td>
<input type=button class="btn setting1" value="确认信号" data-i18n-value="cmd.notarizeSignal" style="background:#31869B"
Onclick=HMI_Ctrl_ObstacleTouchConfirmOK()></input>
</td>
<td>
<input type=button class="btn setting1" value="全屏" data-i18n-value="cmd.fullScreen" style="background:#31869B"
Onclick=fullScreen()></input>
</td>
<td>
<input type=button class="btn setting1" value="软件重启" data-i18n-value="cmd.restart" style="background:#31869B"
Onclick=HMI_Ctrl_RebornInitOK()></input>
</td>
<td>
<input type=button class="btn setting" value="跳过检测" style=" background:#31869B"
Onclick=HMI_Ctrl_SkipPlateCheckOK()></input>
</td>
</tr>
</table>
<table style="margin: 10px 0px" class="tb1 table1">
<tr>
<td>
<input type=button class="btn setting" value="显示屏控制使能" style=" background:#FD4F00FF"
onclick=HMI_Ctrl_Enable(true)></input>
</td>
<td>
<input type=button class="btn setting" value="显示屏控制关闭" style=" background:#FD4F00FF"
onclick=HMI_Ctrl_Enable(false)></input>
</td>
<td>
<input type=button class="btn setting" value="TCS控制使能" style=" background:#FD4F00FF"
onclick=TCS_Ctrl_Enable(true)></input>
</td>
<td>
<input type=button class="btn setting" value="TCS控制关闭" style=" background:#FD4F00FF"
onclick=TCS_Ctrl_Enable(false)></input>
</td>
<td>
<input type=button class="btn setting" value="显示屏控制使能srv" style="background:#FD4F00FF"
onclick=HMI_Ctrl_Enable_srv(true)></input>
</td>
</tr>
<tr>
<td>
<input type=button class="btn setting" value="显示屏控制关闭srv" style="background:green"
onclick=HMI_Ctrl_Enable_srv(false)></input>
</td>
<td>
<input type=button class="btn setting" value="TCS控制使能srv" style="background:green"
onclick=TCS_Ctrl_Enable_srv(true)></input>
</td>
<td>
<input type=button class="btn setting" value="TCS控制关闭srv" style="background:green"
onclick=TCS_Ctrl_Enable_srv(false)></input>
</td>
<td>
<input type=button class="btn setting" value="跳过请求通行" style="background:green"
onclick=HMI_Ctrl_SkipRequest_srv()></input>
</td>
<td>
<input type=button class="btn setting" value="跳过释放通行" style="background:green"
onclick=HMI_Ctrl_SkipRelease_srv()></input>
</td>
<td>
<input type=button class="btn setting" value="ChooseInsertPath" style="background:green"
Onclick=HMI_Ctrl_ChooseInsertPath_srv()></input>
</td>
</tr>
</table>
<div class='setting'>
<table>
<tr>
<form>
<p><input type=text class="input form-control" id="StepStartNode" name=StepStartNode></input>
</p>
<p><input type=text class="input form-control" id="StepEndNode" name=StepEndNode></input></p>
<p>
<input type=button class="btn" value="单步使能" style=" background:#fd4f00"
onclick=HMI_Ctrl_StepEnable(StepStartNode.value,StepEndNode.value)></input>
<input type=button class="btn" value="单步使能Srv" style=" background:#fd4f00"
onclick=HMI_Ctrl_StepEnable_By_Srv(StepStartNode.value,StepEndNode.value)></input>
<input type=button class="btn" value="单步使能到位检测Srv" style=" background:#fd4f00"
onclick=HMI_Ctrl_StepEnableReachCheck_By_Srv(StepStartNode.value,StepEndNode.value)></input>
<input type=button class="btn" value="单步使能PlateCheckSrv" style="background:#fd4f00"
onclick=HMI_Ctrl_StepEnablePlateCheck_By_Srv(StepStartNode.value,StepEndNode.value)></input>
</p>
<p><input type=text class="input form-control" id="RouterInfoStartNode" name=RouterInfoStartNode></input></p>
<p><input type=text class="input form-control" id="RouterInfoEndNode" name=RouterInfoEndNode></input></p>
<p>
<input type=button class="btn" value="Router" style="background:#fd4f00"" onclick=HMI_Ctrl_RouterInfo_By_Srv(RouterInfoStartNode.value,RouterInfoEndNode.value)></input>
</p>
</form>
</tr>
<tr>
</tr>
<tr>
<form>
<p><input class="input form-control" type=text id="SetNav350CurrLayer"
name=SetNav350CurrLayer></input></p>
<input type=button class="btn" value="读取NAV350层号" style=" background:#FD4F00FF"
onclick=HMI_Ctrl_GetNav350CurrLayer()></input>
<input type=button class="btn" value="设置NAV350层号" style=" background:#FD4F00FF"
onclick=HMI_Ctrl_SetNav350CurrLayer(SetNav350CurrLayer.value)></input>
<P><input type=text class="input form-control" id="SetLanguage" name=SetLanguage></input></P>
<input type=button class="btn" value="设置 Language" style="background:#FD4F00FF"
onclick=HMI_Ctrl_SetLanguage_By_Srv(SetLanguage.value)></input>
</form>
</tr>
</table>
<table>
<tr>
<p style="margin: 5px">清除偏差告警</p>
</tr>
<tr>
<td>
<input type=button class="btn" value="清除高度偏差告警" style=" background:orange"
Onclick=HMI_Ctrl_ClearAltitudeDeviationErrOK_request()></input>
</td>
<td>
<input type=button class="btn" id="ClearAltitudeDeviationErrOKNow" value="清除高度偏差告警Now"
style=" background:orange" Onclick=HMI_Ctrl_ClearAltitudeDeviationErrOK()></input>
</td>
</tr>
</table>
</div>
<div class="modal fade" id="exampleModalCmd" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabelCmd" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabelCmd">请选择层级</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" onclick="closeModal()">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" aria-label="Close" onclick="closeModal()">取消</button>
</div>
</div>
</div>
</div>
</body>
<script src="js/drag.js"></script>
<script type="text/javascript" src="js/i18n/TimeI18n.js"></script>
<script type="text/javascript" src="js/monitoringElectricity.js"></script>
<script>
$(".input").focus(function() {
window.parent.inputDom = this;
var distance = $(parent.document).scrollTop() + 500 + "px";
$(".simple-keyboard", parent.document).css("top", distance)
$(".keyboard", parent.document).show();
window.parent.clearKeyboard();
})
if(window.parent.Switching_Modes == 0){
$('.setting').hide()
$('.tb1').attr("class", "tb1 table1")
$('.setting1').attr('class', "btn setting1 btn1")
}else{
$('.tb1').attr("class","tb1")
$('.setting1').attr('class',"btn setting1")
}
loadText();
modifyStyle();
// let ROS_String_Output = `27560656 101 1 1 name1 <-0.839 0.033> <|101:4@[AltitudeLoadSch12#1$TwoUInt16%1000 1200&3E804B0][AltitudeLoadSch34#2$TwoUInt16%1200 300&4B0012C][AltitudeUnloadSch12#3$TwoUInt16%1200 1000&4B003E8][AltitudeUnloadSch34#4$TwoUInt16%1200 1000&3E80001]>
// 27560656 201 2 2 name2 <0.810 0.012> <|201:4@[AltitudeLoadSch12#1$TwoUInt16%1000 1200&3E804B0][AltitudeLoadSch34#2$TwoUInt16%1200 300&4B0012C][AltitudeUnloadSch12#3$TwoUInt16%1200 1000&4B003E8][AltitudeUnloadSch34#4$TwoUInt16%1200 1000&3E80001]>
// 27560656 211 2 2 name2 <0.810 0.012> <|201:4@[AltitudeLoadSch12#1$TwoUInt16%1000 1200&3E804B0][AltitudeLoadSch34#2$TwoUInt16%1200 300&4B0012C][AltitudeUnloadSch12#3$TwoUInt16%1200 1000&4B003E8][AltitudeUnloadSch34#4$TwoUInt16%1200 1000&3E80001]>`;
// //console.log("GetStationFloorIndexTable:"+ROS_String_Output);
// Lu_Parse_StationFloorIndexTable(ROS_String_Output);
// var arrayObj = Array.from(Node_Map);
// console.log("Node_Map",)
// if(Node_Map.get(2).FloorOperationInfos.size>0){
// $("#exampleModalCmd").modal('show');
// }
// Node_Map.get(2).FloorOperationInfos.forEach (function(value, key) {
// })
// for (var i = 0; i < arrayObj.length - 1; i++) {
// for (var j = 0; j < arrayObj.length - 1 - i; j++) {
// if (arrayObj[j][1].NodeName.length > arrayObj[j + 1][1].NodeName.length) {
// var temp = arrayObj[j];
// arrayObj[j] = arrayObj[j + 1];
// arrayObj[j + 1] = temp;
// }
// if (arrayObj[j][1].NodeName.length == arrayObj[j + 1][1].NodeName.length) {
// if (parseInt(arrayObj[j][1].NodeName.split(/[^0-9]/).pop() || 0) >
// parseInt(arrayObj[j + 1][1].NodeName.split(/[^0-9]/).pop() || 0)) {
// var temp = arrayObj[j];
// arrayObj[j] = arrayObj[j + 1];
// arrayObj[j + 1] = temp;
// }
// }
// }
// }
// let itemnum1 = 0;
// for (var [key, value] of arrayObj) {
// var MyDiv = document.getElementById("output");
// var button = document.createElement("input");
// button.setAttribute("type", "button");
// button.setAttribute("class", "input btn task")
// // button.setAttribute("value", key+":"+map.get(key).NodeName);
// button.setAttribute("value", value.NodeName);
// // button.style.width = "150px";
// // button.style.height = "80px";
// button.setAttribute("onclick", 'Lu_Set_RouterEndNode("' + key + ':' + value.NodeName + '")');
// // if (itemnum1 >= 4) {
// // // var newline = document.createElement("br");
// // // MyDiv.appendChild(newline);
// // itemnum1 = 0;
// // }
// if (itemnum1 % 2 == 0) {
// button.style.background = "#FD4F00FF";
// } else {
// button.style.background = "#31869B";
// }
// itemnum1++;
// MyDiv.appendChild(button);
// }
// // let data = `{ v1: 0, v2: "HMIRouter:0;2;#\nExport_NodeIDPath:\n1 2 \nExport_NodeIDPath_End", v3: "HMIRouter:0;2;#" }`
// // let nodes = data.substring(data.indexOf("Export_NodeIDPath:\n")+"Export_NodeIDPath:\n".length,data.indexOf(" \nExport_NodeIDPath_End"))
// // console.log("nodes",nodes);
// // let nodeList = nodes.split(" ");
// console.log("nodeList",$.cookie("taskList"));
</script>
</html>