mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
492 Formatted Talkgroup and TalkgroupRange Editors (#493)
* Updates Talkgroup and Talkgroup ranges and editors to support formatted talkgroup values. * Updates talkgroup format masks to allow spaces (ie incomplete values) in talkgroup values.
This commit is contained in:
@@ -1,23 +1,28 @@
|
||||
/*******************************************************************************
|
||||
* sdr-trunk
|
||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
||||
/*
|
||||
* ******************************************************************************
|
||||
* sdrtrunk
|
||||
* 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 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.
|
||||
* 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/>
|
||||
*
|
||||
******************************************************************************/
|
||||
* 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.mpt1327.identifier;
|
||||
|
||||
import io.github.dsheirer.identifier.Role;
|
||||
import io.github.dsheirer.identifier.talkgroup.TalkgroupIdentifier;
|
||||
import io.github.dsheirer.preference.identifier.talkgroup.MPT1327TalkgroupFormatter;
|
||||
import io.github.dsheirer.protocol.Protocol;
|
||||
|
||||
/**
|
||||
@@ -40,35 +45,19 @@ public class MPT1327Talkgroup extends TalkgroupIdentifier
|
||||
}
|
||||
|
||||
/**
|
||||
* This identifier formatted as PPP-IIII where P=prefix and I=ident
|
||||
*/
|
||||
public String formatted()
|
||||
{
|
||||
return String.format("%03d-%04d", getPrefix(), getIdent());
|
||||
}
|
||||
|
||||
/**
|
||||
* Prefix for the talkgroup
|
||||
* Prefix for this talkgroup
|
||||
*/
|
||||
public int getPrefix()
|
||||
{
|
||||
return (getValue() >> 13) & 0x7F;
|
||||
return MPT1327TalkgroupFormatter.getPrefix(getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Ident for the talkgroup
|
||||
* Ident for this talkgroup
|
||||
*/
|
||||
public int getIdent()
|
||||
{
|
||||
return getValue() & 0x1FFF;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates the type of ident value
|
||||
*/
|
||||
public IdentType getIdentType()
|
||||
{
|
||||
return IdentType.fromIdent(getIdent());
|
||||
return MPT1327TalkgroupFormatter.getIdent(getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user