Adds event type as a filtering option in the Events tab

This commit is contained in:
Christopher Varner
2021-11-11 13:13:13 -05:00
committed by Dennis Sheirer
parent adfc8b2d6f
commit d246ffff30
39 changed files with 2686 additions and 452 deletions

View File

@@ -2,19 +2,24 @@
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* * ******************************************************************************
* * Copyright (C) 2014-2019 Dennis Sheirer
* *
* * This program is free software: you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation, either version 3 of the License, or
* * (at your option) any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program. If not, see <http://www.gnu.org/licenses/>
* * *****************************************************************************
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* ****************************************************************************
*/
package io.github.dsheirer.module.decode.fleetsync2;
@@ -107,13 +112,7 @@ public class Fleetsync2DecoderState extends DecoderState
case ANI:
case EMERGENCY:
case LONE_WORKER_EMERGENCY:
DecodeEvent aniEvent = DecodeEvent.builder(fleetsync.getTimestamp())
.channel(getCurrentChannel())
.eventDescription(fleetsync.getMessageType().toString())
.details(fleetsync.toString())
.identifiers(getIdentifierCollection().copyOf())
.build();
DecodeEvent aniEvent = getDecodeEvent(fleetsync, getDecodeEventType(fleetsync.getMessageType()));
broadcast(aniEvent);
broadcast(new DecoderStateEvent(this, DecoderStateEvent.Event.DECODE, State.CALL));
break;
@@ -121,18 +120,14 @@ public class Fleetsync2DecoderState extends DecoderState
case PAGING:
case STATUS:
case UNKNOWN:
DecodeEvent statusEvent = DecodeEvent.builder(fleetsync.getTimestamp())
.channel(getCurrentChannel())
.eventDescription(fleetsync.getMessageType().toString())
.details(fleetsync.toString())
.identifiers(getIdentifierCollection().copyOf())
.build();
DecodeEvent statusEvent = getDecodeEvent(fleetsync, getDecodeEventType(fleetsync.getMessageType()));
broadcast(statusEvent);
broadcast(new DecoderStateEvent(this, DecoderStateEvent.Event.DECODE, State.DATA));
break;
case GPS:
PlottableDecodeEvent plottableDecodeEvent = PlottableDecodeEvent.plottableBuilder(fleetsync.getTimestamp())
.channel(getCurrentChannel())
.eventType(DecodeEventType.GPS)
.eventDescription(DecodeEventType.GPS.toString())
.details(fleetsync.toString())
.identifiers(getIdentifierCollection().copyOf())
@@ -147,6 +142,37 @@ public class Fleetsync2DecoderState extends DecoderState
}
}
private DecodeEvent getDecodeEvent(Fleetsync2Message fleetsync, DecodeEventType eventType) {
return DecodeEvent.builder(fleetsync.getTimestamp())
.channel(getCurrentChannel())
.eventType(eventType)
.eventDescription(fleetsync.getMessageType().toString())
.details(fleetsync.toString())
.identifiers(getIdentifierCollection().copyOf())
.protocol(Protocol.FLEETSYNC)
.build();
}
private DecodeEventType getDecodeEventType(FleetsyncMessageType fleetsyncMessageType) {
switch (fleetsyncMessageType) {
case ANI:
return DecodeEventType.ID_ANI;
case EMERGENCY:
case LONE_WORKER_EMERGENCY:
return DecodeEventType.EMERGENCY;
case ACKNOWLEDGE:
return DecodeEventType.ACKNOWLEDGE;
case PAGING:
return DecodeEventType.PAGE;
case STATUS:
return DecodeEventType.STATUS;
case GPS:
return DecodeEventType.GPS;
default:
return DecodeEventType.UNKNOWN;
}
}
/**
* Responds to reset events issued by the channel state
*/