2020-05-28 13:39:41 +08:00
|
|
|
var i=0;
|
|
|
|
var update = null;
|
|
|
|
function timedCount(){
|
|
|
|
|
|
|
|
onmessage = (e) => {
|
|
|
|
|
|
|
|
|
|
|
|
if(e.data == "on"){
|
2020-09-22 15:16:53 +08:00
|
|
|
// console.log("on");
|
2020-06-05 18:56:42 +08:00
|
|
|
update = setInterval("stationupdate()", 2000);
|
2020-05-28 13:39:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if(e.data == "off"){
|
|
|
|
clearInterval(update);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
function stationupdate(){
|
|
|
|
|
|
|
|
postMessage("up");
|
|
|
|
}
|
|
|
|
|
|
|
|
timedCount();
|