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

478 lines
16 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<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;
}
</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 src="NumberPad/js/bootstrap.min.js"></script>
<script src="NumberPad/js/jquery.numpad.js"></script>
<script type="text/javascript" type="text/javascript">
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 "GetStationFloorIndexTable":{
//console.log("GetStationFloorIndexTable:"+ROS_String_Output);
Lu_Parse_StationFloorIndexTable(ROS_String_Output);
//console.log(Node_Map);
var itemnum1=0;
Node_Map.forEach(function (value, key, map) {
console.log(map.get(key).NodeName);
var MyDiv =document.getElementById("output");
var button = document.createElement("input");
button.setAttribute("type", "button");
button.setAttribute("value", key+":"+map.get(key).NodeName);
button.style.width = "200px";
button.style.height = "50px";
button.style.background="Cyan";
button.setAttribute("onclick", "Lu_Set_RouterEndNode(this.value)");
if(itemnum1>=5){
var newline= document.createElement("br");
MyDiv.appendChild(newline);
itemnum1=0;
}
itemnum1++;
MyDiv.appendChild(button);
});
}
break;
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;
}
}
break;
}
}
break;
}
}
window.addEventListener("message", receiveMessage, false);
client_request("GetStationFloorIndexTable");
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 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 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_StepEnable_By_Srv(StartNode,EndNode){
if(StartNode=="")StartNode=0;
if(EndNode=="")EndNode=0;
client_request("HMIStepOrRTPathFollow:"+StartNode+";"+EndNode+";0#");
}
function HMI_Ctrl_StepEnableReachCheck_By_Srv(StartNode,EndNode){
if(StartNode=="")StartNode=0;
if(EndNode=="")EndNode=0;
client_request("HMIStepOrRTPathFollowProp:"+StartNode+";"+EndNode+";0;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("HMIStepOrRTPathFollow:"+StartNode+";"+EndNode+";1#");
}
function HMI_Ctrl_RouterEnableReachCheck_By_Srv(StartNode,EndNode){
if(StartNode=="")StartNode=0;
if(EndNode=="")EndNode=0;
client_request("HMIStepOrRTPathFollowProp:"+StartNode+";"+EndNode+";1;1#");
}
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);
}
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_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');
});
*/
});
</script>
</head>
<body>
<table>
<tr>
<div id='AGV_Text_Info1'> </div>
</tr>
</table>
<table style="margin: 10px 0px">
<tr>
<td>
<input type=button value="跳过起点" style="height:50px;background:green" onclick=HMI_Ctrl_StartCheckOK()></input>
</td>
<td>
<input type=button value="软件重启" style="height:50px;background:green" Onclick=HMI_Ctrl_RebornInitOK()></input>
</td>
<td>
<input type=button value="提前到位" style="height:50px;background:green" Onclick=HMI_Ctrl_ReachEndOK()></input>
</td>
<td>
<input type=button value="确认信号" style="height:50px;background:green" Onclick=HMI_Ctrl_ObstacleTouchConfirmOK()></input>
</td>
<td>
<input type=button value="显示屏控制使能" style="height:50px;background:yellow" onclick=HMI_Ctrl_Enable(true)></input>
</td>
<td>
<input type=button value="显示屏控制关闭" style="height:50px;background:yellow" onclick=HMI_Ctrl_Enable(false)></input>
</td>
<td>
<input type=button value="TCS控制使能" style="height:50px;background:yellow" onclick=TCS_Ctrl_Enable(true)></input>
</td>
<td>
<input type=button value="TCS控制关闭" style="height:50px;background:yellow" onclick=TCS_Ctrl_Enable(false)></input>
</td>
</tr>
</table>
<table>
<tr>
<form>
<p><input type=text class="input" id="StepStartNode" name=StepStartNode></input></p>
<p><input type=text class="input" id="StepEndNode" name=StepEndNode></input></p>
<p>
<input type=button value="单步使能" style="width:200px;height:50px;background:yellow" onclick=HMI_Ctrl_StepEnable(StepStartNode.value,StepEndNode.value)></input>
<input type=button value="单步使能Srv" style="width:200px;height:50px;background:yellow" onclick=HMI_Ctrl_StepEnable_By_Srv(StepStartNode.value,StepEndNode.value)></input>
<input type=button value="单步使能到位检测Srv" style="width:200px;height:50px;background:yellow" onclick=HMI_Ctrl_StepEnableReachCheck_By_Srv(StepStartNode.value,StepEndNode.value)></input>
</p>
<p><input type=text class="input" id="RouterStartNode" name=RouterStartNode></input></p>
<p><input type=text class="input" id="RouterEndNode" name=RouterEndNode></input></p>
<p>
<input type=button value="路由使能" style="width:200px;height:50px;background:yellow" onclick=HMI_Ctrl_RouterEnable(RouterStartNode.value,RouterEndNode.value)></input>
<input type=button value="路由使能Srv" style="width:200px;height:50px;background:yellow" onclick=HMI_Ctrl_RouterEnable_By_Srv(RouterStartNode.value,RouterEndNode.value)></input>
<input type=button value="路由使能到位检测Srv" style="width:200px;height:50px;background:yellow" onclick=HMI_Ctrl_RouterEnableReachCheck_By_Srv(RouterStartNode.value,RouterEndNode.value)></input>
</p>
</form>
</tr>
<tr>
<div id="Info"></div>
</tr>
<tr>
<div id="output"></div>
</tr>
<tr>
<form>
<p><input type=text class="input" id="SetNav350CurrLayer" name=SetNav350CurrLayer></input></p>
<input type=button value="读取NAV350层号" style="width:200px;height:50px;background:yellow" onclick=HMI_Ctrl_GetNav350CurrLayer()></input>
<input type=button value="设置NAV350层号" style="width:200px;height:50px;background:yellow" onclick=HMI_Ctrl_SetNav350CurrLayer(SetNav350CurrLayer.value)></input>
</form>
</tr>
</table>
<table>
<tr>
清除偏差告警
</tr>
<tr>
<td>
<input type=button value="清除高度偏差告警" style="height:50px;background:orange" Onclick=HMI_Ctrl_ClearAltitudeDeviationErrOK_request()></input>
</td>
<td>
<input type=button id="ClearAltitudeDeviationErrOKNow" value="清除高度偏差告警Now" style="height:50px;background:orange" Onclick=HMI_Ctrl_ClearAltitudeDeviationErrOK()></input>
</td>
</tr>
<tr>
<td>
<input type=button value="清除前移偏差告警" style="height:50px;background:orange" Onclick=HMI_Ctrl_ClearGantryYDeviationErrOK_request()></input>
</td>
<td>
<input type=button id="ClearGantryYDeviationErrOKNow" value="清除前移偏差告警Now" style="height:50px;background:orange" Onclick=HMI_Ctrl_ClearGantryYDeviationErrOK()></input>
</td>
</tr>
<tr>
<td>
<input type=button value="清除侧移偏差告警" style="height:50px;background:orange" Onclick=HMI_Ctrl_ClearGantryXDeviationErrOK_request()></input>
</td>
<td>
<input type=button id="ClearGantryXDeviationErrOKNow" value="清除侧移偏差告警Now" style="height:50px;background:orange" Onclick=HMI_Ctrl_ClearGantryXDeviationErrOK()></input>
</td>
</tr>
</table>
</body>
<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();
})
</script>
</html>