Resolves #620. Separates radio identifiers from talkgroups for APCO-25. Updates alias editor with two new options for radio id and radio id range. (#627)

This commit is contained in:
Denny Sheirer
2019-12-22 07:30:48 -05:00
committed by GitHub
parent 83e518d503
commit c658582157
208 changed files with 4490 additions and 3218 deletions

View File

@@ -44,6 +44,7 @@ public enum Form
NEIGHBOR_SITE,
NETWORK_ACCESS_CODE,
PATCH_GROUP,
RADIO,
RF_SUBSYSTEM,
SCRAMBLE_PARAMETERS,
SHORT_DATA_MESSAGE,

View File

@@ -1,21 +1,23 @@
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2018 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.identifier.patch;
@@ -45,17 +47,17 @@ public class PatchGroup
public void addPatchedGroup(TalkgroupIdentifier patchedGroupIdentifier)
{
mPatchedGroupIdentifiers.add(patchedGroupIdentifier);
if(!mPatchedGroupIdentifiers.contains(patchedGroupIdentifier))
{
mPatchedGroupIdentifiers.add(patchedGroupIdentifier);
}
}
public void addPatchedGroups(List<TalkgroupIdentifier> patchedGroupIdentifiers)
{
for(TalkgroupIdentifier identifier : patchedGroupIdentifiers)
{
if(!mPatchedGroupIdentifiers.contains(identifier))
{
mPatchedGroupIdentifiers.add(identifier);
}
addPatchedGroup(identifier);
}
}

View File

@@ -0,0 +1,53 @@
/*
*
* * ******************************************************************************
* * 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/>
* * *****************************************************************************
*
*
*/
package io.github.dsheirer.identifier.radio;
import io.github.dsheirer.identifier.Role;
/**
* Fully qualified radio identifier
*/
public abstract class FullyQualifiedRadioIdentifier extends RadioIdentifier
{
private int mWacn;
private int mSystem;
/**
* Constructs an instance
* @param wacn
* @param system
* @param id
*/
public FullyQualifiedRadioIdentifier(int wacn, int system, int id, Role role)
{
super(id, role);
mWacn = wacn;
mSystem = system;
}
@Override
public String toString()
{
return mWacn + "." + mSystem + "." + super.toString();
}
}

View File

@@ -0,0 +1,42 @@
/*
*
* * ******************************************************************************
* * 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/>
* * *****************************************************************************
*
*
*/
package io.github.dsheirer.identifier.radio;
import io.github.dsheirer.identifier.Form;
import io.github.dsheirer.identifier.IdentifierClass;
import io.github.dsheirer.identifier.Role;
import io.github.dsheirer.identifier.integer.IntegerIdentifier;
public abstract class RadioIdentifier extends IntegerIdentifier
{
public RadioIdentifier(Integer value, Role role)
{
super(value, IdentifierClass.USER, Form.RADIO, role);
}
@Override
public boolean isValid()
{
return getValue() > 0;
}
}

View File

@@ -22,14 +22,15 @@
package io.github.dsheirer.identifier.talkgroup;
import io.github.dsheirer.identifier.Role;
/**
* Fully qualified radio identifier
*/
public class FullyQualifiedIdentifier
public abstract class FullyQualifiedTalkgroupIdentifier extends TalkgroupIdentifier
{
private int mWacn;
private int mSystem;
private int mId;
/**
* Constructs an instance
@@ -37,28 +38,16 @@ public class FullyQualifiedIdentifier
* @param system
* @param id
*/
public FullyQualifiedIdentifier(int wacn, int system, int id)
public FullyQualifiedTalkgroupIdentifier(int wacn, int system, int id, Role role)
{
super(id, role);
mWacn = wacn;
mSystem = system;
mId = id;
}
@Override
public String toString()
{
return mWacn + "." + mSystem + "." + mId;
}
/**
* Creates an instance with the specified values
* @param wacn value
* @param system value
* @param id value
* @return instance
*/
public static FullyQualifiedIdentifier create(int wacn, int system, int id)
{
return new FullyQualifiedIdentifier(wacn, system, id);
return mWacn + "." + mSystem + "." + super.toString();
}
}

View File

@@ -1,21 +1,23 @@
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2018 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.identifier.talkgroup;
@@ -30,7 +32,7 @@ public class LTRTalkgroup extends TalkgroupIdentifier implements Comparable<LTRT
{
public LTRTalkgroup(Integer talkgroup, Role role)
{
super(talkgroup, role, true);
super(talkgroup, role);
}
@Override

View File

@@ -1,21 +1,23 @@
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2018 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.identifier.talkgroup;
@@ -27,12 +29,9 @@ import io.github.dsheirer.identifier.integer.IntegerIdentifier;
public abstract class TalkgroupIdentifier extends IntegerIdentifier
{
private boolean mIsGroup;
public TalkgroupIdentifier(Integer value, Role role, boolean isGroup)
public TalkgroupIdentifier(Integer value, Role role)
{
super(value, IdentifierClass.USER, Form.TALKGROUP, role);
mIsGroup = isGroup;
}
@Override
@@ -40,12 +39,4 @@ public abstract class TalkgroupIdentifier extends IntegerIdentifier
{
return getValue() > 0;
}
/**
* Indicates if this is a group or individual identifier
*/
public boolean isGroup()
{
return mIsGroup;
}
}