Skip to content

Commit

Permalink
6.1.52
Browse files Browse the repository at this point in the history
🐞 修正
免費版沒有顯示🔒問題
  • Loading branch information
yayacat committed Nov 3, 2023
1 parent 1af20f0 commit 381a666
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 45 deletions.
94 changes: 50 additions & 44 deletions TREM.Electron/js/earthquake.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`;

Check failure on line 1698 in TREM.Electron/js/earthquake.js

View workflow job for this annotation

GitHub Actions / macOS_x64

Expected { after 'if' condition

Check failure on line 1698 in TREM.Electron/js/earthquake.js

View workflow job for this annotation

GitHub Actions / Windows_x64

Expected { after 'if' condition

Check failure on line 1698 in TREM.Electron/js/earthquake.js

View workflow job for this annotation

GitHub Actions / Linux_amd64

Expected { after 'if' condition
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 " + "⚡";

Check warning on line 1704 in TREM.Electron/js/earthquake.js

View workflow job for this annotation

GitHub Actions / macOS_x64

Expected indentation of 8 tabs but found 7

Check warning on line 1704 in TREM.Electron/js/earthquake.js

View workflow job for this annotation

GitHub Actions / Windows_x64

Expected indentation of 8 tabs but found 7

Check warning on line 1704 in TREM.Electron/js/earthquake.js

View workflow job for this annotation

GitHub Actions / Linux_amd64

Expected indentation of 8 tabs but found 7
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 {
Expand Down Expand Up @@ -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`;

Check failure on line 1914 in TREM.Electron/js/earthquake.js

View workflow job for this annotation

GitHub Actions / macOS_x64

Expected { after 'if' condition

Check failure on line 1914 in TREM.Electron/js/earthquake.js

View workflow job for this annotation

GitHub Actions / Windows_x64

Expected { after 'if' condition

Check failure on line 1914 in TREM.Electron/js/earthquake.js

View workflow job for this annotation

GitHub Actions / Linux_amd64

Expected { after 'if' condition
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 {
Expand Down
2 changes: 1 addition & 1 deletion TREM.Electron/package.json
Original file line number Diff line number Diff line change
@@ -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/",
Expand Down

0 comments on commit 381a666

Please sign in to comment.