mirror of
https://github.com/syuilo/ai.git
synced 2025-03-25 21:12:56 +00:00
通知出すときの最大震度しきい値まわり
This commit is contained in:
parent
59cdd5849f
commit
dc3b7dd954
1 changed files with 20 additions and 17 deletions
|
@ -48,6 +48,7 @@ export default class extends Module {
|
||||||
public readonly name = "earthquake";
|
public readonly name = "earthquake";
|
||||||
private message: string = "";
|
private message: string = "";
|
||||||
|
|
||||||
|
private thresholdVal = 0; // 下の配列の添え字に相当する値。しきい値以上のものについて通知を出す。
|
||||||
private earthquakeIntensityIndex: string[] = [
|
private earthquakeIntensityIndex: string[] = [
|
||||||
"0未満",
|
"0未満",
|
||||||
"0",
|
"0",
|
||||||
|
@ -87,6 +88,7 @@ export default class extends Module {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (rawDataJSON.type == "intensity_report") {
|
if (rawDataJSON.type == "intensity_report") {
|
||||||
|
if (rawDataJSON.max_index >= this.thresholdVal) {
|
||||||
const data: 震度レポート = {
|
const data: 震度レポート = {
|
||||||
type: rawDataJSON.type,
|
type: rawDataJSON.type,
|
||||||
time: new Date(parseInt(rawDataJSON.time)),
|
time: new Date(parseInt(rawDataJSON.time)),
|
||||||
|
@ -104,6 +106,7 @@ export default class extends Module {
|
||||||
).join("\n")
|
).join("\n")
|
||||||
}`;
|
}`;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (rawDataJSON.type == "eew" && false) { // これ使わなさそうだしとりあえず入らないようにした
|
if (rawDataJSON.type == "eew" && false) { // これ使わなさそうだしとりあえず入らないようにした
|
||||||
const data: 緊急地震速報 = {
|
const data: 緊急地震速報 = {
|
||||||
type: rawDataJSON.type,
|
type: rawDataJSON.type,
|
||||||
|
|
Loading…
Reference in a new issue