mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-21 13:05:43 -05:00
Merge branch 'master' into #90-channel_processing_list_and_gui_reformat
# Conflicts: # src/alias/AliasList.java
This commit is contained in:
@@ -579,8 +579,12 @@ public class AliasList implements Listener<AliasEvent>
|
||||
|
||||
/**
|
||||
* Lookup alias by talkgroup
|
||||
*
|
||||
* @param tgid to use when searching for an alias
|
||||
* @param includeWildcards true if you want to additionally search for a matching alias that contains wildcard(s)
|
||||
* when there is not a direct match to the TGID.
|
||||
*/
|
||||
public Alias getTalkgroupAlias(String tgid)
|
||||
public Alias getTalkgroupAlias(String tgid, boolean includeWildcards)
|
||||
{
|
||||
Alias alias = null;
|
||||
|
||||
@@ -588,7 +592,7 @@ public class AliasList implements Listener<AliasEvent>
|
||||
{
|
||||
alias = mTalkgroup.get(tgid);
|
||||
|
||||
if(alias == null)
|
||||
if (alias == null && includeWildcards)
|
||||
{
|
||||
String wildcard = getWildcardMatch(tgid, mTalkgroupWildcards);
|
||||
|
||||
@@ -602,6 +606,14 @@ public class AliasList implements Listener<AliasEvent>
|
||||
return alias;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lookup alias by talkgroup. Defaults to matching to wildcard talkgroups.
|
||||
*/
|
||||
public Alias getTalkgroupAlias(String tgid)
|
||||
{
|
||||
return getTalkgroupAlias(tgid, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias list name
|
||||
*/
|
||||
|
||||
@@ -143,8 +143,6 @@ public class PatchGroupAlias extends Alias
|
||||
return getPatchGroupAlias().getName();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(getId().size() > 0)
|
||||
{
|
||||
for(AliasID id: getId())
|
||||
{
|
||||
@@ -154,9 +152,8 @@ public class PatchGroupAlias extends Alias
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return "PATCH";
|
||||
return "PATCH:****";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -164,16 +161,22 @@ public class PatchGroupAlias extends Alias
|
||||
{
|
||||
List<AliasAction> aliasActions = new ArrayList<>();
|
||||
|
||||
for(Alias alias: mPatchedAliases)
|
||||
{
|
||||
aliasActions.addAll(alias.getAction());
|
||||
}
|
||||
|
||||
if(hasPatchGroupAlias())
|
||||
{
|
||||
aliasActions.addAll(getPatchGroupAlias().getAction());
|
||||
}
|
||||
|
||||
for(Alias alias: mPatchedAliases)
|
||||
{
|
||||
for(AliasAction action: alias.getAction())
|
||||
{
|
||||
if(!aliasActions.contains(action))
|
||||
{
|
||||
aliasActions.add(action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return aliasActions;
|
||||
}
|
||||
|
||||
@@ -198,7 +201,7 @@ public class PatchGroupAlias extends Alias
|
||||
|
||||
for(Alias alias: mPatchedAliases)
|
||||
{
|
||||
if(alias.getCallPriority() < highestPriority)
|
||||
if(alias.hasCallPriority() && alias.getCallPriority() < highestPriority)
|
||||
{
|
||||
highestPriority = alias.getCallPriority();
|
||||
}
|
||||
|
||||
@@ -2917,8 +2917,8 @@ public class P25DecoderState extends DecoderState
|
||||
{
|
||||
PatchGroupAlias patchGroupAlias = null;
|
||||
|
||||
//Check for an existing alias for the patch talkgroup
|
||||
Alias existingAlias = getAliasList().getTalkgroupAlias(patchGroupID);
|
||||
//Check for an existing alias for the patch talkgroup - do not include wildcard aliases
|
||||
Alias existingAlias = getAliasList().getTalkgroupAlias(patchGroupID, false);
|
||||
|
||||
if(existingAlias instanceof PatchGroupAlias)
|
||||
{
|
||||
@@ -2928,6 +2928,8 @@ public class P25DecoderState extends DecoderState
|
||||
{
|
||||
patchGroupAlias = new PatchGroupAlias();
|
||||
|
||||
patchGroupAlias.addAliasID(new TalkgroupID(patchGroupID));
|
||||
|
||||
if(existingAlias != null)
|
||||
{
|
||||
getAliasList().removeAlias(existingAlias);
|
||||
@@ -2935,8 +2937,6 @@ public class P25DecoderState extends DecoderState
|
||||
patchGroupAlias.setPatchGroupAlias(existingAlias);
|
||||
}
|
||||
|
||||
patchGroupAlias.addAliasID(new TalkgroupID(patchGroupID));
|
||||
|
||||
getAliasList().addAlias(patchGroupAlias);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user