From 381a66681fe7e7f4da1e6e6618ca27373a47c685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E5=A4=9C?= Date: Fri, 3 Nov 2023 21:02:42 +0800 Subject: [PATCH] 6.1.52 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ๐Ÿž ไฟฎๆญฃ ๅ…่ฒป็‰ˆๆฒ’ๆœ‰้กฏ็คบ๐Ÿ”’ๅ•้กŒ --- TREM.Electron/js/earthquake.js | 94 ++++++++++++++++++---------------- TREM.Electron/package.json | 2 +- 2 files changed, 51 insertions(+), 45 deletions(-) diff --git a/TREM.Electron/js/earthquake.js b/TREM.Electron/js/earthquake.js index 63a7ee66..5858e20d 100644 --- a/TREM.Electron/js/earthquake.js +++ b/TREM.Electron/js/earthquake.js @@ -1696,29 +1696,32 @@ function PGAMain() { const t0 = Math.abs(rts_response.Time - NOW().getTime()); if (!rts_key_verify) Ping = `๐Ÿ”’ ${(t0 / 1000).toFixed(1)}s`; - else if (t0 < 1500) Ping = `โšก ${(t0 / 1000).toFixed(1)}s`; - else if (t0 < 7500) Ping = `๐Ÿ“ถ ${(t0 / 1000).toFixed(1)}s`; - else Ping = `โš ๏ธ ${(t0 / 1000).toFixed(1)}s`; + else if (rts_key_verify) { + if (t0 < 1500) Ping = `โšก ${(t0 / 1000).toFixed(1)}s`; + else if (t0 < 7500) Ping = `๐Ÿ“ถ ${(t0 / 1000).toFixed(1)}s`; + else Ping = `โš ๏ธ ${(t0 / 1000).toFixed(1)}s`; // Ping = NOW().getTime() - rts_ws_timestamp + "ms " + "โšก"; - Response = rts_response; - - if ((NOW().getTime() - rts_ws_timestamp) > 10_000 && !setting["sleep.mode"]) { - Ping = `โŒ ${((NOW().getTime() - rts_ws_timestamp) / 1000).toFixed(1)}s`; - log("PGA timer time out 10s", 2, "PGATimer", "PGAMain"); - dump({ level: 1, message: "PGA timer time out 10s", origin: "PGATimer" }); - setTimeout(() => { - reconnect(); - PGAMainbkup(); - }, 3000); - - if (Timers.rts_clock) clearInterval(Timers.rts_clock); - } else if ((NOW().getTime() - Response.Time) > 1_000 && setting["sleep.mode"]) { - stationnow = 0; - Response = {}; - Ping = "๐Ÿ’ค"; - } else if (setting["sleep.mode"]) { - Ping = "๐Ÿ’ค"; + + Response = rts_response; + + if ((NOW().getTime() - rts_ws_timestamp) > 10_000 && !setting["sleep.mode"]) { + Ping = `โŒ ${((NOW().getTime() - rts_ws_timestamp) / 1000).toFixed(1)}s`; + log("PGA timer time out 10s", 2, "PGATimer", "PGAMain"); + dump({ level: 1, message: "PGA timer time out 10s", origin: "PGATimer" }); + setTimeout(() => { + reconnect(); + PGAMainbkup(); + }, 3000); + + if (Timers.rts_clock) clearInterval(Timers.rts_clock); + } else if ((NOW().getTime() - Response.Time) > 1_000 && setting["sleep.mode"]) { + stationnow = 0; + Response = {}; + Ping = "๐Ÿ’ค"; + } else if (setting["sleep.mode"]) { + Ping = "๐Ÿ’ค"; + } } // ipcMain.emit("restart"); } else { @@ -1909,29 +1912,32 @@ function PGAMainbkup() { const t1 = Math.abs(rts_response.Time - NOW().getTime()); if (!rts_key_verify) Ping = `๐Ÿ”’ ${(t1 / 1000).toFixed(1)}s`; - else if (t1 < 1500) Ping = `โšก ${(t1 / 1000).toFixed(1)}s`; - else if (t1 < 7500) Ping = `๐Ÿ“ถ ${(t1 / 1000).toFixed(1)}s`; - else Ping = `โš ๏ธ ${(t1 / 1000).toFixed(1)}s`; - - // Ping = NOW().getTime() - rts_ws_timestamp + "ms " + "โšก"; - Response = rts_response; - - if ((NOW().getTime() - rts_ws_timestamp) > 10_000 && !setting["sleep.mode"]) { - Ping = `โŒ ${((NOW().getTime() - rts_ws_timestamp) / 1000).toFixed(1)}s`; - log("PGA timer backup time out 10s", 2, "PGATimer", "PGAMainbkup"); - dump({ level: 1, message: "PGA timer backup time out 10s", origin: "PGATimer" }); - setTimeout(() => { - reconnect(); - PGAMain(); - }, 3000); - - if (Timers.rts_clock) clearInterval(Timers.rts_clock); - } else if ((NOW().getTime() - Response.Time) > 1_000 && setting["sleep.mode"]) { - stationnow = 0; - Response = {}; - Ping = "๐Ÿ’ค"; - } else if (setting["sleep.mode"]) { - Ping = "๐Ÿ’ค"; + else if (rts_key_verify) { + if (t1 < 1500) Ping = `โšก ${(t1 / 1000).toFixed(1)}s`; + else if (t1 < 7500) Ping = `๐Ÿ“ถ ${(t1 / 1000).toFixed(1)}s`; + else Ping = `โš ๏ธ ${(t1 / 1000).toFixed(1)}s`; + + // Ping = NOW().getTime() - rts_ws_timestamp + "ms " + "โšก"; + + Response = rts_response; + + if ((NOW().getTime() - rts_ws_timestamp) > 10_000 && !setting["sleep.mode"]) { + Ping = `โŒ ${((NOW().getTime() - rts_ws_timestamp) / 1000).toFixed(1)}s`; + log("PGA timer backup time out 10s", 2, "PGATimer", "PGAMainbkup"); + dump({ level: 1, message: "PGA timer backup time out 10s", origin: "PGATimer" }); + setTimeout(() => { + reconnect(); + PGAMain(); + }, 3000); + + if (Timers.rts_clock) clearInterval(Timers.rts_clock); + } else if ((NOW().getTime() - Response.Time) > 1_000 && setting["sleep.mode"]) { + stationnow = 0; + Response = {}; + Ping = "๐Ÿ’ค"; + } else if (setting["sleep.mode"]) { + Ping = "๐Ÿ’ค"; + } } // ipcMain.emit("restart"); } else { diff --git a/TREM.Electron/package.json b/TREM.Electron/package.json index 72d2099d..f4815546 100644 --- a/TREM.Electron/package.json +++ b/TREM.Electron/package.json @@ -1,6 +1,6 @@ { "name": "tremv", - "version": "6.1.51", + "version": "6.1.52", "description": "Taiwan Real-time Earthquake Monitoring Variety ( ่‡บ็ฃๅณๆ™‚ๅœฐ้œ‡็›ฃๆธฌ่ฎŠ้ซ” )", "main": "main.js", "homepage": "https://exptech.com.tw/",