165 lines
5.7 KiB
HTML
165 lines
5.7 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">
|
|
<script src="../jquery-2.1.0.min.js"></script>
|
|
<script src="../jquery.cookie.js"></script>
|
|
<script type="text/javascript" type="text/javascript">
|
|
var SetStation_Sch=0;
|
|
var Point_rx=0;
|
|
var Point_ry=0;
|
|
var Point_rt=0;
|
|
var Point_Ref_NodeID=0;
|
|
|
|
var NodeID=0;
|
|
var NodeName="";
|
|
var FloorNum=0;
|
|
var FloorName="";
|
|
var AltitudeLoadSch1=0;
|
|
var AltitudeLoadSch2=0;
|
|
var AltitudeLoadSch3=0;
|
|
var AltitudeLoadSch4=0;
|
|
var AltitudeUnloadSch1=0;
|
|
var AltitudeUnloadSch2=0;
|
|
var AltitudeUnloadSch3=0;
|
|
var AltitudeUnloadSch4=0;
|
|
|
|
|
|
function SketchLeftSetStationMainPostMessage(str){
|
|
parent.window.postMessage(
|
|
str,
|
|
"*" //or "www.parentpage.com"
|
|
);
|
|
}
|
|
|
|
function SetStation_Main_Init(){
|
|
SetStation_Sch=0;
|
|
Point_rx=0;
|
|
Point_ry=0;
|
|
Point_rt=0;
|
|
Point_Ref_NodeID=0;
|
|
}
|
|
|
|
function client_request_left_setstation_main(str){
|
|
window.parent.parent.postMessage(
|
|
{
|
|
event_id: 'client_request_left_setstation_main',
|
|
data: {
|
|
v1: str
|
|
}
|
|
},
|
|
"*" //or "www.parentpage.com"
|
|
);
|
|
}
|
|
|
|
function receiveMessage(event){
|
|
console.log(event);
|
|
if(event.data.event_id=="client_response_left_setstation_main"){
|
|
document.getElementById('LeftSetStationIframe').contentWindow.postMessage(
|
|
event.data
|
|
);
|
|
return;
|
|
}
|
|
|
|
var frame=event.data.split('#');
|
|
var head=frame[0].split(':');
|
|
|
|
switch(head[0]){
|
|
case 'SetStationSch0':
|
|
{
|
|
var data=head[1].split(',');
|
|
Point_rx=parseFloat(data[0]);
|
|
Point_ry=parseFloat(data[1]);
|
|
Point_rt=parseFloat(data[2]);
|
|
Point_Ref_NodeID=parseInt(data[3]);
|
|
SetStation_Sch=1;
|
|
window.open('HMI_Sketch_Left_SetStation_Sch1.html', 'LeftSetStationIframe');
|
|
}break;
|
|
|
|
case 'SetStationSch1':
|
|
{
|
|
var data=head[1].split(',');
|
|
NodeID=parseInt(data[0]);
|
|
NodeName=data[1];
|
|
FloorNum=parseInt(data[2]);
|
|
FloorName=data[3];
|
|
AltitudeLoadSch1=parseInt(data[4]);
|
|
AltitudeLoadSch2=parseInt(data[5]);
|
|
AltitudeLoadSch3=parseInt(data[6]);
|
|
AltitudeLoadSch4=parseInt(data[7]);
|
|
AltitudeUnloadSch1=parseInt(data[8]);
|
|
AltitudeUnloadSch2=parseInt(data[9]);
|
|
AltitudeUnloadSch3=parseInt(data[10]);
|
|
AltitudeUnloadSch4=parseInt(data[11]);
|
|
//console.log("NodeID:"+NodeID+" NodeName:"+NodeName+" FloorNum:"+FloorNum);
|
|
SetStation_Sch=2;
|
|
window.open('HMI_Sketch_Left_SetStation_Sch2.html','LeftSetStationIframe');
|
|
/*
|
|
var str="LearnSetStation:"
|
|
+NodeID+";"
|
|
+NodeName+";"
|
|
+FloorNum+";"
|
|
+"#";
|
|
client_request_left_setstation_main(str);
|
|
*/
|
|
}break;
|
|
|
|
case 'SetStationSch2':
|
|
{
|
|
var data=head[1];
|
|
if(data=="OK"){
|
|
var str="LearnSetStation:"
|
|
+NodeID+";"
|
|
+NodeName+";"
|
|
+FloorNum+";"
|
|
+FloorName+";"
|
|
+AltitudeLoadSch1+";"
|
|
+AltitudeLoadSch2+";"
|
|
+AltitudeLoadSch3+";"
|
|
+AltitudeLoadSch4+";"
|
|
+AltitudeUnloadSch1+";"
|
|
+AltitudeUnloadSch2+";"
|
|
+AltitudeUnloadSch3+";"
|
|
+AltitudeUnloadSch4+";"
|
|
+"#";
|
|
client_request_left_setstation_main(str);
|
|
}
|
|
SetStation_Sch=3;
|
|
window.open('HMI_Sketch_Left_SetStation_Sch3.html','LeftSetStationIframe');
|
|
//SetStation_Main_Init();
|
|
//SketchLeftSetStationMainPostMessage("Main");
|
|
}break;
|
|
case 'SetStationSch3':
|
|
{
|
|
var data=head[1];
|
|
if(data=="Quit"){
|
|
SetStation_Main_Init();
|
|
SketchLeftSetStationMainPostMessage("Main");
|
|
}
|
|
}break;
|
|
}
|
|
}
|
|
window.addEventListener("message", receiveMessage, false);
|
|
|
|
function Refresh(){
|
|
|
|
}
|
|
|
|
function Timer(){
|
|
Refresh();
|
|
}
|
|
|
|
window.setInterval("Timer()",100);
|
|
</script>
|
|
<title>Title</title>
|
|
</head>
|
|
<body>
|
|
HMI_Sketch_Left_SetStation_Main
|
|
<div id='SetStation_Sch'> </div>
|
|
<div>
|
|
<iframe id="LeftSetStationIframe" name="LeftSetStationIframe" width=100% height=560 src="HMI_Sketch_Left_SetStation_Sch0.html" frameborder="2" scrolling="auto"></iframe>
|
|
</div>
|
|
</body>
|
|
<script src="../js/drag.js"></script>
|
|
</html> |