mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
* WIP - Adds support for aliasing P25 Phase 2 tones.Playlist editor - adds editor support for alias actions * Playlist editor implementation and integration into application is complete. Adds JavaFX window monitoring to persist window size/location across application runs. Co-authored-by: Denny <denny@denny-desktop>
This commit is contained in:
@@ -30,6 +30,10 @@ import io.github.dsheirer.protocol.Protocol;
|
||||
*/
|
||||
public class LTRTalkgroup extends TalkgroupIdentifier implements Comparable<LTRTalkgroup>
|
||||
{
|
||||
private static final int AREA_MASK = 0x2000;
|
||||
private static final int HOME_MASK = 0x1F00;
|
||||
private static final int GROUP_MASK = 0xFF;
|
||||
|
||||
public LTRTalkgroup(Integer talkgroup, Role role)
|
||||
{
|
||||
super(talkgroup, role);
|
||||
@@ -38,7 +42,7 @@ public class LTRTalkgroup extends TalkgroupIdentifier implements Comparable<LTRT
|
||||
@Override
|
||||
public Protocol getProtocol()
|
||||
{
|
||||
return Protocol.LTR_NET;
|
||||
return Protocol.LTR;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,12 +53,17 @@ public class LTRTalkgroup extends TalkgroupIdentifier implements Comparable<LTRT
|
||||
return String.format("%02d-%03d", getHomeChannel(), getTalkgroup());
|
||||
}
|
||||
|
||||
public int getArea()
|
||||
{
|
||||
return (getValue() & AREA_MASK) >> 13;
|
||||
}
|
||||
|
||||
/**
|
||||
* Home channel for the identifier
|
||||
*/
|
||||
public int getHomeChannel()
|
||||
{
|
||||
return (getValue() >> 8) & 0x1F;
|
||||
return (getValue() & HOME_MASK) >> 8;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,17 +71,26 @@ public class LTRTalkgroup extends TalkgroupIdentifier implements Comparable<LTRT
|
||||
*/
|
||||
public int getTalkgroup()
|
||||
{
|
||||
return getValue() & 0xFF;
|
||||
return getValue() & GROUP_MASK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an LTR-Net identifier from the integer value that contains both the fleet and the ident with a TO role
|
||||
* Creates an LTR identifier from the integer value that contains both the fleet and the ident with a TO role
|
||||
*/
|
||||
public static LTRTalkgroup create(int talkgroup)
|
||||
{
|
||||
return new LTRTalkgroup(talkgroup, Role.TO);
|
||||
}
|
||||
|
||||
public static int create(int area, int home, int group)
|
||||
{
|
||||
int value = (area << 13);
|
||||
value += (home << 8);
|
||||
value += group;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(LTRTalkgroup o)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2020 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/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
package io.github.dsheirer.identifier.talkgroup;
|
||||
|
||||
import io.github.dsheirer.identifier.Role;
|
||||
import io.github.dsheirer.protocol.Protocol;
|
||||
|
||||
/**
|
||||
* Unknown (protocol) talkgroup identifier
|
||||
*/
|
||||
public class UnknownTalkgroupIdentifier extends TalkgroupIdentifier
|
||||
{
|
||||
public UnknownTalkgroupIdentifier(Integer value)
|
||||
{
|
||||
super(value, Role.TO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Protocol getProtocol()
|
||||
{
|
||||
return Protocol.UNKNOWN;
|
||||
}
|
||||
|
||||
public static UnknownTalkgroupIdentifier create(int value)
|
||||
{
|
||||
return new UnknownTalkgroupIdentifier(value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user