Files
apt-nl-map/static/Magic4/Sketch/HMI_Sketch_Left_RemoveStation_Main.html

104 lines
4.0 KiB
HTML
Raw Normal View History

2024-12-04 10:21:04 +08:00
<!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 type="text/javascript">
var RemoveStation_Sch=0;
function SketchLeftRemoveStationMainPostMessage(str){
parent.window.postMessage(
str,
"*" //or "www.parentpage.com"
);
}
function RemoveStation_Main_Init(){
RemoveStation_Sch=0;
}
function client_request_left_removestation_main(str){
window.parent.parent.postMessage(
{
event_id: 'client_request_left_removestation_main',
data: {
v1: str
}
},
"*" //or "www.parentpage.com"
);
}
function receiveMessage(event) {
//console.log(event);
if (event.data.event_id == "client_response_left_removestation_main") {
document.getElementById('LeftRemoveStationIframe').contentWindow.postMessage(
event.data
);
return;
}
var frame = event.data.split('#');
var head = frame[0].split(':');
switch (head[0]) {
case 'RemoveSingleStation':{
RemoveStation_Sch = 1;
window.open('HMI_Sketch_Left_RemoveStation_Sch1_RemoveSingleStation.html', 'LeftRemoveStationIframe');
}
break;
case 'RemoveAllStation':{
RemoveStation_Sch = 1;
window.open('HMI_Sketch_Left_RemoveStation_Sch1_RemoveAllStation.html', 'LeftRemoveStationIframe');
}
break;
case 'RemoveStationSch1_RemoveAllStation':{
var data=head[1];
if(data=="OK"){
var str="RemoveAllStation:OK#" ;
//client(str);
client_request_left_removestation_main(str);
}
RemoveStation_Main_Init();
SketchLeftRemoveStationMainPostMessage("Main");
}
break;
case 'RemoveStationSch1_RemoveSingleStation':{
var data = head[1].split(',');
NodeID = parseInt(data[0]);
var str = "CheckStationNodeID:" +
NodeID + ";";
//client(str);
client_request_left_removestation_main(str);
}
break;
case 'RemoveStationSch1_RemoveSingleStation_CheckStationOK':{
RemoveStation_Sch=2;
window.open('HMI_Sketch_Left_RemoveStation_Sch2_RemoveSingleStation.html', 'LeftRemoveStationIframe');
}
break;
case 'RemoveStationSch2_RemoveSingleStation':{
var data=head[1];
if(data=="OK"){
var str="RemoveSingleStationNodeID:" +
NodeID + ";";
//client(str);
client_request_left_removestation_main(str);
}
RemoveStation_Main_Init();
SketchLeftRemoveStationMainPostMessage("Main");
}
break;
}
}
window.addEventListener("message", receiveMessage, false);
</script>
<title>Title</title>
</head>
<body>
HMI_Sketch_Left_RemoveStation_Main
<div id='RemoveStation_Sch'> </div>
<div>
<iframe id="LeftRemoveStationIframe" name="LeftRemoveStationIframe" width=100% height=560 src="HMI_Sketch_Left_RemoveStation_Sch0.html" frameborder="2" scrolling="auto"></iframe>
</div>
</body>
<script src="../js/drag.js"></script>
</html>