diff --git a/.idea/compiler.xml b/.idea/compiler.xml index d0a7e4b0..9c276ab9 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,9 +1,6 @@ - - - diff --git a/.idea/misc.xml b/.idea/misc.xml index 0e851262..05483570 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,10 +1,6 @@ - - - ApexVCS - - - + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 35eb1ddf..94a25f7f 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 1feb8d30..8d07e90c 100644 --- a/build.gradle +++ b/build.gradle @@ -53,7 +53,7 @@ dependencies { compile 'org.apache.mina:mina-http:2.0.16' compile 'org.apache.axis:axis-jaxrpc:1.4' compile 'org.apache.axis:axis:1.4' - + compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.3' } task wrapper(type: Wrapper) { diff --git a/src/main/java/io/github/dsheirer/alias/Alias.java b/src/main/java/io/github/dsheirer/alias/Alias.java index 90316a2b..588995cd 100644 --- a/src/main/java/io/github/dsheirer/alias/Alias.java +++ b/src/main/java/io/github/dsheirer/alias/Alias.java @@ -1,22 +1,25 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014-2016 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 ******************************************************************************/ package io.github.dsheirer.alias; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import io.github.dsheirer.alias.action.AliasAction; import io.github.dsheirer.alias.id.AliasID; import io.github.dsheirer.alias.id.AliasIDType; @@ -24,283 +27,184 @@ import io.github.dsheirer.alias.id.broadcast.BroadcastChannel; import io.github.dsheirer.alias.id.nonrecordable.NonRecordable; import io.github.dsheirer.alias.id.priority.Priority; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlTransient; import java.awt.*; import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.TreeSet; -@XmlSeeAlso( { AliasID.class, AliasAction.class } ) -@XmlRootElement( name = "alias") +@JacksonXmlRootElement(localName = "alias") public class Alias { - private String mList; - private String mGroup; - private String mName; - private int mColor; - private String mIconName; - private List mAliasIDs = new ArrayList(); - private List mAliasActions = new ArrayList(); - - public Alias() - { - } + private String mList; + private String mGroup; + private String mName; + private int mColor; + private String mIconName; + private List mAliasIDs = new ArrayList(); + private List mAliasActions = new ArrayList(); - public Alias( String name ) - { - mName = name; - } - - public String toString() - { - return getName(); - } + public Alias() + { + } - @XmlAttribute( name="name" ) - public String getName() - { - return mName; - } - - public void setName( String name ) - { - mName = name; - } + public Alias(String name) + { + mName = name; + } - @XmlAttribute( name="list" ) - public String getList() - { - return mList; - } - - public void setList( String list ) - { - mList = list; - } - - public boolean hasList() - { - return mList != null; - } + public String toString() + { + return getName(); + } - @XmlAttribute( name="group" ) - public String getGroup() - { - return mGroup; - } - - public void setGroup( String group ) - { - mGroup = group; - } - - public boolean hasGroup() - { - return mGroup != null; - } + @JacksonXmlProperty(isAttribute = true, localName = "name") + public String getName() + { + return mName; + } - @XmlAttribute - public int getColor() - { - return mColor; - } + public void setName(String name) + { + mName = name; + } - public void setColor( int color ) - { - mColor = color; - } + @JacksonXmlProperty(isAttribute = true, localName = "list") + public String getList() + { + return mList; + } - public Color getDisplayColor() - { - return new Color( getColor() ); - } - - @XmlAttribute - public String getIconName() - { - return mIconName; - } - - public void setIconName( String iconName ) - { - mIconName = iconName; - } - - @XmlElement( name="id" ) - public List getId() - { - return mAliasIDs; - } - - public void setId( ArrayList id ) - { - mAliasIDs = id; - } - - public void addAliasID( AliasID id ) - { - mAliasIDs.add( id ); - } - - public void removeAliasID( AliasID id ) - { - mAliasIDs.remove( id ); - } - - @XmlElement( name="action" ) - public List getAction() - { - return mAliasActions; - } - - public void setAction( List actions ) - { - mAliasActions = actions; - } - - public void addAliasAction( AliasAction action ) - { - mAliasActions.add( action ); - } - - public void removeAliasAction( AliasAction action ) - { - mAliasActions.remove( action ); - } - - public boolean hasActions() - { - return !mAliasActions.isEmpty(); - } + public void setList(String list) + { + mList = list; + } - /** - * Perform any validation/cleanup actions on this alias. - */ - public void validate() - { - } - /** - * Returns the priority level of this alias, if defined, or the default priority - */ - @XmlTransient - public int getCallPriority() - { - for( AliasID id: mAliasIDs ) - { - if( id.getType() == AliasIDType.PRIORITY) - { - return ((Priority)id).getPriority(); - } - } - - return Priority.DEFAULT_PRIORITY; - } - - public boolean hasCallPriority() - { - for( AliasID id: mAliasIDs ) - { - if( id.getType() == AliasIDType.PRIORITY) - { - return true; - } - } + public boolean hasList() + { + return mList != null; + } - return false; - } + @JacksonXmlProperty(isAttribute = true, localName = "group") + public String getGroup() + { + return mGroup; + } - /** - * Sets or updates the call priority - */ - public void setCallPriority( int priority ) - { - if( priority == Priority.DO_NOT_MONITOR || - ( Priority.MIN_PRIORITY <= priority && priority <= Priority.MAX_PRIORITY ) ) - { - for( AliasID id: mAliasIDs ) - { - if( id.getType() == AliasIDType.PRIORITY) - { - ((Priority)id).setPriority( priority ); - return; - } - } - - //If we don't find a priority id, create one - Priority p = new Priority(); - p.setPriority( priority ); - addAliasID( p ); - } - } + public void setGroup(String group) + { + mGroup = group; + } - /** - * Inspects the alias for a non-recordable alias id. Default is true; - */ - @XmlTransient - public boolean isRecordable() - { - for( AliasID id: getId() ) - { - if( id.getType() == AliasIDType.NON_RECORDABLE) - { - return false; - } - } - - return true; - } + public boolean hasGroup() + { + return mGroup != null; + } - /** - * Sets or removes the non-recordable alias ID for this alias. - */ - public void setRecordable( boolean recordable ) - { - if( recordable ) - { - AliasID toRemove = null; - - for( AliasID id: getId() ) - { - if( id.getType() == AliasIDType.NON_RECORDABLE) - { - toRemove = id; - break; - } - } - - if( toRemove != null ) - { - removeAliasID( toRemove ); - } - } - else - { - for( AliasID id: getId() ) - { - if( id.getType() == AliasIDType.NON_RECORDABLE) - { - return; - } - } - - addAliasID( new NonRecordable() ); - } - } + @JacksonXmlProperty(isAttribute = true, localName = "color") + public int getColor() + { + return mColor; + } + + public void setColor(int color) + { + mColor = color; + } + + @JsonIgnore + public Color getDisplayColor() + { + return new Color(getColor()); + } + + @JacksonXmlProperty(isAttribute = true, localName = "iconName") + public String getIconName() + { + return mIconName; + } + + public void setIconName(String iconName) + { + mIconName = iconName; + } + + @JacksonXmlProperty(isAttribute = false, localName = "id") + public List getId() + { + return mAliasIDs; + } + + public void setId(ArrayList id) + { + mAliasIDs = id; + } + + public void addAliasID(AliasID id) + { + mAliasIDs.add(id); + } + + public void removeAliasID(AliasID id) + { + mAliasIDs.remove(id); + } + + @JacksonXmlProperty(isAttribute = false, localName = "action") + public List getAction() + { + return mAliasActions; + } + + public void setAction(List actions) + { + mAliasActions = actions; + } + + public void addAliasAction(AliasAction action) + { + mAliasActions.add(action); + } + + public void removeAliasAction(AliasAction action) + { + mAliasActions.remove(action); + } + + public boolean hasActions() + { + return !mAliasActions.isEmpty(); + } /** - * Inspects the alias for broadcast channel/streamable alias ids. Default is false; + * Perform any validation/cleanup actions on this alias. */ - @XmlTransient - public boolean isStreamable() + public void validate() { - for( AliasID id: getId() ) + } + + /** + * Returns the priority level of this alias, if defined, or the default priority + */ + @JsonIgnore + public int getCallPriority() + { + for(AliasID id : mAliasIDs) { - if( id.getType() == AliasIDType.BROADCAST_CHANNEL) + if(id.getType() == AliasIDType.PRIORITY) + { + return ((Priority)id).getPriority(); + } + } + + return Priority.DEFAULT_PRIORITY; + } + + public boolean hasCallPriority() + { + for(AliasID id : mAliasIDs) + { + if(id.getType() == AliasIDType.PRIORITY) { return true; } @@ -310,43 +214,138 @@ public class Alias } /** - * List of broadcast channels specified for this alias. - */ - @XmlTransient - public Set getBroadcastChannels() - { - Set broadcastChannels = new TreeSet<>(); + * Sets or updates the call priority + */ + public void setCallPriority(int priority) + { + if(priority == Priority.DO_NOT_MONITOR || + (Priority.MIN_PRIORITY <= priority && priority <= Priority.MAX_PRIORITY)) + { + for(AliasID id : mAliasIDs) + { + if(id.getType() == AliasIDType.PRIORITY) + { + ((Priority)id).setPriority(priority); + return; + } + } - for(AliasID id: getId()) - { - if(id.getType() == AliasIDType.BROADCAST_CHANNEL) - { - broadcastChannels.add((BroadcastChannel)id); - } - } + //If we don't find a priority id, create one + Priority p = new Priority(); + p.setPriority(priority); + addAliasID(p); + } + } - return broadcastChannels; - } + /** + * Inspects the alias for a non-recordable alias id. Default is true; + */ + @JsonIgnore + public boolean isRecordable() + { + for(AliasID id : getId()) + { + if(id.getType() == AliasIDType.NON_RECORDABLE) + { + return false; + } + } - /** - * Indicates if this alias contains a broadcast channel alias id with the channel name. - */ - public boolean hasBroadcastChannel(String channel) - { - if(channel == null || channel.isEmpty()) - { - return false; - } + return true; + } - for(AliasID id: getId()) - { - if(id.getType() == AliasIDType.BROADCAST_CHANNEL && - ((BroadcastChannel)id).getChannelName().contentEquals(channel)) - { - return true; - } - } + /** + * Sets or removes the non-recordable alias ID for this alias. + */ + public void setRecordable(boolean recordable) + { + if(recordable) + { + AliasID toRemove = null; - return false; - } + for(AliasID id : getId()) + { + if(id.getType() == AliasIDType.NON_RECORDABLE) + { + toRemove = id; + break; + } + } + + if(toRemove != null) + { + removeAliasID(toRemove); + } + } + else + { + for(AliasID id : getId()) + { + if(id.getType() == AliasIDType.NON_RECORDABLE) + { + return; + } + } + + addAliasID(new NonRecordable()); + } + } + + /** + * Inspects the alias for broadcast channel/streamable alias ids. Default is false; + */ + @JsonIgnore + public boolean isStreamable() + { + for(AliasID id : getId()) + { + if(id.getType() == AliasIDType.BROADCAST_CHANNEL) + { + return true; + } + } + + return false; + } + + /** + * List of broadcast channels specified for this alias. + */ + @JsonIgnore + public Set getBroadcastChannels() + { + Set broadcastChannels = new TreeSet<>(); + + for(AliasID id : getId()) + { + if(id.getType() == AliasIDType.BROADCAST_CHANNEL) + { + broadcastChannels.add((BroadcastChannel)id); + } + } + + return broadcastChannels; + } + + /** + * Indicates if this alias contains a broadcast channel alias id with the channel name. + */ + public boolean hasBroadcastChannel(String channel) + { + if(channel == null || channel.isEmpty()) + { + return false; + } + + for(AliasID id : getId()) + { + if(id.getType() == AliasIDType.BROADCAST_CHANNEL && + ((BroadcastChannel)id).getChannelName().contentEquals(channel)) + { + return true; + } + } + + return false; + } } diff --git a/src/main/java/io/github/dsheirer/alias/AliasEditor.java b/src/main/java/io/github/dsheirer/alias/AliasEditor.java index 8edab474..a6df0774 100644 --- a/src/main/java/io/github/dsheirer/alias/AliasEditor.java +++ b/src/main/java/io/github/dsheirer/alias/AliasEditor.java @@ -19,12 +19,12 @@ package io.github.dsheirer.alias; import com.jidesoft.swing.JideTabbedPane; import io.github.dsheirer.alias.action.AliasActionEditor; +import io.github.dsheirer.alias.id.AliasIdentifierEditor; import io.github.dsheirer.audio.broadcast.BroadcastModel; import io.github.dsheirer.gui.editor.Editor; import io.github.dsheirer.icon.IconManager; import io.github.dsheirer.sample.Listener; import net.miginfocom.swing.MigLayout; -import io.github.dsheirer.alias.id.AliasIdentifierEditor; import javax.swing.*; import java.awt.*; diff --git a/src/main/java/io/github/dsheirer/alias/AliasFactory.java b/src/main/java/io/github/dsheirer/alias/AliasFactory.java index 7abe13c1..ad28d053 100644 --- a/src/main/java/io/github/dsheirer/alias/AliasFactory.java +++ b/src/main/java/io/github/dsheirer/alias/AliasFactory.java @@ -17,31 +17,25 @@ ******************************************************************************/ package io.github.dsheirer.alias; -import io.github.dsheirer.alias.action.AliasActionType; -import io.github.dsheirer.alias.action.clip.ClipAction; -import io.github.dsheirer.alias.id.broadcast.BroadcastChannel; -import io.github.dsheirer.alias.id.fleetsync.FleetsyncIDEditor; -import io.github.dsheirer.alias.id.lojack.LoJackIDEditor; -import io.github.dsheirer.alias.id.mdc.MDC1200ID; -import io.github.dsheirer.alias.id.priority.Priority; -import io.github.dsheirer.alias.id.siteID.SiteID; -import io.github.dsheirer.alias.id.uniqueID.UniqueIDEditor; -import io.github.dsheirer.audio.broadcast.BroadcastModel; -import io.github.dsheirer.gui.editor.Editor; -import io.github.dsheirer.gui.editor.EmptyEditor; import io.github.dsheirer.alias.action.AliasAction; +import io.github.dsheirer.alias.action.AliasActionType; import io.github.dsheirer.alias.action.beep.BeepAction; import io.github.dsheirer.alias.action.beep.BeepActionEditor; +import io.github.dsheirer.alias.action.clip.ClipAction; import io.github.dsheirer.alias.action.clip.ClipActionEditor; import io.github.dsheirer.alias.action.script.ScriptAction; import io.github.dsheirer.alias.action.script.ScriptActionEditor; import io.github.dsheirer.alias.id.AliasID; import io.github.dsheirer.alias.id.AliasIDType; +import io.github.dsheirer.alias.id.broadcast.BroadcastChannel; import io.github.dsheirer.alias.id.broadcast.BroadcastChannelEditor; import io.github.dsheirer.alias.id.esn.ESNEditor; import io.github.dsheirer.alias.id.esn.Esn; import io.github.dsheirer.alias.id.fleetsync.FleetsyncID; +import io.github.dsheirer.alias.id.fleetsync.FleetsyncIDEditor; import io.github.dsheirer.alias.id.lojack.LoJackFunctionAndID; +import io.github.dsheirer.alias.id.lojack.LoJackIDEditor; +import io.github.dsheirer.alias.id.mdc.MDC1200ID; import io.github.dsheirer.alias.id.mdc.MDC1200IDEditor; import io.github.dsheirer.alias.id.mobileID.MINEditor; import io.github.dsheirer.alias.id.mobileID.Min; @@ -49,13 +43,19 @@ import io.github.dsheirer.alias.id.mpt1327.MPT1327ID; import io.github.dsheirer.alias.id.mpt1327.MPT1327IDEditor; import io.github.dsheirer.alias.id.nonrecordable.NonRecordable; import io.github.dsheirer.alias.id.nonrecordable.NonRecordableEditor; +import io.github.dsheirer.alias.id.priority.Priority; import io.github.dsheirer.alias.id.priority.PriorityEditor; +import io.github.dsheirer.alias.id.siteID.SiteID; import io.github.dsheirer.alias.id.siteID.SiteIDEditor; import io.github.dsheirer.alias.id.status.StatusID; import io.github.dsheirer.alias.id.status.StatusIDEditor; import io.github.dsheirer.alias.id.talkgroup.TalkgroupID; import io.github.dsheirer.alias.id.talkgroup.TalkgroupIDEditor; import io.github.dsheirer.alias.id.uniqueID.UniqueID; +import io.github.dsheirer.alias.id.uniqueID.UniqueIDEditor; +import io.github.dsheirer.audio.broadcast.BroadcastModel; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.gui.editor.EmptyEditor; public class AliasFactory { diff --git a/src/main/java/io/github/dsheirer/alias/AliasList.java b/src/main/java/io/github/dsheirer/alias/AliasList.java index 448c008d..b51503bf 100644 --- a/src/main/java/io/github/dsheirer/alias/AliasList.java +++ b/src/main/java/io/github/dsheirer/alias/AliasList.java @@ -18,6 +18,7 @@ ******************************************************************************/ package io.github.dsheirer.alias; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.alias.id.AliasID; import io.github.dsheirer.alias.id.WildcardID; import io.github.dsheirer.alias.id.esn.Esn; @@ -35,7 +36,6 @@ import io.github.dsheirer.sample.Listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.xml.bind.annotation.XmlAttribute; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -625,7 +625,7 @@ public class AliasList implements Listener /** * Alias list name */ - @XmlAttribute + @JacksonXmlProperty(isAttribute = true, localName = "name") public String getName() { return mName; diff --git a/src/main/java/io/github/dsheirer/alias/MultipleAliasEditor.java b/src/main/java/io/github/dsheirer/alias/MultipleAliasEditor.java index 5d92dad0..472911fc 100644 --- a/src/main/java/io/github/dsheirer/alias/MultipleAliasEditor.java +++ b/src/main/java/io/github/dsheirer/alias/MultipleAliasEditor.java @@ -1,5 +1,6 @@ package io.github.dsheirer.alias; +import io.github.dsheirer.alias.id.AliasIDType; import io.github.dsheirer.alias.id.broadcast.BroadcastChannel; import io.github.dsheirer.alias.id.priority.Priority; import io.github.dsheirer.audio.broadcast.BroadcastModel; @@ -11,7 +12,6 @@ import io.github.dsheirer.sample.Listener; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.id.AliasIDType; import javax.swing.*; import javax.swing.event.ChangeEvent; diff --git a/src/main/java/io/github/dsheirer/alias/PatchGroupAlias.java b/src/main/java/io/github/dsheirer/alias/PatchGroupAlias.java index df2f1d14..9350fec8 100644 --- a/src/main/java/io/github/dsheirer/alias/PatchGroupAlias.java +++ b/src/main/java/io/github/dsheirer/alias/PatchGroupAlias.java @@ -20,12 +20,12 @@ package io.github.dsheirer.alias; import io.github.dsheirer.alias.action.AliasAction; import io.github.dsheirer.alias.id.AliasID; +import io.github.dsheirer.alias.id.AliasIDType; import io.github.dsheirer.alias.id.broadcast.BroadcastChannel; import io.github.dsheirer.alias.id.priority.Priority; import io.github.dsheirer.alias.id.talkgroup.TalkgroupID; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.id.AliasIDType; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/io/github/dsheirer/alias/action/AliasAction.java b/src/main/java/io/github/dsheirer/alias/action/AliasAction.java index 47dcc551..ae514992 100644 --- a/src/main/java/io/github/dsheirer/alias/action/AliasAction.java +++ b/src/main/java/io/github/dsheirer/alias/action/AliasAction.java @@ -18,41 +18,48 @@ ******************************************************************************/ package io.github.dsheirer.alias.action; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.action.beep.BeepAction; import io.github.dsheirer.alias.action.clip.ClipAction; import io.github.dsheirer.alias.action.script.ScriptAction; import io.github.dsheirer.message.Message; -import io.github.dsheirer.alias.action.beep.BeepAction; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlTransient; import java.util.concurrent.ScheduledExecutorService; /** * Alias action defines an action to execute when an alias is detected active. */ -@XmlSeeAlso( { BeepAction.class, ClipAction.class, ScriptAction.class } ) -@XmlRootElement( name = "action" ) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = BeepAction.class, name="beepAction"), + @JsonSubTypes.Type(value = ClipAction.class, name = "clipAction"), + @JsonSubTypes.Type(value = RecurringAction.class, name = "recurringAction"), + @JsonSubTypes.Type(value = ScriptAction.class, name = "scriptAction") +}) +@JacksonXmlRootElement(localName = "action") public abstract class AliasAction { - public AliasAction() - { - } + public AliasAction() + { + } - @XmlTransient - public abstract AliasActionType getType(); - - /** - * Task to execute when an alias action is defined. The message argument is - * the original message containing one or more aliases that have an alias - * action attached. The alias argument is the parent alias containing the - * alias action. - */ - public abstract void execute(ScheduledExecutorService scheduledExecutorService, Alias alias, Message message ); + @JsonIgnore + public abstract AliasActionType getType(); - /** - * Dismiss a persistent alias action - */ - public abstract void dismiss( boolean reset ); + /** + * Task to execute when an alias action is defined. The message argument is + * the original message containing one or more aliases that have an alias + * action attached. The alias argument is the parent alias containing the + * alias action. + */ + public abstract void execute(ScheduledExecutorService scheduledExecutorService, Alias alias, Message message); + + /** + * Dismiss a persistent alias action + */ + public abstract void dismiss(boolean reset); } diff --git a/src/main/java/io/github/dsheirer/alias/action/AliasActionEditor.java b/src/main/java/io/github/dsheirer/alias/action/AliasActionEditor.java index 3e6a4365..388a5ea9 100644 --- a/src/main/java/io/github/dsheirer/alias/action/AliasActionEditor.java +++ b/src/main/java/io/github/dsheirer/alias/action/AliasActionEditor.java @@ -18,13 +18,13 @@ package io.github.dsheirer.alias.action; import io.github.dsheirer.alias.Alias; -import io.github.dsheirer.gui.editor.Editor; -import io.github.dsheirer.gui.editor.EmptyEditor; -import net.miginfocom.swing.MigLayout; import io.github.dsheirer.alias.AliasEvent; import io.github.dsheirer.alias.AliasEvent.Event; import io.github.dsheirer.alias.AliasFactory; import io.github.dsheirer.alias.AliasModel; +import io.github.dsheirer.gui.editor.Editor; +import io.github.dsheirer.gui.editor.EmptyEditor; +import net.miginfocom.swing.MigLayout; import javax.swing.*; import javax.swing.event.ListSelectionEvent; diff --git a/src/main/java/io/github/dsheirer/alias/action/RecurringAction.java b/src/main/java/io/github/dsheirer/alias/action/RecurringAction.java index a6a7e297..8847eddf 100644 --- a/src/main/java/io/github/dsheirer/alias/action/RecurringAction.java +++ b/src/main/java/io/github/dsheirer/alias/action/RecurringAction.java @@ -1,11 +1,11 @@ package io.github.dsheirer.alias.action; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.alias.Alias; import io.github.dsheirer.message.Message; import javax.swing.*; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlTransient; import java.awt.*; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; @@ -14,11 +14,11 @@ import java.util.concurrent.atomic.AtomicBoolean; public abstract class RecurringAction extends AliasAction { - @XmlTransient + @JsonIgnore protected AtomicBoolean mRunning = new AtomicBoolean(false); - @XmlTransient + @JsonIgnore private ScheduledFuture mPerpetualAction; - @XmlTransient + @JsonIgnore protected ScheduledExecutorService mScheduledExecutorService; protected Interval mInterval = Interval.ONCE; @@ -107,7 +107,7 @@ public abstract class RecurringAction extends AliasAction } } - @XmlAttribute + @JacksonXmlProperty(isAttribute = true, localName = "period") public int getPeriod() { return mPeriod; @@ -118,7 +118,7 @@ public abstract class RecurringAction extends AliasAction mPeriod = period; } - @XmlAttribute + @JacksonXmlProperty(isAttribute = true, localName = "interval") public Interval getInterval() { return mInterval; @@ -164,8 +164,8 @@ public abstract class RecurringAction extends AliasAction @Override public void run() { - /* Don't use the performThreadedAction() method, since this is - * already running in a separate thread */ + /* Don't use the performThreadedAction() method, since this is + * already running in a separate thread */ performAction(mAlias, mMessage); } } diff --git a/src/main/java/io/github/dsheirer/alias/action/beep/BeepAction.java b/src/main/java/io/github/dsheirer/alias/action/beep/BeepAction.java index dd7ee6a7..6a0717ac 100644 --- a/src/main/java/io/github/dsheirer/alias/action/beep/BeepAction.java +++ b/src/main/java/io/github/dsheirer/alias/action/beep/BeepAction.java @@ -1,5 +1,6 @@ package io.github.dsheirer.alias.action.beep; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.alias.Alias; import io.github.dsheirer.alias.action.AliasActionType; import io.github.dsheirer.alias.action.RecurringAction; @@ -8,6 +9,7 @@ import io.github.dsheirer.message.Message; public class BeepAction extends RecurringAction { + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") @Override public AliasActionType getType() { diff --git a/src/main/java/io/github/dsheirer/alias/action/clip/ClipAction.java b/src/main/java/io/github/dsheirer/alias/action/clip/ClipAction.java index bbceb9a7..15807304 100644 --- a/src/main/java/io/github/dsheirer/alias/action/clip/ClipAction.java +++ b/src/main/java/io/github/dsheirer/alias/action/clip/ClipAction.java @@ -1,107 +1,109 @@ package io.github.dsheirer.alias.action.clip; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.alias.Alias; import io.github.dsheirer.alias.action.AliasActionType; +import io.github.dsheirer.alias.action.RecurringAction; import io.github.dsheirer.message.Message; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.action.RecurringAction; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Clip; -import javax.xml.bind.annotation.XmlTransient; import java.io.File; public class ClipAction extends RecurringAction { - private final static Logger mLog = LoggerFactory.getLogger( ClipAction.class ); + private final static Logger mLog = LoggerFactory.getLogger(ClipAction.class); - private String mFilePath; + private String mFilePath; - @XmlTransient - private Clip mClip; - - public ClipAction() - { - } - - @Override - public AliasActionType getType() - { - return AliasActionType.CLIP; - } + @JsonIgnore + private Clip mClip; - public String getPath() - { - return mFilePath; - } - - public void setPath( String path ) - { - mFilePath = path; - } - - @Override - public void performAction(Alias alias, Message message ) - { - try - { - play(); - } - catch( Exception e ) - { - mLog.error( "Couldn't play audio clip", e ); - } - } - - public void play() throws Exception - { - try - { - if( mFilePath != null ) - { - if( mClip == null ) - { - mClip = AudioSystem.getClip(); - - AudioInputStream ais = - AudioSystem.getAudioInputStream( new File( mFilePath ) ); - - mClip.open( ais ); - } + public ClipAction() + { + } - if( mClip.isRunning() ) - { - mClip.stop(); - } - - mClip.setFramePosition( 0 ); - - mClip.start(); - } - } - catch( Exception e ) - { - mClip = null; + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override + public AliasActionType getType() + { + return AliasActionType.CLIP; + } - mLog.error( "Error playing sound clip [" + mFilePath + "] - " + e.getMessage() ); - - throw e; - } - } - + public String getPath() + { + return mFilePath; + } - @Override - public String toString() - { - if( mFilePath == null ) - { - return "Play Clip"; - } - else - { - return "Play Clip: " + mFilePath; - } - } + public void setPath(String path) + { + mFilePath = path; + } + + @Override + public void performAction(Alias alias, Message message) + { + try + { + play(); + } + catch(Exception e) + { + mLog.error("Couldn't play audio clip", e); + } + } + + public void play() throws Exception + { + try + { + if(mFilePath != null) + { + if(mClip == null) + { + mClip = AudioSystem.getClip(); + + AudioInputStream ais = + AudioSystem.getAudioInputStream(new File(mFilePath)); + + mClip.open(ais); + } + + if(mClip.isRunning()) + { + mClip.stop(); + } + + mClip.setFramePosition(0); + + mClip.start(); + } + } + catch(Exception e) + { + mClip = null; + + mLog.error("Error playing sound clip [" + mFilePath + "] - " + e.getMessage()); + + throw e; + } + } + + + @Override + public String toString() + { + if(mFilePath == null) + { + return "Play Clip"; + } + else + { + return "Play Clip: " + mFilePath; + } + } } diff --git a/src/main/java/io/github/dsheirer/alias/action/script/ScriptAction.java b/src/main/java/io/github/dsheirer/alias/action/script/ScriptAction.java index 7285cff7..9aa920c2 100644 --- a/src/main/java/io/github/dsheirer/alias/action/script/ScriptAction.java +++ b/src/main/java/io/github/dsheirer/alias/action/script/ScriptAction.java @@ -1,96 +1,98 @@ package io.github.dsheirer.alias.action.script; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.alias.Alias; import io.github.dsheirer.alias.action.AliasActionType; +import io.github.dsheirer.alias.action.RecurringAction; import io.github.dsheirer.message.Message; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.action.RecurringAction; import java.io.BufferedReader; import java.io.InputStreamReader; public class ScriptAction extends RecurringAction { - private final static Logger mLog = LoggerFactory.getLogger( ScriptAction.class ); + private final static Logger mLog = LoggerFactory.getLogger(ScriptAction.class); - private String mScript; + private String mScript; - public ScriptAction() - { - } - - @Override - public AliasActionType getType() - { - return AliasActionType.SCRIPT; - } + public ScriptAction() + { + } - public String getScript() - { - return mScript; - } - - public void setScript( String script ) - { - mScript = script; - } - - @Override - public void performAction(Alias alias, Message message ) - { - try - { - play(); - } - catch( Exception e ) - { - mLog.error( "Couldn't execute script [" + mScript + "]", e ); - } - } - - public void play() throws Exception - { - if( mScript != null ) - { - ProcessBuilder pb = new ProcessBuilder( mScript ); - - pb.redirectErrorStream( true ); + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override + public AliasActionType getType() + { + return AliasActionType.SCRIPT; + } - Process p = pb.start(); - - int exitCode = p.waitFor(); - - BufferedReader reader = new BufferedReader( - new InputStreamReader( p.getInputStream() ) ); + public String getScript() + { + return mScript; + } - String line = ""; + public void setScript(String script) + { + mScript = script; + } + + @Override + public void performAction(Alias alias, Message message) + { + try + { + play(); + } + catch(Exception e) + { + mLog.error("Couldn't execute script [" + mScript + "]", e); + } + } + + public void play() throws Exception + { + if(mScript != null) + { + ProcessBuilder pb = new ProcessBuilder(mScript); + + pb.redirectErrorStream(true); + + Process p = pb.start(); + + int exitCode = p.waitFor(); + + BufferedReader reader = new BufferedReader( + new InputStreamReader(p.getInputStream())); + + String line = ""; StringBuilder sb = new StringBuilder(); - - while( ( line = reader.readLine() ) != null ) + + while((line = reader.readLine()) != null) { - sb.append(line + "\n"); + sb.append(line + "\n"); } - - if( exitCode != 0 ) + + if(exitCode != 0) { - throw new RuntimeException( "Exit Code: " + exitCode + - " Console:" + sb.toString() ); + throw new RuntimeException("Exit Code: " + exitCode + + " Console:" + sb.toString()); } - } - } - - @Override - public String toString() - { - if( mScript == null ) - { - return "Run Script"; - } - else - { - return "Run Script: " + mScript; - } - } + } + } + + @Override + public String toString() + { + if(mScript == null) + { + return "Run Script"; + } + else + { + return "Run Script: " + mScript; + } + } } diff --git a/src/main/java/io/github/dsheirer/alias/id/AliasID.java b/src/main/java/io/github/dsheirer/alias/id/AliasID.java index 60b9348f..0534f4a2 100644 --- a/src/main/java/io/github/dsheirer/alias/id/AliasID.java +++ b/src/main/java/io/github/dsheirer/alias/id/AliasID.java @@ -17,6 +17,10 @@ ******************************************************************************/ package io.github.dsheirer.alias.id; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import io.github.dsheirer.alias.id.broadcast.BroadcastChannel; import io.github.dsheirer.alias.id.esn.Esn; import io.github.dsheirer.alias.id.fleetsync.FleetsyncID; @@ -30,28 +34,35 @@ import io.github.dsheirer.alias.id.siteID.SiteID; import io.github.dsheirer.alias.id.status.StatusID; import io.github.dsheirer.alias.id.talkgroup.TalkgroupID; import io.github.dsheirer.alias.id.uniqueID.UniqueID; -import io.github.dsheirer.playlist.version1.Group; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlTransient; - -@SuppressWarnings( "deprecation" ) -@XmlSeeAlso( {BroadcastChannel.class, Esn.class, FleetsyncID.class, Group.class, LoJackFunctionAndID.class, - MDC1200ID.class, Min.class, MPT1327ID.class, NonRecordable.class, - Priority.class, SiteID.class, StatusID.class, TalkgroupID.class, - UniqueID.class } ) -@XmlRootElement( name = "id" ) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include= JsonTypeInfo.As.PROPERTY, property="type") +@JsonSubTypes({ + @JsonSubTypes.Type(value=BroadcastChannel.class, name="broadcastChannel"), + @JsonSubTypes.Type(value=Esn.class, name="esn"), + @JsonSubTypes.Type(value=FleetsyncID.class, name="fleetsyncID"), + @JsonSubTypes.Type(value = LoJackFunctionAndID.class, name = "loJackFunctionAndID"), + @JsonSubTypes.Type(value = MDC1200ID.class, name = "mdc1200ID"), + @JsonSubTypes.Type(value = Min.class, name = "min"), + @JsonSubTypes.Type(value = MPT1327ID.class, name = "mpt1327ID"), + @JsonSubTypes.Type(value = NonRecordable.class, name = "nonRecordable"), + @JsonSubTypes.Type(value = Priority.class, name = "priority"), + @JsonSubTypes.Type(value = SiteID.class, name = "siteID"), + @JsonSubTypes.Type(value = StatusID.class, name = "statusID"), + @JsonSubTypes.Type(value = TalkgroupID.class, name = "talkgroupID"), + @JsonSubTypes.Type(value = UniqueID.class, name = "uniqueID") +}) +@JacksonXmlRootElement( localName = "id" ) public abstract class AliasID { public AliasID() { } - + + @JsonIgnore public abstract AliasIDType getType(); public abstract boolean matches( AliasID id ); - @XmlTransient + @JsonIgnore public abstract boolean isValid(); } diff --git a/src/main/java/io/github/dsheirer/alias/id/broadcast/BroadcastChannel.java b/src/main/java/io/github/dsheirer/alias/id/broadcast/BroadcastChannel.java index 97f5ed77..d3aec77c 100644 --- a/src/main/java/io/github/dsheirer/alias/id/broadcast/BroadcastChannel.java +++ b/src/main/java/io/github/dsheirer/alias/id/broadcast/BroadcastChannel.java @@ -18,11 +18,10 @@ ******************************************************************************/ package io.github.dsheirer.alias.id.broadcast; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.alias.id.AliasID; import io.github.dsheirer.alias.id.AliasIDType; -import javax.xml.bind.annotation.XmlAttribute; - public class BroadcastChannel extends AliasID implements Comparable { private String mChannelName; @@ -83,7 +82,7 @@ public class BroadcastChannel extends AliasID implements Comparable ******************************************************************************/ package io.github.dsheirer.alias.id.lojack; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.alias.id.AliasID; import io.github.dsheirer.alias.id.AliasIDType; import io.github.dsheirer.module.decode.lj1200.LJ1200Message; -import javax.xml.bind.annotation.XmlAttribute; - public class LoJackFunctionAndID extends AliasID { - private LJ1200Message.Function mFunction = LJ1200Message.Function.F0_UNKNOWN; - private String mID = "*****"; - - public LoJackFunctionAndID() - { - } + private LJ1200Message.Function mFunction = LJ1200Message.Function.F0_UNKNOWN; + private String mID = "*****"; - @XmlAttribute( name="id" ) - public String getID() - { - return mID; - } - - public void setID( String id ) - { - mID = id; - } - - @XmlAttribute( name="function" ) - public LJ1200Message.Function getFunction() - { - return mFunction; - } - - public void setFunction( LJ1200Message.Function function ) - { - mFunction = function; - } - - @Override - public boolean isValid() - { - return mFunction != null && mID != null; - } - - public String toString() - { - return "LoJack FUNC: " + mFunction.getLabel() + " ID:" + ( mID == null ? "" : mID ); - } - - /** - * Indicates if the function and id combination match this alias id - */ - public boolean matches(LJ1200Message.Function function, String id ) - { - return mFunction == function && - mID != null && - id != null && - id.matches( mID.replace( "*", ".?" ) ); - } - - @Override - public boolean matches( AliasID id ) + public LoJackFunctionAndID() { - boolean retVal = false; - - if( mID != null && id instanceof LoJackFunctionAndID ) - { - LoJackFunctionAndID otherLojack = (LoJackFunctionAndID)id; - - if( otherLojack.getFunction() == mFunction ) - { - //Create a pattern - replace * wildcards with regex single-char wildcard - String pattern = mID.replace( "*", ".?" ); - - retVal = otherLojack.getID().matches( pattern ); - } - } - - return retVal; } - @Override + @JacksonXmlProperty(isAttribute = true, localName = "id") + public String getID() + { + return mID; + } + + public void setID(String id) + { + mID = id; + } + + @JacksonXmlProperty(isAttribute = true, localName = "function") + public LJ1200Message.Function getFunction() + { + return mFunction; + } + + public void setFunction(LJ1200Message.Function function) + { + mFunction = function; + } + + @Override + public boolean isValid() + { + return mFunction != null && mID != null; + } + + public String toString() + { + return "LoJack FUNC: " + mFunction.getLabel() + " ID:" + (mID == null ? "" : mID); + } + + /** + * Indicates if the function and id combination match this alias id + */ + public boolean matches(LJ1200Message.Function function, String id) + { + return mFunction == function && + mID != null && + id != null && + id.matches(mID.replace("*", ".?")); + } + + @Override + public boolean matches(AliasID id) + { + boolean retVal = false; + + if(mID != null && id instanceof LoJackFunctionAndID) + { + LoJackFunctionAndID otherLojack = (LoJackFunctionAndID)id; + + if(otherLojack.getFunction() == mFunction) + { + //Create a pattern - replace * wildcards with regex single-char wildcard + String pattern = mID.replace("*", ".?"); + + retVal = otherLojack.getID().matches(pattern); + } + } + + return retVal; + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override public AliasIDType getType() { - return AliasIDType.LOJACK; + return AliasIDType.LOJACK; } - - @Override - public int hashCode() - { - final int prime = 31; - int result = 1; - result = prime * result - + ( ( mFunction == null ) ? 0 : mFunction.hashCode() ); - result = prime * result + ( ( mID == null ) ? 0 : mID.hashCode() ); - return result; - } - @Override - public boolean equals( Object obj ) - { - if ( this == obj ) - return true; - if ( obj == null ) - return false; - if ( getClass() != obj.getClass() ) - return false; - LoJackFunctionAndID other = (LoJackFunctionAndID) obj; - if ( mFunction != other.mFunction ) - return false; - if ( mID == null ) - { - if ( other.mID != null ) - return false; - } else if ( !mID.equals( other.mID ) ) - return false; - return true; - } + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + + ((mFunction == null) ? 0 : mFunction.hashCode()); + result = prime * result + ((mID == null) ? 0 : mID.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) + { + if(this == obj) + { + return true; + } + if(obj == null) + { + return false; + } + if(getClass() != obj.getClass()) + { + return false; + } + LoJackFunctionAndID other = (LoJackFunctionAndID)obj; + if(mFunction != other.mFunction) + { + return false; + } + if(mID == null) + { + if(other.mID != null) + { + return false; + } + } + else if(!mID.equals(other.mID)) + { + return false; + } + return true; + } } diff --git a/src/main/java/io/github/dsheirer/alias/id/lojack/LoJackIDEditor.java b/src/main/java/io/github/dsheirer/alias/id/lojack/LoJackIDEditor.java index 93266193..85e9fc8e 100644 --- a/src/main/java/io/github/dsheirer/alias/id/lojack/LoJackIDEditor.java +++ b/src/main/java/io/github/dsheirer/alias/id/lojack/LoJackIDEditor.java @@ -17,11 +17,11 @@ ******************************************************************************/ package io.github.dsheirer.alias.id.lojack; -import io.github.dsheirer.gui.editor.DocumentListenerEditor; -import net.miginfocom.swing.MigLayout; import io.github.dsheirer.alias.id.AliasID; +import io.github.dsheirer.gui.editor.DocumentListenerEditor; import io.github.dsheirer.module.decode.lj1200.LJ1200Message; import io.github.dsheirer.module.decode.lj1200.LJ1200Message.Function; +import net.miginfocom.swing.MigLayout; import javax.swing.*; import javax.swing.text.MaskFormatter; diff --git a/src/main/java/io/github/dsheirer/alias/id/mdc/MDC1200ID.java b/src/main/java/io/github/dsheirer/alias/id/mdc/MDC1200ID.java index 5d4e2767..e8f50df7 100644 --- a/src/main/java/io/github/dsheirer/alias/id/mdc/MDC1200ID.java +++ b/src/main/java/io/github/dsheirer/alias/id/mdc/MDC1200ID.java @@ -1,80 +1,79 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.alias.id.mdc; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.alias.id.AliasID; import io.github.dsheirer.alias.id.AliasIDType; -import javax.xml.bind.annotation.XmlAttribute; - - public class MDC1200ID extends AliasID { - private String mID; - - public MDC1200ID() - { - } + private String mID; - @XmlAttribute - public String getIdent() - { - return mID; - } - - public void setIdent( String ident ) - { - mID = ident; - } - - @Override - public boolean isValid() - { - return mID != null; - } - - public String toString() - { - return "MDC-1200: " + mID; - } - - @Override - public boolean matches( AliasID id ) + public MDC1200ID() { - boolean retVal = false; - - if( mID != null && id instanceof MDC1200ID ) - { - MDC1200ID tgid = (MDC1200ID)id; - - //Create a pattern - replace * wildcards with regex single-char wildcard - String pattern = mID.replace( "*", ".?" ); - - retVal = tgid.getIdent().matches( pattern ); - } - - return retVal; } - @Override + @JacksonXmlProperty(isAttribute = true, localName = "ident") + public String getIdent() + { + return mID; + } + + public void setIdent(String ident) + { + mID = ident; + } + + @Override + public boolean isValid() + { + return mID != null; + } + + public String toString() + { + return "MDC-1200: " + mID; + } + + @Override + public boolean matches(AliasID id) + { + boolean retVal = false; + + if(mID != null && id instanceof MDC1200ID) + { + MDC1200ID tgid = (MDC1200ID)id; + + //Create a pattern - replace * wildcards with regex single-char wildcard + String pattern = mID.replace("*", ".?"); + + retVal = tgid.getIdent().matches(pattern); + } + + return retVal; + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override public AliasIDType getType() { - return AliasIDType.MDC1200; + return AliasIDType.MDC1200; } } diff --git a/src/main/java/io/github/dsheirer/alias/id/mdc/MDC1200IDEditor.java b/src/main/java/io/github/dsheirer/alias/id/mdc/MDC1200IDEditor.java index 64a5b9e6..e688421e 100644 --- a/src/main/java/io/github/dsheirer/alias/id/mdc/MDC1200IDEditor.java +++ b/src/main/java/io/github/dsheirer/alias/id/mdc/MDC1200IDEditor.java @@ -17,9 +17,9 @@ ******************************************************************************/ package io.github.dsheirer.alias.id.mdc; +import io.github.dsheirer.alias.id.AliasID; import io.github.dsheirer.gui.editor.DocumentListenerEditor; import net.miginfocom.swing.MigLayout; -import io.github.dsheirer.alias.id.AliasID; import javax.swing.*; import javax.swing.text.MaskFormatter; diff --git a/src/main/java/io/github/dsheirer/alias/id/mobileID/Min.java b/src/main/java/io/github/dsheirer/alias/id/mobileID/Min.java index 3288b9fd..aec0eb72 100644 --- a/src/main/java/io/github/dsheirer/alias/id/mobileID/Min.java +++ b/src/main/java/io/github/dsheirer/alias/id/mobileID/Min.java @@ -1,82 +1,82 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.alias.id.mobileID; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.alias.id.AliasID; import io.github.dsheirer.alias.id.AliasIDType; -import javax.xml.bind.annotation.XmlAttribute; - /** * Mobile ID Number */ public class Min extends AliasID { - private String mMin; - - public Min() - { - } + private String mMin; - @XmlAttribute - public String getMin() - { - return mMin; - } - - public void setMin( String min ) - { - mMin = min; - } - - @Override - public boolean isValid() - { - return mMin != null; - } - - public String toString() - { - return "MIN: " + mMin; - } - - @Override - public boolean matches( AliasID id ) + public Min() { - boolean retVal = false; - - if( mMin != null && id instanceof Min ) - { - Min min = (Min)id; - - //Create a pattern - replace * wildcards with regex single-char wildcard - String pattern = mMin.replace( "*", ".?" ); - - retVal = min.getMin().matches( pattern ); - } - - return retVal; } - @Override + @JacksonXmlProperty(isAttribute = true, localName = "min") + public String getMin() + { + return mMin; + } + + public void setMin(String min) + { + mMin = min; + } + + @Override + public boolean isValid() + { + return mMin != null; + } + + public String toString() + { + return "MIN: " + mMin; + } + + @Override + public boolean matches(AliasID id) + { + boolean retVal = false; + + if(mMin != null && id instanceof Min) + { + Min min = (Min)id; + + //Create a pattern - replace * wildcards with regex single-char wildcard + String pattern = mMin.replace("*", ".?"); + + retVal = min.getMin().matches(pattern); + } + + return retVal; + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override public AliasIDType getType() { - return AliasIDType.MIN; + return AliasIDType.MIN; } } diff --git a/src/main/java/io/github/dsheirer/alias/id/mpt1327/MPT1327ID.java b/src/main/java/io/github/dsheirer/alias/id/mpt1327/MPT1327ID.java index 336d2eb1..53208bbb 100644 --- a/src/main/java/io/github/dsheirer/alias/id/mpt1327/MPT1327ID.java +++ b/src/main/java/io/github/dsheirer/alias/id/mpt1327/MPT1327ID.java @@ -1,79 +1,79 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.alias.id.mpt1327; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.alias.id.AliasID; import io.github.dsheirer.alias.id.AliasIDType; -import javax.xml.bind.annotation.XmlAttribute; - public class MPT1327ID extends AliasID { - private String mID; - - public MPT1327ID() - { - } + private String mID; - @XmlAttribute - public String getIdent() - { - return mID; - } - - public void setIdent( String ident ) - { - mID = ident; - } - - @Override - public boolean isValid() - { - return mID != null; - } - - public String toString() - { - return "MPT-1327: " + mID; - } - - @Override - public boolean matches( AliasID id ) + public MPT1327ID() { - boolean retVal = false; - - if( mID != null && id instanceof MPT1327ID ) - { - MPT1327ID tgid = (MPT1327ID)id; - - //Create a pattern - replace * wildcards with regex single-char wildcard - String pattern = mID.replace( "*", ".?" ); - - retVal = tgid.getIdent().matches( pattern ); - } - - return retVal; } - @Override + @JacksonXmlProperty(isAttribute = true, localName = "ident") + public String getIdent() + { + return mID; + } + + public void setIdent(String ident) + { + mID = ident; + } + + @Override + public boolean isValid() + { + return mID != null; + } + + public String toString() + { + return "MPT-1327: " + mID; + } + + @Override + public boolean matches(AliasID id) + { + boolean retVal = false; + + if(mID != null && id instanceof MPT1327ID) + { + MPT1327ID tgid = (MPT1327ID)id; + + //Create a pattern - replace * wildcards with regex single-char wildcard + String pattern = mID.replace("*", ".?"); + + retVal = tgid.getIdent().matches(pattern); + } + + return retVal; + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override public AliasIDType getType() { - return AliasIDType.MPT1327; + return AliasIDType.MPT1327; } } diff --git a/src/main/java/io/github/dsheirer/alias/id/mpt1327/MPT1327IDEditor.java b/src/main/java/io/github/dsheirer/alias/id/mpt1327/MPT1327IDEditor.java index 53a8e9b4..6ce3ccad 100644 --- a/src/main/java/io/github/dsheirer/alias/id/mpt1327/MPT1327IDEditor.java +++ b/src/main/java/io/github/dsheirer/alias/id/mpt1327/MPT1327IDEditor.java @@ -17,9 +17,9 @@ ******************************************************************************/ package io.github.dsheirer.alias.id.mpt1327; +import io.github.dsheirer.alias.id.AliasID; import io.github.dsheirer.gui.editor.DocumentListenerEditor; import net.miginfocom.swing.MigLayout; -import io.github.dsheirer.alias.id.AliasID; import javax.swing.*; import javax.swing.text.MaskFormatter; diff --git a/src/main/java/io/github/dsheirer/alias/id/nonrecordable/NonRecordable.java b/src/main/java/io/github/dsheirer/alias/id/nonrecordable/NonRecordable.java index 889e3206..b6a2fcb9 100644 --- a/src/main/java/io/github/dsheirer/alias/id/nonrecordable/NonRecordable.java +++ b/src/main/java/io/github/dsheirer/alias/id/nonrecordable/NonRecordable.java @@ -1,31 +1,33 @@ package io.github.dsheirer.alias.id.nonrecordable; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.alias.id.AliasID; import io.github.dsheirer.alias.id.AliasIDType; public class NonRecordable extends AliasID { - @Override - public AliasIDType getType() - { - return AliasIDType.NON_RECORDABLE; - } + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override + public AliasIDType getType() + { + return AliasIDType.NON_RECORDABLE; + } - @Override - public boolean isValid() - { - return true; - } + @Override + public boolean isValid() + { + return true; + } - @Override - public boolean matches( AliasID id ) - { - return false; - } - - @Override - public String toString() - { - return "Audio Non-Recordable"; - } + @Override + public boolean matches(AliasID id) + { + return false; + } + + @Override + public String toString() + { + return "Audio Non-Recordable"; + } } diff --git a/src/main/java/io/github/dsheirer/alias/id/nonrecordable/NonRecordableEditor.java b/src/main/java/io/github/dsheirer/alias/id/nonrecordable/NonRecordableEditor.java index 23e9e936..02726cc9 100644 --- a/src/main/java/io/github/dsheirer/alias/id/nonrecordable/NonRecordableEditor.java +++ b/src/main/java/io/github/dsheirer/alias/id/nonrecordable/NonRecordableEditor.java @@ -17,9 +17,9 @@ ******************************************************************************/ package io.github.dsheirer.alias.id.nonrecordable; +import io.github.dsheirer.alias.id.AliasID; import io.github.dsheirer.gui.editor.DocumentListenerEditor; import net.miginfocom.swing.MigLayout; -import io.github.dsheirer.alias.id.AliasID; import javax.swing.*; import java.awt.*; diff --git a/src/main/java/io/github/dsheirer/alias/id/priority/Priority.java b/src/main/java/io/github/dsheirer/alias/id/priority/Priority.java index 2d3520ae..6184c8ff 100644 --- a/src/main/java/io/github/dsheirer/alias/id/priority/Priority.java +++ b/src/main/java/io/github/dsheirer/alias/id/priority/Priority.java @@ -1,83 +1,85 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.alias.id.priority; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.alias.id.AliasID; import io.github.dsheirer.alias.id.AliasIDType; -import javax.xml.bind.annotation.XmlAttribute; - /** * Specifies an (audio) priority level for this alias. */ public class Priority extends AliasID { - public static final int DO_NOT_MONITOR = -1; - public static final int SELECTED_PRIORITY = 0; - public static final int MIN_PRIORITY = 1; - public static final int MAX_PRIORITY = 100; - public static final int DEFAULT_PRIORITY = 100; - - private int mPriority = DEFAULT_PRIORITY; - - public Priority() - { - } + public static final int DO_NOT_MONITOR = -1; + public static final int SELECTED_PRIORITY = 0; + public static final int MIN_PRIORITY = 1; + public static final int MAX_PRIORITY = 100; + public static final int DEFAULT_PRIORITY = 100; - @Override - public boolean isValid() - { - return true; - } + private int mPriority = DEFAULT_PRIORITY; - /** - * Indicates the associated alias should not be monitored or tracked. - */ - public boolean isDoNotMonitor() - { - return mPriority == DO_NOT_MONITOR; - } - - @XmlAttribute - public int getPriority() - { - return mPriority; - } - - public void setPriority( int priority ) - { - mPriority = priority; - } - - public String toString() - { - return "Audio Priority: " + ( isDoNotMonitor() ? "Do Not Monitor" : mPriority ); - } - - @Override - public boolean matches( AliasID id ) + public Priority() { - return false; } - @Override + @Override + public boolean isValid() + { + return true; + } + + /** + * Indicates the associated alias should not be monitored or tracked. + */ + @JsonIgnore + public boolean isDoNotMonitor() + { + return mPriority == DO_NOT_MONITOR; + } + + @JacksonXmlProperty(isAttribute = true, localName = "priority") + public int getPriority() + { + return mPriority; + } + + public void setPriority(int priority) + { + mPriority = priority; + } + + public String toString() + { + return "Audio Priority: " + (isDoNotMonitor() ? "Do Not Monitor" : mPriority); + } + + @Override + public boolean matches(AliasID id) + { + return false; + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override public AliasIDType getType() { - return AliasIDType.PRIORITY; + return AliasIDType.PRIORITY; } } diff --git a/src/main/java/io/github/dsheirer/alias/id/siteID/SiteID.java b/src/main/java/io/github/dsheirer/alias/id/siteID/SiteID.java index 601b2308..acf3016e 100644 --- a/src/main/java/io/github/dsheirer/alias/id/siteID/SiteID.java +++ b/src/main/java/io/github/dsheirer/alias/id/siteID/SiteID.java @@ -1,70 +1,68 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.alias.id.siteID; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.alias.id.AliasID; import io.github.dsheirer.alias.id.AliasIDType; -import io.github.dsheirer.alias.id.AliasID; -import io.github.dsheirer.alias.id.AliasIDType; - -import javax.xml.bind.annotation.XmlAttribute; public class SiteID extends AliasID { - private String mSite; - - public SiteID() - { - } + private String mSite; - @XmlAttribute - public String getSite() - { - return mSite; - } - - public void setSite( String site ) - { - mSite = site; - } - - @Override - public boolean isValid() - { - return mSite != null; - } - - public String toString() - { - return "Site: " + mSite; - } - - @Override - public boolean matches( AliasID otherID ) + public SiteID() { - return otherID != null && - otherID instanceof SiteID && - getSite().contentEquals( ( (SiteID)otherID).getSite() ); } - @Override + @JacksonXmlProperty(isAttribute = true, localName = "site") + public String getSite() + { + return mSite; + } + + public void setSite(String site) + { + mSite = site; + } + + @Override + public boolean isValid() + { + return mSite != null; + } + + public String toString() + { + return "Site: " + mSite; + } + + @Override + public boolean matches(AliasID otherID) + { + return otherID != null && + otherID instanceof SiteID && + getSite().contentEquals(((SiteID)otherID).getSite()); + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override public AliasIDType getType() { - return AliasIDType.SITE; + return AliasIDType.SITE; } } diff --git a/src/main/java/io/github/dsheirer/alias/id/siteID/SiteIDEditor.java b/src/main/java/io/github/dsheirer/alias/id/siteID/SiteIDEditor.java index 4b54f7cf..aa87fcee 100644 --- a/src/main/java/io/github/dsheirer/alias/id/siteID/SiteIDEditor.java +++ b/src/main/java/io/github/dsheirer/alias/id/siteID/SiteIDEditor.java @@ -17,9 +17,9 @@ ******************************************************************************/ package io.github.dsheirer.alias.id.siteID; +import io.github.dsheirer.alias.id.AliasID; import io.github.dsheirer.gui.editor.DocumentListenerEditor; import net.miginfocom.swing.MigLayout; -import io.github.dsheirer.alias.id.AliasID; import javax.swing.*; import java.awt.*; diff --git a/src/main/java/io/github/dsheirer/alias/id/status/StatusID.java b/src/main/java/io/github/dsheirer/alias/id/status/StatusID.java index fec84635..24050b1a 100644 --- a/src/main/java/io/github/dsheirer/alias/id/status/StatusID.java +++ b/src/main/java/io/github/dsheirer/alias/id/status/StatusID.java @@ -1,75 +1,75 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.alias.id.status; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.alias.id.AliasID; import io.github.dsheirer.alias.id.AliasIDType; -import javax.xml.bind.annotation.XmlAttribute; - public class StatusID extends AliasID { - private int mStatus; - - public StatusID() - { - } + private int mStatus; - @XmlAttribute - public int getStatus() - { - return mStatus; - } - - public void setStatus( int status ) - { - this.mStatus = status; - } - - @Override - public boolean isValid() - { - return true; - } - - public String toString() - { - return "Status: " + String.format( "%03d", mStatus ); - } - - @Override - public boolean matches( AliasID id ) + public StatusID() { - boolean retVal = false; - - if( id instanceof StatusID ) - { - StatusID statusId = (StatusID)id; - - retVal = ( mStatus == statusId.getStatus() ); - } - - return retVal; } - @Override + @JacksonXmlProperty(isAttribute = true, localName = "status") + public int getStatus() + { + return mStatus; + } + + public void setStatus(int status) + { + this.mStatus = status; + } + + @Override + public boolean isValid() + { + return true; + } + + public String toString() + { + return "Status: " + String.format("%03d", mStatus); + } + + @Override + public boolean matches(AliasID id) + { + boolean retVal = false; + + if(id instanceof StatusID) + { + StatusID statusId = (StatusID)id; + + retVal = (mStatus == statusId.getStatus()); + } + + return retVal; + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override public AliasIDType getType() { - return AliasIDType.STATUS; + return AliasIDType.STATUS; } } diff --git a/src/main/java/io/github/dsheirer/alias/id/talkgroup/TalkgroupID.java b/src/main/java/io/github/dsheirer/alias/id/talkgroup/TalkgroupID.java index 1b9f3bcb..c70accbd 100644 --- a/src/main/java/io/github/dsheirer/alias/id/talkgroup/TalkgroupID.java +++ b/src/main/java/io/github/dsheirer/alias/id/talkgroup/TalkgroupID.java @@ -18,12 +18,10 @@ package io.github.dsheirer.alias.id.talkgroup; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.alias.id.AliasID; import io.github.dsheirer.alias.id.AliasIDType; -import javax.xml.bind.annotation.XmlAttribute; - - public class TalkgroupID extends AliasID { private String mTalkgroup; @@ -38,7 +36,7 @@ public class TalkgroupID extends AliasID mTalkgroup = talkgroup; } - @XmlAttribute + @JacksonXmlProperty(isAttribute = true, localName = "talkgroup") public String getTalkgroup() { return mTalkgroup; @@ -71,7 +69,7 @@ public class TalkgroupID extends AliasID if(id instanceof TalkgroupID) { - TalkgroupID tgid = (TalkgroupID) id; + TalkgroupID tgid = (TalkgroupID)id; //Create a pattern - replace * wildcards with regex single-char wildcard String pattern = mTalkgroup.replace("*", ".?"); @@ -82,6 +80,7 @@ public class TalkgroupID extends AliasID return retVal; } + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") @Override public AliasIDType getType() { diff --git a/src/main/java/io/github/dsheirer/alias/id/talkgroup/TalkgroupIDEditor.java b/src/main/java/io/github/dsheirer/alias/id/talkgroup/TalkgroupIDEditor.java index 744f674c..8cf061c5 100644 --- a/src/main/java/io/github/dsheirer/alias/id/talkgroup/TalkgroupIDEditor.java +++ b/src/main/java/io/github/dsheirer/alias/id/talkgroup/TalkgroupIDEditor.java @@ -17,9 +17,9 @@ ******************************************************************************/ package io.github.dsheirer.alias.id.talkgroup; +import io.github.dsheirer.alias.id.AliasID; import io.github.dsheirer.gui.editor.DocumentListenerEditor; import net.miginfocom.swing.MigLayout; -import io.github.dsheirer.alias.id.AliasID; import javax.swing.*; import java.awt.*; diff --git a/src/main/java/io/github/dsheirer/alias/id/uniqueID/UniqueID.java b/src/main/java/io/github/dsheirer/alias/id/uniqueID/UniqueID.java index 27413124..5b2e1f77 100644 --- a/src/main/java/io/github/dsheirer/alias/id/uniqueID/UniqueID.java +++ b/src/main/java/io/github/dsheirer/alias/id/uniqueID/UniqueID.java @@ -1,75 +1,75 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.alias.id.uniqueID; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.alias.id.AliasID; import io.github.dsheirer.alias.id.AliasIDType; -import javax.xml.bind.annotation.XmlAttribute; - public class UniqueID extends AliasID { - private int mUid; - - public UniqueID() - { - } + private int mUid; - @XmlAttribute - public int getUid() - { - return mUid; - } - - public void setUid( int uid ) - { - this.mUid = uid; - } - - @Override - public boolean isValid() - { - return true; - } - - public String toString() - { - return "UniqueID: " + mUid; - } - - @Override - public boolean matches( AliasID id ) + public UniqueID() { - boolean retVal = false; - - if( id instanceof UniqueID ) - { - UniqueID uid = (UniqueID)id; - - retVal = mUid == uid.getUid(); - } - - return retVal; } - @Override + @JacksonXmlProperty(isAttribute = true, localName = "uid") + public int getUid() + { + return mUid; + } + + public void setUid(int uid) + { + this.mUid = uid; + } + + @Override + public boolean isValid() + { + return true; + } + + public String toString() + { + return "UniqueID: " + mUid; + } + + @Override + public boolean matches(AliasID id) + { + boolean retVal = false; + + if(id instanceof UniqueID) + { + UniqueID uid = (UniqueID)id; + + retVal = mUid == uid.getUid(); + } + + return retVal; + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + @Override public AliasIDType getType() { - return AliasIDType.LTR_NET_UID; + return AliasIDType.LTR_NET_UID; } } diff --git a/src/main/java/io/github/dsheirer/alias/id/uniqueID/UniqueIDEditor.java b/src/main/java/io/github/dsheirer/alias/id/uniqueID/UniqueIDEditor.java index eb9816cd..01053c51 100644 --- a/src/main/java/io/github/dsheirer/alias/id/uniqueID/UniqueIDEditor.java +++ b/src/main/java/io/github/dsheirer/alias/id/uniqueID/UniqueIDEditor.java @@ -17,9 +17,9 @@ ******************************************************************************/ package io.github.dsheirer.alias.id.uniqueID; +import io.github.dsheirer.alias.id.AliasID; import io.github.dsheirer.gui.editor.DocumentListenerEditor; import net.miginfocom.swing.MigLayout; -import io.github.dsheirer.alias.id.AliasID; import javax.swing.*; import java.awt.*; diff --git a/src/main/java/io/github/dsheirer/audio/AudioChannelPanel.java b/src/main/java/io/github/dsheirer/audio/AudioChannelPanel.java index 4be52c57..7e6c1aa3 100644 --- a/src/main/java/io/github/dsheirer/audio/AudioChannelPanel.java +++ b/src/main/java/io/github/dsheirer/audio/AudioChannelPanel.java @@ -18,6 +18,7 @@ ******************************************************************************/ package io.github.dsheirer.audio; +import io.github.dsheirer.alias.Alias; import io.github.dsheirer.audio.output.AudioOutput; import io.github.dsheirer.channel.metadata.Metadata; import io.github.dsheirer.icon.IconManager; @@ -30,7 +31,6 @@ import io.github.dsheirer.settings.SettingsManager; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.Alias; import javax.swing.*; import java.awt.*; diff --git a/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastConfiguration.java b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastConfiguration.java index 3ae8796f..220416e5 100644 --- a/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastConfiguration.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastConfiguration.java @@ -18,25 +18,25 @@ ******************************************************************************/ package io.github.dsheirer.audio.broadcast; -import io.github.dsheirer.audio.broadcast.broadcastify.BroadcastifyConfiguration; -import io.github.dsheirer.audio.broadcast.icecast.IcecastHTTPConfiguration; -import io.github.dsheirer.audio.broadcast.icecast.IcecastTCPConfiguration; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import io.github.dsheirer.audio.broadcast.icecast.IcecastConfiguration; import io.github.dsheirer.audio.broadcast.shoutcast.v1.ShoutcastV1Configuration; import io.github.dsheirer.audio.broadcast.shoutcast.v2.ShoutcastV2Configuration; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlTransient; import java.net.InetSocketAddress; import java.net.SocketAddress; -@XmlSeeAlso({BroadcastifyConfiguration.class, - IcecastTCPConfiguration.class, - IcecastHTTPConfiguration.class, - ShoutcastV1Configuration.class, - ShoutcastV2Configuration.class}) -@XmlRootElement(name = "stream") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = IcecastConfiguration.class, name="icecastConfiguration"), + @JsonSubTypes.Type(value = ShoutcastV1Configuration.class, name="shoutcastV1Configuration"), + @JsonSubTypes.Type(value = ShoutcastV2Configuration.class, name="shoutcastV2Configuration"), +}) +@JacksonXmlRootElement(localName = "stream") public abstract class BroadcastConfiguration { private BroadcastFormat mBroadcastFormat = BroadcastFormat.MP3; @@ -69,13 +69,18 @@ public abstract class BroadcastConfiguration /** * Broadcast server type */ - @XmlAttribute(name = "type") + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") public abstract BroadcastServerType getBroadcastServerType(); + private void setBroadcastServerType(BroadcastServerType type) + { + //Do nothing + } + /** * Name identifying this broadcastAudio configuration. */ - @XmlAttribute(name = "name") + @JacksonXmlProperty(isAttribute = true, localName = "name") public String getName() { return mName; @@ -102,7 +107,7 @@ public abstract class BroadcastConfiguration /** * BROADCAST server host name. */ - @XmlAttribute(name = "host") + @JacksonXmlProperty(isAttribute = true, localName = "host") public String getHost() { return mHost; @@ -129,7 +134,7 @@ public abstract class BroadcastConfiguration /** * BROADCAST server port number; */ - @XmlAttribute(name = "port") + @JacksonXmlProperty(isAttribute = true, localName = "port") public int getPort() { return mPort; @@ -153,6 +158,7 @@ public abstract class BroadcastConfiguration return mPort > 0; } + @JsonIgnore public SocketAddress getAddress() { return new InetSocketAddress(getHost(), getPort()); @@ -161,7 +167,7 @@ public abstract class BroadcastConfiguration /** * Password to authenticate with the streaming server. */ - @XmlAttribute(name = "password") + @JacksonXmlProperty(isAttribute = true, localName = "password") public String getPassword() { return mPassword; @@ -188,7 +194,7 @@ public abstract class BroadcastConfiguration /** * Audio broadcastAudio content type (e.g. mp3) */ - @XmlAttribute(name = "format") + @JacksonXmlProperty(isAttribute = false, localName = "format") public BroadcastFormat getBroadcastFormat() { return mBroadcastFormat; @@ -202,7 +208,7 @@ public abstract class BroadcastConfiguration /** * Audio broadcastAudio delay from recording start until the audio file is broadcastAudio to the server. */ - @XmlAttribute(name = "delay") + @JacksonXmlProperty(isAttribute = true, localName = "delay") public long getDelay() { return mDelay; @@ -222,7 +228,7 @@ public abstract class BroadcastConfiguration * queue awaiting streaming before it is purged from the queue. This value is in addition to the delay setting. * @return age in milliseconds */ - @XmlAttribute(name = "maximum_recording_age") + @JacksonXmlProperty(isAttribute = true, localName = "maximum_recording_age") public long getMaximumRecordingAge() { return mMaximumRecordingAge; @@ -241,7 +247,7 @@ public abstract class BroadcastConfiguration /** * Indicates if this broadcaster is enable, meaning that it will automatically connect on startup. */ - @XmlAttribute(name = "enabled") + @JacksonXmlProperty(isAttribute = true, localName = "enabled") public boolean isEnabled() { return mEnabled; @@ -293,7 +299,7 @@ public abstract class BroadcastConfiguration * Indicates if this configuration is valid. A minimal check will ensure that it contains at least a hostname and * port number. */ - @XmlTransient + @JsonIgnore public boolean isValid() { return mHost != null && mPort > 0; diff --git a/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastConfigurationEditor.java b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastConfigurationEditor.java index 46aa8c90..bb5b9a18 100644 --- a/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastConfigurationEditor.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastConfigurationEditor.java @@ -18,9 +18,9 @@ ******************************************************************************/ package io.github.dsheirer.audio.broadcast; +import io.github.dsheirer.alias.AliasModel; import io.github.dsheirer.gui.editor.DocumentListenerEditor; import io.github.dsheirer.icon.IconManager; -import io.github.dsheirer.alias.AliasModel; import javax.swing.*; diff --git a/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastFactory.java b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastFactory.java index c9e43f44..85f6e43c 100644 --- a/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastFactory.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastFactory.java @@ -18,6 +18,7 @@ ******************************************************************************/ package io.github.dsheirer.audio.broadcast; +import io.github.dsheirer.alias.AliasModel; import io.github.dsheirer.audio.broadcast.broadcastify.BroadcastifyConfiguration; import io.github.dsheirer.audio.broadcast.broadcastify.BroadcastifyConfigurationEditor; import io.github.dsheirer.audio.broadcast.icecast.IcecastHTTPAudioBroadcaster; @@ -43,7 +44,6 @@ import io.github.dsheirer.record.AudioRecorder; import io.github.dsheirer.record.mp3.MP3Recorder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.AliasModel; import java.nio.file.Path; diff --git a/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastModel.java b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastModel.java index 38dae77a..f942411b 100644 --- a/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastModel.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastModel.java @@ -18,6 +18,7 @@ ******************************************************************************/ package io.github.dsheirer.audio.broadcast; +import io.github.dsheirer.alias.id.broadcast.BroadcastChannel; import io.github.dsheirer.audio.AudioPacket; import io.github.dsheirer.channel.metadata.Metadata; import io.github.dsheirer.icon.IconManager; @@ -27,7 +28,6 @@ import io.github.dsheirer.sample.Listener; import io.github.dsheirer.util.ThreadPool; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.id.broadcast.BroadcastChannel; import javax.swing.*; import javax.swing.table.AbstractTableModel; diff --git a/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastPanel.java b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastPanel.java index 561acbe2..f1455618 100644 --- a/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastPanel.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastPanel.java @@ -19,13 +19,13 @@ package io.github.dsheirer.audio.broadcast; import com.jidesoft.swing.JideSplitPane; +import io.github.dsheirer.alias.AliasModel; import io.github.dsheirer.gui.editor.Editor; import io.github.dsheirer.gui.editor.EmptyEditor; import io.github.dsheirer.icon.IconManager; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.AliasModel; import javax.swing.*; import javax.swing.event.ListSelectionEvent; diff --git a/src/main/java/io/github/dsheirer/audio/broadcast/broadcastify/BroadcastifyConfiguration.java b/src/main/java/io/github/dsheirer/audio/broadcast/broadcastify/BroadcastifyConfiguration.java index 97bd1efb..367592cb 100644 --- a/src/main/java/io/github/dsheirer/audio/broadcast/broadcastify/BroadcastifyConfiguration.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/broadcastify/BroadcastifyConfiguration.java @@ -18,13 +18,12 @@ ******************************************************************************/ package io.github.dsheirer.audio.broadcast.broadcastify; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.audio.broadcast.BroadcastConfiguration; import io.github.dsheirer.audio.broadcast.BroadcastFormat; import io.github.dsheirer.audio.broadcast.BroadcastServerType; import io.github.dsheirer.audio.broadcast.icecast.IcecastTCPConfiguration; -import javax.xml.bind.annotation.XmlAttribute; - public class BroadcastifyConfiguration extends IcecastTCPConfiguration { private int mFeedID; @@ -77,13 +76,14 @@ public class BroadcastifyConfiguration extends IcecastTCPConfiguration return copy; } + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") @Override public BroadcastServerType getBroadcastServerType() { return BroadcastServerType.BROADCASTIFY; } - @XmlAttribute(name="feed_id") + @JacksonXmlProperty(isAttribute = true, localName = "feed_id") public int getFeedID() { return mFeedID; diff --git a/src/main/java/io/github/dsheirer/audio/broadcast/broadcastify/BroadcastifyConfigurationEditor.java b/src/main/java/io/github/dsheirer/audio/broadcast/broadcastify/BroadcastifyConfigurationEditor.java index 0f8dc5c0..3b74585d 100644 --- a/src/main/java/io/github/dsheirer/audio/broadcast/broadcastify/BroadcastifyConfigurationEditor.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/broadcastify/BroadcastifyConfigurationEditor.java @@ -19,6 +19,7 @@ package io.github.dsheirer.audio.broadcast.broadcastify; import com.radioreference.api.soap2.UserFeedBroadcast; +import io.github.dsheirer.alias.AliasModel; import io.github.dsheirer.audio.broadcast.BroadcastConfiguration; import io.github.dsheirer.audio.broadcast.BroadcastConfigurationEditor; import io.github.dsheirer.audio.broadcast.BroadcastEvent; @@ -29,7 +30,6 @@ import io.github.dsheirer.sample.Listener; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.AliasModel; import javax.swing.*; import javax.swing.event.ChangeEvent; diff --git a/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastConfiguration.java b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastConfiguration.java index 55520d1c..682dc7ed 100644 --- a/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastConfiguration.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastConfiguration.java @@ -18,13 +18,20 @@ ******************************************************************************/ package io.github.dsheirer.audio.broadcast.icecast; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.audio.broadcast.BroadcastConfiguration; import io.github.dsheirer.audio.broadcast.BroadcastFormat; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlTransient; import java.util.Base64; +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = IcecastHTTPConfiguration.class, name="icecastHTTPConfiguration"), + @JsonSubTypes.Type(value = IcecastTCPConfiguration.class, name="icecastTCPConfiguration"), +}) public abstract class IcecastConfiguration extends BroadcastConfiguration { protected String mUserName = "source"; @@ -49,7 +56,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration /** * Base64 encoded version of the username and password with prepended 'Basic ' tag. */ - @XmlTransient + @JsonIgnore public String getBase64EncodedCredentials() { StringBuilder sb = new StringBuilder(); @@ -68,7 +75,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration return "Basic " + base64; } - @XmlAttribute( name="user_name" ) + @JacksonXmlProperty(isAttribute = true, localName = "user_name") public String getUserName() { return mUserName; @@ -86,9 +93,10 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration /** * Mount point or path to the stream + * * @return mount point */ - @XmlAttribute( name="mount_point" ) + @JacksonXmlProperty(isAttribute = true, localName = "mount_point") public String getMountPoint() { return mMountPoint; @@ -96,6 +104,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration /** * Sets the mount point (path) for the stream + * * @param mountPoint */ public void setMountPoint(String mountPoint) @@ -118,7 +127,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration return mMountPoint != null; } - @XmlAttribute( name="description" ) + @JacksonXmlProperty(isAttribute = true, localName = "description") public String getDescription() { return mDescription; @@ -137,7 +146,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration /** * Stream genre */ - @XmlAttribute( name="genre" ) + @JacksonXmlProperty(isAttribute = true, localName = "genre") public String getGenre() { return mGenre; @@ -145,6 +154,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration /** * Stream genre + * * @param genre */ public void setGenre(String genre) @@ -160,7 +170,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration /** * Public visibility of the broadcastAudio */ - @XmlAttribute( name="public" ) + @JacksonXmlProperty(isAttribute = true, localName = "public") public boolean isPublic() { return mPublic; @@ -168,6 +178,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration /** * Sets public visibility of the broadcastAudio + * * @param isPublic indicates if the broadcastAudio should be visible to the public */ public void setPublic(boolean isPublic) @@ -178,7 +189,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration /** * Number of audio channels in the broadcastAudio */ - @XmlAttribute( name="channels" ) + @JacksonXmlProperty(isAttribute = true, localName = "channels") public int getChannels() { return mChannels; @@ -200,7 +211,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration /** * Bit rate in bits per second */ - @XmlAttribute( name="bitrate" ) + @JacksonXmlProperty(isAttribute = true, localName = "bitrate") public int getBitRate() { return mBitRate; @@ -208,6 +219,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration /** * Bit rate + * * @param bitRate in samples per second */ public void setBitRate(int bitRate) @@ -220,7 +232,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration return mBitRate > 0; } - @XmlAttribute( name="sample_rate" ) + @JacksonXmlProperty(isAttribute = true, localName = "sample_rate") public int getSampleRate() { return mSampleRate; @@ -239,7 +251,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration /** * URL associated with the broadcastAudio where users can find additional details. */ - @XmlAttribute( name="url" ) + @JacksonXmlProperty(isAttribute = true, localName = "url") public String getURL() { return mURL; @@ -247,6 +259,7 @@ public abstract class IcecastConfiguration extends BroadcastConfiguration /** * URL associated with the broadcastAudio where users can find additional details. + * * @param url */ public void setURL(String url) diff --git a/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastHTTPConfiguration.java b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastHTTPConfiguration.java index 2f2fcc6c..b4b1f99a 100644 --- a/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastHTTPConfiguration.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastHTTPConfiguration.java @@ -18,10 +18,13 @@ ******************************************************************************/ package io.github.dsheirer.audio.broadcast.icecast; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.audio.broadcast.BroadcastConfiguration; import io.github.dsheirer.audio.broadcast.BroadcastFormat; import io.github.dsheirer.audio.broadcast.BroadcastServerType; +@JsonSubTypes.Type(value=IcecastHTTPConfiguration.class, name="icecastHTTPConfiguration") public class IcecastHTTPConfiguration extends IcecastConfiguration { public IcecastHTTPConfiguration() @@ -66,11 +69,10 @@ public class IcecastHTTPConfiguration extends IcecastConfiguration return copy; } + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") @Override public BroadcastServerType getBroadcastServerType() { return BroadcastServerType.ICECAST_HTTP; } - - } diff --git a/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastHTTPConfigurationEditor.java b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastHTTPConfigurationEditor.java index bb55e775..399e6096 100644 --- a/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastHTTPConfigurationEditor.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastHTTPConfigurationEditor.java @@ -18,6 +18,7 @@ ******************************************************************************/ package io.github.dsheirer.audio.broadcast.icecast; +import io.github.dsheirer.alias.AliasModel; import io.github.dsheirer.audio.broadcast.BroadcastConfiguration; import io.github.dsheirer.audio.broadcast.BroadcastConfigurationEditor; import io.github.dsheirer.audio.broadcast.BroadcastEvent; @@ -27,7 +28,6 @@ import io.github.dsheirer.icon.IconManager; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.AliasModel; import javax.swing.*; import javax.swing.event.ChangeEvent; diff --git a/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastTCPConfiguration.java b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastTCPConfiguration.java index 86a67f3b..c735265e 100644 --- a/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastTCPConfiguration.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastTCPConfiguration.java @@ -18,6 +18,9 @@ ******************************************************************************/ package io.github.dsheirer.audio.broadcast.icecast; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.audio.broadcast.BroadcastConfiguration; import io.github.dsheirer.audio.broadcast.BroadcastFormat; import io.github.dsheirer.audio.broadcast.BroadcastServerType; @@ -25,9 +28,10 @@ import io.github.dsheirer.audio.broadcast.broadcastify.BroadcastifyConfiguration import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.xml.bind.annotation.XmlSeeAlso; - -@XmlSeeAlso( {BroadcastifyConfiguration.class } ) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = BroadcastifyConfiguration.class, name="broadcastifyConfiguration"), +}) public class IcecastTCPConfiguration extends IcecastConfiguration { private final static Logger mLog = LoggerFactory.getLogger( IcecastTCPConfiguration.class ); @@ -70,6 +74,7 @@ public class IcecastTCPConfiguration extends IcecastConfiguration return copy; } + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") @Override public BroadcastServerType getBroadcastServerType() { diff --git a/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastTCPConfigurationEditor.java b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastTCPConfigurationEditor.java index 00f1883e..4223a0d9 100644 --- a/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastTCPConfigurationEditor.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/icecast/IcecastTCPConfigurationEditor.java @@ -18,6 +18,7 @@ ******************************************************************************/ package io.github.dsheirer.audio.broadcast.icecast; +import io.github.dsheirer.alias.AliasModel; import io.github.dsheirer.audio.broadcast.BroadcastConfiguration; import io.github.dsheirer.audio.broadcast.BroadcastConfigurationEditor; import io.github.dsheirer.audio.broadcast.BroadcastEvent; @@ -27,7 +28,6 @@ import io.github.dsheirer.icon.IconManager; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.AliasModel; import javax.swing.*; import javax.swing.event.ChangeEvent; diff --git a/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastV1Configuration.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastV1Configuration.java index 8480bd52..db8c0dc3 100644 --- a/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastV1Configuration.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastV1Configuration.java @@ -18,12 +18,11 @@ ******************************************************************************/ package io.github.dsheirer.audio.broadcast.shoutcast.v1; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.audio.broadcast.BroadcastConfiguration; import io.github.dsheirer.audio.broadcast.BroadcastFormat; import io.github.dsheirer.audio.broadcast.BroadcastServerType; -import javax.xml.bind.annotation.XmlAttribute; - public class ShoutcastV1Configuration extends BroadcastConfiguration { private String mGenre; @@ -73,7 +72,7 @@ public class ShoutcastV1Configuration extends BroadcastConfiguration /** * Stream genre */ - @XmlAttribute(name="genre") + @JacksonXmlProperty(isAttribute = true, localName = "genre") public String getGenre() { return mGenre; @@ -81,6 +80,7 @@ public class ShoutcastV1Configuration extends BroadcastConfiguration /** * Stream genre + * * @param genre */ public void setGenre(String genre) @@ -91,7 +91,7 @@ public class ShoutcastV1Configuration extends BroadcastConfiguration /** * Stream description */ - @XmlAttribute(name="description") + @JacksonXmlProperty(isAttribute = true, localName = "description") public String getDescription() { return mDescription; @@ -99,6 +99,7 @@ public class ShoutcastV1Configuration extends BroadcastConfiguration /** * Stream description + * * @param description */ public void setDescription(String description) @@ -109,7 +110,7 @@ public class ShoutcastV1Configuration extends BroadcastConfiguration /** * Public visibility of the broadcastAudio */ - @XmlAttribute(name="public") + @JacksonXmlProperty(isAttribute = true, localName = "public") public boolean isPublic() { return mPublic; @@ -117,6 +118,7 @@ public class ShoutcastV1Configuration extends BroadcastConfiguration /** * Sets public visibility of the broadcastAudio + * * @param isPublic indicates if the broadcastAudio should be visible to the public */ public void setPublic(boolean isPublic) @@ -127,7 +129,7 @@ public class ShoutcastV1Configuration extends BroadcastConfiguration /** * Number of audio channels in the broadcastAudio */ - @XmlAttribute(name="channels") + @JacksonXmlProperty(isAttribute = true, localName = "channels") public int getChannels() { return mChannels; @@ -144,7 +146,7 @@ public class ShoutcastV1Configuration extends BroadcastConfiguration /** * Bit rate in bits per second */ - @XmlAttribute(name="bitrate") + @JacksonXmlProperty(isAttribute = true, localName = "bitrate") public int getBitRate() { return mBitRate; @@ -152,6 +154,7 @@ public class ShoutcastV1Configuration extends BroadcastConfiguration /** * Bit rate + * * @param bitRate in samples per second */ public void setBitRate(int bitRate) @@ -163,8 +166,8 @@ public class ShoutcastV1Configuration extends BroadcastConfiguration public boolean isValid() { return getName() != null && !getName().isEmpty() && - getHost() != null && !getHost().isEmpty() && - getPort() > 0 && getPort() < 65535 && - getPassword() != null && !getPassword().isEmpty(); + getHost() != null && !getHost().isEmpty() && + getPort() > 0 && getPort() < 65535 && + getPassword() != null && !getPassword().isEmpty(); } } diff --git a/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastV1ConfigurationEditor.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastV1ConfigurationEditor.java index ff66da72..79f0a0e4 100644 --- a/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastV1ConfigurationEditor.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v1/ShoutcastV1ConfigurationEditor.java @@ -18,6 +18,7 @@ ******************************************************************************/ package io.github.dsheirer.audio.broadcast.shoutcast.v1; +import io.github.dsheirer.alias.AliasModel; import io.github.dsheirer.audio.broadcast.BroadcastConfiguration; import io.github.dsheirer.audio.broadcast.BroadcastConfigurationEditor; import io.github.dsheirer.audio.broadcast.BroadcastEvent; @@ -27,7 +28,6 @@ import io.github.dsheirer.icon.IconManager; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.AliasModel; import javax.swing.*; import javax.swing.event.ChangeEvent; diff --git a/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ShoutcastV2Configuration.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ShoutcastV2Configuration.java index 4360000e..d4fa7f06 100644 --- a/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ShoutcastV2Configuration.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ShoutcastV2Configuration.java @@ -18,13 +18,12 @@ ******************************************************************************/ package io.github.dsheirer.audio.broadcast.shoutcast.v2; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.audio.broadcast.BroadcastConfiguration; import io.github.dsheirer.audio.broadcast.BroadcastFormat; import io.github.dsheirer.audio.broadcast.BroadcastServerType; import org.apache.commons.lang3.Validate; -import javax.xml.bind.annotation.XmlAttribute; - public class ShoutcastV2Configuration extends BroadcastConfiguration { private int mStreamID; @@ -78,7 +77,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration /** * Stream ID */ - @XmlAttribute(name = "stream_id") + @JacksonXmlProperty(isAttribute = true, localName = "stream_id") public int getStreamID() { return mStreamID; @@ -98,7 +97,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration /** * User ID */ - @XmlAttribute(name = "user_id") + @JacksonXmlProperty(isAttribute = true, localName = "user_id") public String getUserID() { return mUserID; @@ -106,6 +105,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration /** * Sets the user ID + * * @param userID */ public void setUserID(String userID) @@ -116,7 +116,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration /** * Bit rate in kilobits per second */ - @XmlAttribute(name = "bitrate") + @JacksonXmlProperty(isAttribute = true, localName = "bitrate") public int getBitRate() { return mBitRate; @@ -124,6 +124,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration /** * Bit rate + * * @param bitRate in kilobits per second */ public void setBitRate(int bitRate) @@ -134,7 +135,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration /** * Stream genre */ - @XmlAttribute(name = "genre") + @JacksonXmlProperty(isAttribute = true, localName = "genre") public String getGenre() { return mGenre; @@ -157,7 +158,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration /** * Public visibility of the broadcastAudio */ - @XmlAttribute(name = "public") + @JacksonXmlProperty(isAttribute = true, localName = "public") public boolean isPublic() { return mPublic; @@ -165,6 +166,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration /** * Sets public visibility of the broadcastAudio + * * @param isPublic indicates if the broadcastAudio should be visible to the public */ public void setPublic(boolean isPublic) @@ -175,7 +177,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration /** * URL associated with the broadcastAudio where users can find additional details. */ - @XmlAttribute(name = "url") + @JacksonXmlProperty(isAttribute = true, localName = "url") public String getURL() { return mURL; @@ -183,6 +185,7 @@ public class ShoutcastV2Configuration extends BroadcastConfiguration /** * URL associated with the broadcastAudio where users can find additional details. + * * @param url */ public void setURL(String url) diff --git a/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ShoutcastV2ConfigurationEditor.java b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ShoutcastV2ConfigurationEditor.java index 90c541d5..ee8637eb 100644 --- a/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ShoutcastV2ConfigurationEditor.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/shoutcast/v2/ShoutcastV2ConfigurationEditor.java @@ -18,6 +18,7 @@ ******************************************************************************/ package io.github.dsheirer.audio.broadcast.shoutcast.v2; +import io.github.dsheirer.alias.AliasModel; import io.github.dsheirer.audio.broadcast.BroadcastConfiguration; import io.github.dsheirer.audio.broadcast.BroadcastConfigurationEditor; import io.github.dsheirer.audio.broadcast.BroadcastEvent; @@ -27,7 +28,6 @@ import io.github.dsheirer.icon.IconManager; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.AliasModel; import javax.swing.*; import javax.swing.event.ChangeEvent; diff --git a/src/main/java/io/github/dsheirer/audio/invert/AudioInverter.java b/src/main/java/io/github/dsheirer/audio/invert/AudioInverter.java index 0c031f38..a892b23c 100644 --- a/src/main/java/io/github/dsheirer/audio/invert/AudioInverter.java +++ b/src/main/java/io/github/dsheirer/audio/invert/AudioInverter.java @@ -18,10 +18,10 @@ package io.github.dsheirer.audio.invert; import io.github.dsheirer.audio.InversionFrequency; -import io.github.dsheirer.sample.real.RealSampleListener; import io.github.dsheirer.dsp.filter.Filters; import io.github.dsheirer.dsp.filter.FloatFIRFilter; import io.github.dsheirer.dsp.mixer.Oscillator; +import io.github.dsheirer.sample.real.RealSampleListener; /** * Applies audio inversion (or un-inversion) to a broadcast of float audio samples diff --git a/src/main/java/io/github/dsheirer/bits/MessageFramer.java b/src/main/java/io/github/dsheirer/bits/MessageFramer.java index 529b1901..79596cae 100644 --- a/src/main/java/io/github/dsheirer/bits/MessageFramer.java +++ b/src/main/java/io/github/dsheirer/bits/MessageFramer.java @@ -17,10 +17,10 @@ ******************************************************************************/ package io.github.dsheirer.bits; -import io.github.dsheirer.sample.Broadcaster; -import io.github.dsheirer.sample.Listener; import io.github.dsheirer.dsp.symbol.SyncDetectListener; import io.github.dsheirer.dsp.symbol.SyncDetectProvider; +import io.github.dsheirer.sample.Broadcaster; +import io.github.dsheirer.sample.Listener; import java.util.ArrayList; import java.util.Iterator; diff --git a/src/main/java/io/github/dsheirer/channel/details/ChannelDetailPanel.java b/src/main/java/io/github/dsheirer/channel/details/ChannelDetailPanel.java index f4cd734d..e93a4234 100644 --- a/src/main/java/io/github/dsheirer/channel/details/ChannelDetailPanel.java +++ b/src/main/java/io/github/dsheirer/channel/details/ChannelDetailPanel.java @@ -21,9 +21,9 @@ package io.github.dsheirer.channel.details; import io.github.dsheirer.channel.state.DecoderState; import io.github.dsheirer.controller.channel.Channel; import io.github.dsheirer.controller.channel.ChannelProcessingManager; +import io.github.dsheirer.module.ProcessingChain; import io.github.dsheirer.sample.Listener; import net.miginfocom.swing.MigLayout; -import io.github.dsheirer.module.ProcessingChain; import javax.swing.*; import javax.swing.text.DefaultCaret; diff --git a/src/main/java/io/github/dsheirer/channel/metadata/ChannelMetadataPanel.java b/src/main/java/io/github/dsheirer/channel/metadata/ChannelMetadataPanel.java index d919f26a..b78129a2 100644 --- a/src/main/java/io/github/dsheirer/channel/metadata/ChannelMetadataPanel.java +++ b/src/main/java/io/github/dsheirer/channel/metadata/ChannelMetadataPanel.java @@ -18,11 +18,13 @@ ******************************************************************************/ package io.github.dsheirer.channel.metadata; +import io.github.dsheirer.alias.Alias; import io.github.dsheirer.channel.state.State; import io.github.dsheirer.controller.channel.Channel; import io.github.dsheirer.controller.channel.ChannelProcessingManager; import io.github.dsheirer.controller.channel.ChannelUtils; import io.github.dsheirer.icon.IconManager; +import io.github.dsheirer.module.ProcessingChain; import io.github.dsheirer.properties.SystemProperties; import io.github.dsheirer.sample.Broadcaster; import io.github.dsheirer.sample.Listener; @@ -30,8 +32,6 @@ import net.miginfocom.swing.MigLayout; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.Alias; -import io.github.dsheirer.module.ProcessingChain; import javax.swing.*; import javax.swing.event.ListSelectionEvent; diff --git a/src/main/java/io/github/dsheirer/channel/metadata/ChannelMetadataViewer.java b/src/main/java/io/github/dsheirer/channel/metadata/ChannelMetadataViewer.java index 73c5502b..f121508e 100644 --- a/src/main/java/io/github/dsheirer/channel/metadata/ChannelMetadataViewer.java +++ b/src/main/java/io/github/dsheirer/channel/metadata/ChannelMetadataViewer.java @@ -23,11 +23,11 @@ import com.jidesoft.swing.JideTabbedPane; import io.github.dsheirer.channel.details.ChannelDetailPanel; import io.github.dsheirer.controller.channel.ChannelProcessingManager; import io.github.dsheirer.icon.IconManager; +import io.github.dsheirer.module.decode.event.CallEventPanel; +import io.github.dsheirer.module.decode.event.MessageActivityPanel; import io.github.dsheirer.settings.SettingsManager; import io.github.dsheirer.spectrum.ChannelSpectrumPanel; import net.miginfocom.swing.MigLayout; -import io.github.dsheirer.module.decode.event.CallEventPanel; -import io.github.dsheirer.module.decode.event.MessageActivityPanel; import javax.swing.*; import java.awt.*; diff --git a/src/main/java/io/github/dsheirer/channel/metadata/Metadata.java b/src/main/java/io/github/dsheirer/channel/metadata/Metadata.java index e11032e5..5145053e 100644 --- a/src/main/java/io/github/dsheirer/channel/metadata/Metadata.java +++ b/src/main/java/io/github/dsheirer/channel/metadata/Metadata.java @@ -18,13 +18,13 @@ ******************************************************************************/ package io.github.dsheirer.channel.metadata; -import io.github.dsheirer.channel.state.State; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import io.github.dsheirer.alias.Alias; import io.github.dsheirer.alias.id.broadcast.BroadcastChannel; import io.github.dsheirer.alias.id.priority.Priority; +import io.github.dsheirer.channel.state.State; import io.github.dsheirer.module.decode.DecoderType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.Set; import java.util.TreeSet; diff --git a/src/main/java/io/github/dsheirer/channel/metadata/MutableMetadata.java b/src/main/java/io/github/dsheirer/channel/metadata/MutableMetadata.java index 75c8c67d..5b7c6852 100644 --- a/src/main/java/io/github/dsheirer/channel/metadata/MutableMetadata.java +++ b/src/main/java/io/github/dsheirer/channel/metadata/MutableMetadata.java @@ -19,11 +19,11 @@ package io.github.dsheirer.channel.metadata; import io.github.dsheirer.channel.state.State; +import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.sample.Broadcaster; import io.github.dsheirer.sample.Listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.module.decode.DecoderType; public class MutableMetadata extends Metadata implements Listener { diff --git a/src/main/java/io/github/dsheirer/controller/ControllerPanel.java b/src/main/java/io/github/dsheirer/controller/ControllerPanel.java index 9d46bd0e..95bcd3d3 100644 --- a/src/main/java/io/github/dsheirer/controller/ControllerPanel.java +++ b/src/main/java/io/github/dsheirer/controller/ControllerPanel.java @@ -19,6 +19,8 @@ package io.github.dsheirer.controller; import com.jidesoft.swing.JideTabbedPane; +import io.github.dsheirer.alias.AliasController; +import io.github.dsheirer.alias.AliasModel; import io.github.dsheirer.audio.AudioManager; import io.github.dsheirer.audio.AudioPanel; import io.github.dsheirer.audio.broadcast.BroadcastModel; @@ -36,8 +38,6 @@ import io.github.dsheirer.source.SourceManager; import io.github.dsheirer.source.tuner.TunerModel; import io.github.dsheirer.source.tuner.TunerViewPanel; import net.miginfocom.swing.MigLayout; -import io.github.dsheirer.alias.AliasController; -import io.github.dsheirer.alias.AliasModel; import javax.swing.*; import java.awt.*; diff --git a/src/main/java/io/github/dsheirer/controller/channel/Channel.java b/src/main/java/io/github/dsheirer/controller/channel/Channel.java index eaf11b9b..1ce7e070 100644 --- a/src/main/java/io/github/dsheirer/controller/channel/Channel.java +++ b/src/main/java/io/github/dsheirer/controller/channel/Channel.java @@ -18,6 +18,9 @@ ******************************************************************************/ package io.github.dsheirer.controller.channel; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import io.github.dsheirer.controller.config.Configuration; import io.github.dsheirer.module.decode.DecoderFactory; import io.github.dsheirer.module.decode.DecoderType; @@ -38,24 +41,11 @@ import io.github.dsheirer.source.tuner.TunerChannel.Type; import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent.Event; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlTransient; - -@XmlSeeAlso({Configuration.class}) -@XmlRootElement(name = "channel") +@JacksonXmlRootElement(localName = "channel") public class Channel extends Configuration implements Listener { // Standard channels are persisted and traffic channels are temporary - public enum ChannelType - { - STANDARD, TRAFFIC - } - - ; - + public enum ChannelType {STANDARD, TRAFFIC} // Static unique channel identifier tracking private static int UNIQUE_ID = 0; @@ -161,7 +151,7 @@ public class Channel extends Configuration implements Listener ******************************************************************************/ package io.github.dsheirer.controller.channel.map; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlTransient; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + import java.util.ArrayList; import java.util.List; -@XmlSeeAlso( { ChannelRange.class } ) public class ChannelMap { - private String mName; - private boolean mInvalid = false; - - private List mRanges = new ArrayList(); - - public ChannelMap() - { - this( "New Channel Map" ); - } - - public ChannelMap( String name ) - { - mName = name; - } - - public ChannelMap copyOf() - { - ChannelMap map = new ChannelMap( new String( mName ) ); - - for( ChannelRange range: mRanges ) - { - map.addRange( range.copyOf() ); - } - - return map; - } + private String mName; + private boolean mInvalid = false; - @XmlTransient - public boolean isInvalid() - { - return mInvalid; - } + private List mRanges = new ArrayList(); - public String toString() - { - return mName + ( mInvalid ? " - Error" : "" ); - } - - @XmlElement( name = "range" ) - public List getRanges() - { - return mRanges; - } + public ChannelMap() + { + this("New Channel Map"); + } - public void setRanges( List ranges ) - { - mRanges = ranges; - - validate(); - } - - @XmlAttribute - public String getName() - { - return mName; - } - - public void setName( String name ) - { - mName = name; - } - - public long getFrequency( int channelNumber ) - { - for( ChannelRange range: mRanges ) - { - if( range.hasChannel( channelNumber ) ) - { - return range.getFrequency( channelNumber ); - } - } - - return 0; - } + public ChannelMap(String name) + { + mName = name; + } - /** - * Validates each of the channel ranges for overlap - */ - private void validate() - { - mInvalid = false; - - for( int x = 0; x < mRanges.size(); x++ ) - { - if( !mRanges.get( x ).isValid() ) - { - mInvalid = true; - } - - for( int y = x + 1; y < mRanges.size(); y++ ) - { - if( mRanges.get( x ).overlaps( mRanges.get( y ) ) ) - { - mInvalid = true; - } - } - } - } - - - public void addRange( ChannelRange range ) - { - mRanges.add( range ); - - validate(); - } - - public void removeRange( ChannelRange range ) - { - mRanges.remove( range ); - - validate(); - } + public ChannelMap copyOf() + { + ChannelMap map = new ChannelMap(new String(mName)); + + for(ChannelRange range : mRanges) + { + map.addRange(range.copyOf()); + } + + return map; + } + + @JsonIgnore + public boolean isInvalid() + { + return mInvalid; + } + + public String toString() + { + return mName + (mInvalid ? " - Error" : ""); + } + + @JacksonXmlProperty(isAttribute = false, localName = "range") + public List getRanges() + { + return mRanges; + } + + public void setRanges(List ranges) + { + mRanges = ranges; + + validate(); + } + + @JacksonXmlProperty(isAttribute = true, localName = "name") + public String getName() + { + return mName; + } + + public void setName(String name) + { + mName = name; + } + + public long getFrequency(int channelNumber) + { + for(ChannelRange range : mRanges) + { + if(range.hasChannel(channelNumber)) + { + return range.getFrequency(channelNumber); + } + } + + return 0; + } + + /** + * Validates each of the channel ranges for overlap + */ + private void validate() + { + mInvalid = false; + + for(int x = 0; x < mRanges.size(); x++) + { + if(!mRanges.get(x).isValid()) + { + mInvalid = true; + } + + for(int y = x + 1; y < mRanges.size(); y++) + { + if(mRanges.get(x).overlaps(mRanges.get(y))) + { + mInvalid = true; + } + } + } + } + + + public void addRange(ChannelRange range) + { + mRanges.add(range); + + validate(); + } + + public void removeRange(ChannelRange range) + { + mRanges.remove(range); + + validate(); + } } diff --git a/src/main/java/io/github/dsheirer/controller/channel/map/ChannelRange.java b/src/main/java/io/github/dsheirer/controller/channel/map/ChannelRange.java index cf42b39b..35ba0440 100644 --- a/src/main/java/io/github/dsheirer/controller/channel/map/ChannelRange.java +++ b/src/main/java/io/github/dsheirer/controller/channel/map/ChannelRange.java @@ -1,185 +1,188 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014-2016 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 ******************************************************************************/ package io.github.dsheirer.controller.channel.map; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlTransient; -import javax.xml.bind.annotation.XmlType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; + import java.text.DecimalFormat; -@XmlRootElement -@XmlType( name = "range" ) +@JacksonXmlRootElement(localName = "range") public class ChannelRange { - private static final DecimalFormat FREQUENCY_FORMATTER = new DecimalFormat( "#.0000" ); + private static final DecimalFormat FREQUENCY_FORMATTER = new DecimalFormat("#.0000"); - private int mFirst = 1; - private int mLast = 1023; - private int mBase = 450000000; - private int mSize = 12500; - - private boolean mOverlapping = false; + private int mFirst = 1; + private int mLast = 1023; + private int mBase = 450000000; + private int mSize = 12500; - public ChannelRange() - { - } - - public ChannelRange( int first, int last, int base, int size ) - { - mFirst = first; - mLast = last; - mBase = base; - mSize = size; - } + private boolean mOverlapping = false; - public ChannelRange copyOf() - { - return new ChannelRange( mFirst, mLast, mBase, mSize ); - } - - public String getDescription() - { - StringBuilder sb = new StringBuilder(); - - if( isValid() ) - { - sb.append( "First: " ); - sb.append( mFirst + "=" ); - - long frequency = getFrequency( mFirst ); - - sb.append( FREQUENCY_FORMATTER.format( (double)frequency / 1E6D ) ); - sb.append( " Last: " ); - sb.append( mLast + "=" ); - - frequency = getFrequency( mLast ); - sb.append( FREQUENCY_FORMATTER.format( (double)frequency / 1E6D ) ); - sb.append( " MHz" ); - } - else - { - sb.append( "First channel must be smaller than last channel" ); - } - - if( isOverlapping() ) - { - if( sb.length() > 0 ) - { - sb.append( ", " ); - } - - sb.append( "Overlap!" ); - } + public ChannelRange() + { + } - return sb.toString(); - } - - public boolean isValid() - { - return mFirst < mLast; - } - - public boolean overlaps( ChannelRange other ) - { - return ( mFirst <= other.mFirst && other.mFirst <= mLast ) || - ( mFirst <= other.mLast && other.mLast <= mLast ) || - ( mFirst <= other.mFirst && other.mLast <= mLast ) || - ( other.mFirst <= mFirst && mLast <= other.mLast ); - } + public ChannelRange(int first, int last, int base, int size) + { + mFirst = first; + mLast = last; + mBase = base; + mSize = size; + } - @XmlTransient - public boolean isOverlapping() - { - return mOverlapping; - } - - public void setOverlapping( boolean overlapping ) - { - mOverlapping = overlapping; - } - - public boolean hasChannel( int channel ) - { - return mFirst <= channel && channel <= mLast; - } - - public long getFrequency( int channel ) - { - if( hasChannel( channel ) ) - { - return mBase + ( ( channel - mFirst ) * mSize ); - } - else - { - return 0; - } - } - - @XmlAttribute( name = "first" ) - public int getFirstChannelNumber() - { - return mFirst; - } - - public void setFirstChannelNumber( int first ) - { - mFirst = first; - } + public ChannelRange copyOf() + { + return new ChannelRange(mFirst, mLast, mBase, mSize); + } - @XmlAttribute( name = "last" ) - public void setLastChannelNumber( int last ) - { - mLast = last; - } - - public int getLastChannelNumber() - { - return mLast; - } + @JsonIgnore + public String getDescription() + { + StringBuilder sb = new StringBuilder(); - /** - * Sets the base frequency - * @param base frequency in hertz - */ - @XmlAttribute( name = "base" ) - public void setBase( int base ) - { - mBase = base; - } - - public int getBase() - { - return mBase; - } + if(isValid()) + { + sb.append("First: "); + sb.append(mFirst + "="); - /** - * Sets the channel size - * @param size in hertz - */ - @XmlAttribute( name = "size" ) - public void setSize( int size ) - { - mSize = size; - } - - public int getSize() - { - return mSize; - } + long frequency = getFrequency(mFirst); + + sb.append(FREQUENCY_FORMATTER.format((double)frequency / 1E6D)); + sb.append(" Last: "); + sb.append(mLast + "="); + + frequency = getFrequency(mLast); + sb.append(FREQUENCY_FORMATTER.format((double)frequency / 1E6D)); + sb.append(" MHz"); + } + else + { + sb.append("First channel must be smaller than last channel"); + } + + if(isOverlapping()) + { + if(sb.length() > 0) + { + sb.append(", "); + } + + sb.append("Overlap!"); + } + + return sb.toString(); + } + + @JsonIgnore + public boolean isValid() + { + return mFirst < mLast; + } + + public boolean overlaps(ChannelRange other) + { + return (mFirst <= other.mFirst && other.mFirst <= mLast) || + (mFirst <= other.mLast && other.mLast <= mLast) || + (mFirst <= other.mFirst && other.mLast <= mLast) || + (other.mFirst <= mFirst && mLast <= other.mLast); + } + + @JsonIgnore + public boolean isOverlapping() + { + return mOverlapping; + } + + public void setOverlapping(boolean overlapping) + { + mOverlapping = overlapping; + } + + public boolean hasChannel(int channel) + { + return mFirst <= channel && channel <= mLast; + } + + public long getFrequency(int channel) + { + if(hasChannel(channel)) + { + return mBase + ((channel - mFirst) * mSize); + } + else + { + return 0; + } + } + + @JacksonXmlProperty(isAttribute = true, localName = "first") + public int getFirstChannelNumber() + { + return mFirst; + } + + public void setFirstChannelNumber(int first) + { + mFirst = first; + } + + @JacksonXmlProperty(isAttribute = true, localName = "last") + public void setLastChannelNumber(int last) + { + mLast = last; + } + + public int getLastChannelNumber() + { + return mLast; + } + + /** + * Sets the base frequency + * + * @param base frequency in hertz + */ + @JacksonXmlProperty(isAttribute = true, localName = "base") + public void setBase(int base) + { + mBase = base; + } + + public int getBase() + { + return mBase; + } + + /** + * Sets the channel size + * + * @param size in hertz + */ + @JacksonXmlProperty(isAttribute = true, localName = "size") + public void setSize(int size) + { + mSize = size; + } + + public int getSize() + { + return mSize; + } } diff --git a/src/main/java/io/github/dsheirer/controller/config/Configuration.java b/src/main/java/io/github/dsheirer/controller/config/Configuration.java index 62888274..6b639977 100644 --- a/src/main/java/io/github/dsheirer/controller/config/Configuration.java +++ b/src/main/java/io/github/dsheirer/controller/config/Configuration.java @@ -1,40 +1,28 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.controller.config; -import io.github.dsheirer.record.config.RecordConfiguration; -import io.github.dsheirer.source.config.SourceConfiguration; -import io.github.dsheirer.module.decode.config.AuxDecodeConfiguration; -import io.github.dsheirer.module.decode.config.DecodeConfiguration; -import io.github.dsheirer.module.log.config.EventLogConfiguration; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; - -@XmlSeeAlso( { AuxDecodeConfiguration.class, - DecodeConfiguration.class, - EventLogConfiguration.class, - RecordConfiguration.class, - SourceConfiguration.class } ) -@XmlRootElement( name = "configuration" ) +@JacksonXmlRootElement(localName = "configuration") public abstract class Configuration { - public Configuration() - { - } + public Configuration() + { + } } diff --git a/src/main/java/io/github/dsheirer/dsp/filter/cic/RealPrimeCICDecimate.java b/src/main/java/io/github/dsheirer/dsp/filter/cic/RealPrimeCICDecimate.java index d1cfb6f0..2b1b2b82 100644 --- a/src/main/java/io/github/dsheirer/dsp/filter/cic/RealPrimeCICDecimate.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/cic/RealPrimeCICDecimate.java @@ -19,6 +19,8 @@ package io.github.dsheirer.dsp.filter.cic; import io.github.dsheirer.dsp.filter.FilterFactory; import io.github.dsheirer.dsp.filter.Filters; +import io.github.dsheirer.dsp.filter.Window.WindowType; +import io.github.dsheirer.dsp.filter.fir.real.RealFIRFilter_RB_RB; import io.github.dsheirer.dsp.filter.halfband.real.HalfBandFilter_RB_RB; import io.github.dsheirer.sample.Listener; import io.github.dsheirer.sample.decimator.RealDecimator; @@ -28,8 +30,6 @@ import io.github.dsheirer.sample.real.RealToRealBufferAssembler; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.dsp.filter.Window.WindowType; -import io.github.dsheirer.dsp.filter.fir.real.RealFIRFilter_RB_RB; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/io/github/dsheirer/dsp/filter/design/FilterViewer.java b/src/main/java/io/github/dsheirer/dsp/filter/design/FilterViewer.java index 36fecc04..e2e7d9ca 100644 --- a/src/main/java/io/github/dsheirer/dsp/filter/design/FilterViewer.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/design/FilterViewer.java @@ -1,12 +1,12 @@ package io.github.dsheirer.dsp.filter.design; +import io.github.dsheirer.dsp.filter.fir.FIRFilterSpecification; +import io.github.dsheirer.dsp.filter.fir.remez.RemezFIRFilterDesigner; import javafx.application.Application; import javafx.scene.Scene; import javafx.stage.Stage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.dsp.filter.fir.FIRFilterSpecification; -import io.github.dsheirer.dsp.filter.fir.remez.RemezFIRFilterDesigner; public class FilterViewer extends Application { diff --git a/src/main/java/io/github/dsheirer/dsp/filter/halfband/complex/HalfBandFilter_CB_CB.java b/src/main/java/io/github/dsheirer/dsp/filter/halfband/complex/HalfBandFilter_CB_CB.java index 6cc7ac56..337077be 100644 --- a/src/main/java/io/github/dsheirer/dsp/filter/halfband/complex/HalfBandFilter_CB_CB.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/halfband/complex/HalfBandFilter_CB_CB.java @@ -1,8 +1,8 @@ package io.github.dsheirer.dsp.filter.halfband.complex; +import io.github.dsheirer.dsp.filter.halfband.real.HalfBandFilter; import io.github.dsheirer.sample.Listener; import io.github.dsheirer.sample.complex.ComplexBuffer; -import io.github.dsheirer.dsp.filter.halfband.real.HalfBandFilter; public class HalfBandFilter_CB_CB implements Listener { diff --git a/src/main/java/io/github/dsheirer/dsp/filter/polyphase/PolyphaseFIRDecimatingFilter_RB.java b/src/main/java/io/github/dsheirer/dsp/filter/polyphase/PolyphaseFIRDecimatingFilter_RB.java index 2cda8747..0012b2c9 100644 --- a/src/main/java/io/github/dsheirer/dsp/filter/polyphase/PolyphaseFIRDecimatingFilter_RB.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/polyphase/PolyphaseFIRDecimatingFilter_RB.java @@ -21,12 +21,12 @@ import io.github.dsheirer.dsp.filter.design.FilterDesignException; import io.github.dsheirer.dsp.filter.fir.FIRFilter; import io.github.dsheirer.dsp.filter.fir.FIRFilterSpecification; import io.github.dsheirer.dsp.filter.fir.remez.RemezFIRFilterDesigner; +import io.github.dsheirer.dsp.mixer.Oscillator; import io.github.dsheirer.sample.Listener; import io.github.dsheirer.sample.real.RealBuffer; import io.github.dsheirer.sample.real.RealToRealBufferAssembler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.dsp.mixer.Oscillator; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/main/java/io/github/dsheirer/dsp/fsk/FSK2Decoder.java b/src/main/java/io/github/dsheirer/dsp/fsk/FSK2Decoder.java index 2072ca95..142201f5 100644 --- a/src/main/java/io/github/dsheirer/dsp/fsk/FSK2Decoder.java +++ b/src/main/java/io/github/dsheirer/dsp/fsk/FSK2Decoder.java @@ -18,6 +18,8 @@ package io.github.dsheirer.dsp.fsk; import io.github.dsheirer.buffer.BooleanAveragingBuffer; +import io.github.dsheirer.dsp.symbol.SymbolEvent; +import io.github.dsheirer.dsp.symbol.SymbolEvent.Shift; import io.github.dsheirer.instrument.Instrumentable; import io.github.dsheirer.instrument.tap.Tap; import io.github.dsheirer.instrument.tap.TapGroup; @@ -26,8 +28,6 @@ import io.github.dsheirer.sample.Listener; import io.github.dsheirer.sample.real.RealBuffer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.dsp.symbol.SymbolEvent; -import io.github.dsheirer.dsp.symbol.SymbolEvent.Shift; import java.util.ArrayList; import java.util.BitSet; diff --git a/src/main/java/io/github/dsheirer/dsp/fsk/LTRFSKDecoder.java b/src/main/java/io/github/dsheirer/dsp/fsk/LTRFSKDecoder.java index c33231b8..6e473ba6 100644 --- a/src/main/java/io/github/dsheirer/dsp/fsk/LTRFSKDecoder.java +++ b/src/main/java/io/github/dsheirer/dsp/fsk/LTRFSKDecoder.java @@ -18,9 +18,15 @@ package io.github.dsheirer.dsp.fsk; import io.github.dsheirer.dsp.filter.Filters; +import io.github.dsheirer.dsp.filter.FloatHalfBandFilter; import io.github.dsheirer.dsp.filter.FloatHalfBandNoDecimateFilter; import io.github.dsheirer.dsp.filter.LTRPulseShapingFilter; import io.github.dsheirer.dsp.filter.SquaringFilter; +import io.github.dsheirer.dsp.filter.Window.WindowType; +import io.github.dsheirer.dsp.filter.cic.RealPrimeCICDecimate; +import io.github.dsheirer.dsp.filter.dc.IIRSinglePoleDCRemovalFilter; +import io.github.dsheirer.dsp.symbol.Slicer; +import io.github.dsheirer.dsp.symbol.Slicer.Output; import io.github.dsheirer.instrument.Instrumentable; import io.github.dsheirer.instrument.tap.Tap; import io.github.dsheirer.instrument.tap.TapGroup; @@ -30,12 +36,6 @@ import io.github.dsheirer.instrument.tap.stream.FloatTap; import io.github.dsheirer.instrument.tap.stream.SymbolEventTap; import io.github.dsheirer.sample.Listener; import io.github.dsheirer.sample.real.RealBuffer; -import io.github.dsheirer.dsp.filter.FloatHalfBandFilter; -import io.github.dsheirer.dsp.filter.Window.WindowType; -import io.github.dsheirer.dsp.filter.cic.RealPrimeCICDecimate; -import io.github.dsheirer.dsp.filter.dc.IIRSinglePoleDCRemovalFilter; -import io.github.dsheirer.dsp.symbol.Slicer; -import io.github.dsheirer.dsp.symbol.Slicer.Output; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/io/github/dsheirer/dsp/psk/LSMDemodulator.java b/src/main/java/io/github/dsheirer/dsp/psk/LSMDemodulator.java index eb779d66..030ef0d8 100644 --- a/src/main/java/io/github/dsheirer/dsp/psk/LSMDemodulator.java +++ b/src/main/java/io/github/dsheirer/dsp/psk/LSMDemodulator.java @@ -31,6 +31,8 @@ package io.github.dsheirer.dsp.psk; ******************************************************************************/ import io.github.dsheirer.buffer.FloatAveragingBuffer; +import io.github.dsheirer.dsp.filter.interpolator.RealInterpolator; +import io.github.dsheirer.dsp.symbol.Dibit; import io.github.dsheirer.instrument.Instrumentable; import io.github.dsheirer.instrument.tap.Tap; import io.github.dsheirer.instrument.tap.TapGroup; @@ -40,8 +42,6 @@ import io.github.dsheirer.sample.Listener; import io.github.dsheirer.sample.complex.Complex; import io.github.dsheirer.sample.complex.ComplexSampleListener; import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeListener; -import io.github.dsheirer.dsp.filter.interpolator.RealInterpolator; -import io.github.dsheirer.dsp.symbol.Dibit; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/main/java/io/github/dsheirer/dsp/psk/QPSKPolarSlicer.java b/src/main/java/io/github/dsheirer/dsp/psk/QPSKPolarSlicer.java index ace9e855..3ff0c708 100644 --- a/src/main/java/io/github/dsheirer/dsp/psk/QPSKPolarSlicer.java +++ b/src/main/java/io/github/dsheirer/dsp/psk/QPSKPolarSlicer.java @@ -1,9 +1,9 @@ package io.github.dsheirer.dsp.psk; +import io.github.dsheirer.dsp.symbol.Dibit; import io.github.dsheirer.sample.Broadcaster; import io.github.dsheirer.sample.Listener; import io.github.dsheirer.sample.complex.Complex; -import io.github.dsheirer.dsp.symbol.Dibit; /******************************************************************************* * SDR Trunk diff --git a/src/main/java/io/github/dsheirer/dsp/psk/QPSKStarSlicer.java b/src/main/java/io/github/dsheirer/dsp/psk/QPSKStarSlicer.java index 9b54ec4f..f6b23861 100644 --- a/src/main/java/io/github/dsheirer/dsp/psk/QPSKStarSlicer.java +++ b/src/main/java/io/github/dsheirer/dsp/psk/QPSKStarSlicer.java @@ -1,9 +1,9 @@ package io.github.dsheirer.dsp.psk; +import io.github.dsheirer.dsp.symbol.Dibit; import io.github.dsheirer.sample.Broadcaster; import io.github.dsheirer.sample.Listener; import io.github.dsheirer.sample.complex.Complex; -import io.github.dsheirer.dsp.symbol.Dibit; public class QPSKStarSlicer implements Listener { diff --git a/src/main/java/io/github/dsheirer/gui/SDRTrunk.java b/src/main/java/io/github/dsheirer/gui/SDRTrunk.java index 21bfaedb..79cedda4 100644 --- a/src/main/java/io/github/dsheirer/gui/SDRTrunk.java +++ b/src/main/java/io/github/dsheirer/gui/SDRTrunk.java @@ -19,6 +19,8 @@ package io.github.dsheirer.gui; import com.jidesoft.swing.JideSplitPane; +import io.github.dsheirer.alias.AliasModel; +import io.github.dsheirer.alias.action.AliasActionManager; import io.github.dsheirer.audio.AudioManager; import io.github.dsheirer.audio.broadcast.BroadcastModel; import io.github.dsheirer.audio.broadcast.BroadcastStatusPanel; @@ -29,6 +31,7 @@ import io.github.dsheirer.controller.channel.ChannelSelectionManager; import io.github.dsheirer.controller.channel.map.ChannelMapModel; import io.github.dsheirer.icon.IconManager; import io.github.dsheirer.map.MapService; +import io.github.dsheirer.module.log.EventLogManager; import io.github.dsheirer.playlist.PlaylistManager; import io.github.dsheirer.properties.SystemProperties; import io.github.dsheirer.record.RecorderManager; @@ -46,9 +49,6 @@ import net.miginfocom.swing.MigLayout; import org.apache.commons.io.FileUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.AliasModel; -import io.github.dsheirer.alias.action.AliasActionManager; -import io.github.dsheirer.module.log.EventLogManager; import javax.imageio.ImageIO; import javax.swing.*; diff --git a/src/main/java/io/github/dsheirer/icon/Icon.java b/src/main/java/io/github/dsheirer/icon/Icon.java index fe59ea6c..6c3024a9 100644 --- a/src/main/java/io/github/dsheirer/icon/Icon.java +++ b/src/main/java/io/github/dsheirer/icon/Icon.java @@ -18,15 +18,15 @@ ******************************************************************************/ package io.github.dsheirer.icon; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.swing.*; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlTransient; -@XmlRootElement(name = "icon") +@JacksonXmlRootElement(localName = "icon") public class Icon implements Comparable { private final static Logger mLog = LoggerFactory.getLogger(Icon.class); @@ -46,7 +46,7 @@ public class Icon implements Comparable mPath = path; } - @XmlAttribute(name = "name") + @JacksonXmlProperty(isAttribute = true, localName = "name") public String getName() { return mName; @@ -62,7 +62,7 @@ public class Icon implements Comparable return mName; } - @XmlAttribute(name = "path") + @JacksonXmlProperty(isAttribute = true, localName = "path") public String getPath() { return mPath; @@ -73,7 +73,7 @@ public class Icon implements Comparable mPath = path; } - @XmlTransient + @JsonIgnore public ImageIcon getIcon() { if(mImageIcon == null && mPath != null) diff --git a/src/main/java/io/github/dsheirer/icon/IconManager.java b/src/main/java/io/github/dsheirer/icon/IconManager.java index e78e0a37..66e2dbe4 100644 --- a/src/main/java/io/github/dsheirer/icon/IconManager.java +++ b/src/main/java/io/github/dsheirer/icon/IconManager.java @@ -1,21 +1,19 @@ -/******************************************************************************* +/* + * ********************************************************************************************************************* * sdrtrunk * Copyright (C) 2014-2017 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 - * - ******************************************************************************/ + * You should have received a copy of the GNU General Public License along with this program. + * If not, see + * ********************************************************************************************************************* + */ package io.github.dsheirer.icon; import io.github.dsheirer.properties.SystemProperties; diff --git a/src/main/java/io/github/dsheirer/icon/IconSet.java b/src/main/java/io/github/dsheirer/icon/IconSet.java index 40c4be69..86e61434 100644 --- a/src/main/java/io/github/dsheirer/icon/IconSet.java +++ b/src/main/java/io/github/dsheirer/icon/IconSet.java @@ -18,13 +18,13 @@ ******************************************************************************/ package io.github.dsheirer.icon; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; + import java.util.ArrayList; import java.util.List; -@XmlRootElement(name="iconset") +@JacksonXmlRootElement(localName = "iconset") public class IconSet { private String mDefaultIcon; @@ -45,7 +45,7 @@ public class IconSet mIcons.remove(icon); } - @XmlElement(name = "icon") + @JacksonXmlProperty(isAttribute = false, localName = "icon") public List getIcons() { if(mIcons == null) @@ -61,7 +61,7 @@ public class IconSet mIcons = icons; } - @XmlAttribute(name = "default") + @JacksonXmlProperty(isAttribute = true, localName = "default") public String getDefaultIcon() { return mDefaultIcon; diff --git a/src/main/java/io/github/dsheirer/instrument/InstrumentableProcessingChain.java b/src/main/java/io/github/dsheirer/instrument/InstrumentableProcessingChain.java index ac47aa8b..d2a99b2f 100644 --- a/src/main/java/io/github/dsheirer/instrument/InstrumentableProcessingChain.java +++ b/src/main/java/io/github/dsheirer/instrument/InstrumentableProcessingChain.java @@ -21,9 +21,9 @@ package io.github.dsheirer.instrument; import io.github.dsheirer.controller.channel.Channel.ChannelType; import io.github.dsheirer.instrument.tap.Tap; import io.github.dsheirer.instrument.tap.TapGroup; -import io.github.dsheirer.source.Source; import io.github.dsheirer.module.Module; import io.github.dsheirer.module.ProcessingChain; +import io.github.dsheirer.source.Source; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/io/github/dsheirer/instrument/gui/DecoderSelectionFrame.java b/src/main/java/io/github/dsheirer/instrument/gui/DecoderSelectionFrame.java index 588c9895..00df6945 100644 --- a/src/main/java/io/github/dsheirer/instrument/gui/DecoderSelectionFrame.java +++ b/src/main/java/io/github/dsheirer/instrument/gui/DecoderSelectionFrame.java @@ -1,13 +1,13 @@ package io.github.dsheirer.instrument.gui; +import io.github.dsheirer.alias.AliasModel; import io.github.dsheirer.audio.broadcast.BroadcastModel; import io.github.dsheirer.controller.channel.ChannelModel; import io.github.dsheirer.controller.channel.map.ChannelMapModel; +import io.github.dsheirer.module.decode.DecodeConfigurationEditor; import io.github.dsheirer.playlist.PlaylistManager; import io.github.dsheirer.source.IControllableFileSource; import net.miginfocom.swing.MigLayout; -import io.github.dsheirer.alias.AliasModel; -import io.github.dsheirer.module.decode.DecodeConfigurationEditor; import javax.swing.*; import java.awt.*; diff --git a/src/main/java/io/github/dsheirer/instrument/tap/event/SyncDetectTap.java b/src/main/java/io/github/dsheirer/instrument/tap/event/SyncDetectTap.java index f93fd74b..c027b596 100644 --- a/src/main/java/io/github/dsheirer/instrument/tap/event/SyncDetectTap.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/event/SyncDetectTap.java @@ -17,11 +17,11 @@ ******************************************************************************/ package io.github.dsheirer.instrument.tap.event; +import io.github.dsheirer.dsp.symbol.SyncDetectListener; +import io.github.dsheirer.dsp.symbol.SyncDetectProvider; import io.github.dsheirer.instrument.tap.Tap; import io.github.dsheirer.instrument.tap.TapListener; import io.github.dsheirer.instrument.tap.TapType; -import io.github.dsheirer.dsp.symbol.SyncDetectListener; -import io.github.dsheirer.dsp.symbol.SyncDetectProvider; public class SyncDetectTap extends Tap implements SyncDetectListener, diff --git a/src/main/java/io/github/dsheirer/instrument/tap/stream/DibitTap.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/DibitTap.java index 57c35663..dcd30186 100644 --- a/src/main/java/io/github/dsheirer/instrument/tap/stream/DibitTap.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/DibitTap.java @@ -17,10 +17,10 @@ ******************************************************************************/ package io.github.dsheirer.instrument.tap.stream; +import io.github.dsheirer.dsp.symbol.Dibit; import io.github.dsheirer.instrument.tap.TapListener; import io.github.dsheirer.instrument.tap.TapType; import io.github.dsheirer.sample.Listener; -import io.github.dsheirer.dsp.symbol.Dibit; public class DibitTap extends StreamTap implements Listener diff --git a/src/main/java/io/github/dsheirer/instrument/tap/stream/DibitTapViewPanel.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/DibitTapViewPanel.java index 785cb6a6..7a53e622 100644 --- a/src/main/java/io/github/dsheirer/instrument/tap/stream/DibitTapViewPanel.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/DibitTapViewPanel.java @@ -17,10 +17,10 @@ ******************************************************************************/ package io.github.dsheirer.instrument.tap.stream; +import io.github.dsheirer.dsp.symbol.Dibit; import io.github.dsheirer.instrument.gui.SampleModel; import io.github.dsheirer.instrument.tap.Tap; import io.github.dsheirer.instrument.tap.TapViewPanel; -import io.github.dsheirer.dsp.symbol.Dibit; import java.awt.*; import java.awt.geom.Path2D; diff --git a/src/main/java/io/github/dsheirer/instrument/tap/stream/SymbolEventTap.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/SymbolEventTap.java index d2995ea7..8954be23 100644 --- a/src/main/java/io/github/dsheirer/instrument/tap/stream/SymbolEventTap.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/SymbolEventTap.java @@ -17,10 +17,10 @@ ******************************************************************************/ package io.github.dsheirer.instrument.tap.stream; +import io.github.dsheirer.dsp.symbol.SymbolEvent; import io.github.dsheirer.instrument.tap.TapListener; import io.github.dsheirer.instrument.tap.TapType; import io.github.dsheirer.sample.Listener; -import io.github.dsheirer.dsp.symbol.SymbolEvent; public class SymbolEventTap extends StreamTap implements Listener { diff --git a/src/main/java/io/github/dsheirer/instrument/tap/stream/SymbolEventTapViewPanel.java b/src/main/java/io/github/dsheirer/instrument/tap/stream/SymbolEventTapViewPanel.java index b66cf0d6..fb271bcb 100644 --- a/src/main/java/io/github/dsheirer/instrument/tap/stream/SymbolEventTapViewPanel.java +++ b/src/main/java/io/github/dsheirer/instrument/tap/stream/SymbolEventTapViewPanel.java @@ -17,9 +17,9 @@ ******************************************************************************/ package io.github.dsheirer.instrument.tap.stream; +import io.github.dsheirer.dsp.symbol.SymbolEvent; import io.github.dsheirer.instrument.gui.SampleModel; import io.github.dsheirer.instrument.tap.TapViewPanel; -import io.github.dsheirer.dsp.symbol.SymbolEvent; import java.awt.*; import java.awt.geom.Path2D; diff --git a/src/main/java/io/github/dsheirer/map/DefaultIcon.java b/src/main/java/io/github/dsheirer/map/DefaultIcon.java index 45f4a9f7..43cb2710 100644 --- a/src/main/java/io/github/dsheirer/map/DefaultIcon.java +++ b/src/main/java/io/github/dsheirer/map/DefaultIcon.java @@ -17,8 +17,10 @@ ******************************************************************************/ package io.github.dsheirer.map; +import com.fasterxml.jackson.annotation.JsonSubTypes; import io.github.dsheirer.settings.Setting; +@JsonSubTypes.Type(value = DefaultIcon.class, name = "defaultIcon") public class DefaultIcon extends Setting { public DefaultIcon( String name ) diff --git a/src/main/java/io/github/dsheirer/map/MapIcon.java b/src/main/java/io/github/dsheirer/map/MapIcon.java index aadc7df3..2bc1785e 100644 --- a/src/main/java/io/github/dsheirer/map/MapIcon.java +++ b/src/main/java/io/github/dsheirer/map/MapIcon.java @@ -1,187 +1,190 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.map; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.settings.Setting; import javax.swing.*; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlTransient; import java.awt.*; +@JsonSubTypes.Type(value = MapIcon.class, name = "mapIcon") public class MapIcon extends Setting implements Comparable { - private static final int sMAX_IMAGE_DIMENSION = 48; - private String mPath; - private ImageIcon mImageIcon; + private static final int sMAX_IMAGE_DIMENSION = 48; + private String mPath; + private ImageIcon mImageIcon; - /** - * Only map icons created at runtime can be marked as non-editable, and - * therefore this property is transient. - */ - @XmlTransient - private boolean mEditable; - - @XmlTransient - private boolean mDefaultIcon; - - /** - * Wrapper class for a map icon. - * @param name - name of the icon - also used as key to lookup the icon - * @param path - file path to the icon - * @param editable - defines if the map icon or details can be edited - * - * Note: the default icons are constructed with editable = false, so that - * they cannot be deleted from the Icon Manager editor window - */ - public MapIcon( String name, String path, boolean editable ) - { - super( name ); - mPath = path; - mEditable = editable; - } - - public MapIcon( String name, String path ) - { - this( name, path, true ); - } + /** + * Only map icons created at runtime can be marked as non-editable, and + * therefore this property is transient. + */ + @JsonIgnore + private boolean mEditable; - /** - * Don't use this constructor. This is used by JAXB to unmarshall saved - * map icons. - */ - public MapIcon() - { - mEditable = true; - } + @JsonIgnore + private boolean mDefaultIcon; - - @XmlAttribute( name="editable" ) - public boolean isEditable() - { - return mEditable; - } - - @XmlAttribute( name="default" ) - public boolean isDefaultIcon() - { - return mDefaultIcon; - } - - public void setDefaultIcon( boolean isDefault ) - { - mDefaultIcon = isDefault; - } - - public ImageIcon getImageIcon() - { - if( mImageIcon == null ) - { - mImageIcon = new ImageIcon( mPath ); - - /** - * If the image is too big, scale it down to max pixel size squared - */ - if( mImageIcon.getIconWidth() > sMAX_IMAGE_DIMENSION || - mImageIcon.getIconHeight() > sMAX_IMAGE_DIMENSION ) - { - /** - * getScaled instance will correct any negative value to the - * correct value, maintaining original aspect ratio. So, we - * only scale the larger value, and allow the image class to - * determine the correct value for the other measurement - */ - int height = -1; - int width = -1; - - /** - * Use the larger width or height value to determine the - * scaling factor - */ - if( mImageIcon.getIconHeight() > mImageIcon.getIconWidth() ) - { - height = sMAX_IMAGE_DIMENSION; - } - else - { - width = sMAX_IMAGE_DIMENSION; - } - - mImageIcon = new ImageIcon( mImageIcon.getImage() - .getScaledInstance( width, height, Image.SCALE_SMOOTH ) ); - } - - } - - return mImageIcon; - } - - @XmlAttribute( name="path" ) - public String getPath() - { - return mPath; - } - - public void setPath( String path ) - { - mPath = path; - } - - public String toString() - { - if( mDefaultIcon ) - { - return getName() + " (default)"; - } - else - { - return getName(); - } - } - - @Override - public boolean equals( Object obj ) - { - if( obj instanceof MapIcon ) - { - MapIcon other = (MapIcon)obj; - - return other.getName().contentEquals( getName() ) && - other.getPath().contentEquals( getPath() ); - } - else - { - return false; - } - } - - @Override - public int hashCode() - { - return getName().hashCode() + getPath().hashCode(); - } - - /** - * Sort order is determined by the icon name - */ - @Override - public int compareTo( MapIcon other ) + /** + * Wrapper class for a map icon. + * + * @param name - name of the icon - also used as key to lookup the icon + * @param path - file path to the icon + * @param editable - defines if the map icon or details can be edited + * + * Note: the default icons are constructed with editable = false, so that + * they cannot be deleted from the Icon Manager editor window + */ + public MapIcon(String name, String path, boolean editable) { - return getName().compareTo( other.getName() ); + super(name); + mPath = path; + mEditable = editable; + } + + public MapIcon(String name, String path) + { + this(name, path, true); + } + + /** + * Don't use this constructor. This is used by JAXB to unmarshall saved + * map icons. + */ + public MapIcon() + { + mEditable = true; + } + + + @JacksonXmlProperty(isAttribute = true, localName = "editable") + public boolean isEditable() + { + return mEditable; + } + + @JacksonXmlProperty(isAttribute = true, localName = "default") + public boolean isDefaultIcon() + { + return mDefaultIcon; + } + + public void setDefaultIcon(boolean isDefault) + { + mDefaultIcon = isDefault; + } + + public ImageIcon getImageIcon() + { + if(mImageIcon == null) + { + mImageIcon = new ImageIcon(mPath); + + /** + * If the image is too big, scale it down to max pixel size squared + */ + if(mImageIcon.getIconWidth() > sMAX_IMAGE_DIMENSION || + mImageIcon.getIconHeight() > sMAX_IMAGE_DIMENSION) + { + /** + * getScaled instance will correct any negative value to the + * correct value, maintaining original aspect ratio. So, we + * only scale the larger value, and allow the image class to + * determine the correct value for the other measurement + */ + int height = -1; + int width = -1; + + /** + * Use the larger width or height value to determine the + * scaling factor + */ + if(mImageIcon.getIconHeight() > mImageIcon.getIconWidth()) + { + height = sMAX_IMAGE_DIMENSION; + } + else + { + width = sMAX_IMAGE_DIMENSION; + } + + mImageIcon = new ImageIcon(mImageIcon.getImage() + .getScaledInstance(width, height, Image.SCALE_SMOOTH)); + } + + } + + return mImageIcon; + } + + @JacksonXmlProperty(isAttribute = true, localName = "path") + public String getPath() + { + return mPath; + } + + public void setPath(String path) + { + mPath = path; + } + + public String toString() + { + if(mDefaultIcon) + { + return getName() + " (default)"; + } + else + { + return getName(); + } + } + + @Override + public boolean equals(Object obj) + { + if(obj instanceof MapIcon) + { + MapIcon other = (MapIcon)obj; + + return other.getName().contentEquals(getName()) && + other.getPath().contentEquals(getPath()); + } + else + { + return false; + } + } + + @Override + public int hashCode() + { + return getName().hashCode() + getPath().hashCode(); + } + + /** + * Sort order is determined by the icon name + */ + @Override + public int compareTo(MapIcon other) + { + return getName().compareTo(other.getName()); } } diff --git a/src/main/java/io/github/dsheirer/map/MapService.java b/src/main/java/io/github/dsheirer/map/MapService.java index 0cb4ebba..80d53f77 100644 --- a/src/main/java/io/github/dsheirer/map/MapService.java +++ b/src/main/java/io/github/dsheirer/map/MapService.java @@ -18,10 +18,10 @@ ******************************************************************************/ package io.github.dsheirer.map; +import io.github.dsheirer.alias.Alias; import io.github.dsheirer.icon.IconManager; import io.github.dsheirer.message.Message; import io.github.dsheirer.sample.Listener; -import io.github.dsheirer.alias.Alias; import java.awt.*; import java.util.ArrayList; diff --git a/src/main/java/io/github/dsheirer/map/PlottableEntity.java b/src/main/java/io/github/dsheirer/map/PlottableEntity.java index 77d91328..62bfb474 100644 --- a/src/main/java/io/github/dsheirer/map/PlottableEntity.java +++ b/src/main/java/io/github/dsheirer/map/PlottableEntity.java @@ -17,8 +17,8 @@ ******************************************************************************/ package io.github.dsheirer.map; -import org.jdesktop.swingx.mapviewer.GeoPosition; import io.github.dsheirer.alias.Alias; +import org.jdesktop.swingx.mapviewer.GeoPosition; import java.awt.*; import java.util.Collections; diff --git a/src/main/java/io/github/dsheirer/module/decode/am/DecodeConfigAM.java b/src/main/java/io/github/dsheirer/module/decode/am/DecodeConfigAM.java index edfce6aa..81024e74 100644 --- a/src/main/java/io/github/dsheirer/module/decode/am/DecodeConfigAM.java +++ b/src/main/java/io/github/dsheirer/module/decode/am/DecodeConfigAM.java @@ -17,6 +17,7 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.am; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.module.decode.config.DecodeConfiguration; @@ -24,11 +25,15 @@ public class DecodeConfigAM extends DecodeConfiguration { public DecodeConfigAM() { - super( DecoderType.AM ); - setAFC( false ); } - + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + public DecoderType getDecoderType() + { + return DecoderType.AM; + } + public boolean supportsAFC() { return false; diff --git a/src/main/java/io/github/dsheirer/module/decode/config/AuxDecodeConfiguration.java b/src/main/java/io/github/dsheirer/module/decode/config/AuxDecodeConfiguration.java index ce6a4170..b37b455f 100644 --- a/src/main/java/io/github/dsheirer/module/decode/config/AuxDecodeConfiguration.java +++ b/src/main/java/io/github/dsheirer/module/decode/config/AuxDecodeConfiguration.java @@ -17,12 +17,14 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.config; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.controller.config.Configuration; import io.github.dsheirer.module.decode.DecoderType; -import javax.xml.bind.annotation.XmlElement; import java.util.ArrayList; +@JsonSubTypes.Type(value = AuxDecodeConfiguration.class, name = "auxDecodeConfiguration") public class AuxDecodeConfiguration extends Configuration { ArrayList mAuxDecoders = new ArrayList(); @@ -31,7 +33,7 @@ public class AuxDecodeConfiguration extends Configuration { } - @XmlElement( name="aux_decoder" ) + @JacksonXmlProperty(isAttribute = false, localName = "aux_decoder") public ArrayList getAuxDecoders() { return mAuxDecoders; diff --git a/src/main/java/io/github/dsheirer/module/decode/config/DecodeConfiguration.java b/src/main/java/io/github/dsheirer/module/decode/config/DecodeConfiguration.java index 0b73d790..ca65a6e5 100644 --- a/src/main/java/io/github/dsheirer/module/decode/config/DecodeConfiguration.java +++ b/src/main/java/io/github/dsheirer/module/decode/config/DecodeConfiguration.java @@ -1,22 +1,27 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.module.decode.config; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import io.github.dsheirer.controller.config.Configuration; import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.module.decode.am.DecodeConfigAM; @@ -27,78 +32,69 @@ import io.github.dsheirer.module.decode.nbfm.DecodeConfigNBFM; import io.github.dsheirer.module.decode.p25.DecodeConfigP25Phase1; import io.github.dsheirer.module.decode.passport.DecodeConfigPassport; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; - -@XmlSeeAlso( { DecodeConfigAM.class, - DecodeConfigNBFM.class, - DecodeConfigLTRNet.class, - DecodeConfigLTRStandard.class, - DecodeConfigMPT1327.class, - DecodeConfigPassport.class, - DecodeConfigP25Phase1.class } ) -@XmlRootElement( name = "decode_configuration" ) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = DecodeConfigAM.class, name = "decodeConfigAM"), + @JsonSubTypes.Type(value = DecodeConfigLTRNet.class, name = "decodeConfigLTRNet"), + @JsonSubTypes.Type(value = DecodeConfigLTRStandard.class, name = "decodeConfigLTRStandard"), + @JsonSubTypes.Type(value = DecodeConfigMPT1327.class, name = "decodeConfigMPT1327"), + @JsonSubTypes.Type(value = DecodeConfigNBFM.class, name = "decodeConfigNBFM"), + @JsonSubTypes.Type(value = DecodeConfigP25Phase1.class, name = "decodeConfigP25Phase1"), + @JsonSubTypes.Type(value = DecodeConfigPassport.class, name = "decodeConfigPassport") +}) +@JacksonXmlRootElement(localName = "decode_configuration") public abstract class DecodeConfiguration extends Configuration { - public static final int DEFAULT_CALL_TIMEOUT_SECONDS = 45; - public static final int CALL_TIMEOUT_MINIMUM = 1; - public static final int CALL_TIMEOUT_MAXIMUM = 300; //5 minutes - - public static final int TRAFFIC_CHANNEL_LIMIT_DEFAULT = 3; - public static final int TRAFFIC_CHANNEL_LIMIT_MINIMUM = 0; - public static final int TRAFFIC_CHANNEL_LIMIT_MAXIMUM = 30; + public static final int DEFAULT_CALL_TIMEOUT_SECONDS = 45; + public static final int CALL_TIMEOUT_MINIMUM = 1; + public static final int CALL_TIMEOUT_MAXIMUM = 300; //5 minutes - public static final int DEFAULT_AFC_MAX_CORRECTION = 1000; - - private DecoderType mDecoderType = DecoderType.NBFM; - private boolean mAFCEnabled = true; - private int mAFCMaxCorrection = DEFAULT_AFC_MAX_CORRECTION; + public static final int TRAFFIC_CHANNEL_LIMIT_DEFAULT = 3; + public static final int TRAFFIC_CHANNEL_LIMIT_MINIMUM = 0; + public static final int TRAFFIC_CHANNEL_LIMIT_MAXIMUM = 30; - public DecodeConfiguration() - { - this( DecoderType.NBFM ); - } - - public DecodeConfiguration( DecoderType type ) - { - mDecoderType = type; - } + public static final int DEFAULT_AFC_MAX_CORRECTION = 1000; - public DecoderType getDecoderType() - { - return mDecoderType; - } + private boolean mAFCEnabled = true; + private int mAFCMaxCorrection = DEFAULT_AFC_MAX_CORRECTION; - @XmlAttribute( name = "afc" ) - public boolean getAFC() - { - return mAFCEnabled; - } - - public boolean isAFCEnabled() - { - return mAFCEnabled; - } - - public void setAFC( boolean enabled ) - { - mAFCEnabled = enabled; - } - - @XmlAttribute( name = "AFCMaximumCorrection" ) - public int getAFCMaximumCorrection() - { - return mAFCMaxCorrection; - } - - public void setAFCMaximumCorrection( int max ) - { - mAFCMaxCorrection = max; - } - - public boolean supportsAFC() - { - return true; - } + public DecodeConfiguration() + { + } + + @JsonIgnore + public abstract DecoderType getDecoderType(); + + @JacksonXmlProperty(isAttribute = true, localName = "afc") + public boolean getAFC() + { + return mAFCEnabled; + } + + @JsonIgnore + public boolean isAFCEnabled() + { + return mAFCEnabled; + } + + public void setAFC(boolean enabled) + { + mAFCEnabled = enabled; + } + + @JacksonXmlProperty(isAttribute = true, localName = "AFCMaximumCorrection") + public int getAFCMaximumCorrection() + { + return mAFCMaxCorrection; + } + + public void setAFCMaximumCorrection(int max) + { + mAFCMaxCorrection = max; + } + + public boolean supportsAFC() + { + return true; + } } diff --git a/src/main/java/io/github/dsheirer/module/decode/event/CallEventAliasCellRenderer.java b/src/main/java/io/github/dsheirer/module/decode/event/CallEventAliasCellRenderer.java index 46ceacea..302d08fe 100644 --- a/src/main/java/io/github/dsheirer/module/decode/event/CallEventAliasCellRenderer.java +++ b/src/main/java/io/github/dsheirer/module/decode/event/CallEventAliasCellRenderer.java @@ -18,10 +18,10 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.event; +import io.github.dsheirer.alias.Alias; import io.github.dsheirer.icon.IconManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.Alias; import javax.swing.*; import javax.swing.table.DefaultTableCellRenderer; diff --git a/src/main/java/io/github/dsheirer/module/decode/event/CallEventModel.java b/src/main/java/io/github/dsheirer/module/decode/event/CallEventModel.java index bbd8335b..93ed0fcb 100644 --- a/src/main/java/io/github/dsheirer/module/decode/event/CallEventModel.java +++ b/src/main/java/io/github/dsheirer/module/decode/event/CallEventModel.java @@ -17,8 +17,8 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.event; -import io.github.dsheirer.sample.Listener; import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.sample.Listener; import javax.swing.table.AbstractTableModel; import java.text.DecimalFormat; diff --git a/src/main/java/io/github/dsheirer/module/decode/event/CallEventPanel.java b/src/main/java/io/github/dsheirer/module/decode/event/CallEventPanel.java index c2aec182..0223e56b 100644 --- a/src/main/java/io/github/dsheirer/module/decode/event/CallEventPanel.java +++ b/src/main/java/io/github/dsheirer/module/decode/event/CallEventPanel.java @@ -19,9 +19,9 @@ package io.github.dsheirer.module.decode.event; import io.github.dsheirer.icon.IconManager; +import io.github.dsheirer.module.ProcessingChain; import io.github.dsheirer.sample.Listener; import net.miginfocom.swing.MigLayout; -import io.github.dsheirer.module.ProcessingChain; import javax.swing.*; import java.awt.*; diff --git a/src/main/java/io/github/dsheirer/module/decode/fleetsync1/Fleetsync1Message.java b/src/main/java/io/github/dsheirer/module/decode/fleetsync1/Fleetsync1Message.java index 3fb9dafe..14bccd61 100644 --- a/src/main/java/io/github/dsheirer/module/decode/fleetsync1/Fleetsync1Message.java +++ b/src/main/java/io/github/dsheirer/module/decode/fleetsync1/Fleetsync1Message.java @@ -17,10 +17,10 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.fleetsync1; +import io.github.dsheirer.alias.Alias; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.map.Plottable; import io.github.dsheirer.message.Message; -import io.github.dsheirer.alias.Alias; import java.text.SimpleDateFormat; import java.util.ArrayList; diff --git a/src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2Decoder.java b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2Decoder.java index e90cca2a..072d28f4 100644 --- a/src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2Decoder.java +++ b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2Decoder.java @@ -17,24 +17,24 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.fleetsync2; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.MessageFramer; import io.github.dsheirer.bits.SyncPattern; -import io.github.dsheirer.instrument.Instrumentable; -import io.github.dsheirer.instrument.tap.Tap; -import io.github.dsheirer.instrument.tap.TapGroup; -import io.github.dsheirer.instrument.tap.stream.BinaryTap; -import io.github.dsheirer.instrument.tap.stream.FloatBufferTap; -import io.github.dsheirer.sample.Listener; -import io.github.dsheirer.sample.real.IFilteredRealBufferListener; -import io.github.dsheirer.sample.real.RealBuffer; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.dsp.filter.Filters; import io.github.dsheirer.dsp.filter.fir.real.RealFIRFilter_RB_RB; import io.github.dsheirer.dsp.filter.halfband.real.HalfBandFilter_RB_RB; import io.github.dsheirer.dsp.fsk.FSK2Decoder; import io.github.dsheirer.dsp.fsk.FSK2Decoder.Output; +import io.github.dsheirer.instrument.Instrumentable; +import io.github.dsheirer.instrument.tap.Tap; +import io.github.dsheirer.instrument.tap.TapGroup; +import io.github.dsheirer.instrument.tap.stream.BinaryTap; +import io.github.dsheirer.instrument.tap.stream.FloatBufferTap; import io.github.dsheirer.module.decode.Decoder; import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.IFilteredRealBufferListener; +import io.github.dsheirer.sample.real.RealBuffer; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2DecoderState.java b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2DecoderState.java index 8d100ef7..0c49e560 100644 --- a/src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2DecoderState.java +++ b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2DecoderState.java @@ -18,6 +18,9 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.fleetsync2; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.alias.id.AliasIDType; import io.github.dsheirer.channel.metadata.AliasedStringAttributeMonitor; import io.github.dsheirer.channel.metadata.Attribute; import io.github.dsheirer.channel.metadata.AttributeChangeRequest; @@ -28,9 +31,6 @@ import io.github.dsheirer.channel.state.State; import io.github.dsheirer.message.Message; import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.util.StringUtils; -import io.github.dsheirer.alias.Alias; -import io.github.dsheirer.alias.AliasList; -import io.github.dsheirer.alias.id.AliasIDType; import java.util.Iterator; import java.util.TreeSet; diff --git a/src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2MessageProcessor.java b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2MessageProcessor.java index 0ad060df..c958b785 100644 --- a/src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2MessageProcessor.java +++ b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/Fleetsync2MessageProcessor.java @@ -17,10 +17,10 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.fleetsync2; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.message.Message; import io.github.dsheirer.sample.Listener; -import io.github.dsheirer.alias.AliasList; public class Fleetsync2MessageProcessor implements Listener { diff --git a/src/main/java/io/github/dsheirer/module/decode/fleetsync2/FleetsyncCallEvent.java b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/FleetsyncCallEvent.java index 9941f688..70fb96e7 100644 --- a/src/main/java/io/github/dsheirer/module/decode/fleetsync2/FleetsyncCallEvent.java +++ b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/FleetsyncCallEvent.java @@ -17,9 +17,9 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.fleetsync2; -import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.alias.Alias; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.module.decode.event.CallEvent; public class FleetsyncCallEvent extends CallEvent diff --git a/src/main/java/io/github/dsheirer/module/decode/fleetsync2/FleetsyncMessage.java b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/FleetsyncMessage.java index 2efb8d7c..206aa3fd 100644 --- a/src/main/java/io/github/dsheirer/module/decode/fleetsync2/FleetsyncMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/fleetsync2/FleetsyncMessage.java @@ -17,14 +17,14 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.fleetsync2; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.edac.CRC; import io.github.dsheirer.edac.CRCFleetsync; import io.github.dsheirer.map.Plottable; import io.github.dsheirer.message.Message; import org.jdesktop.swingx.mapviewer.GeoPosition; -import io.github.dsheirer.alias.Alias; -import io.github.dsheirer.alias.AliasList; import java.text.DecimalFormat; import java.text.SimpleDateFormat; diff --git a/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200CallEvent.java b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200CallEvent.java index e6959919..c90d3df1 100644 --- a/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200CallEvent.java +++ b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200CallEvent.java @@ -17,9 +17,9 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.lj1200; -import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.alias.Alias; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.module.decode.event.CallEvent; public class LJ1200CallEvent extends CallEvent diff --git a/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200Decoder.java b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200Decoder.java index 308bcf75..fb19a8d2 100644 --- a/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200Decoder.java +++ b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200Decoder.java @@ -17,27 +17,27 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.lj1200; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.MessageFramer; import io.github.dsheirer.bits.SyncPattern; +import io.github.dsheirer.dsp.filter.Filters; +import io.github.dsheirer.dsp.filter.fir.real.RealFIRFilter_RB_RB; +import io.github.dsheirer.dsp.filter.halfband.real.HalfBandFilter_RB_RB; +import io.github.dsheirer.dsp.fsk.FSK2Decoder; +import io.github.dsheirer.dsp.fsk.FSK2Decoder.Output; import io.github.dsheirer.instrument.Instrumentable; import io.github.dsheirer.instrument.tap.Tap; import io.github.dsheirer.instrument.tap.TapGroup; import io.github.dsheirer.instrument.tap.stream.BinaryTap; import io.github.dsheirer.instrument.tap.stream.FloatBufferTap; import io.github.dsheirer.instrument.tap.stream.FloatTap; +import io.github.dsheirer.module.decode.Decoder; import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.sample.Broadcaster; import io.github.dsheirer.sample.Listener; import io.github.dsheirer.sample.real.IFilteredRealBufferListener; import io.github.dsheirer.sample.real.RealBuffer; import io.github.dsheirer.sample.real.RealSampleListener; -import io.github.dsheirer.alias.AliasList; -import io.github.dsheirer.dsp.filter.Filters; -import io.github.dsheirer.dsp.filter.fir.real.RealFIRFilter_RB_RB; -import io.github.dsheirer.dsp.filter.halfband.real.HalfBandFilter_RB_RB; -import io.github.dsheirer.dsp.fsk.FSK2Decoder; -import io.github.dsheirer.dsp.fsk.FSK2Decoder.Output; -import io.github.dsheirer.module.decode.Decoder; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200DecoderState.java b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200DecoderState.java index 998a2c4e..c4154dc5 100644 --- a/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200DecoderState.java +++ b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200DecoderState.java @@ -18,6 +18,8 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.lj1200; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.alias.id.AliasIDType; import io.github.dsheirer.channel.metadata.AliasedStringAttributeMonitor; import io.github.dsheirer.channel.metadata.Attribute; import io.github.dsheirer.channel.state.DecoderState; @@ -28,8 +30,6 @@ import io.github.dsheirer.message.Message; import io.github.dsheirer.module.decode.DecoderType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.AliasList; -import io.github.dsheirer.alias.id.AliasIDType; import java.util.ArrayList; import java.util.Collections; diff --git a/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200Message.java b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200Message.java index 98c0b002..962d1a82 100644 --- a/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200Message.java +++ b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200Message.java @@ -17,6 +17,8 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.lj1200; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.edac.CRC; import io.github.dsheirer.edac.CRCLJ; @@ -24,8 +26,6 @@ import io.github.dsheirer.map.Plottable; import io.github.dsheirer.message.Message; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.Alias; -import io.github.dsheirer.alias.AliasList; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200MessageProcessor.java b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200MessageProcessor.java index 65ef4a31..4b212b5e 100644 --- a/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200MessageProcessor.java +++ b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200MessageProcessor.java @@ -17,12 +17,12 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.lj1200; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.message.Message; import io.github.dsheirer.sample.Listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.AliasList; public class LJ1200MessageProcessor implements Listener { diff --git a/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200TransponderMessage.java b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200TransponderMessage.java index 82456351..2ebd0b70 100644 --- a/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200TransponderMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/lj1200/LJ1200TransponderMessage.java @@ -17,14 +17,14 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.lj1200; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.edac.CRC; import io.github.dsheirer.map.Plottable; import io.github.dsheirer.message.Message; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.Alias; -import io.github.dsheirer.alias.AliasList; import java.text.SimpleDateFormat; diff --git a/src/main/java/io/github/dsheirer/module/decode/ltrnet/DecodeConfigLTRNet.java b/src/main/java/io/github/dsheirer/module/decode/ltrnet/DecodeConfigLTRNet.java index 615dab1a..2e119ae9 100644 --- a/src/main/java/io/github/dsheirer/module/decode/ltrnet/DecodeConfigLTRNet.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrnet/DecodeConfigLTRNet.java @@ -1,45 +1,49 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.module.decode.ltrnet; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.message.MessageDirection; import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.module.decode.config.DecodeConfiguration; -import javax.xml.bind.annotation.XmlAttribute; - public class DecodeConfigLTRNet extends DecodeConfiguration { - private MessageDirection mMessageDirection = MessageDirection.OSW; - - public DecodeConfigLTRNet() + private MessageDirection mMessageDirection = MessageDirection.OSW; + + public DecodeConfigLTRNet() { - super( DecoderType.LTR_NET ); } - @XmlAttribute( name = "direction" ) - public MessageDirection getMessageDirection() - { - return mMessageDirection; - } - - public void setMessageDirection( MessageDirection direction ) - { - mMessageDirection = direction; - } + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + public DecoderType getDecoderType() + { + return DecoderType.LTR_NET; + } + + @JacksonXmlProperty(isAttribute = true, localName = "direction") + public MessageDirection getMessageDirection() + { + return mMessageDirection; + } + + public void setMessageDirection(MessageDirection direction) + { + mMessageDirection = direction; + } } diff --git a/src/main/java/io/github/dsheirer/module/decode/ltrstandard/DecodeConfigLTRStandard.java b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/DecodeConfigLTRStandard.java index ef2f61b9..556816a2 100644 --- a/src/main/java/io/github/dsheirer/module/decode/ltrstandard/DecodeConfigLTRStandard.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/DecodeConfigLTRStandard.java @@ -1,45 +1,50 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.module.decode.ltrstandard; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.message.MessageDirection; import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.module.decode.config.DecodeConfiguration; -import javax.xml.bind.annotation.XmlAttribute; - public class DecodeConfigLTRStandard extends DecodeConfiguration { - private MessageDirection mMessageDirection = MessageDirection.OSW; + private MessageDirection mMessageDirection = MessageDirection.OSW; - public DecodeConfigLTRStandard() + public DecodeConfigLTRStandard() { - super( DecoderType.LTR_STANDARD ); } - @XmlAttribute( name = "direction" ) - public MessageDirection getMessageDirection() - { - return mMessageDirection; - } - - public void setMessageDirection( MessageDirection direction ) - { - mMessageDirection = direction; - } + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + public DecoderType getDecoderType() + { + return DecoderType.LTR_STANDARD; + } + + + @JacksonXmlProperty(isAttribute = false, localName = "direction") + public MessageDirection getMessageDirection() + { + return mMessageDirection; + } + + public void setMessageDirection(MessageDirection direction) + { + mMessageDirection = direction; + } } diff --git a/src/main/java/io/github/dsheirer/module/decode/ltrstandard/message/LTRStandardMessage.java b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/message/LTRStandardMessage.java index a0d4a38e..d977c3ea 100644 --- a/src/main/java/io/github/dsheirer/module/decode/ltrstandard/message/LTRStandardMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/ltrstandard/message/LTRStandardMessage.java @@ -26,9 +26,6 @@ import io.github.dsheirer.message.MessageDirection; import io.github.dsheirer.message.MessageType; import io.github.dsheirer.module.decode.DecoderType; import org.apache.commons.lang3.StringUtils; -import io.github.dsheirer.alias.Alias; -import io.github.dsheirer.alias.AliasList; -import io.github.dsheirer.module.decode.DecoderType; import java.text.SimpleDateFormat; import java.util.ArrayList; diff --git a/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCCallEvent.java b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCCallEvent.java index 05f362a4..05933a40 100644 --- a/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCCallEvent.java +++ b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCCallEvent.java @@ -17,9 +17,9 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.mdc1200; -import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.alias.Alias; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.module.decode.event.CallEvent; public class MDCCallEvent extends CallEvent diff --git a/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCDecoder.java b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCDecoder.java index 937b4178..beaf51da 100644 --- a/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCDecoder.java +++ b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCDecoder.java @@ -17,26 +17,26 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.mdc1200; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.MessageFramer; import io.github.dsheirer.bits.SyncPattern; -import io.github.dsheirer.instrument.Instrumentable; -import io.github.dsheirer.instrument.tap.Tap; -import io.github.dsheirer.instrument.tap.TapGroup; -import io.github.dsheirer.instrument.tap.stream.BinaryTap; -import io.github.dsheirer.instrument.tap.stream.FloatBufferTap; -import io.github.dsheirer.instrument.tap.stream.FloatTap; -import io.github.dsheirer.module.decode.DecoderType; -import io.github.dsheirer.sample.Listener; -import io.github.dsheirer.sample.real.IFilteredRealBufferListener; -import io.github.dsheirer.sample.real.RealBuffer; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.dsp.NRZDecoder; import io.github.dsheirer.dsp.filter.Filters; import io.github.dsheirer.dsp.filter.fir.real.RealFIRFilter_RB_RB; import io.github.dsheirer.dsp.filter.halfband.real.HalfBandFilter_RB_RB; import io.github.dsheirer.dsp.fsk.FSK2Decoder; import io.github.dsheirer.dsp.fsk.FSK2Decoder.Output; +import io.github.dsheirer.instrument.Instrumentable; +import io.github.dsheirer.instrument.tap.Tap; +import io.github.dsheirer.instrument.tap.TapGroup; +import io.github.dsheirer.instrument.tap.stream.BinaryTap; +import io.github.dsheirer.instrument.tap.stream.FloatBufferTap; +import io.github.dsheirer.instrument.tap.stream.FloatTap; import io.github.dsheirer.module.decode.Decoder; +import io.github.dsheirer.module.decode.DecoderType; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.real.IFilteredRealBufferListener; +import io.github.dsheirer.sample.real.RealBuffer; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCDecoderState.java b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCDecoderState.java index 7eedcee9..379b4037 100644 --- a/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCDecoderState.java +++ b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCDecoderState.java @@ -18,6 +18,9 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.mdc1200; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.alias.id.AliasIDType; import io.github.dsheirer.channel.metadata.AliasedStringAttributeMonitor; import io.github.dsheirer.channel.metadata.Attribute; import io.github.dsheirer.channel.metadata.AttributeChangeRequest; @@ -28,9 +31,6 @@ import io.github.dsheirer.channel.state.State; import io.github.dsheirer.message.Message; import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.util.StringUtils; -import io.github.dsheirer.alias.Alias; -import io.github.dsheirer.alias.AliasList; -import io.github.dsheirer.alias.id.AliasIDType; import java.util.Iterator; import java.util.TreeSet; diff --git a/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCMessage.java b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCMessage.java index 3fd47360..f73027df 100644 --- a/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCMessage.java @@ -17,11 +17,11 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.mdc1200; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.map.Plottable; import io.github.dsheirer.message.Message; -import io.github.dsheirer.alias.Alias; -import io.github.dsheirer.alias.AliasList; import java.text.SimpleDateFormat; import java.util.ArrayList; diff --git a/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCMessageProcessor.java b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCMessageProcessor.java index 69e0669b..b4511e93 100644 --- a/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCMessageProcessor.java +++ b/src/main/java/io/github/dsheirer/module/decode/mdc1200/MDCMessageProcessor.java @@ -17,11 +17,11 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.mdc1200; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.message.Message; import io.github.dsheirer.sample.Broadcaster; import io.github.dsheirer.sample.Listener; -import io.github.dsheirer.alias.AliasList; public class MDCMessageProcessor implements Listener { diff --git a/src/main/java/io/github/dsheirer/module/decode/mpt1327/DecodeConfigMPT1327.java b/src/main/java/io/github/dsheirer/module/decode/mpt1327/DecodeConfigMPT1327.java index c17f90e7..172ee2e7 100644 --- a/src/main/java/io/github/dsheirer/module/decode/mpt1327/DecodeConfigMPT1327.java +++ b/src/main/java/io/github/dsheirer/module/decode/mpt1327/DecodeConfigMPT1327.java @@ -1,102 +1,106 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.module.decode.mpt1327; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.module.decode.config.DecodeConfiguration; import io.github.dsheirer.module.decode.mpt1327.MPT1327Decoder.Sync; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - public class DecodeConfigMPT1327 extends DecodeConfiguration { - private String mChannelMapName; - private Sync mSync = Sync.NORMAL; - - private int mCallTimeout = DEFAULT_CALL_TIMEOUT_SECONDS; - private int mTrafficChannelPoolSize = TRAFFIC_CHANNEL_LIMIT_DEFAULT; - - public DecodeConfigMPT1327() + private String mChannelMapName; + private Sync mSync = Sync.NORMAL; + + private int mCallTimeout = DEFAULT_CALL_TIMEOUT_SECONDS; + private int mTrafficChannelPoolSize = TRAFFIC_CHANNEL_LIMIT_DEFAULT; + + public DecodeConfigMPT1327() { - super( DecoderType.MPT1327 ); } - @XmlElement - public String getChannelMapName() - { - return mChannelMapName; - } - - public void setChannelMapName( String name ) - { - mChannelMapName = name; - } + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + public DecoderType getDecoderType() + { + return DecoderType.MPT1327; + } - @XmlAttribute( name="sync" ) - public Sync getSync() - { - return mSync; - } - - public void setSync( Sync sync ) - { - mSync = sync; - } - - @XmlAttribute( name="call_timeout" ) - public int getCallTimeout() - { - return mCallTimeout; - } - - /** - * Sets the call timeout value in seconds ( 10 - 600 ); - * @param timeout - */ - public void setCallTimeout( int timeout ) - { - if( CALL_TIMEOUT_MINIMUM <= timeout && timeout <= CALL_TIMEOUT_MAXIMUM ) - { - mCallTimeout = timeout; - } - else - { - mCallTimeout = DEFAULT_CALL_TIMEOUT_SECONDS; - } - } - - @XmlAttribute( name="traffic_channel_pool_size" ) - public int getTrafficChannelPoolSize() - { - return mTrafficChannelPoolSize; - } - - /** - * Sets the traffic channel pool size which is the maximum number of - * simultaneous traffic channels that can be allocated. - * - * This limits the maximum calls so that busy systems won't cause more - * traffic channels to be allocated than the decoder/software/host computer - * can support. - */ - public void setTrafficChannelPoolSize( int size ) - { - mTrafficChannelPoolSize = size; - } + @JacksonXmlProperty(isAttribute = false, localName = "channelMapName") + public String getChannelMapName() + { + return mChannelMapName; + } + + public void setChannelMapName(String name) + { + mChannelMapName = name; + } + + @JacksonXmlProperty(isAttribute = true, localName = "sync") + public Sync getSync() + { + return mSync; + } + + public void setSync(Sync sync) + { + mSync = sync; + } + + @JacksonXmlProperty(isAttribute = true, localName = "call_timeout") + public int getCallTimeout() + { + return mCallTimeout; + } + + /** + * Sets the call timeout value in seconds ( 10 - 600 ); + * + * @param timeout + */ + public void setCallTimeout(int timeout) + { + if(CALL_TIMEOUT_MINIMUM <= timeout && timeout <= CALL_TIMEOUT_MAXIMUM) + { + mCallTimeout = timeout; + } + else + { + mCallTimeout = DEFAULT_CALL_TIMEOUT_SECONDS; + } + } + + @JacksonXmlProperty(isAttribute = true, localName = "traffic_channel_pool_size") + public int getTrafficChannelPoolSize() + { + return mTrafficChannelPoolSize; + } + + /** + * Sets the traffic channel pool size which is the maximum number of + * simultaneous traffic channels that can be allocated. + * + * This limits the maximum calls so that busy systems won't cause more + * traffic channels to be allocated than the decoder/software/host computer + * can support. + */ + public void setTrafficChannelPoolSize(int size) + { + mTrafficChannelPoolSize = size; + } } diff --git a/src/main/java/io/github/dsheirer/module/decode/nbfm/DecodeConfigNBFM.java b/src/main/java/io/github/dsheirer/module/decode/nbfm/DecodeConfigNBFM.java index a22aeca4..87189144 100644 --- a/src/main/java/io/github/dsheirer/module/decode/nbfm/DecodeConfigNBFM.java +++ b/src/main/java/io/github/dsheirer/module/decode/nbfm/DecodeConfigNBFM.java @@ -1,29 +1,36 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.module.decode.nbfm; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.module.decode.config.DecodeConfiguration; public class DecodeConfigNBFM extends DecodeConfiguration { - public DecodeConfigNBFM() + public DecodeConfigNBFM() { - super( DecoderType.NBFM ); } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + public DecoderType getDecoderType() + { + return DecoderType.NBFM; + } + } diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/C4FMSymbolFilter.java b/src/main/java/io/github/dsheirer/module/decode/p25/C4FMSymbolFilter.java index 23b3895d..7279a511 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/C4FMSymbolFilter.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/C4FMSymbolFilter.java @@ -1,5 +1,6 @@ package io.github.dsheirer.module.decode.p25; +import io.github.dsheirer.dsp.gain.DirectGainControl; import io.github.dsheirer.instrument.Instrumentable; import io.github.dsheirer.instrument.tap.Tap; import io.github.dsheirer.instrument.tap.TapGroup; @@ -12,7 +13,6 @@ import io.github.dsheirer.sample.real.RealSampleProvider; import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent.Event; import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeListener; -import io.github.dsheirer.dsp.gain.DirectGainControl; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/DecodeConfigP25Phase1.java b/src/main/java/io/github/dsheirer/module/decode/p25/DecodeConfigP25Phase1.java index 0648fcbb..03aec81b 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/DecodeConfigP25Phase1.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/DecodeConfigP25Phase1.java @@ -1,108 +1,113 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.module.decode.p25; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.module.decode.config.DecodeConfiguration; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlTransient; - public class DecodeConfigP25Phase1 extends DecodeConfiguration { - private P25_LSMDecoder.Modulation mModulation = P25Decoder.Modulation.C4FM; - - private int mCallTimeout = 1; - private int mTrafficChannelPoolSize = TRAFFIC_CHANNEL_LIMIT_DEFAULT; - private boolean mIgnoreDataCalls = true; - - public DecodeConfigP25Phase1() + private P25_LSMDecoder.Modulation mModulation = P25Decoder.Modulation.C4FM; + + private int mCallTimeout = 1; + private int mTrafficChannelPoolSize = TRAFFIC_CHANNEL_LIMIT_DEFAULT; + private boolean mIgnoreDataCalls = true; + + public DecodeConfigP25Phase1() { - super( DecoderType.P25_PHASE1 ); - - setAFC( false ); + setAFC(false); } - + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + public DecoderType getDecoderType() + { + return DecoderType.P25_PHASE1; + } + public boolean supportsAFC() { return false; } - - @XmlAttribute( name = "modulation" ) - public P25_LSMDecoder.Modulation getModulation() - { - return mModulation; - } - - public void setModulation( P25_LSMDecoder.Modulation modulation ) - { - mModulation = modulation; - } - - @XmlAttribute( name = "ignore_data_calls" ) - public boolean getIgnoreDataCalls() - { - return mIgnoreDataCalls; - } - - public void setIgnoreDataCalls( boolean ignore ) - { - mIgnoreDataCalls = ignore; - } - /** - * Note: this field is now deprecated. - * @return - */ - @XmlTransient - @Deprecated - public int getCallTimeout() - { - return mCallTimeout; - } - - /** - * Sets the call timeout value in seconds ( 10 - 600 ); - * @param timeout - */ - @Deprecated - public void setCallTimeout( int timeout ) - { - } + @JacksonXmlProperty(isAttribute = true, localName = "modulation") + public P25_LSMDecoder.Modulation getModulation() + { + return mModulation; + } - - @XmlAttribute( name="traffic_channel_pool_size" ) - public int getTrafficChannelPoolSize() - { - return mTrafficChannelPoolSize; - } - - /** - * Sets the traffic channel pool size which is the maximum number of - * simultaneous traffic channels that can be allocated. - * - * This limits the maximum calls so that busy systems won't cause more - * traffic channels to be allocated than the decoder/software/host computer - * can support. - */ - public void setTrafficChannelPoolSize( int size ) - { - mTrafficChannelPoolSize = size; - } + public void setModulation(P25_LSMDecoder.Modulation modulation) + { + mModulation = modulation; + } + + @JacksonXmlProperty(isAttribute = true, localName = "ignore_data_calls") + public boolean getIgnoreDataCalls() + { + return mIgnoreDataCalls; + } + + public void setIgnoreDataCalls(boolean ignore) + { + mIgnoreDataCalls = ignore; + } + + /** + * Note: this field is now deprecated. + * + * @return + */ + @JsonIgnore + @Deprecated + public int getCallTimeout() + { + return mCallTimeout; + } + + /** + * Sets the call timeout value in seconds ( 10 - 600 ); + * + * @param timeout + */ + @Deprecated + public void setCallTimeout(int timeout) + { + } + + + @JacksonXmlProperty(isAttribute = true, localName = "traffic_channel_pool_size") + public int getTrafficChannelPoolSize() + { + return mTrafficChannelPoolSize; + } + + /** + * Sets the traffic channel pool size which is the maximum number of + * simultaneous traffic channels that can be allocated. + * + * This limits the maximum calls so that busy systems won't cause more + * traffic channels to be allocated than the decoder/software/host computer + * can support. + */ + public void setTrafficChannelPoolSize(int size) + { + mTrafficChannelPoolSize = size; + } } diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/P25CallEvent.java b/src/main/java/io/github/dsheirer/module/decode/p25/P25CallEvent.java index fc21c244..99d80555 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/P25CallEvent.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/P25CallEvent.java @@ -17,9 +17,9 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25; -import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.alias.Alias; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.module.decode.event.CallEvent; public class P25CallEvent extends CallEvent diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/P25DecoderState.java b/src/main/java/io/github/dsheirer/module/decode/p25/P25DecoderState.java index e56b14d9..f73c4b05 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/P25DecoderState.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/P25DecoderState.java @@ -129,7 +129,6 @@ import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.UnitToUnitVoi import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.UnitToUnitVoiceChannelGrantUpdate; import io.github.dsheirer.module.decode.p25.reference.IPProtocol; import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; -import io.github.dsheirer.module.decode.p25.reference.PDUType; import io.github.dsheirer.module.decode.p25.reference.Response; import io.github.dsheirer.module.decode.p25.reference.Vendor; import org.slf4j.Logger; @@ -145,8 +144,6 @@ import java.util.Set; import java.util.TreeSet; import java.util.concurrent.ScheduledExecutorService; -import static io.github.dsheirer.module.decode.p25.reference.PDUType.*; - public class P25DecoderState extends DecoderState { private final static Logger mLog = LoggerFactory.getLogger(P25DecoderState.class); diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/P25_LSMDecoder.java b/src/main/java/io/github/dsheirer/module/decode/p25/P25_LSMDecoder.java index 270f00be..806b20e6 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/P25_LSMDecoder.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/P25_LSMDecoder.java @@ -17,6 +17,13 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.dsp.filter.FilterFactory; +import io.github.dsheirer.dsp.filter.Window.WindowType; +import io.github.dsheirer.dsp.filter.fir.complex.ComplexFIRFilter_CB_CB; +import io.github.dsheirer.dsp.gain.ComplexFeedForwardGainControl; +import io.github.dsheirer.dsp.psk.LSMDemodulator; +import io.github.dsheirer.dsp.psk.QPSKPolarSlicer; import io.github.dsheirer.instrument.tap.Tap; import io.github.dsheirer.instrument.tap.TapGroup; import io.github.dsheirer.instrument.tap.stream.ComplexSampleTap; @@ -30,13 +37,6 @@ import io.github.dsheirer.sample.complex.IComplexBufferListener; import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.AliasList; -import io.github.dsheirer.dsp.filter.FilterFactory; -import io.github.dsheirer.dsp.filter.Window.WindowType; -import io.github.dsheirer.dsp.filter.fir.complex.ComplexFIRFilter_CB_CB; -import io.github.dsheirer.dsp.gain.ComplexFeedForwardGainControl; -import io.github.dsheirer.dsp.psk.LSMDemodulator; -import io.github.dsheirer.dsp.psk.QPSKPolarSlicer; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/PatchGroupManager.java b/src/main/java/io/github/dsheirer/module/decode/p25/PatchGroupManager.java index 4dba49fb..1208ab22 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/PatchGroupManager.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/PatchGroupManager.java @@ -18,12 +18,12 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25; -import io.github.dsheirer.module.decode.event.CallEvent; -import io.github.dsheirer.sample.Broadcaster; import io.github.dsheirer.alias.Alias; import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.alias.PatchGroupAlias; import io.github.dsheirer.alias.id.talkgroup.TalkgroupID; +import io.github.dsheirer.module.decode.event.CallEvent; +import io.github.dsheirer.sample.Broadcaster; import java.util.ArrayList; import java.util.Iterator; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/Trellis_1_2_Rate.java b/src/main/java/io/github/dsheirer/module/decode/p25/Trellis_1_2_Rate.java index 63d0c265..25c8b19a 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/Trellis_1_2_Rate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/Trellis_1_2_Rate.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25; import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.dsp.symbol.Dibit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.dsp.symbol.Dibit; import java.util.ArrayList; import java.util.Random; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/Trellis_3_4_Rate.java b/src/main/java/io/github/dsheirer/module/decode/p25/Trellis_3_4_Rate.java index c7b26c49..cea87249 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/Trellis_3_4_Rate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/Trellis_3_4_Rate.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25; import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.dsp.symbol.Dibit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.dsp.symbol.Dibit; import java.util.ArrayList; import java.util.HashMap; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/audio/P25AudioModule.java b/src/main/java/io/github/dsheirer/module/decode/p25/audio/P25AudioModule.java index 89ca9065..f94f4b9b 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/audio/P25AudioModule.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/audio/P25AudioModule.java @@ -6,19 +6,19 @@ import io.github.dsheirer.audio.IAudioPacketProvider; import io.github.dsheirer.audio.squelch.ISquelchStateListener; import io.github.dsheirer.audio.squelch.SquelchState; import io.github.dsheirer.channel.metadata.Metadata; +import io.github.dsheirer.dsp.gain.NonClippingGain; import io.github.dsheirer.message.IMessageListener; import io.github.dsheirer.message.Message; -import io.github.dsheirer.sample.Listener; -import jmbe.iface.AudioConversionLibrary; -import jmbe.iface.AudioConverter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import io.github.dsheirer.dsp.gain.NonClippingGain; import io.github.dsheirer.module.Module; import io.github.dsheirer.module.decode.p25.message.hdu.HDUMessage; import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; import io.github.dsheirer.module.decode.p25.message.ldu.LDU2Message; import io.github.dsheirer.module.decode.p25.message.ldu.LDUMessage; +import io.github.dsheirer.sample.Listener; +import jmbe.iface.AudioConversionLibrary; +import jmbe.iface.AudioConverter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.concurrent.ScheduledExecutorService; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/filter/TSBKMessageFilterSet.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/filter/TSBKMessageFilterSet.java index 2bbf8f82..34e3f0e4 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/filter/TSBKMessageFilterSet.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/filter/TSBKMessageFilterSet.java @@ -6,8 +6,8 @@ import io.github.dsheirer.filter.FilterSet; import io.github.dsheirer.message.Message; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.MotorolaOpcode; -import io.github.dsheirer.module.decode.p25.reference.Opcode; import io.github.dsheirer.module.decode.p25.message.tsbk.vendor.VendorOpcode; +import io.github.dsheirer.module.decode.p25.reference.Opcode; import io.github.dsheirer.module.decode.p25.reference.Vendor; import java.util.ArrayList; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/hdu/HDUMessage.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/hdu/HDUMessage.java index 6d379188..a72894f9 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/hdu/HDUMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/hdu/HDUMessage.java @@ -1,15 +1,15 @@ package io.github.dsheirer.module.decode.p25.message.hdu; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.edac.CRC; import io.github.dsheirer.edac.Golay18; import io.github.dsheirer.edac.ReedSolomon_63_47_17; import io.github.dsheirer.module.decode.p25.message.P25Message; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; +import io.github.dsheirer.module.decode.p25.reference.Encryption; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.AliasList; -import io.github.dsheirer.module.decode.p25.reference.Encryption; public class HDUMessage extends P25Message { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/ExtendedFunctionCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/ExtendedFunctionCommand.java index 64ba2704..77fa4256 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/ExtendedFunctionCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/ExtendedFunctionCommand.java @@ -1,10 +1,10 @@ package io.github.dsheirer.module.decode.p25.message.ldu.lc; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; import io.github.dsheirer.module.decode.p25.reference.ExtendedFunction; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; -import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class ExtendedFunctionCommand extends LDU1Message { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/LDULCMessageFactory.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/LDULCMessageFactory.java index 14f072a5..de4ef637 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/LDULCMessageFactory.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/LDULCMessageFactory.java @@ -1,13 +1,10 @@ package io.github.dsheirer.module.decode.p25.message.ldu.lc; import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; -import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import io.github.dsheirer.module.decode.p25.reference.Vendor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode.*; - public class LDULCMessageFactory { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/MessageUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/MessageUpdate.java index 3b1ce82e..f4668f99 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/MessageUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/MessageUpdate.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25.message.ldu.lc; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class MessageUpdate extends LDU1Message { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/NetworkStatusBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/NetworkStatusBroadcast.java index 16e452a3..528439e5 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/NetworkStatusBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/NetworkStatusBroadcast.java @@ -19,10 +19,10 @@ package io.github.dsheirer.module.decode.p25.message.ldu.lc; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; -import io.github.dsheirer.module.decode.p25.reference.Service; import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.reference.Service; public class NetworkStatusBroadcast extends LDU1Message implements IdentifierReceiver { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/ProtectionParameterBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/ProtectionParameterBroadcast.java index 7e21df07..3bb551d0 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/ProtectionParameterBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/ProtectionParameterBroadcast.java @@ -1,10 +1,10 @@ package io.github.dsheirer.module.decode.p25.message.ldu.lc; import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.Encryption; import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.module.decode.p25.reference.Encryption; public class ProtectionParameterBroadcast extends LDU1Message { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/RFSSStatusBroadcastExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/RFSSStatusBroadcastExplicit.java index b0efe3cf..17c5a9d6 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/RFSSStatusBroadcastExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/RFSSStatusBroadcastExplicit.java @@ -20,8 +20,8 @@ package io.github.dsheirer.module.decode.p25.message.ldu.lc; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; -import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class RFSSStatusBroadcastExplicit extends LDU1Message implements IdentifierReceiver diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SecondaryControlChannelBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SecondaryControlChannelBroadcast.java index 5ca6bc1b..6beae5d3 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SecondaryControlChannelBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SecondaryControlChannelBroadcast.java @@ -19,9 +19,9 @@ package io.github.dsheirer.module.decode.p25.message.ldu.lc; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; -import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class SecondaryControlChannelBroadcast extends LDU1Message implements IdentifierReceiver diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SecondaryControlChannelBroadcastExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SecondaryControlChannelBroadcastExplicit.java index 1e796583..408d651c 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SecondaryControlChannelBroadcastExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SecondaryControlChannelBroadcastExplicit.java @@ -19,9 +19,9 @@ package io.github.dsheirer.module.decode.p25.message.ldu.lc; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; -import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class SecondaryControlChannelBroadcastExplicit extends LDU1Message implements IdentifierReceiver diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/StatusQuery.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/StatusQuery.java index 97bee954..7db8e146 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/StatusQuery.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/StatusQuery.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25.message.ldu.lc; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class StatusQuery extends LDU1Message { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SystemServiceBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SystemServiceBroadcast.java index df3ca68b..de530908 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SystemServiceBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/SystemServiceBroadcast.java @@ -1,10 +1,10 @@ package io.github.dsheirer.module.decode.p25.message.ldu.lc; +import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import io.github.dsheirer.module.decode.p25.reference.Service; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; -import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import java.util.List; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/TelephoneInterconnectVoiceChannelUser.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/TelephoneInterconnectVoiceChannelUser.java index fdd74c3c..9753c197 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/TelephoneInterconnectVoiceChannelUser.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/TelephoneInterconnectVoiceChannelUser.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25.message.ldu.lc; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TelephoneInterconnectVoiceChannelUser extends LDU1Message { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitAuthenticationCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitAuthenticationCommand.java index 73e4feb3..cfd952f3 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitAuthenticationCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitAuthenticationCommand.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25.message.ldu.lc; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class UnitAuthenticationCommand extends LDU1Message { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitRegistrationCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitRegistrationCommand.java index 30a477dc..1ee90d23 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitRegistrationCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitRegistrationCommand.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25.message.ldu.lc; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class UnitRegistrationCommand extends LDU1Message { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitToUnitVoiceChannelUser.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitToUnitVoiceChannelUser.java index 0f8bc6a5..ab26df62 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitToUnitVoiceChannelUser.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/UnitToUnitVoiceChannelUser.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25.message.ldu.lc; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class UnitToUnitVoiceChannelUser extends LDU1Message { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/motorola/MotorolaOpcode_0.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/motorola/MotorolaOpcode_0.java index 8c569b98..add7846d 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/motorola/MotorolaOpcode_0.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/ldu/lc/motorola/MotorolaOpcode_0.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25.message.ldu.lc.motorola; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import io.github.dsheirer.module.decode.p25.message.ldu.LDU1Message; import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class MotorolaOpcode_0 extends LDU1Message { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/PDUConfirmedMessage.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/PDUConfirmedMessage.java index bd278196..41f362ea 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/PDUConfirmedMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/PDUConfirmedMessage.java @@ -1,15 +1,15 @@ package io.github.dsheirer.module.decode.p25.message.pdu.confirmed; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.edac.CRC; import io.github.dsheirer.edac.CRCP25; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.PDUType; import io.github.dsheirer.module.decode.p25.reference.Vendor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class PDUConfirmedMessage extends PDUMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/PacketData.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/PacketData.java index b01a0409..c07f556b 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/PacketData.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/PacketData.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25.message.pdu.confirmed; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.AliasList; public class PacketData extends PDUConfirmedMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextAccept.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextAccept.java index 741d3f80..11ed37b6 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextAccept.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextAccept.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.pdu.confirmed; +import io.github.dsheirer.module.decode.p25.reference.MDPConfigurationOption; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.module.decode.p25.reference.MDPConfigurationOption; public class SNDCPActivateTDSContextAccept extends PDUConfirmedMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextReject.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextReject.java index cf22691d..ecc52b37 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextReject.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextReject.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.pdu.confirmed; +import io.github.dsheirer.module.decode.p25.reference.SNDCPActivationRejectReason; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.module.decode.p25.reference.SNDCPActivationRejectReason; public class SNDCPActivateTDSContextReject extends PDUConfirmedMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextRequest.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextRequest.java index 948d0130..ea6e53bd 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextRequest.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/confirmed/SNDCPActivateTDSContextRequest.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.pdu.confirmed; +import io.github.dsheirer.module.decode.p25.reference.MDPConfigurationOption; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.module.decode.p25.reference.MDPConfigurationOption; public class SNDCPActivateTDSContextRequest extends PDUConfirmedMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/RoamingAddressUpdateExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/RoamingAddressUpdateExtended.java index c5ab7ef5..c60184e0 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/RoamingAddressUpdateExtended.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/RoamingAddressUpdateExtended.java @@ -1,12 +1,12 @@ package io.github.dsheirer.module.decode.p25.message.pdu.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.edac.CRCP25; import io.github.dsheirer.module.decode.p25.P25MessageFramer; import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; -import io.github.dsheirer.alias.AliasList; public class RoamingAddressUpdateExtended extends PDUMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/StatusQueryExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/StatusQueryExtended.java index 2492b0fc..df3a3dc0 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/StatusQueryExtended.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/StatusQueryExtended.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.pdu.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.edac.CRCP25; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/StatusUpdateExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/StatusUpdateExtended.java index a7de760b..280f9dfe 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/StatusUpdateExtended.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/StatusUpdateExtended.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.pdu.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.edac.CRCP25; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/UnitRegistrationResponseExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/UnitRegistrationResponseExtended.java index c5f62466..b35a680b 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/UnitRegistrationResponseExtended.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/control/UnitRegistrationResponseExtended.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.pdu.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.edac.CRCP25; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/TelephoneInterconnectChannelGrantExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/TelephoneInterconnectChannelGrantExplicit.java index c926f08e..b3b3880d 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/TelephoneInterconnectChannelGrantExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/TelephoneInterconnectChannelGrantExplicit.java @@ -18,6 +18,7 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25.message.pdu.osp.voice; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.edac.CRCP25; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; @@ -26,7 +27,6 @@ import io.github.dsheirer.module.decode.p25.message.P25Message; import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; -import io.github.dsheirer.alias.AliasList; import java.util.Date; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/TelephoneInterconnectChannelGrantUpdateExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/TelephoneInterconnectChannelGrantUpdateExplicit.java index 72b2d254..587565ec 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/TelephoneInterconnectChannelGrantUpdateExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/TelephoneInterconnectChannelGrantUpdateExplicit.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25.message.pdu.osp.voice; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; -import io.github.dsheirer.alias.AliasList; public class TelephoneInterconnectChannelGrantUpdateExplicit extends TelephoneInterconnectChannelGrantExplicit diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitAnswerRequestExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitAnswerRequestExplicit.java index c3a374fa..39e028c3 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitAnswerRequestExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitAnswerRequestExplicit.java @@ -1,12 +1,12 @@ package io.github.dsheirer.module.decode.p25.message.pdu.osp.voice; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.edac.CRCP25; import io.github.dsheirer.module.decode.p25.message.P25Message; import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; -import io.github.dsheirer.alias.AliasList; public class UnitToUnitAnswerRequestExplicit extends PDUMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitVoiceChannelGrantExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitVoiceChannelGrantExtended.java index 886ece42..81d30f74 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitVoiceChannelGrantExtended.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitVoiceChannelGrantExtended.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25.message.pdu.osp.voice; -import io.github.dsheirer.bits.BinaryMessage; -import io.github.dsheirer.module.decode.p25.message.pdu.UnitToUnitChannelGrantExtended; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.pdu.UnitToUnitChannelGrantExtended; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitVoiceChannelGrantUpdateExtended.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitVoiceChannelGrantUpdateExtended.java index f1dd158c..d981c610 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitVoiceChannelGrantUpdateExtended.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/pdu/osp/voice/UnitToUnitVoiceChannelGrantUpdateExtended.java @@ -18,9 +18,9 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25.message.pdu.osp.voice; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.edac.CRCP25; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; import io.github.dsheirer.module.decode.p25.message.pdu.PDUMessage; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/TDUMessage.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/TDUMessage.java index c18d82c9..9bc63985 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/TDUMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/TDUMessage.java @@ -18,11 +18,11 @@ package io.github.dsheirer.module.decode.p25.message.tdu; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.edac.CRC; import io.github.dsheirer.module.decode.p25.message.P25Message; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; -import io.github.dsheirer.alias.AliasList; public class TDUMessage extends P25Message { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupAffiliationQuery.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupAffiliationQuery.java index ece8370a..aafe1d3b 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupAffiliationQuery.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupAffiliationQuery.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class GroupAffiliationQuery extends TDULinkControlMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupVoiceChannelUpdateExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupVoiceChannelUpdateExplicit.java index 3a3a2589..55a6fb8d 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupVoiceChannelUpdateExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupVoiceChannelUpdateExplicit.java @@ -18,11 +18,11 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25.message.tdu.lc; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class GroupVoiceChannelUpdateExplicit extends TDULinkControlMessage implements IdentifierReceiver diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupVoiceChannelUser.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupVoiceChannelUser.java index d2395eef..daa3ab0a 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupVoiceChannelUser.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/GroupVoiceChannelUser.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class GroupVoiceChannelUser extends TDULinkControlMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/MessageUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/MessageUpdate.java index d2e55826..39bc6607 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/MessageUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/MessageUpdate.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class MessageUpdate extends TDULinkControlMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/NetworkStatusBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/NetworkStatusBroadcast.java index a4b07d80..1d7cf390 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/NetworkStatusBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/NetworkStatusBroadcast.java @@ -18,10 +18,10 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25.message.tdu.lc; -import io.github.dsheirer.module.decode.p25.reference.Service; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import io.github.dsheirer.module.decode.p25.reference.Service; public class NetworkStatusBroadcast extends TDULinkControlMessage implements IdentifierReceiver { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/ProtectionParameterBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/ProtectionParameterBroadcast.java index f443ccdf..2343bf2b 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/ProtectionParameterBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/ProtectionParameterBroadcast.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.Encryption; import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.module.decode.p25.reference.Encryption; public class ProtectionParameterBroadcast extends TDULinkControlMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/RFSSStatusBroadcastExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/RFSSStatusBroadcastExplicit.java index bdbec7d1..40fcdf77 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/RFSSStatusBroadcastExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/RFSSStatusBroadcastExplicit.java @@ -18,12 +18,12 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25.message.tdu.lc; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemService; import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class RFSSStatusBroadcastExplicit extends TDULinkControlMessage implements IdentifierReceiver { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/StatusQuery.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/StatusQuery.java index 72a24ed1..0c4acefd 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/StatusQuery.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/StatusQuery.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class StatusQuery extends TDULinkControlMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/SystemServiceBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/SystemServiceBroadcast.java index 3eab1c61..31d781a3 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/SystemServiceBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/SystemServiceBroadcast.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import io.github.dsheirer.module.decode.p25.reference.Service; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import java.util.List; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TDULCMessageFactory.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TDULCMessageFactory.java index f60212ed..8e40d0a1 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TDULCMessageFactory.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TDULCMessageFactory.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.Vendor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.module.decode.p25.reference.Vendor; public class TDULCMessageFactory diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TDULinkControlMessage.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TDULinkControlMessage.java index 05b3a7ea..1429e2d6 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TDULinkControlMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TDULinkControlMessage.java @@ -1,5 +1,6 @@ package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.edac.CRC; import io.github.dsheirer.edac.Golay24; @@ -12,7 +13,6 @@ import io.github.dsheirer.module.decode.p25.reference.Vendor; import io.github.dsheirer.module.decode.p25.reference.VendorLinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.AliasList; public class TDULinkControlMessage extends P25Message { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TelephoneInterconnectAnswerRequest.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TelephoneInterconnectAnswerRequest.java index d1840bc9..503b1ed3 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TelephoneInterconnectAnswerRequest.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/TelephoneInterconnectAnswerRequest.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25.message.tdu.lc; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import io.github.dsheirer.module.decode.p25.reference.Digit; import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitAuthenticationCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitAuthenticationCommand.java index 6b43a074..6a458d26 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitAuthenticationCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitAuthenticationCommand.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class UnitAuthenticationCommand extends TDULinkControlMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitRegistrationCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitRegistrationCommand.java index dc056fb0..145f237d 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitRegistrationCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitRegistrationCommand.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class UnitRegistrationCommand extends TDULinkControlMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitToUnitAnswerRequest.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitToUnitAnswerRequest.java index 0f488b85..e6cd06d7 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitToUnitAnswerRequest.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tdu/lc/UnitToUnitAnswerRequest.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.tdu.lc; +import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.module.decode.p25.reference.LinkControlOpcode; public class UnitToUnitAnswerRequest extends TDULinkControlMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/ChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/ChannelGrant.java index 99b994a7..9fad0b82 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/ChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/ChannelGrant.java @@ -18,11 +18,11 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25.message.tsbk; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; -import io.github.dsheirer.alias.AliasList; public abstract class ChannelGrant extends ServiceMessage implements IdentifierReceiver { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupChannelGrant.java index 1a3a0900..6f1b3d48 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupChannelGrant.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25.message.tsbk; -import io.github.dsheirer.bits.BinaryMessage; -import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.alias.Alias; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public abstract class GroupChannelGrant extends ChannelGrant { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupChannelGrantExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupChannelGrantExplicit.java index 98b42890..bf18e3bc 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupChannelGrantExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupChannelGrantExplicit.java @@ -18,9 +18,9 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25.message.tsbk; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public abstract class GroupChannelGrantExplicit extends ChannelGrant diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupMultiChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupMultiChannelGrant.java index 8103b33f..4fd3d263 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupMultiChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/GroupMultiChannelGrant.java @@ -18,11 +18,11 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25.message.tsbk; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; -import io.github.dsheirer.alias.AliasList; public abstract class GroupMultiChannelGrant extends ChannelGrant implements IdentifierReceiver { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/ServiceMessage.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/ServiceMessage.java index a5caa73c..9e46a463 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/ServiceMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/ServiceMessage.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25.message.tsbk; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.P25Message; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; -import io.github.dsheirer.alias.AliasList; public abstract class ServiceMessage extends TSBKMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/TSBKMessage.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/TSBKMessage.java index c52fbf87..6753a1e0 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/TSBKMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/TSBKMessage.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.tsbk; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.edac.CRC; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.message.P25Message; import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.MotorolaOpcode; import io.github.dsheirer.module.decode.p25.message.tsbk.vendor.VendorOpcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/TSBKMessageFactory.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/TSBKMessageFactory.java index 0b5c670f..f5b225aa 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/TSBKMessageFactory.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/TSBKMessageFactory.java @@ -1,31 +1,44 @@ package io.github.dsheirer.module.decode.p25.message.tsbk; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.ControlChannelBaseStationIdentification; import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.MotorolaOpcode; +import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.MotorolaTSBKMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.PatchGroupAdd; import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.PatchGroupDelete; import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.PatchGroupVoiceChannelGrant; +import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.PatchGroupVoiceChannelGrantUpdate; import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.PlannedControlChannnelShutdown; import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.SystemLoading; import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.TrafficChannelBaseStationIdentification; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.AcknowledgeResponse; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.AdjacentStatusBroadcast; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.AuthenticationCommand; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.CallAlert; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.DenyResponse; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.ExtendedFunctionCommand; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.GroupAffiliationQuery; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.GroupAffiliationResponse; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.IdentifierUpdateNonVUHF; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.IdentifierUpdateTDMA; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.IdentifierUpdateVUHF; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.LocationRegistrationResponse; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.MessageUpdate; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.NetworkStatusBroadcast; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.ProtectionParameterUpdate; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.QueuedResponse; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.RFSSStatusBroadcast; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.RadioUnitMonitorCommand; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.RoamingAddressCommand; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SecondaryControlChannelBroadcast; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SecondaryControlChannelBroadcastExplicit; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.StatusQuery; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.StatusUpdate; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SyncBroadcast; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemServiceBroadcast; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.TimeAndDateAnnouncement; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.UnitDeregistrationAcknowledge; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.UnitRegistrationCommand; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.UnitRegistrationResponse; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.GroupDataChannelAnnouncement; @@ -33,32 +46,19 @@ import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.GroupDataChann import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.GroupDataChannelGrant; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.IndividualDataChannelGrant; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.SNDCPDataChannelAnnouncementExplicit; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.SNDCPDataChannelGrant; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.SNDCPDataPageRequest; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.GroupVoiceChannelGrant; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.GroupVoiceChannelGrantUpdate; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.GroupVoiceChannelGrantUpdateExplicit; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.TelephoneInterconnectAnswerRequest; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.TelephoneInterconnectVoiceChannelGrant; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.UnitToUnitAnswerRequest; +import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.UnitToUnitVoiceChannelGrant; import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.UnitToUnitVoiceChannelGrantUpdate; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; import io.github.dsheirer.module.decode.p25.reference.Vendor; -import io.github.dsheirer.alias.AliasList; -import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.MotorolaTSBKMessage; -import io.github.dsheirer.module.decode.p25.message.tsbk.motorola.PatchGroupVoiceChannelGrantUpdate; -import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.AcknowledgeResponse; -import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.DenyResponse; -import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.ExtendedFunctionCommand; -import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.GroupAffiliationQuery; -import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.LocationRegistrationResponse; -import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.RadioUnitMonitorCommand; -import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.StatusQuery; -import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.StatusUpdate; -import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.SystemServiceBroadcast; -import io.github.dsheirer.module.decode.p25.message.tsbk.osp.control.UnitDeregistrationAcknowledge; -import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.SNDCPDataChannelGrant; -import io.github.dsheirer.module.decode.p25.message.tsbk.osp.data.SNDCPDataPageRequest; -import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.GroupVoiceChannelGrantUpdate; -import io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice.UnitToUnitVoiceChannelGrant; public class TSBKMessageFactory { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/UnitChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/UnitChannelGrant.java index 58f28a45..61208f0d 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/UnitChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/UnitChannelGrant.java @@ -18,10 +18,10 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25.message.tsbk; -import io.github.dsheirer.bits.BinaryMessage; -import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.alias.Alias; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; +import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public abstract class UnitChannelGrant extends ChannelGrant { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/ControlChannelBaseStationIdentification.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/ControlChannelBaseStationIdentification.java index 74f42445..f7e38182 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/ControlChannelBaseStationIdentification.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/ControlChannelBaseStationIdentification.java @@ -18,9 +18,9 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/MotorolaTSBKMessage.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/MotorolaTSBKMessage.java index 0319bdd2..a85713ac 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/MotorolaTSBKMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/MotorolaTSBKMessage.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; -import io.github.dsheirer.alias.AliasList; public class MotorolaTSBKMessage extends TSBKMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroup.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroup.java index f18735fe..b7a859a9 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroup.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroup.java @@ -1,7 +1,7 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; -import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import java.util.ArrayList; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupAdd.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupAdd.java index 79837c15..10244c95 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupAdd.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupAdd.java @@ -1,7 +1,7 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; -import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public class PatchGroupAdd extends PatchGroup diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupDelete.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupDelete.java index 59d47d6b..f3ddbfa1 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupDelete.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupDelete.java @@ -1,7 +1,7 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; -import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public class PatchGroupDelete extends PatchGroup diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupVoiceChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupVoiceChannelGrant.java index 73cd373c..5d93b82f 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupVoiceChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupVoiceChannelGrant.java @@ -18,8 +18,8 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; -import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupVoiceChannelGrantUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupVoiceChannelGrantUpdate.java index e2877449..98b3b3f2 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupVoiceChannelGrantUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PatchGroupVoiceChannelGrantUpdate.java @@ -18,11 +18,11 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; -import io.github.dsheirer.alias.AliasList; public class PatchGroupVoiceChannelGrantUpdate extends MotorolaTSBKMessage implements IdentifierReceiver { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PlannedControlChannnelShutdown.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PlannedControlChannnelShutdown.java index 02d6767b..1654165d 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PlannedControlChannnelShutdown.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/PlannedControlChannnelShutdown.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; -import io.github.dsheirer.alias.AliasList; public class PlannedControlChannnelShutdown extends MotorolaTSBKMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/SystemLoading.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/SystemLoading.java index 08cee48f..7e11128c 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/SystemLoading.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/SystemLoading.java @@ -1,7 +1,7 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; -import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public class SystemLoading extends MotorolaTSBKMessage diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/TrafficChannelBaseStationIdentification.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/TrafficChannelBaseStationIdentification.java index cebdd921..c833cb88 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/TrafficChannelBaseStationIdentification.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/motorola/TrafficChannelBaseStationIdentification.java @@ -1,7 +1,7 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.motorola; -import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public class TrafficChannelBaseStationIdentification extends MotorolaTSBKMessage diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AcknowledgeResponse.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AcknowledgeResponse.java index abc10067..fd9424b8 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AcknowledgeResponse.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AcknowledgeResponse.java @@ -1,10 +1,10 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; -import io.github.dsheirer.alias.AliasList; public class AcknowledgeResponse extends TSBKMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AdjacentStatusBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AdjacentStatusBroadcast.java index 73ec6d09..f2adf300 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AdjacentStatusBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AdjacentStatusBroadcast.java @@ -18,12 +18,12 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.IAdjacentSite; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; -import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AuthenticationCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AuthenticationCommand.java index b4616f1b..c782be73 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AuthenticationCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/AuthenticationCommand.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.reference.Opcode; public class AuthenticationCommand extends TSBKMessage diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/CallAlert.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/CallAlert.java index d2447ec1..7673d368 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/CallAlert.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/CallAlert.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/DenyResponse.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/DenyResponse.java index a6acbc50..e1895272 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/DenyResponse.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/DenyResponse.java @@ -1,11 +1,11 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.DenyReason; import io.github.dsheirer.module.decode.p25.reference.Opcode; -import io.github.dsheirer.alias.AliasList; public class DenyResponse extends TSBKMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/ExtendedFunctionCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/ExtendedFunctionCommand.java index 32cb5fac..ebd70c75 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/ExtendedFunctionCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/ExtendedFunctionCommand.java @@ -1,11 +1,11 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.ExtendedFunction; import io.github.dsheirer.module.decode.p25.reference.Opcode; -import io.github.dsheirer.alias.AliasList; public class ExtendedFunctionCommand extends TSBKMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/GroupAffiliationQuery.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/GroupAffiliationQuery.java index ed84084e..72d3e0d9 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/GroupAffiliationQuery.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/GroupAffiliationQuery.java @@ -1,10 +1,10 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; -import io.github.dsheirer.alias.AliasList; public class GroupAffiliationQuery extends TSBKMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/GroupAffiliationResponse.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/GroupAffiliationResponse.java index d9a119c5..596902d2 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/GroupAffiliationResponse.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/GroupAffiliationResponse.java @@ -1,11 +1,11 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; -import io.github.dsheirer.module.decode.p25.reference.Response; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; +import io.github.dsheirer.module.decode.p25.reference.Response; public class GroupAffiliationResponse extends TSBKMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdate.java index a31dfc69..672e19d0 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdate.java @@ -18,11 +18,11 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; -import io.github.dsheirer.alias.AliasList; public abstract class IdentifierUpdate extends TSBKMessage implements IBandIdentifier { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateNonVUHF.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateNonVUHF.java index cc9c19a7..4a5bd0ce 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateNonVUHF.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateNonVUHF.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; -import io.github.dsheirer.alias.AliasList; public class IdentifierUpdateNonVUHF extends IdentifierUpdate { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateTDMA.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateTDMA.java index 7ebfa5e0..57eaf71e 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateTDMA.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateTDMA.java @@ -1,7 +1,7 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; -import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateVUHF.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateVUHF.java index 766f912a..bf8bb500 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateVUHF.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/IdentifierUpdateVUHF.java @@ -1,7 +1,7 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; -import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/LocationRegistrationResponse.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/LocationRegistrationResponse.java index caaf6dd4..9924e5b1 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/LocationRegistrationResponse.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/LocationRegistrationResponse.java @@ -1,11 +1,11 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; import io.github.dsheirer.module.decode.p25.reference.Response; -import io.github.dsheirer.alias.AliasList; public class LocationRegistrationResponse extends TSBKMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/MessageUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/MessageUpdate.java index 09bf1e81..497b5bd3 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/MessageUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/MessageUpdate.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/NetworkStatusBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/NetworkStatusBroadcast.java index 55956d31..c19510c3 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/NetworkStatusBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/NetworkStatusBroadcast.java @@ -18,12 +18,12 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; +import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; -import io.github.dsheirer.alias.AliasList; -import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; import io.github.dsheirer.module.decode.p25.reference.Opcode; import io.github.dsheirer.module.decode.p25.reference.P25NetworkCallsign; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/ProtectionParameterUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/ProtectionParameterUpdate.java index 991f3455..9131f693 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/ProtectionParameterUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/ProtectionParameterUpdate.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Encryption; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/QueuedResponse.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/QueuedResponse.java index 4ee2b2cd..932128df 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/QueuedResponse.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/QueuedResponse.java @@ -1,11 +1,11 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; import io.github.dsheirer.module.decode.p25.reference.QueuedResponseReason; -import io.github.dsheirer.alias.AliasList; public class QueuedResponse extends TSBKMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RFSSStatusBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RFSSStatusBroadcast.java index 62e3eae2..a2a72d8a 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RFSSStatusBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RFSSStatusBroadcast.java @@ -18,11 +18,11 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; -import io.github.dsheirer.bits.BinaryMessage; -import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RadioUnitMonitorCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RadioUnitMonitorCommand.java index d0eeb0d7..9a54d794 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RadioUnitMonitorCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RadioUnitMonitorCommand.java @@ -1,10 +1,10 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; -import io.github.dsheirer.alias.AliasList; public class RadioUnitMonitorCommand extends TSBKMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RoamingAddressCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RoamingAddressCommand.java index 9e7eda8f..3a9f9545 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RoamingAddressCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/RoamingAddressCommand.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; import io.github.dsheirer.module.decode.p25.reference.StackOperation; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SecondaryControlChannelBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SecondaryControlChannelBroadcast.java index 68c78853..15461a76 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SecondaryControlChannelBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SecondaryControlChannelBroadcast.java @@ -18,11 +18,11 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; -import io.github.dsheirer.bits.BinaryMessage; -import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; +import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SecondaryControlChannelBroadcastExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SecondaryControlChannelBroadcastExplicit.java index 10e135c5..a8be1880 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SecondaryControlChannelBroadcastExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SecondaryControlChannelBroadcastExplicit.java @@ -1,11 +1,11 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; -import io.github.dsheirer.bits.BinaryMessage; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SecondaryControlChannelBroadcastExplicit extends SecondaryControlChannelBroadcast diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/StatusQuery.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/StatusQuery.java index f0dded5c..8986c317 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/StatusQuery.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/StatusQuery.java @@ -1,10 +1,10 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; -import io.github.dsheirer.alias.AliasList; public class StatusQuery extends TSBKMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/StatusUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/StatusUpdate.java index 5e2be6b5..370c7874 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/StatusUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/StatusUpdate.java @@ -1,10 +1,10 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; -import io.github.dsheirer.alias.AliasList; public class StatusUpdate extends TSBKMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SyncBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SyncBroadcast.java index ddbffa42..2f8f1988 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SyncBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SyncBroadcast.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SystemServiceBroadcast.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SystemServiceBroadcast.java index 47d92104..a722abfb 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SystemServiceBroadcast.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/SystemServiceBroadcast.java @@ -1,11 +1,11 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; import io.github.dsheirer.module.decode.p25.reference.Service; -import io.github.dsheirer.alias.AliasList; import java.util.List; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/TimeAndDateAnnouncement.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/TimeAndDateAnnouncement.java index 6a2abe84..b85ea059 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/TimeAndDateAnnouncement.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/TimeAndDateAnnouncement.java @@ -1,7 +1,7 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; -import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitDeregistrationAcknowledge.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitDeregistrationAcknowledge.java index c260f420..467a5bbf 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitDeregistrationAcknowledge.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitDeregistrationAcknowledge.java @@ -1,10 +1,10 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; -import io.github.dsheirer.alias.AliasList; public class UnitDeregistrationAcknowledge extends TSBKMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitRegistrationCommand.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitRegistrationCommand.java index e0eedc35..00b15a9e 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitRegistrationCommand.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitRegistrationCommand.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitRegistrationResponse.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitRegistrationResponse.java index f4588ac4..e0c3d5da 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitRegistrationResponse.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/control/UnitRegistrationResponse.java @@ -1,11 +1,11 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.control; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; -import io.github.dsheirer.module.decode.p25.reference.Response; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; +import io.github.dsheirer.module.decode.p25.reference.Response; public class UnitRegistrationResponse extends TSBKMessage { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelAnnouncement.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelAnnouncement.java index 479de377..70d0bd65 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelAnnouncement.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelAnnouncement.java @@ -1,7 +1,7 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.data; -import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.GroupMultiChannelGrant; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelAnnouncementExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelAnnouncementExplicit.java index 1f40b50f..c71a9368 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelAnnouncementExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelAnnouncementExplicit.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.data; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.GroupChannelGrantExplicit; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelGrant.java index 05ead309..5ffbe530 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/GroupDataChannelGrant.java @@ -18,8 +18,8 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.data; -import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.GroupChannelGrant; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/IndividualDataChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/IndividualDataChannelGrant.java index 07a54e37..7f0067a3 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/IndividualDataChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/IndividualDataChannelGrant.java @@ -1,7 +1,7 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.data; -import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.UnitChannelGrant; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPData.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPData.java index 8a12a543..870e27e0 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPData.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPData.java @@ -1,7 +1,7 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.data; -import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.ServiceMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataChannelAnnouncementExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataChannelAnnouncementExplicit.java index b4afa442..a4ef3e3e 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataChannelAnnouncementExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataChannelAnnouncementExplicit.java @@ -18,9 +18,9 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.data; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataChannelGrant.java index a54d5dce..ccac4d50 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataChannelGrant.java @@ -18,11 +18,11 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.data; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.IBandIdentifier; import io.github.dsheirer.module.decode.p25.message.IdentifierReceiver; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; -import io.github.dsheirer.alias.AliasList; public class SNDCPDataChannelGrant extends SNDCPData implements IdentifierReceiver { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataPageRequest.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataPageRequest.java index d5d11a04..1219f873 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataPageRequest.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/data/SNDCPDataPageRequest.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.data; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; -import io.github.dsheirer.alias.AliasList; public class SNDCPDataPageRequest extends SNDCPData { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrant.java index 6a525cd5..fb743fec 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrant.java @@ -1,7 +1,7 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice; -import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.GroupChannelGrant; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrantUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrantUpdate.java index 02cb3668..082c499c 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrantUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrantUpdate.java @@ -1,10 +1,10 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.GroupMultiChannelGrant; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; -import io.github.dsheirer.alias.AliasList; public class GroupVoiceChannelGrantUpdate extends GroupMultiChannelGrant { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrantUpdateExplicit.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrantUpdateExplicit.java index 6ad2680d..066f3a75 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrantUpdateExplicit.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/GroupVoiceChannelGrantUpdateExplicit.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.GroupChannelGrantExplicit; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectAnswerRequest.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectAnswerRequest.java index 9eae0f04..c0944228 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectAnswerRequest.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectAnswerRequest.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.TSBKMessage; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Digit; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectVoiceChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectVoiceChannelGrant.java index fe054375..16725c33 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectVoiceChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectVoiceChannelGrant.java @@ -1,7 +1,7 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice; -import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.UnitChannelGrant; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectVoiceChannelGrantUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectVoiceChannelGrantUpdate.java index b7a7b78a..db6b95e7 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectVoiceChannelGrantUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/TelephoneInterconnectVoiceChannelGrantUpdate.java @@ -1,9 +1,9 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; -import io.github.dsheirer.alias.AliasList; public class TelephoneInterconnectVoiceChannelGrantUpdate extends TelephoneInterconnectVoiceChannelGrant diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitAnswerRequest.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitAnswerRequest.java index 0c42e0ff..5240d7d7 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitAnswerRequest.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitAnswerRequest.java @@ -1,7 +1,7 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice; -import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.UnitChannelGrant; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitVoiceChannelGrant.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitVoiceChannelGrant.java index e8078de5..6ac7541d 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitVoiceChannelGrant.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitVoiceChannelGrant.java @@ -1,10 +1,10 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.UnitChannelGrant; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; -import io.github.dsheirer.alias.AliasList; public class UnitToUnitVoiceChannelGrant extends UnitChannelGrant { diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitVoiceChannelGrantUpdate.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitVoiceChannelGrantUpdate.java index c381204b..29e23e97 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitVoiceChannelGrantUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/tsbk/osp/voice/UnitToUnitVoiceChannelGrantUpdate.java @@ -1,7 +1,7 @@ package io.github.dsheirer.module.decode.p25.message.tsbk.osp.voice; -import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.tsbk.UnitChannelGrant; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; import io.github.dsheirer.module.decode.p25.reference.Opcode; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/vselp/VSELP1Message.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/vselp/VSELP1Message.java index 427f7cf7..15af9627 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/vselp/VSELP1Message.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/vselp/VSELP1Message.java @@ -1,7 +1,7 @@ package io.github.dsheirer.module.decode.p25.message.vselp; -import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.P25Message; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/message/vselp/VSELP2Message.java b/src/main/java/io/github/dsheirer/module/decode/p25/message/vselp/VSELP2Message.java index 84068185..886d652a 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/message/vselp/VSELP2Message.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/message/vselp/VSELP2Message.java @@ -1,8 +1,8 @@ package io.github.dsheirer.module.decode.p25.message.vselp; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.module.decode.p25.message.P25Message; -import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.module.decode.p25.reference.DataUnitID; public class VSELP2Message extends P25Message diff --git a/src/main/java/io/github/dsheirer/module/decode/passport/DecodeConfigPassport.java b/src/main/java/io/github/dsheirer/module/decode/passport/DecodeConfigPassport.java index d3245f4a..85bb4b0a 100644 --- a/src/main/java/io/github/dsheirer/module/decode/passport/DecodeConfigPassport.java +++ b/src/main/java/io/github/dsheirer/module/decode/passport/DecodeConfigPassport.java @@ -1,29 +1,34 @@ -/******************************************************************************* - * SDR Trunk - * Copyright (C) 2014 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 - ******************************************************************************/ +/* + * ********************************************************************************************************************* + * sdrtrunk + * Copyright (C) 2014-2017 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 + * ********************************************************************************************************************* + */ package io.github.dsheirer.module.decode.passport; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.module.decode.config.DecodeConfiguration; public class DecodeConfigPassport extends DecodeConfiguration { - public DecodeConfigPassport() + public DecodeConfigPassport() { - super( DecoderType.PASSPORT ); + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + public DecoderType getDecoderType() + { + return DecoderType.PASSPORT; } } diff --git a/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200ANIMessage.java b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200ANIMessage.java index 908f313e..9bcc471d 100644 --- a/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200ANIMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200ANIMessage.java @@ -17,14 +17,14 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.tait; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.edac.CRC; import io.github.dsheirer.map.Plottable; import io.github.dsheirer.message.Message; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.Alias; -import io.github.dsheirer.alias.AliasList; import java.text.SimpleDateFormat; import java.util.ArrayList; diff --git a/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200ANIMessageProcessor.java b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200ANIMessageProcessor.java index d8e42f36..d384ad28 100644 --- a/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200ANIMessageProcessor.java +++ b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200ANIMessageProcessor.java @@ -17,12 +17,12 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.tait; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.message.Message; import io.github.dsheirer.sample.Listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.AliasList; public class Tait1200ANIMessageProcessor implements Listener { diff --git a/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200CallEvent.java b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200CallEvent.java index c4d7b2a3..e6a53d70 100644 --- a/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200CallEvent.java +++ b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200CallEvent.java @@ -17,9 +17,9 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.tait; -import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.alias.Alias; import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.module.decode.event.CallEvent; public class Tait1200CallEvent extends CallEvent diff --git a/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200Decoder.java b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200Decoder.java index f7952431..9ccae831 100644 --- a/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200Decoder.java +++ b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200Decoder.java @@ -17,26 +17,26 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.tait; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.MessageFramer; import io.github.dsheirer.bits.SyncPattern; +import io.github.dsheirer.dsp.filter.Filters; +import io.github.dsheirer.dsp.filter.fir.real.RealFIRFilter_RB_RB; +import io.github.dsheirer.dsp.filter.halfband.real.HalfBandFilter_RB_RB; +import io.github.dsheirer.dsp.fsk.FSK2Decoder; +import io.github.dsheirer.dsp.fsk.FSK2Decoder.Output; import io.github.dsheirer.instrument.Instrumentable; import io.github.dsheirer.instrument.tap.Tap; import io.github.dsheirer.instrument.tap.TapGroup; import io.github.dsheirer.instrument.tap.stream.BinaryTap; import io.github.dsheirer.instrument.tap.stream.FloatBufferTap; import io.github.dsheirer.instrument.tap.stream.FloatTap; +import io.github.dsheirer.module.decode.Decoder; import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.sample.Broadcaster; import io.github.dsheirer.sample.Listener; import io.github.dsheirer.sample.real.IFilteredRealBufferListener; import io.github.dsheirer.sample.real.RealBuffer; -import io.github.dsheirer.alias.AliasList; -import io.github.dsheirer.dsp.filter.Filters; -import io.github.dsheirer.dsp.filter.fir.real.RealFIRFilter_RB_RB; -import io.github.dsheirer.dsp.filter.halfband.real.HalfBandFilter_RB_RB; -import io.github.dsheirer.dsp.fsk.FSK2Decoder; -import io.github.dsheirer.dsp.fsk.FSK2Decoder.Output; -import io.github.dsheirer.module.decode.Decoder; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200DecoderState.java b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200DecoderState.java index 2633c937..44367d23 100644 --- a/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200DecoderState.java +++ b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200DecoderState.java @@ -18,6 +18,9 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.tait; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; +import io.github.dsheirer.alias.id.AliasIDType; import io.github.dsheirer.channel.metadata.AliasedStringAttributeMonitor; import io.github.dsheirer.channel.metadata.Attribute; import io.github.dsheirer.channel.metadata.AttributeChangeRequest; @@ -30,9 +33,6 @@ import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.module.decode.event.CallEvent; import io.github.dsheirer.util.StringUtils; import org.jdesktop.swingx.mapviewer.GeoPosition; -import io.github.dsheirer.alias.Alias; -import io.github.dsheirer.alias.AliasList; -import io.github.dsheirer.alias.id.AliasIDType; import java.util.ArrayList; import java.util.Collections; diff --git a/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200GPSMessage.java b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200GPSMessage.java index f591d96b..6158f1c6 100644 --- a/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200GPSMessage.java +++ b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200GPSMessage.java @@ -17,6 +17,8 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.tait; +import io.github.dsheirer.alias.Alias; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.edac.CRC; import io.github.dsheirer.map.Plottable; @@ -24,8 +26,6 @@ import io.github.dsheirer.message.Message; import org.jdesktop.swingx.mapviewer.GeoPosition; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.Alias; -import io.github.dsheirer.alias.AliasList; import java.text.SimpleDateFormat; import java.util.ArrayList; diff --git a/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200GPSMessageProcessor.java b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200GPSMessageProcessor.java index 49b812aa..c9bf06ef 100644 --- a/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200GPSMessageProcessor.java +++ b/src/main/java/io/github/dsheirer/module/decode/tait/Tait1200GPSMessageProcessor.java @@ -17,12 +17,12 @@ ******************************************************************************/ package io.github.dsheirer.module.decode.tait; +import io.github.dsheirer.alias.AliasList; import io.github.dsheirer.bits.BinaryMessage; import io.github.dsheirer.message.Message; import io.github.dsheirer.sample.Listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.AliasList; public class Tait1200GPSMessageProcessor implements Listener { diff --git a/src/main/java/io/github/dsheirer/module/demodulate/am/AMDemodulatorModule.java b/src/main/java/io/github/dsheirer/module/demodulate/am/AMDemodulatorModule.java index 6907ba54..b52cd0eb 100644 --- a/src/main/java/io/github/dsheirer/module/demodulate/am/AMDemodulatorModule.java +++ b/src/main/java/io/github/dsheirer/module/demodulate/am/AMDemodulatorModule.java @@ -17,18 +17,18 @@ ******************************************************************************/ package io.github.dsheirer.module.demodulate.am; -import io.github.dsheirer.module.Module; -import io.github.dsheirer.sample.Listener; -import io.github.dsheirer.sample.complex.ComplexBuffer; -import io.github.dsheirer.sample.complex.IComplexBufferListener; -import io.github.dsheirer.sample.real.IFilteredRealBufferProvider; -import io.github.dsheirer.sample.real.RealBuffer; import io.github.dsheirer.dsp.am.AMDemodulator_CB; import io.github.dsheirer.dsp.filter.FilterFactory; import io.github.dsheirer.dsp.filter.Window.WindowType; import io.github.dsheirer.dsp.filter.fir.complex.ComplexFIRFilter_CB_CB; import io.github.dsheirer.dsp.filter.fir.real.RealFIRFilter_RB_RB; import io.github.dsheirer.dsp.gain.AutomaticGainControl_RB; +import io.github.dsheirer.module.Module; +import io.github.dsheirer.sample.Listener; +import io.github.dsheirer.sample.complex.ComplexBuffer; +import io.github.dsheirer.sample.complex.IComplexBufferListener; +import io.github.dsheirer.sample.real.IFilteredRealBufferProvider; +import io.github.dsheirer.sample.real.RealBuffer; import java.util.concurrent.ScheduledExecutorService; diff --git a/src/main/java/io/github/dsheirer/module/demodulate/audio/DemodulatedAudioFilterModule.java b/src/main/java/io/github/dsheirer/module/demodulate/audio/DemodulatedAudioFilterModule.java index 9f28159f..b583605a 100644 --- a/src/main/java/io/github/dsheirer/module/demodulate/audio/DemodulatedAudioFilterModule.java +++ b/src/main/java/io/github/dsheirer/module/demodulate/audio/DemodulatedAudioFilterModule.java @@ -19,7 +19,6 @@ package io.github.dsheirer.module.demodulate.audio; import io.github.dsheirer.dsp.filter.FilterFactory; -import io.github.dsheirer.dsp.filter.Window; import io.github.dsheirer.dsp.filter.Window.WindowType; import io.github.dsheirer.dsp.filter.dc.DCRemovalFilter_RealBuffer; import io.github.dsheirer.dsp.filter.fir.real.RealFIRFilter_RB_RB; diff --git a/src/main/java/io/github/dsheirer/module/log/CallEventLogger.java b/src/main/java/io/github/dsheirer/module/log/CallEventLogger.java index 5509dfb0..2f9784f2 100644 --- a/src/main/java/io/github/dsheirer/module/log/CallEventLogger.java +++ b/src/main/java/io/github/dsheirer/module/log/CallEventLogger.java @@ -17,9 +17,9 @@ ******************************************************************************/ package io.github.dsheirer.module.log; +import io.github.dsheirer.module.decode.event.CallEvent; import io.github.dsheirer.module.decode.event.ICallEventListener; import io.github.dsheirer.sample.Listener; -import io.github.dsheirer.module.decode.event.CallEvent; import java.nio.file.Path; diff --git a/src/main/java/io/github/dsheirer/module/log/config/EventLogConfiguration.java b/src/main/java/io/github/dsheirer/module/log/config/EventLogConfiguration.java index b4abe92d..49c02094 100644 --- a/src/main/java/io/github/dsheirer/module/log/config/EventLogConfiguration.java +++ b/src/main/java/io/github/dsheirer/module/log/config/EventLogConfiguration.java @@ -1,57 +1,59 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.module.log.config; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import io.github.dsheirer.controller.config.Configuration; import io.github.dsheirer.module.log.EventLogType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; import java.util.ArrayList; import java.util.List; -@XmlRootElement( name = "event_log_configuration" ) +@JsonSubTypes.Type(value = EventLogConfiguration.class, name = "eventLogConfiguration") +@JacksonXmlRootElement(localName = "event_log_configuration") public class EventLogConfiguration extends Configuration { - protected List mLoggers = new ArrayList(); + protected List mLoggers = new ArrayList(); - public EventLogConfiguration() - { - } + public EventLogConfiguration() + { + } - @XmlElement( name = "logger" ) - public List getLoggers() - { - return mLoggers; - } - - public void setLoggers( ArrayList loggers ) - { - mLoggers = loggers; - } + @JacksonXmlProperty(isAttribute = false, localName = "logger") + public List getLoggers() + { + return mLoggers; + } - public void addLogger( EventLogType logger ) - { - mLoggers.add( logger ); - } - - public void clear() - { - mLoggers.clear(); - } + public void setLoggers(ArrayList loggers) + { + mLoggers = loggers; + } + + public void addLogger(EventLogType logger) + { + mLoggers.add(logger); + } + + public void clear() + { + mLoggers.clear(); + } } diff --git a/src/main/java/io/github/dsheirer/playlist/PlaylistManager.java b/src/main/java/io/github/dsheirer/playlist/PlaylistManager.java index d46b73fc..472ce4f1 100644 --- a/src/main/java/io/github/dsheirer/playlist/PlaylistManager.java +++ b/src/main/java/io/github/dsheirer/playlist/PlaylistManager.java @@ -1,22 +1,25 @@ -/******************************************************************************* - * SDR Trunk - * Copyright (C) 2014-2017 Dennis Sheirer +/* + * ********************************************************************************************************************* + * sdrtrunk + * Copyright (C) 2014-2017 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 - ******************************************************************************/ + * You should have received a copy of the GNU General Public License along with this program. + * If not, see + * ********************************************************************************************************************* + */ package io.github.dsheirer.playlist; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.dataformat.xml.JacksonXmlModule; +import com.fasterxml.jackson.dataformat.xml.XmlMapper; import io.github.dsheirer.alias.AliasEvent; import io.github.dsheirer.alias.AliasModel; import io.github.dsheirer.audio.broadcast.BroadcastEvent; @@ -27,17 +30,12 @@ import io.github.dsheirer.controller.channel.ChannelEventListener; import io.github.dsheirer.controller.channel.ChannelModel; import io.github.dsheirer.controller.channel.map.ChannelMapEvent; import io.github.dsheirer.controller.channel.map.ChannelMapModel; -import io.github.dsheirer.playlist.version1.PlaylistConverterV1ToV2; import io.github.dsheirer.properties.SystemProperties; import io.github.dsheirer.sample.Listener; import io.github.dsheirer.util.ThreadPool; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Marshaller; -import javax.xml.bind.Unmarshaller; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -137,33 +135,7 @@ public class PlaylistManager implements ChannelEventListener public void init() { PlaylistV2 playlist = load(); - - boolean saveRequired = false; - - if(playlist == null) - { - mLog.info("Couldn't find version 2 playlist - looking for version 1 playlist to convert"); - - Path playlistV1Path = getPlaylistFolderPath().resolve("playlist.xml"); - - PlaylistConverterV1ToV2 converter = new PlaylistConverterV1ToV2(playlistV1Path); - - if(converter.hasErrorMessages()) - { - mLog.error("Playlist version 1 conversion errors: " + converter.getErrorMessages()); - } - - playlist = converter.getConvertedPlaylist(); - - saveRequired = true; - } - transferPlaylistToModels(playlist); - - if(saveRequired) - { - schedulePlaylistSave(); - } } /** @@ -297,8 +269,6 @@ public class PlaylistManager implements ChannelEventListener playlist.setChannels(mChannelModel.getChannels()); playlist.setChannelMaps(mChannelMapModel.getChannelMaps()); - JAXBContext context = null; - //Create a backup copy of the current playlist if(Files.exists(getPlaylistPath())) { @@ -329,14 +299,11 @@ public class PlaylistManager implements ChannelEventListener try(OutputStream out = Files.newOutputStream(getPlaylistPath())) { - context = JAXBContext.newInstance(PlaylistV2.class); - - Marshaller m = context.createMarshaller(); - - m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); - - m.marshal(playlist, out); - + JacksonXmlModule xmlModule = new JacksonXmlModule(); + xmlModule.setDefaultUseWrapper(false); + ObjectMapper objectMapper = new XmlMapper(xmlModule); + objectMapper.enable(SerializationFeature.INDENT_OUTPUT); + objectMapper.writeValue(out, playlist); out.flush(); //Remove the playlist lock file to indicate that we successfully saved the file @@ -345,11 +312,6 @@ public class PlaylistManager implements ChannelEventListener Files.delete(getPlaylistLockPath()); } } - catch(JAXBException je) - { - mLog.error("JAXB exception while serializing the playlist to a file [" + getPlaylistPath().toString() + - "]", je); - } catch(IOException ioe) { mLog.error("IO error while writing the playlist to a file [" + getPlaylistPath().toString() + "]", ioe); @@ -395,19 +357,13 @@ public class PlaylistManager implements ChannelEventListener if(Files.exists(getPlaylistPath())) { - JAXBContext context = null; + JacksonXmlModule xmlModule = new JacksonXmlModule(); + xmlModule.setDefaultUseWrapper(false); + ObjectMapper objectMapper = new XmlMapper(xmlModule); try(InputStream in = Files.newInputStream(getPlaylistPath())) { - context = JAXBContext.newInstance(PlaylistV2.class); - - Unmarshaller m = context.createUnmarshaller(); - - playlist = (PlaylistV2) m.unmarshal(in); - } - catch(JAXBException je) - { - mLog.error("JAXB exception while loading/unmarshalling playlist", je); + playlist = objectMapper.readValue(in, PlaylistV2.class); } catch(IOException ioe) { diff --git a/src/main/java/io/github/dsheirer/playlist/PlaylistV2.java b/src/main/java/io/github/dsheirer/playlist/PlaylistV2.java index 04040be6..f132ca3b 100644 --- a/src/main/java/io/github/dsheirer/playlist/PlaylistV2.java +++ b/src/main/java/io/github/dsheirer/playlist/PlaylistV2.java @@ -1,87 +1,85 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014-2016 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 ******************************************************************************/ package io.github.dsheirer.playlist; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import io.github.dsheirer.alias.Alias; import io.github.dsheirer.audio.broadcast.BroadcastConfiguration; import io.github.dsheirer.controller.channel.Channel; import io.github.dsheirer.controller.channel.map.ChannelMap; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; import java.util.ArrayList; import java.util.List; -@XmlSeeAlso( { Alias.class,Channel.class,ChannelMap.class,BroadcastConfiguration.class} ) -@XmlRootElement( name = "playlist") +@JacksonXmlRootElement(localName = "playlist") public class PlaylistV2 { - private List mAliases = new ArrayList<>(); - private List mBroadcastConfigurations = new ArrayList<>(); - private List mChannels = new ArrayList<>(); - private List mChannelMaps = new ArrayList<>(); - - public PlaylistV2() - { - } - - @XmlElement( name = "alias" ) - public List getAliases() - { - return mAliases; - } - - public void setAliases( List aliases ) - { - mAliases = aliases; - } - - @XmlElement( name = "channel" ) - public List getChannels() - { - return mChannels; - } - - public void setChannels( List channels ) - { - mChannels = channels; - } - - @XmlElement( name = "channel_map" ) - public List getChannelMaps() - { - return mChannelMaps; - } + private List mAliases = new ArrayList<>(); + private List mBroadcastConfigurations = new ArrayList<>(); + private List mChannels = new ArrayList<>(); + private List mChannelMaps = new ArrayList<>(); - public void setChannelMaps( List channelMaps ) - { - mChannelMaps = channelMaps; - } + public PlaylistV2() + { + } - @XmlElement(name = "stream") - public List getBroadcastConfigurations() - { - return mBroadcastConfigurations; - } + @JacksonXmlProperty(isAttribute = false, localName = "alias") + public List getAliases() + { + return mAliases; + } - public void setBroadcastConfigurations(List configurations) - { - mBroadcastConfigurations = configurations; - } + public void setAliases(List aliases) + { + mAliases = aliases; + } + + @JacksonXmlProperty(isAttribute = false, localName = "channel") + public List getChannels() + { + return mChannels; + } + + public void setChannels(List channels) + { + mChannels = channels; + } + + @JacksonXmlProperty(isAttribute = false, localName = "channel_map") + public List getChannelMaps() + { + return mChannelMaps; + } + + public void setChannelMaps(List channelMaps) + { + mChannelMaps = channelMaps; + } + + @JacksonXmlProperty(isAttribute = false, localName = "stream") + public List getBroadcastConfigurations() + { + return mBroadcastConfigurations; + } + + public void setBroadcastConfigurations(List configurations) + { + mBroadcastConfigurations = configurations; + } } diff --git a/src/main/java/io/github/dsheirer/playlist/version1/AliasDirectory.java b/src/main/java/io/github/dsheirer/playlist/version1/AliasDirectory.java deleted file mode 100644 index 2d0c593b..00000000 --- a/src/main/java/io/github/dsheirer/playlist/version1/AliasDirectory.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * SDR Trunk - * Copyright (C) 2014 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 - ******************************************************************************/ -package io.github.dsheirer.playlist.version1; - -import io.github.dsheirer.alias.AliasList; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import java.util.ArrayList; - -@XmlSeeAlso( { AliasList.class} ) -@XmlRootElement( name = "alias_directory" ) -@Deprecated -public class AliasDirectory -{ - private ArrayList mAliasList = new ArrayList<>(); - - public AliasDirectory() - { - } - - public void refresh() - { - } - - public void clearAliasLists() - { - mAliasList.clear(); - } - - @XmlElement( name = "alias_list" ) - public ArrayList getAliasList() - { - return mAliasList; - } - - public void setAliasList( ArrayList lists ) - { - mAliasList = lists; - - if( mAliasList == null ) - { - mAliasList = new ArrayList(); - } - } - - public void addAliasList( AliasListOld list ) - { - mAliasList.add( list ); - } - - public void removeAliasList( AliasListOld list ) - { - mAliasList.remove( list ); - } - - /** - * Gets the named alias list, or returns an empty alias list - */ - public AliasListOld getAliasList( String name ) - { - AliasListOld retVal = new AliasListOld( name ); - - for( AliasListOld list: mAliasList ) - { - if( list.getName().equalsIgnoreCase( name ) ) - { - return list; - } - } - - return retVal; - } -} diff --git a/src/main/java/io/github/dsheirer/playlist/version1/AliasListOld.java b/src/main/java/io/github/dsheirer/playlist/version1/AliasListOld.java deleted file mode 100644 index 7d7df08f..00000000 --- a/src/main/java/io/github/dsheirer/playlist/version1/AliasListOld.java +++ /dev/null @@ -1,526 +0,0 @@ -/******************************************************************************* - * SDR Trunk - * Copyright (C) 2014,2015 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 - ******************************************************************************/ -package io.github.dsheirer.playlist.version1; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.Alias; -import io.github.dsheirer.alias.action.AliasAction; -import io.github.dsheirer.alias.action.beep.BeepAction; -import io.github.dsheirer.alias.action.clip.ClipAction; -import io.github.dsheirer.alias.action.script.ScriptAction; -import io.github.dsheirer.alias.id.AliasID; -import io.github.dsheirer.alias.id.esn.Esn; -import io.github.dsheirer.alias.id.fleetsync.FleetsyncID; -import io.github.dsheirer.alias.id.lojack.LoJackFunctionAndID; -import io.github.dsheirer.alias.id.mdc.MDC1200ID; -import io.github.dsheirer.alias.id.mobileID.Min; -import io.github.dsheirer.alias.id.mpt1327.MPT1327ID; -import io.github.dsheirer.alias.id.nonrecordable.NonRecordable; -import io.github.dsheirer.alias.id.priority.Priority; -import io.github.dsheirer.alias.id.siteID.SiteID; -import io.github.dsheirer.alias.id.status.StatusID; -import io.github.dsheirer.alias.id.talkgroup.TalkgroupID; -import io.github.dsheirer.alias.id.uniqueID.UniqueID; -import io.github.dsheirer.module.decode.lj1200.LJ1200Message.Function; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; - -@XmlSeeAlso({Alias.class, - - /* Alias ID's */ - AliasID.class, - FleetsyncID.class, - Esn.class, - Group.class, - LoJackFunctionAndID.class, - MDC1200ID.class, - Min.class, - MPT1327ID.class, - UniqueID.class, - SiteID.class, - StatusID.class, - TalkgroupID.class, - - /* Alias Attributes */ - NonRecordable.class, - Priority.class, - - /* Alias Actions */ - AliasAction.class, - BeepAction.class, - ClipAction.class, - ScriptAction.class}) - -@Deprecated -@XmlRootElement(name = "alias_list") -public class AliasListOld implements Comparable -{ - private final static Logger mLog = LoggerFactory.getLogger(AliasListOld.class); - - private String mName; - private ArrayList mGroups = new ArrayList(); - - private Map mESN = new HashMap<>(); - private Map mFleetsync = new HashMap<>(); - private Map mLoJack = new HashMap<>(); - private Map mMDC1200 = new HashMap<>(); - private Map mMobileID = new HashMap<>(); - private Map mMPT1327 = new HashMap<>(); - private Map mSiteID = new HashMap<>(); - private Map mStatus = new HashMap<>(); - private Map mTalkgroup = new HashMap<>(); - private Map mUniqueID = new HashMap<>(); - - private boolean mESNWildcard = false; - private boolean mMobileIDWildcard = false; - private boolean mFleetsyncWildcard = false; - private boolean mMDC1200Wildcard = false; - private boolean mMPT1327Wildcard = false; - private boolean mSiteWildcard = false; - private boolean mTalkgroupWildcard = false; - - public AliasListOld() - { - this(null); - } - - public AliasListOld(String name) - { - mName = name; - update(); - } - - /** - * Load/Reload all lookup hashmaps - */ - public void update() - { - //Clear hashmaps - mESN.clear(); - mFleetsync.clear(); - mLoJack.clear(); - mMDC1200.clear(); - mMobileID.clear(); - mMPT1327.clear(); - mSiteID.clear(); - mStatus.clear(); - mTalkgroup.clear(); - mUniqueID.clear(); - - for(Group group : mGroups) - { - for(Alias alias : group.getAlias()) - { - for(AliasID id : alias.getId()) - { - switch(id.getType()) - { - case ESN: - Esn esn = (Esn) id; - if(esn.getEsn().contains("*")) - { - mESNWildcard = true; - - mESN.put(fixWildcard(esn.getEsn()), alias); - } - else - { - mESN.put(esn.getEsn(), alias); - } - break; - case FLEETSYNC: - FleetsyncID fs = (FleetsyncID) id; - - if(fs.getIdent().contains("*")) - { - mFleetsyncWildcard = true; - - mFleetsync.put(fixWildcard(fs.getIdent()), alias); - } - else - { - mFleetsync.put(fs.getIdent(), alias); - } - break; - case LOJACK: - mLoJack.put((LoJackFunctionAndID) id, alias); - break; - case MDC1200: - MDC1200ID mdc = (MDC1200ID) id; - - if(mdc.getIdent().contains("*")) - { - mMDC1200Wildcard = true; - - //Replace (*) wildcard with regex wildcard (.) - mMDC1200.put(fixWildcard(mdc.getIdent()), alias); - } - else - { - mMDC1200.put(mdc.getIdent(), alias); - } - break; - case MPT1327: - MPT1327ID mpt = (MPT1327ID) id; - - String ident = mpt.getIdent(); - - if(ident != null) - { - if(ident.contains("*")) - { - mMPT1327Wildcard = true; - - //Replace (*) wildcard with regex wildcard (.) - mMPT1327.put(fixWildcard(ident), alias); - } - else - { - mMPT1327.put(ident, alias); - } - } - break; - case MIN: - Min min = (Min) id; - - if(min.getMin().contains("*")) - { - mMobileIDWildcard = true; - mMobileID.put(fixWildcard(min.getMin()), alias); - } - else - { - mMobileID.put(min.getMin(), alias); - } - break; - case LTR_NET_UID: - UniqueID uid = (UniqueID) id; - - mUniqueID.put(uid.getUid(), alias); - break; - case SITE: - SiteID siteID = (SiteID) id; - - if(siteID.getSite().contains("*")) - { - mSiteWildcard = true; - mSiteID.put(fixWildcard(siteID.getSite()), alias); - } - else - { - mSiteID.put(siteID.getSite(), alias); - } - - break; - case STATUS: - mStatus.put(((StatusID) id).getStatus(), alias); - break; - case TALKGROUP: - TalkgroupID tgid = (TalkgroupID) id; - - if(tgid.getTalkgroup().contains("*")) - { - mTalkgroupWildcard = true; - - //Replace (*) wildcard with regex wildcard (.) - mTalkgroup.put(fixWildcard(tgid.getTalkgroup()), alias); - } - else - { - mTalkgroup.put(tgid.getTalkgroup(), alias); - } - break; - case NON_RECORDABLE: - case PRIORITY: - //We don't maintain lookups for these items - break; - default: - mLog.warn("Unrecognized Alias ID Type:" + id.getType().name()); - break; - } - } - } - } - } - - /** - * Converts user wildcard character (*) to regex single character wildcard (.) - * but ignores a regex multi-character wildcard (.*) - */ - private String fixWildcard(String value) - { - if(value.contains("*") && !value.contains(".*")) - { - return value.replace("*", "."); - } - - return value; - } - - public Alias getSiteID(String siteID) - { - if(siteID != null) - { - if(mSiteWildcard) - { - for(String regex : mSiteID.keySet()) - { - if(siteID.matches(regex)) - { - return mSiteID.get(regex); - } - } - } - else - { - return mSiteID.get(siteID); - } - } - - return null; - } - - public Alias getStatus(int status) - { - return mStatus.get(status); - } - - public Alias getUniqueID(int uniqueID) - { - return mUniqueID.get(uniqueID); - } - - public Alias getESNAlias(String esn) - { - if(esn != null) - { - if(mESNWildcard) - { - for(String regex : mESN.keySet()) - { - if(esn.matches(regex)) - { - return mESN.get(regex); - } - } - } - else - { - return mESN.get(esn); - } - } - - return null; - } - - - public Alias getFleetsyncAlias(String ident) - { - if(ident != null) - { - if(mFleetsyncWildcard) - { - for(String regex : mFleetsync.keySet()) - { - if(ident.matches(regex)) - { - return mFleetsync.get(regex); - } - } - } - else - { - return mFleetsync.get(ident); - } - } - - return null; - } - - public Alias getLoJackAlias(Function function, String id) - { - if(id != null) - { - for(LoJackFunctionAndID lojack : mLoJack.keySet()) - { - if(lojack.matches(function, id)) - { - return mLoJack.get(lojack); - } - } - } - - return null; - } - - public Alias getMDC1200Alias(String ident) - { - if(ident != null) - { - if(mMDC1200Wildcard) - { - for(String regex : mMDC1200.keySet()) - { - if(ident.matches(regex)) - { - return mMDC1200.get(regex); - } - } - } - else - { - return mMDC1200.get(ident); - } - } - - return null; - } - - public Alias getMPT1327Alias(String ident) - { - if(ident != null) - { - if(mMPT1327Wildcard) - { - for(String regex : mMPT1327.keySet()) - { - if(ident.matches(regex)) - { - return mMPT1327.get(regex); - } - } - } - else - { - return mMPT1327.get(ident); - } - } - - return null; - } - - public Group getGroup(Alias alias) - { - if(alias != null) - { - for(Group group : mGroups) - { - if(group.contains(alias)) - { - return group; - } - } - } - - return null; - } - - public Alias getMobileIDNumberAlias(String ident) - { - if(ident != null) - { - if(mMobileIDWildcard) - { - for(String regex : mMobileID.keySet()) - { - if(ident.matches(regex)) - { - return mMobileID.get(regex); - } - } - } - else - { - return mMobileID.get(ident); - } - } - - return null; - } - - public Alias getTalkgroupAlias(String tgid) - { - if(tgid != null) - { - if(mTalkgroupWildcard) - { - for(String regex : mTalkgroup.keySet()) - { - if(tgid.matches(regex)) - { - return mTalkgroup.get(regex); - } - } - } - else - { - return mTalkgroup.get(tgid); - } - } - - return null; - } - - public String toString() - { - return mName; - } - - @XmlAttribute - public String getName() - { - return mName; - } - - public void setName(String name) - { - mName = name; - } - - public ArrayList getGroup() - { - return mGroups; - } - - public void setGroup(ArrayList groups) - { - mGroups = groups; - } - - public void addGroup(Group group) - { - mGroups.add(group); - } - - public void removeGroup(Group group) - { - mGroups.remove(group); - } - - @Override - public int compareTo(AliasListOld otherAliasList) - { - return getName().compareTo(otherAliasList.getName()); - } -} diff --git a/src/main/java/io/github/dsheirer/playlist/version1/ChannelMapList.java b/src/main/java/io/github/dsheirer/playlist/version1/ChannelMapList.java deleted file mode 100644 index eccde153..00000000 --- a/src/main/java/io/github/dsheirer/playlist/version1/ChannelMapList.java +++ /dev/null @@ -1,78 +0,0 @@ -/******************************************************************************* - * SDR Trunk - * Copyright (C) 2014 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 - ******************************************************************************/ -package io.github.dsheirer.playlist.version1; - -import io.github.dsheirer.controller.channel.map.ChannelMap; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import java.util.ArrayList; - -@XmlSeeAlso( ChannelMap.class ) -@Deprecated -public class ChannelMapList -{ - private ArrayList mChannelMap = new ArrayList(); - - public ChannelMapList() - { - /* Empty constructor for JAXB */ - } - - @XmlElement( name = "channel_map" ) - public ArrayList getChannelMap() - { - return mChannelMap; - } - - public void setChannelMap( ArrayList ChannelMaps ) - { - mChannelMap = ChannelMaps; - } - - public void addChannelMap( ChannelMap ChannelMap ) - { - mChannelMap.add( ChannelMap ); - } - - public void removeChannelMap( ChannelMap ChannelMap ) - { - mChannelMap.remove( ChannelMap ); - } - - public void clearChannelMaps() - { - mChannelMap.clear(); - } - - /** - * Gets the named channel map, or returns an empty map - */ - public ChannelMap getChannelMap( String name ) - { - for( ChannelMap map: mChannelMap ) - { - if( map.getName().equalsIgnoreCase( name ) ) - { - return map; - } - } - - return new ChannelMap(); - } -} diff --git a/src/main/java/io/github/dsheirer/playlist/version1/Group.java b/src/main/java/io/github/dsheirer/playlist/version1/Group.java deleted file mode 100644 index 442be3f8..00000000 --- a/src/main/java/io/github/dsheirer/playlist/version1/Group.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * SDR Trunk - * Copyright (C) 2014 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 - ******************************************************************************/ -package io.github.dsheirer.playlist.version1; - -import io.github.dsheirer.alias.Alias; - -import javax.xml.bind.annotation.XmlAttribute; -import java.util.ArrayList; - -@Deprecated -public class Group -{ - private String mName; - private ArrayList mAliases = new ArrayList(); - - public Group() - { - } - - public String toString() - { - return "Group: " + mName; - } - - @XmlAttribute - public String getName() - { - return mName; - } - - public void setName( String name ) - { - mName = name; - } - - public ArrayList getAlias() - { - return mAliases; - } - - public void setAlias( ArrayList aliases ) - { - mAliases = aliases; - } - - public void addAlias( Alias alias ) - { - mAliases.add( alias ); - } - - public void removeAlias( Alias alias ) - { - mAliases.remove( alias ); - } - - public boolean contains( Alias alias ) - { - return mAliases.contains( alias ); - } -} diff --git a/src/main/java/io/github/dsheirer/playlist/version1/PlaylistConverterV1ToV2.java b/src/main/java/io/github/dsheirer/playlist/version1/PlaylistConverterV1ToV2.java deleted file mode 100644 index ef6af763..00000000 --- a/src/main/java/io/github/dsheirer/playlist/version1/PlaylistConverterV1ToV2.java +++ /dev/null @@ -1,166 +0,0 @@ -package io.github.dsheirer.playlist.version1; - -import io.github.dsheirer.controller.channel.Channel; -import io.github.dsheirer.controller.channel.map.ChannelMap; -import io.github.dsheirer.playlist.PlaylistV2; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import io.github.dsheirer.alias.Alias; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; - -public class PlaylistConverterV1ToV2 -{ - private final static Logger mLog = - LoggerFactory.getLogger( PlaylistConverterV1ToV2.class ); - - private PlaylistV2 mConvertedPlaylist; - private List mErrors = new ArrayList<>(); - - @SuppressWarnings( "deprecation" ) - public PlaylistConverterV1ToV2( Path path ) - { - PlaylistV1 playlistVersion1 = null; - - if( path != null && Files.exists( path ) ) - { - mLog.info( "attempting playlist v1 to v2 conversion [" + - path.toString() + "]" ); - - JAXBContext context = null; - - InputStream in = null; - - try - { - in = new FileInputStream( path.toString() ); - - try - { - context = JAXBContext.newInstance( PlaylistV1.class ); - - Unmarshaller m = context.createUnmarshaller(); - - playlistVersion1 = (PlaylistV1)m.unmarshal( in ); - } - catch ( JAXBException e ) - { - mErrors.add( "Couldn't unmarshall version 1 playlist - " + - e.getLocalizedMessage() ); - } - } - catch ( Exception e ) - { - mErrors.add( "Couldn't open version 1 playlist - [" + - path.toString() + "] - " + e.getLocalizedMessage() ); - } - finally - { - if( in != null ) - { - try - { - in.close(); - } - catch ( IOException e ) - { - mLog.error( "exception while closing " + - "the playlist file inputstream reader", e ); - } - } - } - } - else - { - mErrors.add( "version 1 playlist is null or not found [" + - path.toString() + "]" ); - } - - if( playlistVersion1 != null ) - { - mConvertedPlaylist = new PlaylistV2(); - - if( playlistVersion1.hasSystemList() ) - { - SystemList systemList = playlistVersion1.getSystemList(); - - for( System system: systemList.getSystem() ) - { - for( Site site: system.getSite() ) - { - for( Channel channel: site.getChannel() ) - { - channel.setSystem( system.getName() ); - channel.setSite( site.getName() ); - - mConvertedPlaylist.getChannels().add( channel ); - } - } - } - } - - if( playlistVersion1.hasAliasDirectory() ) - { - AliasDirectory aliasDirectory = playlistVersion1.getAliasDirectory(); - - for( AliasListOld list: aliasDirectory.getAliasList() ) - { - for( Group group: list.getGroup() ) - { - for( Alias alias: group.getAlias() ) - { - alias.setList( list.getName() ); - alias.setGroup( group.getName() ); - - mConvertedPlaylist.getAliases().add( alias ); - } - } - } - } - - if( playlistVersion1.hasChannelMapList() ) - { - //Move the channel maps out of the channel map list - ChannelMapList channelMapList = playlistVersion1.getChannelMapList(); - - List channelMaps = channelMapList.getChannelMap(); - - if( channelMaps != null && !channelMaps.isEmpty() ) - { - mConvertedPlaylist.getChannelMaps().addAll( channelMaps ); - } - } - - mLog.info( "Converted [" + mConvertedPlaylist.getChannels().size() + - "] channels to new playlist format" ); - mLog.info( "Converted [" + mConvertedPlaylist.getAliases().size() + - "] aliases to new playlist format" ); - mLog.info( "Converted [" + mConvertedPlaylist.getChannelMaps().size() + - "] channel maps to new playlist format" ); - } - } - - public PlaylistV2 getConvertedPlaylist() - { - return mConvertedPlaylist; - } - - public List getErrorMessages() - { - return mErrors; - } - - public boolean hasErrorMessages() - { - return !mErrors.isEmpty(); - } -} diff --git a/src/main/java/io/github/dsheirer/playlist/version1/PlaylistV1.java b/src/main/java/io/github/dsheirer/playlist/version1/PlaylistV1.java deleted file mode 100644 index 5f46417f..00000000 --- a/src/main/java/io/github/dsheirer/playlist/version1/PlaylistV1.java +++ /dev/null @@ -1,106 +0,0 @@ -/******************************************************************************* - * SDR Trunk - * Copyright (C) 2014 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 - ******************************************************************************/ -package io.github.dsheirer.playlist.version1; - -import io.github.dsheirer.controller.channel.Channel; -import io.github.dsheirer.alias.Alias; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; - -@XmlSeeAlso( { AliasDirectory.class, - Alias.class, - Channel.class, - ChannelMapList.class, - SystemList.class } ) - -@Deprecated -@XmlRootElement( name = "playlist") -public class PlaylistV1 -{ - //Note: these are for legacy version 1 format playlists - private AliasDirectory mAliasDirectory = new AliasDirectory(); - private ChannelMapList mChannelMapList = new ChannelMapList(); - private SystemList mSystemList = new SystemList(); - - public PlaylistV1() - { - } - - @XmlElement( name = "alias_directory" ) - public AliasDirectory getAliasDirectory() - { - mAliasDirectory.refresh(); - - return mAliasDirectory; - } - - - public void setAliasDirectory( AliasDirectory directory ) - { - mAliasDirectory = directory; - } - - public boolean hasAliasDirectory() - { - return mAliasDirectory != null && - mAliasDirectory.getAliasList() != null && - !mAliasDirectory.getAliasList().isEmpty(); - } - - - @XmlElement( name = "system_list" ) - public SystemList getSystemList() - { - return mSystemList; - } - - - public void setSystemList( SystemList list ) - { - mSystemList = list; - } - - public boolean hasSystemList() - { - return mSystemList != null && - mSystemList.getSystem() != null && - !mSystemList.getSystem().isEmpty(); - } - - - @XmlElement( name = "channel_maps" ) - public ChannelMapList getChannelMapList() - { - return mChannelMapList; - } - - public boolean hasChannelMapList() - { - return mChannelMapList != null && - mChannelMapList.getChannelMap() != null && - !mChannelMapList.getChannelMap().isEmpty(); - } - - - public void setChannelMapList( ChannelMapList list ) - { - mChannelMapList = list; - } -} diff --git a/src/main/java/io/github/dsheirer/playlist/version1/Site.java b/src/main/java/io/github/dsheirer/playlist/version1/Site.java deleted file mode 100644 index 49ea9acc..00000000 --- a/src/main/java/io/github/dsheirer/playlist/version1/Site.java +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************* - * SDR Trunk - * Copyright (C) 2014 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 - ******************************************************************************/ -package io.github.dsheirer.playlist.version1; - -import io.github.dsheirer.controller.channel.Channel; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import java.util.ArrayList; - -@XmlSeeAlso( { Channel.class } ) -@XmlRootElement( name = "site" ) -@Deprecated -public class Site -{ - private String mName; - - private ArrayList mChannel = new ArrayList(); - - public Site() - { - this( "New Site" ); - } - - public Site( String name ) - { - mName = name; - } - - public String toString() - { - return mName; - } - - @XmlAttribute - public String getName() - { - return mName; - } - - public void setName( String name ) - { - mName = name; - } - - public ArrayList getChannel() - { - return mChannel; - } - - public void setChannel( ArrayList configs ) - { - mChannel = configs; - } - - public void addChannel( Channel channel ) - { - mChannel.add( channel ); - } - - public void removeChannel( Channel channel ) - { - mChannel.remove( channel ); - } - - public void removeAllChannels() - { - mChannel.clear(); - } -} diff --git a/src/main/java/io/github/dsheirer/playlist/version1/System.java b/src/main/java/io/github/dsheirer/playlist/version1/System.java deleted file mode 100644 index 7a75944a..00000000 --- a/src/main/java/io/github/dsheirer/playlist/version1/System.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * SDR Trunk - * Copyright (C) 2014 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 - ******************************************************************************/ -package io.github.dsheirer.playlist.version1; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import java.util.ArrayList; - -@XmlSeeAlso( { Site.class } ) -@XmlRootElement( name = "system" ) -@Deprecated -public class System -{ - private String mName; - private ArrayList mSite = new ArrayList(); - - public System() - { - this( "New System" ); - } - - public System( String name ) - { - mName = name; - } - - @XmlAttribute - public String getName() - { - return mName; - } - - public void setName( String name ) - { - mName = name; - } - - public ArrayList getSite() - { - return mSite; - } - - public void setSite( ArrayList sites ) - { - mSite = sites; - } - - public void addSite( Site site ) - { - mSite.add( site ); - } - - public void removeSite( Site site ) - { - mSite.remove( site ); - } - - public void clearSites() - { - mSite.clear(); - } - - public String toString() - { - return mName; - } -} diff --git a/src/main/java/io/github/dsheirer/playlist/version1/SystemList.java b/src/main/java/io/github/dsheirer/playlist/version1/SystemList.java deleted file mode 100644 index d6eb7f0d..00000000 --- a/src/main/java/io/github/dsheirer/playlist/version1/SystemList.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * SDR Trunk - * Copyright (C) 2014 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 - ******************************************************************************/ -package io.github.dsheirer.playlist.version1; - -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import java.util.ArrayList; - -@SuppressWarnings( "deprecation" ) -@XmlSeeAlso( { System.class } ) - -@XmlRootElement( name = "system_list" ) -@Deprecated -public class SystemList -{ - private ArrayList mSystem = new ArrayList(); - - public SystemList() - { - } - - public ArrayList getSystem() - { - return mSystem; - } - - public void setSystem( ArrayList systems ) - { - mSystem = systems; - } - - public void addSystem( System system ) - { - mSystem.add( system ); - } - - public void removeSystem( System system ) - { - mSystem.remove( system ); - } - - public void clearSystems() - { - mSystem.clear(); - } -} diff --git a/src/main/java/io/github/dsheirer/properties/SystemProperties.java b/src/main/java/io/github/dsheirer/properties/SystemProperties.java index 35565ddf..61714f57 100644 --- a/src/main/java/io/github/dsheirer/properties/SystemProperties.java +++ b/src/main/java/io/github/dsheirer/properties/SystemProperties.java @@ -24,12 +24,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.awt.*; -import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; -import java.io.InputStreamReader; import java.io.OutputStream; import java.net.URL; import java.nio.file.Files; @@ -38,7 +36,6 @@ import java.nio.file.Paths; import java.util.Properties; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.jar.Attributes; import java.util.jar.Manifest; /** diff --git a/src/main/java/io/github/dsheirer/record/AudioRecorder.java b/src/main/java/io/github/dsheirer/record/AudioRecorder.java index 14820092..656b275c 100644 --- a/src/main/java/io/github/dsheirer/record/AudioRecorder.java +++ b/src/main/java/io/github/dsheirer/record/AudioRecorder.java @@ -21,10 +21,10 @@ package io.github.dsheirer.record; import io.github.dsheirer.audio.AudioPacket; import io.github.dsheirer.audio.IAudioPacketListener; import io.github.dsheirer.channel.metadata.Metadata; +import io.github.dsheirer.module.Module; import io.github.dsheirer.sample.Listener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.module.Module; import java.io.FileOutputStream; import java.io.IOException; diff --git a/src/main/java/io/github/dsheirer/record/config/RecordConfiguration.java b/src/main/java/io/github/dsheirer/record/config/RecordConfiguration.java index 7d83ccd0..47bbd107 100644 --- a/src/main/java/io/github/dsheirer/record/config/RecordConfiguration.java +++ b/src/main/java/io/github/dsheirer/record/config/RecordConfiguration.java @@ -1,57 +1,59 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.record.config; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import io.github.dsheirer.controller.config.Configuration; import io.github.dsheirer.record.RecorderType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; import java.util.ArrayList; import java.util.List; -@XmlRootElement( name = "record_configuration" ) +@JsonSubTypes.Type(value = RecordConfiguration.class, name = "recordConfiguration") +@JacksonXmlRootElement(localName = "record_configuration") public class RecordConfiguration extends Configuration { - private List mRecorders = new ArrayList<>(); - - public RecordConfiguration() - { - } + private List mRecorders = new ArrayList<>(); - @XmlElement( name = "recorder" ) - public List getRecorders() - { - return mRecorders; - } - - public void setRecorders( List recorders ) - { - mRecorders = recorders; - } - - public void addRecorder( RecorderType recorder ) - { - mRecorders.add( recorder ); - } + public RecordConfiguration() + { + } - public void clearRecorders() - { - mRecorders.clear(); - } + @JacksonXmlProperty(isAttribute = false, localName = "recorder") + public List getRecorders() + { + return mRecorders; + } + + public void setRecorders(List recorders) + { + mRecorders = recorders; + } + + public void addRecorder(RecorderType recorder) + { + mRecorders.add(recorder); + } + + public void clearRecorders() + { + mRecorders.clear(); + } } diff --git a/src/main/java/io/github/dsheirer/settings/ColorSetting.java b/src/main/java/io/github/dsheirer/settings/ColorSetting.java index 0f4a9d73..cb4f0abf 100644 --- a/src/main/java/io/github/dsheirer/settings/ColorSetting.java +++ b/src/main/java/io/github/dsheirer/settings/ColorSetting.java @@ -1,190 +1,192 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.settings; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlTransient; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + import java.awt.*; +@JsonSubTypes.Type(value = ColorSetting.class, name = "colorSetting") public class ColorSetting extends Setting { - @SuppressWarnings( "unused" ) - private static final int NO_TRANSLUCENCY = 255; - private static final int SPECTRUM_TRANSLUCENCY = 128; - private static final int CONFIG_TRANSLUCENCY = 60; + private static final int NO_TRANSLUCENCY = 255; + private static final int SPECTRUM_TRANSLUCENCY = 128; + private static final int CONFIG_TRANSLUCENCY = 60; - private String mRGB; - private int mAlpha; - private ColorSettingName mColorSettingName = ColorSettingName.UNKNOWN; - - public ColorSetting() - { - setColor( mColorSettingName.getDefaultColor() ); - } - - public ColorSetting( ColorSettingName name ) - { - setColor( name.getDefaultColor() ); - setColorSettingName( name ); - } + private String mRGB; + private int mAlpha; + private ColorSettingName mColorSettingName = ColorSettingName.UNKNOWN; - @XmlAttribute - public ColorSettingName getColorSettingName() - { - return mColorSettingName; - } - - public void setColorSettingName( ColorSettingName name ) - { - mColorSettingName = name; - } - - @XmlAttribute - public String getRgb() - { - return mRGB; - } - - public void setRgb( String value ) - { - mRGB = value; - } - - @XmlAttribute - public int getAlpha() - { - return mAlpha; - } - - public void setAlpha( int value ) - { - mAlpha = value; - } + public ColorSetting() + { + setColor(mColorSettingName.getDefaultColor()); + } - @XmlTransient - public Color getColor() - { - Color temp = Color.decode( mRGB ); - - return new Color( temp.getRed(), - temp.getGreen(), - temp.getBlue(), - mAlpha ); - } - - public void setColor( Color color ) - { - mRGB = Integer.toHexString( color.getRGB() ); - mRGB = "#" + mRGB.substring( 2, mRGB.length() ); - mAlpha = color.getAlpha(); - } - - public static Color getTranslucent( Color color, int translucency ) - { - return new Color( color.getRed(), - color.getGreen(), - color.getBlue(), - translucency ); - } - - public enum ColorSettingName - { - CHANNEL_CONFIG( getTranslucent( Color.LIGHT_GRAY, CONFIG_TRANSLUCENCY ), - "Channel", "Channel Color" ), - CHANNEL_CONFIG_PROCESSING( getTranslucent( Color.GREEN, CONFIG_TRANSLUCENCY ), - "Channel Processing", "Processing Channel Color" ), - CHANNEL_CONFIG_SELECTED( getTranslucent( Color.BLUE, CONFIG_TRANSLUCENCY ), - "Channel Selected", "Selected Channel Color" ), + public ColorSetting(ColorSettingName name) + { + setColor(name.getDefaultColor()); + setColorSettingName(name); + } - CHANNEL_STATE_BACKGROUND( Color.BLACK, "Background", - "Channel State Background" ), - CHANNEL_STATE_GRADIENT_TOP_CALL( Color.BLACK, - "Call Gradient Top", "Channel Call State Gradient Top" ), - CHANNEL_STATE_GRADIENT_MIDDLE_CALL( Color.BLUE, - "Call Gradient Middle", "Channel Call State Gradient Middle" ), - CHANNEL_STATE_GRADIENT_TOP_CONTROL( Color.BLACK, - "Control Gradient Top", "Channel Control State Gradient Top" ), - CHANNEL_STATE_GRADIENT_MIDDLE_CONTROL( new Color( 0xC64F00 ), - "Control Gradient Middle", "Channel Control State Gradient Middle" ), - CHANNEL_STATE_GRADIENT_TOP_DATA( Color.BLACK, - "Data Gradient Top", "Channel Data State Gradient Top" ), - CHANNEL_STATE_GRADIENT_MIDDLE_DATA( new Color( 0xCC00CC ), - "Data Gradient Middle", "Channel Data State Gradient Middle" ), - CHANNEL_STATE_GRADIENT_TOP_FADE( Color.BLACK, - "Fade Gradient Top", "Channel Fade State Gradient Top" ), - CHANNEL_STATE_GRADIENT_MIDDLE_FADE( Color.DARK_GRAY, - "Fade Gradient Middle", "Channel Fade State Gradient Middle" ), - CHANNEL_STATE_GRADIENT_TOP_IDLE( Color.BLACK, - "Idle Gradient Top", "Channel Idle State Gradient Top" ), - CHANNEL_STATE_GRADIENT_MIDDLE_IDLE( Color.DARK_GRAY, - "Idle Gradient Middle", "Channel Idle State Gradient Middle" ), - CHANNEL_STATE_GRADIENT_TOP_NO_TUNER( Color.RED, - "No Tuner Gradient Top", "Channel No Tuner State Gradient Top" ), - CHANNEL_STATE_GRADIENT_MIDDLE_NO_TUNER( new Color( 0x990000 ), - "No Tuner Gradient Middle", "Channel No Tuner State Gradient Middle" ), - CHANNEL_STATE_LABEL_DETAILS( Color.LIGHT_GRAY, - "Details", "Details Label Color" ), - CHANNEL_STATE_LABEL_DECODER( Color.GREEN, - "Decoder", "Decoder Label Color" ), - CHANNEL_STATE_LABEL_AUX_DECODER( Color.YELLOW, - "Aux Decoder", "Aux Decoder Label Color" ), - CHANNEL_STATE_SELECTED_CHANNEL( Color.YELLOW, - "Selected Channel Indicator", "Selected Channel Indicator Color" ), + @JacksonXmlProperty(isAttribute = true, localName = "colorSettingName") + public ColorSettingName getColorSettingName() + { + return mColorSettingName; + } - SPECTRUM_BACKGROUND( Color.BLACK, - "Background", "Spectrum Background Color" ), - SPECTRUM_CURSOR( Color.ORANGE, - "Cursor", "Spectrum Cursor Color" ), - SPECTRUM_GRADIENT_BOTTOM( getTranslucent( Color.GREEN, SPECTRUM_TRANSLUCENCY ), - "Gradient Bottom", "Spectrum Gradient Bottom Color" ), - SPECTRUM_GRADIENT_TOP( getTranslucent( Color.WHITE, SPECTRUM_TRANSLUCENCY ), - "Gradient Top", "Spectrum Gradient Top Color" ), - SPECTRUM_LINE( getTranslucent( Color.LIGHT_GRAY, SPECTRUM_TRANSLUCENCY ), - "Line", "Spectrum Lines and Text Color" ), - - UNKNOWN( Color.RED, "Unknown", "Unknown Setting Color" ); + public void setColorSettingName(ColorSettingName name) + { + mColorSettingName = name; + } - private Color mDefaultColor; - private String mLabel; - private String mDialogTitle; - - private ColorSettingName( Color defaultColor, - String label, - String dialogTitle ) - { - mDefaultColor = defaultColor; - mLabel = label; - mDialogTitle = dialogTitle; - } - - public Color getDefaultColor() - { - return mDefaultColor; - } - - public String getLabel() - { - return mLabel; - } - - public String getDialogTitle() - { - return mDialogTitle; - } - } + @JacksonXmlProperty(isAttribute = true, localName = "rgb") + public String getRgb() + { + return mRGB; + } + + public void setRgb(String value) + { + mRGB = value; + } + + @JacksonXmlProperty(isAttribute = true, localName = "alpha") + public int getAlpha() + { + return mAlpha; + } + + public void setAlpha(int value) + { + mAlpha = value; + } + + @JsonIgnore + public Color getColor() + { + Color temp = Color.decode(mRGB); + + return new Color(temp.getRed(), + temp.getGreen(), + temp.getBlue(), + mAlpha); + } + + public void setColor(Color color) + { + mRGB = Integer.toHexString(color.getRGB()); + mRGB = "#" + mRGB.substring(2, mRGB.length()); + mAlpha = color.getAlpha(); + } + + public static Color getTranslucent(Color color, int translucency) + { + return new Color(color.getRed(), + color.getGreen(), + color.getBlue(), + translucency); + } + + public enum ColorSettingName + { + CHANNEL_CONFIG(getTranslucent(Color.LIGHT_GRAY, CONFIG_TRANSLUCENCY), + "Channel", "Channel Color"), + CHANNEL_CONFIG_PROCESSING(getTranslucent(Color.GREEN, CONFIG_TRANSLUCENCY), + "Channel Processing", "Processing Channel Color"), + CHANNEL_CONFIG_SELECTED(getTranslucent(Color.BLUE, CONFIG_TRANSLUCENCY), + "Channel Selected", "Selected Channel Color"), + + CHANNEL_STATE_BACKGROUND(Color.BLACK, "Background", + "Channel State Background"), + CHANNEL_STATE_GRADIENT_TOP_CALL(Color.BLACK, + "Call Gradient Top", "Channel Call State Gradient Top"), + CHANNEL_STATE_GRADIENT_MIDDLE_CALL(Color.BLUE, + "Call Gradient Middle", "Channel Call State Gradient Middle"), + CHANNEL_STATE_GRADIENT_TOP_CONTROL(Color.BLACK, + "Control Gradient Top", "Channel Control State Gradient Top"), + CHANNEL_STATE_GRADIENT_MIDDLE_CONTROL(new Color(0xC64F00), + "Control Gradient Middle", "Channel Control State Gradient Middle"), + CHANNEL_STATE_GRADIENT_TOP_DATA(Color.BLACK, + "Data Gradient Top", "Channel Data State Gradient Top"), + CHANNEL_STATE_GRADIENT_MIDDLE_DATA(new Color(0xCC00CC), + "Data Gradient Middle", "Channel Data State Gradient Middle"), + CHANNEL_STATE_GRADIENT_TOP_FADE(Color.BLACK, + "Fade Gradient Top", "Channel Fade State Gradient Top"), + CHANNEL_STATE_GRADIENT_MIDDLE_FADE(Color.DARK_GRAY, + "Fade Gradient Middle", "Channel Fade State Gradient Middle"), + CHANNEL_STATE_GRADIENT_TOP_IDLE(Color.BLACK, + "Idle Gradient Top", "Channel Idle State Gradient Top"), + CHANNEL_STATE_GRADIENT_MIDDLE_IDLE(Color.DARK_GRAY, + "Idle Gradient Middle", "Channel Idle State Gradient Middle"), + CHANNEL_STATE_GRADIENT_TOP_NO_TUNER(Color.RED, + "No Tuner Gradient Top", "Channel No Tuner State Gradient Top"), + CHANNEL_STATE_GRADIENT_MIDDLE_NO_TUNER(new Color(0x990000), + "No Tuner Gradient Middle", "Channel No Tuner State Gradient Middle"), + CHANNEL_STATE_LABEL_DETAILS(Color.LIGHT_GRAY, + "Details", "Details Label Color"), + CHANNEL_STATE_LABEL_DECODER(Color.GREEN, + "Decoder", "Decoder Label Color"), + CHANNEL_STATE_LABEL_AUX_DECODER(Color.YELLOW, + "Aux Decoder", "Aux Decoder Label Color"), + CHANNEL_STATE_SELECTED_CHANNEL(Color.YELLOW, + "Selected Channel Indicator", "Selected Channel Indicator Color"), + + SPECTRUM_BACKGROUND(Color.BLACK, + "Background", "Spectrum Background Color"), + SPECTRUM_CURSOR(Color.ORANGE, + "Cursor", "Spectrum Cursor Color"), + SPECTRUM_GRADIENT_BOTTOM(getTranslucent(Color.GREEN, SPECTRUM_TRANSLUCENCY), + "Gradient Bottom", "Spectrum Gradient Bottom Color"), + SPECTRUM_GRADIENT_TOP(getTranslucent(Color.WHITE, SPECTRUM_TRANSLUCENCY), + "Gradient Top", "Spectrum Gradient Top Color"), + SPECTRUM_LINE(getTranslucent(Color.LIGHT_GRAY, SPECTRUM_TRANSLUCENCY), + "Line", "Spectrum Lines and Text Color"), + + UNKNOWN(Color.RED, "Unknown", "Unknown Setting Color"); + + private Color mDefaultColor; + private String mLabel; + private String mDialogTitle; + + private ColorSettingName(Color defaultColor, + String label, + String dialogTitle) + { + mDefaultColor = defaultColor; + mLabel = label; + mDialogTitle = dialogTitle; + } + + public Color getDefaultColor() + { + return mDefaultColor; + } + + public String getLabel() + { + return mLabel; + } + + public String getDialogTitle() + { + return mDialogTitle; + } + } } diff --git a/src/main/java/io/github/dsheirer/settings/FileSetting.java b/src/main/java/io/github/dsheirer/settings/FileSetting.java index 37686957..06341d1b 100644 --- a/src/main/java/io/github/dsheirer/settings/FileSetting.java +++ b/src/main/java/io/github/dsheirer/settings/FileSetting.java @@ -1,52 +1,55 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.settings; +import com.fasterxml.jackson.annotation.JsonSubTypes; + import java.io.File; +@JsonSubTypes.Type(value = FileSetting.class, name = "fileSetting") public class FileSetting extends Setting { - private String mPath; - - public FileSetting() - { - super(); - } - - public FileSetting( String name, String path ) - { - super( name ); - setPath( path ); - } - - public String getPath() - { - return mPath; - } - - public void setPath( String value ) - { - mPath = value; - } - - public File getFile() - { - return new File( mPath ); - } + private String mPath; + + public FileSetting() + { + super(); + } + + public FileSetting(String name, String path) + { + super(name); + setPath(path); + } + + public String getPath() + { + return mPath; + } + + public void setPath(String value) + { + mPath = value; + } + + public File getFile() + { + return new File(mPath); + } } diff --git a/src/main/java/io/github/dsheirer/settings/MapViewSetting.java b/src/main/java/io/github/dsheirer/settings/MapViewSetting.java index 0023a511..b54fa077 100644 --- a/src/main/java/io/github/dsheirer/settings/MapViewSetting.java +++ b/src/main/java/io/github/dsheirer/settings/MapViewSetting.java @@ -1,79 +1,80 @@ package io.github.dsheirer.settings; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import org.jdesktop.swingx.mapviewer.GeoPosition; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlTransient; - +@JsonSubTypes.Type(value = MapViewSetting.class, name = "mapViewSetting") public class MapViewSetting extends Setting { - private double mLatitude; - private double mLongitude; - private int mZoom; - - public MapViewSetting() - { - /* Empty constructor for JAXB */ - } - - public MapViewSetting( String name, double latitude, double longitude, int zoom ) - { - super( name ); - mLatitude = latitude; - mLongitude = longitude; - mZoom = zoom; - } - - public MapViewSetting( String name, GeoPosition position, int zoom ) - { - super( name ); - mLatitude = position.getLatitude(); - mLongitude = position.getLongitude(); - mZoom = zoom; - } - - @XmlAttribute - public double getLatitude() - { - return mLatitude; - } - - public void setLatitude( double latitude ) - { - mLatitude = latitude; - } + private double mLatitude; + private double mLongitude; + private int mZoom; - @XmlAttribute - public double getLongitude() - { - return mLongitude; - } - - public void setLongitude( double longitude ) - { - mLongitude = longitude; - } + public MapViewSetting() + { + /* Empty constructor for JAXB */ + } - @XmlAttribute - public int getZoom() - { - return mZoom; - } - - public void setZoom( int zoom ) - { - mZoom = zoom; - } + public MapViewSetting(String name, double latitude, double longitude, int zoom) + { + super(name); + mLatitude = latitude; + mLongitude = longitude; + mZoom = zoom; + } - @XmlTransient - public GeoPosition getGeoPosition() - { - return new GeoPosition( mLatitude, mLongitude ); - } - - public void setGeoPosition( GeoPosition position ) - { - mLatitude = position.getLatitude(); - mLongitude = position.getLongitude(); - } + public MapViewSetting(String name, GeoPosition position, int zoom) + { + super(name); + mLatitude = position.getLatitude(); + mLongitude = position.getLongitude(); + mZoom = zoom; + } + + @JacksonXmlProperty(isAttribute = true, localName = "latitude") + public double getLatitude() + { + return mLatitude; + } + + public void setLatitude(double latitude) + { + mLatitude = latitude; + } + + @JacksonXmlProperty(isAttribute = true, localName = "longitude") + public double getLongitude() + { + return mLongitude; + } + + public void setLongitude(double longitude) + { + mLongitude = longitude; + } + + @JacksonXmlProperty(isAttribute = true, localName = "zoom") + public int getZoom() + { + return mZoom; + } + + public void setZoom(int zoom) + { + mZoom = zoom; + } + + @JsonIgnore + public GeoPosition getGeoPosition() + { + return new GeoPosition(mLatitude, mLongitude); + } + + public void setGeoPosition(GeoPosition position) + { + mLatitude = position.getLatitude(); + mLongitude = position.getLongitude(); + } } diff --git a/src/main/java/io/github/dsheirer/settings/Setting.java b/src/main/java/io/github/dsheirer/settings/Setting.java index 5d16a003..ef0122ae 100644 --- a/src/main/java/io/github/dsheirer/settings/Setting.java +++ b/src/main/java/io/github/dsheirer/settings/Setting.java @@ -1,45 +1,47 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.settings; -import javax.xml.bind.annotation.XmlAttribute; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "xsi:type") public class Setting { - protected String mName; - - public Setting() - { - } - - public Setting( String name ) - { - mName = name; - } + protected String mName; - @XmlAttribute - public String getName() - { - return mName; - } - - public void setName( String name ) - { - mName = name; - } + public Setting() + { + } + + public Setting(String name) + { + mName = name; + } + + @JacksonXmlProperty(isAttribute = true, localName = "name") + public String getName() + { + return mName; + } + + public void setName(String name) + { + mName = name; + } } diff --git a/src/main/java/io/github/dsheirer/settings/Settings.java b/src/main/java/io/github/dsheirer/settings/Settings.java index 13197bb4..d7160fb8 100644 --- a/src/main/java/io/github/dsheirer/settings/Settings.java +++ b/src/main/java/io/github/dsheirer/settings/Settings.java @@ -17,43 +17,18 @@ ******************************************************************************/ package io.github.dsheirer.settings; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import io.github.dsheirer.map.DefaultIcon; import io.github.dsheirer.map.MapIcon; import io.github.dsheirer.settings.ColorSetting.ColorSettingName; import io.github.dsheirer.source.recording.RecordingConfiguration; -import io.github.dsheirer.source.tuner.airspy.AirspyTunerConfiguration; import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; -import io.github.dsheirer.source.tuner.fcd.proV1.FCD1TunerConfiguration; -import io.github.dsheirer.source.tuner.fcd.proplusV2.FCD2TunerConfiguration; -import io.github.dsheirer.source.tuner.hackrf.HackRFTunerConfiguration; -import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerConfiguration; -import io.github.dsheirer.source.tuner.rtl.r820t.R820TTunerConfiguration; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; import java.util.ArrayList; import java.util.List; -/** - * Support for persisting via JAXB all configured SDRTrunk settings - */ -@XmlSeeAlso( { AirspyTunerConfiguration.class, - ColorSetting.class, - DefaultIcon.class, - E4KTunerConfiguration.class, - FCD1TunerConfiguration.class, - FCD2TunerConfiguration.class, - FileSetting.class, - HackRFTunerConfiguration.class, - MapViewSetting.class, - MapIcon.class, - R820TTunerConfiguration.class, - RecordingConfiguration.class, - Setting.class, - TunerConfiguration.class } ) - -@XmlRootElement( name = "SDRTrunk_settings" ) +@JacksonXmlRootElement( localName = "SDRTrunk_settings" ) public class Settings { private List mSettings = new ArrayList(); @@ -68,7 +43,7 @@ public class Settings { } - @XmlElement( name="recording_configuration" ) + @JacksonXmlProperty(isAttribute = false, localName = "recording_configuration") public List getRecordingConfigurations() { return mRecordingConfigurations; @@ -88,8 +63,8 @@ public class Settings { mRecordingConfigurations.remove( config ); } - - @XmlElement( name="tuner_configuration" ) + + @JacksonXmlProperty(isAttribute = false, localName = "tuner_configuration") public List getTunerConfigurations() { return mTunerConfiguration; @@ -99,8 +74,8 @@ public class Settings { mTunerConfiguration = configs; } - - @XmlElement( name="setting" ) + + @JacksonXmlProperty(isAttribute = false, localName = "setting") public List getSettings() { return mSettings; diff --git a/src/main/java/io/github/dsheirer/source/config/SourceConfigMixer.java b/src/main/java/io/github/dsheirer/source/config/SourceConfigMixer.java index 7f5d4556..b0762e01 100644 --- a/src/main/java/io/github/dsheirer/source/config/SourceConfigMixer.java +++ b/src/main/java/io/github/dsheirer/source/config/SourceConfigMixer.java @@ -1,74 +1,78 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.source.config; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.source.SourceType; import io.github.dsheirer.source.mixer.MixerChannel; -import javax.xml.bind.annotation.XmlAttribute; - +@JsonSubTypes.Type(value = SourceConfigMixer.class, name = "sourceConfigMixer") public class SourceConfigMixer extends SourceConfiguration { - protected String mMixer; - protected MixerChannel mChannel = MixerChannel.LEFT; //default - - public SourceConfigMixer() + protected String mMixer; + protected MixerChannel mChannel = MixerChannel.LEFT; //default + + public SourceConfigMixer() { - super( SourceType.MIXER ); + super(SourceType.MIXER); } - - @Override + + @JsonIgnore + @Override public String getDescription() { - return getName(); + return getName(); } - public String getName() - { - StringBuilder sb = new StringBuilder(); - - sb.append( "Mixer: " ); - sb.append( mMixer ); - sb.append( "-" ); - sb.append( mChannel.toString() ); - - return sb.toString(); - } - - @XmlAttribute( name= "mixer" ) - public String getMixer() - { - return mMixer; - } - - public void setMixer( String mixer ) - { - mMixer = mixer; - } + @JsonIgnore + public String getName() + { + StringBuilder sb = new StringBuilder(); - @XmlAttribute( name = "channel") - public MixerChannel getChannel() - { - return mChannel; - } - - public void setChannel( MixerChannel channel ) - { - mChannel = channel; - } + sb.append("Mixer: "); + sb.append(mMixer); + sb.append("-"); + sb.append(mChannel.toString()); + + return sb.toString(); + } + + @JacksonXmlProperty(isAttribute = true, localName = "mixer") + public String getMixer() + { + return mMixer; + } + + public void setMixer(String mixer) + { + mMixer = mixer; + } + + @JacksonXmlProperty(isAttribute = true, localName = "channel") + public MixerChannel getChannel() + { + return mChannel; + } + + public void setChannel(MixerChannel channel) + { + mChannel = channel; + } } diff --git a/src/main/java/io/github/dsheirer/source/config/SourceConfigNone.java b/src/main/java/io/github/dsheirer/source/config/SourceConfigNone.java index 3312e602..8f1ccb33 100644 --- a/src/main/java/io/github/dsheirer/source/config/SourceConfigNone.java +++ b/src/main/java/io/github/dsheirer/source/config/SourceConfigNone.java @@ -1,34 +1,38 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.source.config; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; import io.github.dsheirer.source.SourceType; +@JsonSubTypes.Type(value = SourceConfigNone.class, name = "sourceConfigNone") public class SourceConfigNone extends SourceConfiguration { - public SourceConfigNone() + public SourceConfigNone() { - super( SourceType.NONE ); + super(SourceType.NONE); } - @Override + @JsonIgnore + @Override public String getDescription() { - return "No Source"; + return "No Source"; } } diff --git a/src/main/java/io/github/dsheirer/source/config/SourceConfigRecording.java b/src/main/java/io/github/dsheirer/source/config/SourceConfigRecording.java index 4f8ff6c3..aa8717b5 100644 --- a/src/main/java/io/github/dsheirer/source/config/SourceConfigRecording.java +++ b/src/main/java/io/github/dsheirer/source/config/SourceConfigRecording.java @@ -17,12 +17,11 @@ ******************************************************************************/ package io.github.dsheirer.source.config; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.source.SourceType; import io.github.dsheirer.source.tuner.TunerChannel; import io.github.dsheirer.source.tuner.TunerChannel.Type; -import javax.xml.bind.annotation.XmlAttribute; - public class SourceConfigRecording extends SourceConfiguration { private String mRecordingAlias; @@ -32,8 +31,8 @@ public class SourceConfigRecording extends SourceConfiguration { super( SourceType.RECORDING ); } - - @XmlAttribute( name = "recording_alias" ) + + @JacksonXmlProperty(isAttribute=true,localName= "recording_alias" ) public String getRecordingAlias() { return mRecordingAlias; @@ -44,7 +43,7 @@ public class SourceConfigRecording extends SourceConfiguration mRecordingAlias = alias; } - @XmlAttribute( name = "frequency" ) + @JacksonXmlProperty(isAttribute=true,localName= "frequency" ) public long getFrequency() { return mFrequency; diff --git a/src/main/java/io/github/dsheirer/source/config/SourceConfigTuner.java b/src/main/java/io/github/dsheirer/source/config/SourceConfigTuner.java index 7f64aa29..a542e8c6 100644 --- a/src/main/java/io/github/dsheirer/source/config/SourceConfigTuner.java +++ b/src/main/java/io/github/dsheirer/source/config/SourceConfigTuner.java @@ -1,68 +1,73 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014-2016 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 ******************************************************************************/ package io.github.dsheirer.source.config; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.source.SourceType; import io.github.dsheirer.source.tuner.TunerChannel; import io.github.dsheirer.source.tuner.TunerChannel.Type; -import javax.xml.bind.annotation.XmlAttribute; import java.text.DecimalFormat; +@JsonSubTypes.Type(value = SourceConfigTuner.class, name = "sourceConfigTuner") public class SourceConfigTuner extends SourceConfiguration { - private static DecimalFormat sFORMAT = new DecimalFormat( "0.00000" ); + private static DecimalFormat sFORMAT = new DecimalFormat("0.00000"); - private long mFrequency = 0; - private int mBandwidth = 12500; - - public SourceConfigTuner() + private long mFrequency = 0; + private int mBandwidth = 12500; + + public SourceConfigTuner() { - super( SourceType.TUNER ); + super(SourceType.TUNER); } - - public SourceConfigTuner( TunerChannel tunerChannel ) - { - this(); - - mFrequency = tunerChannel.getFrequency(); - mBandwidth = tunerChannel.getBandwidth(); - } - - @XmlAttribute( name = "frequency" ) - public long getFrequency() - { - return mFrequency; - } - - public void setFrequency( long frequency ) - { - mFrequency = frequency; - } - @Override + public SourceConfigTuner(TunerChannel tunerChannel) + { + this(); + + mFrequency = tunerChannel.getFrequency(); + mBandwidth = tunerChannel.getBandwidth(); + } + + @JacksonXmlProperty(isAttribute = true, localName = "frequency") + public long getFrequency() + { + return mFrequency; + } + + public void setFrequency(long frequency) + { + mFrequency = frequency; + } + + @JsonIgnore + @Override public String getDescription() { - return sFORMAT.format( (double)mFrequency / 1000000.0d ) + " MHz"; + return sFORMAT.format((double)mFrequency / 1000000.0d) + " MHz"; + } + + @JsonIgnore + public TunerChannel getTunerChannel() + { + return new TunerChannel(Type.LOCKED, mFrequency, mBandwidth); } - - public TunerChannel getTunerChannel() - { - return new TunerChannel( Type.LOCKED, mFrequency, mBandwidth ); - } } diff --git a/src/main/java/io/github/dsheirer/source/config/SourceConfiguration.java b/src/main/java/io/github/dsheirer/source/config/SourceConfiguration.java index 79aa1f7d..7d4adb66 100644 --- a/src/main/java/io/github/dsheirer/source/config/SourceConfiguration.java +++ b/src/main/java/io/github/dsheirer/source/config/SourceConfiguration.java @@ -1,59 +1,74 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.source.config; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import io.github.dsheirer.controller.config.Configuration; import io.github.dsheirer.source.SourceType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSeeAlso; - -@XmlSeeAlso( { SourceConfigMixer.class, SourceConfigNone.class, - SourceConfigTuner.class } ) -@XmlRootElement( name = "source_configuration" ) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = SourceConfigMixer.class, name = "sourceConfigMixer"), + @JsonSubTypes.Type(value = SourceConfigNone.class, name = "sourceConfigNone"), + @JsonSubTypes.Type(value = SourceConfigRecording.class, name = "sourceConfigRecording"), + @JsonSubTypes.Type(value = SourceConfigTuner.class, name = "sourceConfigTuner"), +}) +@JacksonXmlRootElement(localName = "source_configuration") public class SourceConfiguration extends Configuration { - protected SourceType mSourceType; + protected SourceType mSourceType; - public SourceConfiguration() - { - this( SourceType.NONE ); - } - - public SourceConfiguration( SourceType source ) - { - mSourceType = source; - } + public SourceConfiguration() + { + this(SourceType.NONE); + } - @XmlAttribute( name = "source_type" ) - public SourceType getSourceType() - { - return mSourceType; - } - - public void setSourceType( SourceType source ) - { - mSourceType = source; - } - - public String getDescription() - { - return "No Source"; - } + public SourceConfiguration(SourceType source) + { + mSourceType = source; + } + + @JacksonXmlProperty(isAttribute = true, localName = "source_type") + public SourceType getSourceType() + { + return mSourceType; + } + + public void setSourceType(SourceType source) + { + mSourceType = source; + } + + @JacksonXmlProperty(isAttribute = true, localName = "type", namespace = "http://www.w3.org/2001/XMLSchema-instance") + private String getType() + { + return null; + } + + private void setType(String type) + { + } + + public String getDescription() + { + return "No Source"; + } } diff --git a/src/main/java/io/github/dsheirer/source/mixer/RealMixerSource.java b/src/main/java/io/github/dsheirer/source/mixer/RealMixerSource.java index bba778b9..4135f790 100644 --- a/src/main/java/io/github/dsheirer/source/mixer/RealMixerSource.java +++ b/src/main/java/io/github/dsheirer/source/mixer/RealMixerSource.java @@ -18,6 +18,7 @@ package io.github.dsheirer.source.mixer; import io.github.dsheirer.channel.heartbeat.Heartbeat; +import io.github.dsheirer.dsp.gain.AutomaticGainControl; import io.github.dsheirer.sample.Listener; import io.github.dsheirer.sample.adapter.ISampleAdapter; import io.github.dsheirer.sample.real.RealBuffer; @@ -26,7 +27,6 @@ import io.github.dsheirer.source.SourceException; import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.dsp.gain.AutomaticGainControl; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; diff --git a/src/main/java/io/github/dsheirer/source/recording/RecordingConfiguration.java b/src/main/java/io/github/dsheirer/source/recording/RecordingConfiguration.java index a75985ca..e17e2a21 100644 --- a/src/main/java/io/github/dsheirer/source/recording/RecordingConfiguration.java +++ b/src/main/java/io/github/dsheirer/source/recording/RecordingConfiguration.java @@ -1,86 +1,87 @@ package io.github.dsheirer.source.recording; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlTransient; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; + import java.io.File; +@JsonSubTypes.Type(value = RecordingConfiguration.class, name = "recordingConfiguration") public class RecordingConfiguration { - private File mRecording; - private String mFilePath; - private String mAlias; - private long mCenterFrequency; - - public RecordingConfiguration() - { - mAlias = "New Recording"; - } - - public RecordingConfiguration( String filePath, - String alias, - long centerFrequency ) - { - mFilePath = filePath; - mAlias = alias; - mCenterFrequency = centerFrequency; + private File mRecording; + private String mFilePath; + private String mAlias; + private long mCenterFrequency; - updateFile(); - } - - private void updateFile() - { - if( mFilePath != null ) - { - try - { - mRecording = new File( mFilePath ); - } - catch( Exception e ) - { - throw new IllegalArgumentException( "There was an error while " - + "accessing the recording source [" + mFilePath + "]", e ); - } - } - } + public RecordingConfiguration() + { + mAlias = "New Recording"; + } - @XmlTransient - public File getRecording() - { - return mRecording; - } + public RecordingConfiguration(String filePath, String alias, long centerFrequency) + { + mFilePath = filePath; + mAlias = alias; + mCenterFrequency = centerFrequency; - @XmlAttribute( name = "file_path" ) - public String getFilePath() - { - return mFilePath; - } - - public void setFilePath( String filePath ) - { - mFilePath = filePath; + updateFile(); + } - updateFile(); - } - - @XmlAttribute( name = "alias") - public String getAlias() - { - return mAlias; - } - - public void setAlias( String alias ) - { - mAlias = alias; - } + private void updateFile() + { + if(mFilePath != null) + { + try + { + mRecording = new File(mFilePath); + } + catch(Exception e) + { + throw new IllegalArgumentException("There was an error while " + + "accessing the recording source [" + mFilePath + "]", e); + } + } + } - @XmlAttribute( name = "center_frequency" ) - public long getCenterFrequency() - { - return mCenterFrequency; - } - - public void setCenterFrequency( long frequency ) - { - mCenterFrequency = frequency; - } + @JsonIgnore + public File getRecording() + { + return mRecording; + } + + @JacksonXmlProperty(isAttribute = true, localName = "file_path") + public String getFilePath() + { + return mFilePath; + } + + public void setFilePath(String filePath) + { + mFilePath = filePath; + + updateFile(); + } + + @JacksonXmlProperty(isAttribute = true, localName = "alias") + public String getAlias() + { + return mAlias; + } + + public void setAlias(String alias) + { + mAlias = alias; + } + + @JacksonXmlProperty(isAttribute = true, localName = "center_frequency") + public long getCenterFrequency() + { + return mCenterFrequency; + } + + public void setCenterFrequency(long frequency) + { + mCenterFrequency = frequency; + } } diff --git a/src/main/java/io/github/dsheirer/source/tuner/TunerChannelSource.java b/src/main/java/io/github/dsheirer/source/tuner/TunerChannelSource.java index 4d591069..c577789e 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/TunerChannelSource.java +++ b/src/main/java/io/github/dsheirer/source/tuner/TunerChannelSource.java @@ -19,6 +19,10 @@ package io.github.dsheirer.source.tuner; import io.github.dsheirer.channel.heartbeat.Heartbeat; +import io.github.dsheirer.dsp.filter.FilterFactory; +import io.github.dsheirer.dsp.filter.Window.WindowType; +import io.github.dsheirer.dsp.filter.cic.ComplexPrimeCICDecimate; +import io.github.dsheirer.dsp.mixer.Oscillator; import io.github.dsheirer.sample.Buffer; import io.github.dsheirer.sample.Listener; import io.github.dsheirer.sample.OverflowableTransferQueue; @@ -34,10 +38,6 @@ import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeProcessor; import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.dsp.filter.FilterFactory; -import io.github.dsheirer.dsp.filter.Window.WindowType; -import io.github.dsheirer.dsp.filter.cic.ComplexPrimeCICDecimate; -import io.github.dsheirer.dsp.mixer.Oscillator; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspySampleAdapter.java b/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspySampleAdapter.java index 9f721986..fa0fa459 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspySampleAdapter.java +++ b/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspySampleAdapter.java @@ -18,9 +18,9 @@ ******************************************************************************/ package io.github.dsheirer.source.tuner.airspy; -import io.github.dsheirer.sample.adapter.ISampleAdapter; import io.github.dsheirer.dsp.filter.dc.DCRemovalFilter_RB; import io.github.dsheirer.dsp.filter.hilbert.HilbertTransform; +import io.github.dsheirer.sample.adapter.ISampleAdapter; public class AirspySampleAdapter implements ISampleAdapter { diff --git a/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspyTunerConfiguration.java b/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspyTunerConfiguration.java index 619f3f36..69a447ac 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspyTunerConfiguration.java +++ b/src/main/java/io/github/dsheirer/source/tuner/airspy/AirspyTunerConfiguration.java @@ -17,12 +17,13 @@ ******************************************************************************/ package io.github.dsheirer.source.tuner.airspy; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.source.tuner.TunerType; import io.github.dsheirer.source.tuner.airspy.AirspyTunerController.Gain; import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; -import javax.xml.bind.annotation.XmlAttribute; - +@JsonSubTypes.Type(value = AirspyTunerConfiguration.class, name = "airspyTunerConfiguration") public class AirspyTunerConfiguration extends TunerConfiguration { private int mSampleRate = AirspyTunerController.DEFAULT_SAMPLE_RATE.getRate(); @@ -53,7 +54,7 @@ public class AirspyTunerConfiguration extends TunerConfiguration return TunerType.AIRSPY_R820T; } - @XmlAttribute( name = "sample_rate" ) + @JacksonXmlProperty(isAttribute = true, localName = "sample_rate") public int getSampleRate() { return mSampleRate; @@ -63,8 +64,8 @@ public class AirspyTunerConfiguration extends TunerConfiguration { mSampleRate = sampleRate; } - - @XmlAttribute( name = "gain" ) + + @JacksonXmlProperty(isAttribute = true, localName = "gain") public Gain getGain() { return mGain; @@ -74,8 +75,8 @@ public class AirspyTunerConfiguration extends TunerConfiguration { mGain = gain; } - - @XmlAttribute( name = "if_gain" ) + + @JacksonXmlProperty(isAttribute = true, localName = "if_gain") public int getIFGain() { return mIFGain; @@ -85,8 +86,8 @@ public class AirspyTunerConfiguration extends TunerConfiguration { mIFGain = gain; } - - @XmlAttribute( name = "mixer_gain" ) + + @JacksonXmlProperty(isAttribute = true, localName = "mixer_gain") public int getMixerGain() { return mMixerGain; @@ -97,7 +98,7 @@ public class AirspyTunerConfiguration extends TunerConfiguration mMixerGain = gain; } - @XmlAttribute( name = "lna_gain" ) + @JacksonXmlProperty(isAttribute = true, localName = "lna_gain") public int getLNAGain() { return mLNAGain; @@ -108,7 +109,7 @@ public class AirspyTunerConfiguration extends TunerConfiguration mLNAGain = gain; } - @XmlAttribute( name = "mixer_agc" ) + @JacksonXmlProperty(isAttribute = true, localName = "mixer_agc") public boolean isMixerAGC() { return mMixerAGC; @@ -119,7 +120,7 @@ public class AirspyTunerConfiguration extends TunerConfiguration mMixerAGC = enabled; } - @XmlAttribute( name = "lna_agc" ) + @JacksonXmlProperty(isAttribute = true, localName = "lna_agc") public boolean isLNAAGC() { return mLNAAGC; @@ -130,7 +131,7 @@ public class AirspyTunerConfiguration extends TunerConfiguration mLNAAGC = enabled; } - @XmlAttribute( name = "frequency_correction" ) + @JacksonXmlProperty(isAttribute = true, localName = "frequency_correction") public double getFrequencyCorrection() { return mFrequencyCorrection; diff --git a/src/main/java/io/github/dsheirer/source/tuner/configuration/TunerConfiguration.java b/src/main/java/io/github/dsheirer/source/tuner/configuration/TunerConfiguration.java index 81134494..d35c5d0c 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/configuration/TunerConfiguration.java +++ b/src/main/java/io/github/dsheirer/source/tuner/configuration/TunerConfiguration.java @@ -1,103 +1,105 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.source.tuner.configuration; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import io.github.dsheirer.source.tuner.TunerType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; - /** * Abstract class to hold a named configuration for a specific type of tuner */ -@XmlType( name = "tuner_configuration" ) +@JacksonXmlRootElement(localName = "tuner_configuration") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "xsi:type") public abstract class TunerConfiguration { - protected String mName; - protected String mUniqueID; - protected boolean mAssigned; - protected long mFrequency; + protected String mName; + protected String mUniqueID; + protected boolean mAssigned; + protected long mFrequency; - /** - * Default constructor to support JAXB - */ - public TunerConfiguration() - { - } - - /** - * Normal constructor - */ - public TunerConfiguration( String uniqueID, String name ) - { - mUniqueID = uniqueID; - mName = name; - } - - public String toString() - { - return mName; - } + /** + * Default constructor to support JAXB + */ + public TunerConfiguration() + { + } - @XmlAttribute( name = "name" ) - public String getName() - { - return mName; - } - - public void setName( String name ) - { - mName = name; - } + /** + * Normal constructor + */ + public TunerConfiguration(String uniqueID, String name) + { + mUniqueID = uniqueID; + mName = name; + } - @XmlAttribute( name = "unique_id" ) - public String getUniqueID() - { - return mUniqueID; - } - - public void setUniqueID( String id ) - { - mUniqueID = id;; - } - - @XmlAttribute( name = "assigned" ) - public boolean isAssigned() - { - return mAssigned; - } - - public void setAssigned( boolean assigned ) - { - mAssigned = assigned; - } - - @XmlAttribute( name = "frequency" ) - public long getFrequency() - { - return mFrequency; - } - - public void setFrequency( long frequency ) - { - mFrequency = frequency; - } - - @XmlAttribute( name = "tuner_type" ) - public abstract TunerType getTunerType(); + public String toString() + { + return mName; + } + + @JacksonXmlProperty(isAttribute = true, localName = "name") + public String getName() + { + return mName; + } + + public void setName(String name) + { + mName = name; + } + + @JacksonXmlProperty(isAttribute = true, localName = "unique_id") + public String getUniqueID() + { + return mUniqueID; + } + + public void setUniqueID(String id) + { + mUniqueID = id; + ; + } + + @JacksonXmlProperty(isAttribute = true, localName = "assigned") + public boolean isAssigned() + { + return mAssigned; + } + + public void setAssigned(boolean assigned) + { + mAssigned = assigned; + } + + @JacksonXmlProperty(isAttribute = true, localName = "frequency") + public long getFrequency() + { + return mFrequency; + } + + public void setFrequency(long frequency) + { + mFrequency = frequency; + } + + @JacksonXmlProperty(isAttribute = true, localName = "tuner_type") + public abstract TunerType getTunerType(); } diff --git a/src/main/java/io/github/dsheirer/source/tuner/fcd/proV1/FCD1TunerConfiguration.java b/src/main/java/io/github/dsheirer/source/tuner/fcd/proV1/FCD1TunerConfiguration.java index a75d10ed..b4f03b81 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/fcd/proV1/FCD1TunerConfiguration.java +++ b/src/main/java/io/github/dsheirer/source/tuner/fcd/proV1/FCD1TunerConfiguration.java @@ -1,145 +1,146 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.source.tuner.fcd.proV1; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.source.tuner.TunerType; import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; import io.github.dsheirer.source.tuner.fcd.proV1.FCD1TunerController.LNAEnhance; import io.github.dsheirer.source.tuner.fcd.proV1.FCD1TunerController.LNAGain; import io.github.dsheirer.source.tuner.fcd.proV1.FCD1TunerController.MixerGain; -import javax.xml.bind.annotation.XmlAttribute; - +@JsonSubTypes.Type(value = FCD1TunerConfiguration.class, name = "fcd1TunerConfiguration") public class FCD1TunerConfiguration extends TunerConfiguration { - private double mFrequencyCorrection = 22.0d; - private double mInphaseDCCorrection = 0.0d; - private double mQuadratureDCCorrection = 0.0d; - private double mPhaseCorrection = 0.0d; - private double mGainCorrection = 0.0d; - - private LNAGain mLNAGain = LNAGain.LNA_GAIN_PLUS_20_0; - private LNAEnhance mLNAEnhance = LNAEnhance.LNA_ENHANCE_OFF; - private MixerGain mMixerGain = MixerGain.MIXER_GAIN_PLUS_12_0; + private double mFrequencyCorrection = 22.0d; + private double mInphaseDCCorrection = 0.0d; + private double mQuadratureDCCorrection = 0.0d; + private double mPhaseCorrection = 0.0d; + private double mGainCorrection = 0.0d; - /** - * Default constructor for JAXB - */ - public FCD1TunerConfiguration() - { - } - - public FCD1TunerConfiguration( String uniqueID, String name ) - { - super( uniqueID, name ); - } - - @Override - public TunerType getTunerType() + private LNAGain mLNAGain = LNAGain.LNA_GAIN_PLUS_20_0; + private LNAEnhance mLNAEnhance = LNAEnhance.LNA_ENHANCE_OFF; + private MixerGain mMixerGain = MixerGain.MIXER_GAIN_PLUS_12_0; + + /** + * Default constructor for JAXB + */ + public FCD1TunerConfiguration() { - return TunerType.FUNCUBE_DONGLE_PRO; } - @XmlAttribute( name = "lna_gain" ) - public LNAGain getLNAGain() - { - return mLNAGain; - } - - public void setLNAGain( LNAGain gain ) - { - mLNAGain = gain; - } - - public LNAEnhance getLNAEnhance() - { - return mLNAEnhance; - } - - @XmlAttribute( name = "lna_enhance" ) - public void setLNAEnhance( LNAEnhance enhance ) - { - mLNAEnhance = enhance; - } - - @XmlAttribute( name = "mixer_gain" ) - public MixerGain getMixerGain() - { - return mMixerGain; - } - - public void setMixerGain( MixerGain gain ) - { - mMixerGain = gain; - } - - @XmlAttribute( name = "frequency_correction" ) - public double getFrequencyCorrection() - { - return mFrequencyCorrection; - } - - public void setFrequencyCorrection( double value ) - { - mFrequencyCorrection = value; - } + public FCD1TunerConfiguration(String uniqueID, String name) + { + super(uniqueID, name); + } - @XmlAttribute( name = "inphase_dc_correction" ) - public double getInphaseDCCorrection() - { - return mInphaseDCCorrection; - } + @Override + public TunerType getTunerType() + { + return TunerType.FUNCUBE_DONGLE_PRO; + } - public void setInphaseDCCorrection( double value ) - { - mInphaseDCCorrection = value; - } + @JacksonXmlProperty(isAttribute = true, localName = "lna_gain") + public LNAGain getLNAGain() + { + return mLNAGain; + } - @XmlAttribute( name = "quadrature_dc_correction" ) - public double getQuadratureDCCorrection() - { - return mQuadratureDCCorrection; - } + public void setLNAGain(LNAGain gain) + { + mLNAGain = gain; + } - public void setQuadratureDCCorrection( double value ) - { - mQuadratureDCCorrection = value; - } + public LNAEnhance getLNAEnhance() + { + return mLNAEnhance; + } - @XmlAttribute( name = "phase_correction" ) - public double getPhaseCorrection() - { - return mPhaseCorrection; - } + @JacksonXmlProperty(isAttribute = true, localName = "lna_enhance") + public void setLNAEnhance(LNAEnhance enhance) + { + mLNAEnhance = enhance; + } - public void setPhaseCorrection( double value ) - { - mPhaseCorrection = value; - } + @JacksonXmlProperty(isAttribute = true, localName = "mixer_gain") + public MixerGain getMixerGain() + { + return mMixerGain; + } - @XmlAttribute( name = "gain_correction" ) - public double getGainCorrection() - { - return mGainCorrection; - } + public void setMixerGain(MixerGain gain) + { + mMixerGain = gain; + } - public void setGainCorrection( double value ) - { - mGainCorrection = value; - } + @JacksonXmlProperty(isAttribute = true, localName = "frequency_correction") + public double getFrequencyCorrection() + { + return mFrequencyCorrection; + } + + public void setFrequencyCorrection(double value) + { + mFrequencyCorrection = value; + } + + @JacksonXmlProperty(isAttribute = true, localName = "inphase_dc_correction") + public double getInphaseDCCorrection() + { + return mInphaseDCCorrection; + } + + public void setInphaseDCCorrection(double value) + { + mInphaseDCCorrection = value; + } + + @JacksonXmlProperty(isAttribute = true, localName = "quadrature_dc_correction") + public double getQuadratureDCCorrection() + { + return mQuadratureDCCorrection; + } + + public void setQuadratureDCCorrection(double value) + { + mQuadratureDCCorrection = value; + } + + @JacksonXmlProperty(isAttribute = true, localName = "phase_correction") + public double getPhaseCorrection() + { + return mPhaseCorrection; + } + + public void setPhaseCorrection(double value) + { + mPhaseCorrection = value; + } + + @JacksonXmlProperty(isAttribute = true, localName = "gain_correction") + public double getGainCorrection() + { + return mGainCorrection; + } + + public void setGainCorrection(double value) + { + mGainCorrection = value; + } } diff --git a/src/main/java/io/github/dsheirer/source/tuner/fcd/proplusV2/FCD2TunerConfiguration.java b/src/main/java/io/github/dsheirer/source/tuner/fcd/proplusV2/FCD2TunerConfiguration.java index 763e70db..78d6bcb0 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/fcd/proplusV2/FCD2TunerConfiguration.java +++ b/src/main/java/io/github/dsheirer/source/tuner/fcd/proplusV2/FCD2TunerConfiguration.java @@ -1,81 +1,82 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.source.tuner.fcd.proplusV2; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.source.tuner.TunerType; import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; -import javax.xml.bind.annotation.XmlAttribute; - +@JsonSubTypes.Type(value = FCD2TunerConfiguration.class, name = "fcd2TunerConfiguration") public class FCD2TunerConfiguration extends TunerConfiguration { - private boolean mGainLNA = true; - private boolean mGainMixer = true; - private double mFrequencyCorrection = -2.2d; + private boolean mGainLNA = true; + private boolean mGainMixer = true; + private double mFrequencyCorrection = -2.2d; - /** - * Default constructor for JAXB - */ - public FCD2TunerConfiguration() - { - } - - public FCD2TunerConfiguration( String uniqueID, String name ) - { - super( uniqueID, name ); - } - - @Override - public TunerType getTunerType() + /** + * Default constructor for JAXB + */ + public FCD2TunerConfiguration() { - return TunerType.FUNCUBE_DONGLE_PRO_PLUS; } - @XmlAttribute( name = "lna_gain" ) - public boolean getGainLNA() - { - return mGainLNA; - } - - public void setGainLNA( boolean gain ) - { - mGainLNA = gain; - } - - @XmlAttribute( name = "mixer_gain" ) - public boolean getGainMixer() - { - return mGainMixer; - } - - public void setGainMixer( boolean gain ) - { - mGainMixer = gain; - } - - @XmlAttribute( name = "frequency_correction" ) - public double getFrequencyCorrection() - { - return mFrequencyCorrection; - } - - public void setFrequencyCorrection( double value ) - { - mFrequencyCorrection = value; - } + public FCD2TunerConfiguration(String uniqueID, String name) + { + super(uniqueID, name); + } + + @Override + public TunerType getTunerType() + { + return TunerType.FUNCUBE_DONGLE_PRO_PLUS; + } + + @JacksonXmlProperty(isAttribute = true, localName = "lna_gain") + public boolean getGainLNA() + { + return mGainLNA; + } + + public void setGainLNA(boolean gain) + { + mGainLNA = gain; + } + + @JacksonXmlProperty(isAttribute = true, localName = "mixer_gain") + public boolean getGainMixer() + { + return mGainMixer; + } + + public void setGainMixer(boolean gain) + { + mGainMixer = gain; + } + + @JacksonXmlProperty(isAttribute = true, localName = "frequency_correction") + public double getFrequencyCorrection() + { + return mFrequencyCorrection; + } + + public void setFrequencyCorrection(double value) + { + mFrequencyCorrection = value; + } } diff --git a/src/main/java/io/github/dsheirer/source/tuner/frequency/DCTrackingFrequencyControl.java b/src/main/java/io/github/dsheirer/source/tuner/frequency/DCTrackingFrequencyControl.java index ae5e9769..74c5367f 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/frequency/DCTrackingFrequencyControl.java +++ b/src/main/java/io/github/dsheirer/source/tuner/frequency/DCTrackingFrequencyControl.java @@ -17,10 +17,10 @@ package io.github.dsheirer.source.tuner.frequency; * along with this program. If not, see ******************************************************************************/ +import io.github.dsheirer.module.Module; import io.github.dsheirer.sample.Listener; import io.github.dsheirer.sample.real.RealBuffer; import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent.Event; -import io.github.dsheirer.module.Module; import java.util.concurrent.ScheduledExecutorService; diff --git a/src/main/java/io/github/dsheirer/source/tuner/hackrf/HackRFTunerConfiguration.java b/src/main/java/io/github/dsheirer/source/tuner/hackrf/HackRFTunerConfiguration.java index 115fc1c9..35456f62 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/hackrf/HackRFTunerConfiguration.java +++ b/src/main/java/io/github/dsheirer/source/tuner/hackrf/HackRFTunerConfiguration.java @@ -1,109 +1,110 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.source.tuner.hackrf; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.source.tuner.TunerType; import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; import io.github.dsheirer.source.tuner.hackrf.HackRFTunerController.HackRFLNAGain; import io.github.dsheirer.source.tuner.hackrf.HackRFTunerController.HackRFSampleRate; import io.github.dsheirer.source.tuner.hackrf.HackRFTunerController.HackRFVGAGain; -import javax.xml.bind.annotation.XmlAttribute; - +@JsonSubTypes.Type(value = HackRFTunerConfiguration.class, name = "hackRFTunerConfiguration") public class HackRFTunerConfiguration extends TunerConfiguration { - private HackRFSampleRate mSampleRate = HackRFSampleRate.RATE2_016MHZ; - private HackRFLNAGain mLNAGain = HackRFLNAGain.GAIN_16; - private HackRFVGAGain mVGAGain = HackRFVGAGain.GAIN_10; - private boolean mAmplifierEnabled = true; - private double mFrequencyCorrection = 0.0d; + private HackRFSampleRate mSampleRate = HackRFSampleRate.RATE2_016MHZ; + private HackRFLNAGain mLNAGain = HackRFLNAGain.GAIN_16; + private HackRFVGAGain mVGAGain = HackRFVGAGain.GAIN_10; + private boolean mAmplifierEnabled = true; + private double mFrequencyCorrection = 0.0d; - /** - * Default constructor for JAXB - */ - public HackRFTunerConfiguration() - { - } - - public HackRFTunerConfiguration( String uniqueID, String name ) - { - super( uniqueID, name ); - } - - @Override - public TunerType getTunerType() + /** + * Default constructor for JAXB + */ + public HackRFTunerConfiguration() { - return TunerType.HACKRF; } - @XmlAttribute( name = "amplifier_enabled" ) - public boolean getAmplifierEnabled() - { - return mAmplifierEnabled; - } - - public void setAmplifierEnabled( boolean enabled ) - { - mAmplifierEnabled = enabled; - } - - @XmlAttribute( name = "lna_gain" ) - public HackRFLNAGain getLNAGain() - { - return mLNAGain; - } + public HackRFTunerConfiguration(String uniqueID, String name) + { + super(uniqueID, name); + } - public void setLNAGain( HackRFLNAGain lnaGain ) - { - mLNAGain = lnaGain; - } + @Override + public TunerType getTunerType() + { + return TunerType.HACKRF; + } - @XmlAttribute( name = "vga_gain" ) - public HackRFVGAGain getVGAGain() - { - return mVGAGain; - } + @JacksonXmlProperty(isAttribute = true, localName = "amplifier_enabled") + public boolean getAmplifierEnabled() + { + return mAmplifierEnabled; + } - public void setVGAGain( HackRFVGAGain vgaGain ) - { - mVGAGain = vgaGain; - } + public void setAmplifierEnabled(boolean enabled) + { + mAmplifierEnabled = enabled; + } - @XmlAttribute( name = "frequency_correction" ) - public double getFrequencyCorrection() - { - return mFrequencyCorrection; - } - - public void setFrequencyCorrection( double value ) - { - mFrequencyCorrection = value; - } + @JacksonXmlProperty(isAttribute = true, localName = "lna_gain") + public HackRFLNAGain getLNAGain() + { + return mLNAGain; + } - @XmlAttribute( name = "sample_rate" ) - public HackRFSampleRate getSampleRate() - { - return mSampleRate; - } + public void setLNAGain(HackRFLNAGain lnaGain) + { + mLNAGain = lnaGain; + } - public void setSampleRate( HackRFSampleRate sampleRate ) - { - mSampleRate = sampleRate; - } + @JacksonXmlProperty(isAttribute = true, localName = "vga_gain") + public HackRFVGAGain getVGAGain() + { + return mVGAGain; + } + + public void setVGAGain(HackRFVGAGain vgaGain) + { + mVGAGain = vgaGain; + } + + @JacksonXmlProperty(isAttribute = true, localName = "frequency_correction") + public double getFrequencyCorrection() + { + return mFrequencyCorrection; + } + + public void setFrequencyCorrection(double value) + { + mFrequencyCorrection = value; + } + + @JacksonXmlProperty(isAttribute = true, localName = "sample_rate") + public HackRFSampleRate getSampleRate() + { + return mSampleRate; + } + + public void setSampleRate(HackRFSampleRate sampleRate) + { + mSampleRate = sampleRate; + } } diff --git a/src/main/java/io/github/dsheirer/source/tuner/rtl/e4k/E4KTunerConfiguration.java b/src/main/java/io/github/dsheirer/source/tuner/rtl/e4k/E4KTunerConfiguration.java index 0a8eb26d..3e62c522 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/rtl/e4k/E4KTunerConfiguration.java +++ b/src/main/java/io/github/dsheirer/source/tuner/rtl/e4k/E4KTunerConfiguration.java @@ -1,23 +1,26 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.source.tuner.rtl.e4k; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.source.tuner.TunerType; +import io.github.dsheirer.source.tuner.airspy.AirspyTunerConfiguration; import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; import io.github.dsheirer.source.tuner.rtl.RTL2832TunerController; import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerController.E4KEnhanceGain; @@ -25,99 +28,98 @@ import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerController.E4KGain; import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerController.E4KLNAGain; import io.github.dsheirer.source.tuner.rtl.e4k.E4KTunerController.E4KMixerGain; -import javax.xml.bind.annotation.XmlAttribute; - +@JsonSubTypes.Type(value = AirspyTunerConfiguration.class, name = "e4KTunerConfiguration") public class E4KTunerConfiguration extends TunerConfiguration { - private E4KGain mMasterGain = E4KGain.MANUAL; - private E4KMixerGain mMixerGain = E4KMixerGain.GAIN_4; - private E4KLNAGain mLNAGain = E4KLNAGain.GAIN_PLUS_200; - private E4KEnhanceGain mEnhanceGain = E4KEnhanceGain.GAIN_3; - private double mFrequencyCorrection = 0.0d; - private RTL2832TunerController.SampleRate mSampleRate = RTL2832TunerController.SampleRate.RATE_2_400MHZ; + private E4KGain mMasterGain = E4KGain.MANUAL; + private E4KMixerGain mMixerGain = E4KMixerGain.GAIN_4; + private E4KLNAGain mLNAGain = E4KLNAGain.GAIN_PLUS_200; + private E4KEnhanceGain mEnhanceGain = E4KEnhanceGain.GAIN_3; + private double mFrequencyCorrection = 0.0d; + private RTL2832TunerController.SampleRate mSampleRate = RTL2832TunerController.SampleRate.RATE_2_400MHZ; - /** - * Default constructor for JAXB - */ - public E4KTunerConfiguration() - { - } - - public E4KTunerConfiguration( String uniqueID, String name ) - { - super( uniqueID, name ); - } - - @Override - public TunerType getTunerType() + /** + * Default constructor for JAXB + */ + public E4KTunerConfiguration() { - return TunerType.ELONICS_E4000; } - @XmlAttribute( name="master_gain" ) - public E4KGain getMasterGain() - { - return mMasterGain; - } + public E4KTunerConfiguration(String uniqueID, String name) + { + super(uniqueID, name); + } - public void setMasterGain( E4KGain gain ) - { - mMasterGain = gain; - } + @Override + public TunerType getTunerType() + { + return TunerType.ELONICS_E4000; + } - @XmlAttribute( name="mixer_gain" ) - public E4KMixerGain getMixerGain() - { - return mMixerGain; - } + @JacksonXmlProperty(isAttribute = true, localName = "master_gain") + public E4KGain getMasterGain() + { + return mMasterGain; + } - public void setMixerGain( E4KMixerGain mixerGain ) - { - mMixerGain = mixerGain; - } + public void setMasterGain(E4KGain gain) + { + mMasterGain = gain; + } - @XmlAttribute( name="lna_gain" ) - public E4KLNAGain getLNAGain() - { - return mLNAGain; - } + @JacksonXmlProperty(isAttribute = true, localName = "mixer_gain") + public E4KMixerGain getMixerGain() + { + return mMixerGain; + } - public void setLNAGain( E4KLNAGain lnaGain ) - { - mLNAGain = lnaGain; - } + public void setMixerGain(E4KMixerGain mixerGain) + { + mMixerGain = mixerGain; + } - @XmlAttribute( name="enhance_gain" ) - public E4KEnhanceGain getEnhanceGain() - { - return mEnhanceGain; - } + @JacksonXmlProperty(isAttribute = true, localName = "lna_gain") + public E4KLNAGain getLNAGain() + { + return mLNAGain; + } - public void setEnhanceGain( E4KEnhanceGain enhanceGain ) - { - mEnhanceGain = enhanceGain; - } + public void setLNAGain(E4KLNAGain lnaGain) + { + mLNAGain = lnaGain; + } - @XmlAttribute( name="frequency_correction" ) - public double getFrequencyCorrection() - { - return mFrequencyCorrection; - } - - public void setFrequencyCorrection( double value ) - { - mFrequencyCorrection = value; - } + @JacksonXmlProperty(isAttribute = true, localName = "enhance_gain") + public E4KEnhanceGain getEnhanceGain() + { + return mEnhanceGain; + } - @XmlAttribute( name="sample_rate" ) - public RTL2832TunerController.SampleRate getSampleRate() - { - return mSampleRate; - } + public void setEnhanceGain(E4KEnhanceGain enhanceGain) + { + mEnhanceGain = enhanceGain; + } - public void setSampleRate( RTL2832TunerController.SampleRate sampleRate ) - { - mSampleRate = sampleRate; - } + @JacksonXmlProperty(isAttribute = true, localName = "frequency_correction") + public double getFrequencyCorrection() + { + return mFrequencyCorrection; + } + + public void setFrequencyCorrection(double value) + { + mFrequencyCorrection = value; + } + + @JacksonXmlProperty(isAttribute = true, localName = "sample_rate") + public RTL2832TunerController.SampleRate getSampleRate() + { + return mSampleRate; + } + + public void setSampleRate(RTL2832TunerController.SampleRate sampleRate) + { + mSampleRate = sampleRate; + } } diff --git a/src/main/java/io/github/dsheirer/source/tuner/rtl/r820t/R820TTunerConfiguration.java b/src/main/java/io/github/dsheirer/source/tuner/rtl/r820t/R820TTunerConfiguration.java index ab068640..4ba2f51d 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/rtl/r820t/R820TTunerConfiguration.java +++ b/src/main/java/io/github/dsheirer/source/tuner/rtl/r820t/R820TTunerConfiguration.java @@ -1,118 +1,119 @@ /******************************************************************************* * SDR Trunk * Copyright (C) 2014 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 ******************************************************************************/ package io.github.dsheirer.source.tuner.rtl.r820t; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.github.dsheirer.source.tuner.TunerType; import io.github.dsheirer.source.tuner.configuration.TunerConfiguration; import io.github.dsheirer.source.tuner.rtl.RTL2832TunerController; -import javax.xml.bind.annotation.XmlAttribute; - +@JsonSubTypes.Type(value = R820TTunerConfiguration.class, name = "r820TTunerConfiguration") public class R820TTunerConfiguration extends TunerConfiguration { - private R820TTunerController.R820TGain mMasterGain = R820TTunerController.R820TGain.GAIN_327; - private R820TTunerController.R820TMixerGain mMixerGain = R820TTunerController.R820TMixerGain.GAIN_105; - private R820TTunerController.R820TLNAGain mLNAGain = R820TTunerController.R820TLNAGain.GAIN_222; - private R820TTunerController.R820TVGAGain mVGAGain = R820TTunerController.R820TVGAGain.GAIN_210; - private double mFrequencyCorrection = 0.0d; - private RTL2832TunerController.SampleRate mSampleRate = RTL2832TunerController.SampleRate.RATE_2_400MHZ; + private R820TTunerController.R820TGain mMasterGain = R820TTunerController.R820TGain.GAIN_327; + private R820TTunerController.R820TMixerGain mMixerGain = R820TTunerController.R820TMixerGain.GAIN_105; + private R820TTunerController.R820TLNAGain mLNAGain = R820TTunerController.R820TLNAGain.GAIN_222; + private R820TTunerController.R820TVGAGain mVGAGain = R820TTunerController.R820TVGAGain.GAIN_210; + private double mFrequencyCorrection = 0.0d; + private RTL2832TunerController.SampleRate mSampleRate = RTL2832TunerController.SampleRate.RATE_2_400MHZ; - /** - * Default constructor for JAXB - */ - public R820TTunerConfiguration() - { - } - - public R820TTunerConfiguration( String uniqueID, String name ) - { - super( uniqueID, name ); - } - - @Override - public TunerType getTunerType() + /** + * Default constructor for JAXB + */ + public R820TTunerConfiguration() { - return TunerType.RAFAELMICRO_R820T; } - @XmlAttribute( name = "master_gain" ) - public R820TTunerController.R820TGain getMasterGain() - { - return mMasterGain; - } + public R820TTunerConfiguration(String uniqueID, String name) + { + super(uniqueID, name); + } - public void setMasterGain( R820TTunerController.R820TGain gain ) - { - mMasterGain = gain; - } + @Override + public TunerType getTunerType() + { + return TunerType.RAFAELMICRO_R820T; + } - @XmlAttribute( name = "mixer_gain" ) - public R820TTunerController.R820TMixerGain getMixerGain() - { - return mMixerGain; - } + @JacksonXmlProperty(isAttribute = true, localName = "master_gain") + public R820TTunerController.R820TGain getMasterGain() + { + return mMasterGain; + } - public void setMixerGain( R820TTunerController.R820TMixerGain mixerGain ) - { - mMixerGain = mixerGain; - } + public void setMasterGain(R820TTunerController.R820TGain gain) + { + mMasterGain = gain; + } - @XmlAttribute( name = "lna_gain" ) - public R820TTunerController.R820TLNAGain getLNAGain() - { - return mLNAGain; - } + @JacksonXmlProperty(isAttribute = true, localName = "mixer_gain") + public R820TTunerController.R820TMixerGain getMixerGain() + { + return mMixerGain; + } - public void setLNAGain( R820TTunerController.R820TLNAGain lnaGain ) - { - mLNAGain = lnaGain; - } + public void setMixerGain(R820TTunerController.R820TMixerGain mixerGain) + { + mMixerGain = mixerGain; + } - @XmlAttribute( name = "vga_gain" ) - public R820TTunerController.R820TVGAGain getVGAGain() - { - return mVGAGain; - } + @JacksonXmlProperty(isAttribute = true, localName = "lna_gain") + public R820TTunerController.R820TLNAGain getLNAGain() + { + return mLNAGain; + } - public void setVGAGain( R820TTunerController.R820TVGAGain vgaGain ) - { - mVGAGain = vgaGain; - } + public void setLNAGain(R820TTunerController.R820TLNAGain lnaGain) + { + mLNAGain = lnaGain; + } - @XmlAttribute( name = "frequency_correction" ) - public double getFrequencyCorrection() - { - return mFrequencyCorrection; - } - - public void setFrequencyCorrection( double value ) - { - mFrequencyCorrection = value; - } + @JacksonXmlProperty(isAttribute = true, localName = "vga_gain") + public R820TTunerController.R820TVGAGain getVGAGain() + { + return mVGAGain; + } - @XmlAttribute( name = "sample_rate" ) - public RTL2832TunerController.SampleRate getSampleRate() - { - return mSampleRate; - } + public void setVGAGain(R820TTunerController.R820TVGAGain vgaGain) + { + mVGAGain = vgaGain; + } - public void setSampleRate( RTL2832TunerController.SampleRate sampleRate ) - { - mSampleRate = sampleRate; - } + @JacksonXmlProperty(isAttribute = true, localName = "frequency_correction") + public double getFrequencyCorrection() + { + return mFrequencyCorrection; + } + + public void setFrequencyCorrection(double value) + { + mFrequencyCorrection = value; + } + + @JacksonXmlProperty(isAttribute = true, localName = "sample_rate") + public RTL2832TunerController.SampleRate getSampleRate() + { + return mSampleRate; + } + + public void setSampleRate(RTL2832TunerController.SampleRate sampleRate) + { + mSampleRate = sampleRate; + } } diff --git a/src/main/java/io/github/dsheirer/spectrum/ChannelSpectrumPanel.java b/src/main/java/io/github/dsheirer/spectrum/ChannelSpectrumPanel.java index f77488b6..7b7bf9d0 100644 --- a/src/main/java/io/github/dsheirer/spectrum/ChannelSpectrumPanel.java +++ b/src/main/java/io/github/dsheirer/spectrum/ChannelSpectrumPanel.java @@ -4,6 +4,11 @@ import io.github.dsheirer.controller.channel.Channel; import io.github.dsheirer.controller.channel.ChannelEvent; import io.github.dsheirer.controller.channel.ChannelEventListener; import io.github.dsheirer.controller.channel.ChannelProcessingManager; +import io.github.dsheirer.dsp.filter.Filters; +import io.github.dsheirer.dsp.filter.Window.WindowType; +import io.github.dsheirer.dsp.filter.halfband.real.HalfBandFilter_RB_RB; +import io.github.dsheirer.dsp.filter.smoothing.SmoothingFilter.SmoothingType; +import io.github.dsheirer.module.ProcessingChain; import io.github.dsheirer.sample.Listener; import io.github.dsheirer.sample.SampleType; import io.github.dsheirer.sample.complex.ComplexBuffer; @@ -24,11 +29,6 @@ import io.github.dsheirer.spectrum.menu.FrameRateItem; import io.github.dsheirer.spectrum.menu.SmoothingItem; import io.github.dsheirer.spectrum.menu.SmoothingTypeItem; import net.miginfocom.swing.MigLayout; -import io.github.dsheirer.dsp.filter.Filters; -import io.github.dsheirer.dsp.filter.Window.WindowType; -import io.github.dsheirer.dsp.filter.halfband.real.HalfBandFilter_RB_RB; -import io.github.dsheirer.dsp.filter.smoothing.SmoothingFilter.SmoothingType; -import io.github.dsheirer.module.ProcessingChain; import javax.swing.*; import java.awt.*; diff --git a/src/main/java/io/github/dsheirer/spectrum/DFTProcessor.java b/src/main/java/io/github/dsheirer/spectrum/DFTProcessor.java index afe731a6..b69628be 100644 --- a/src/main/java/io/github/dsheirer/spectrum/DFTProcessor.java +++ b/src/main/java/io/github/dsheirer/spectrum/DFTProcessor.java @@ -18,6 +18,8 @@ ******************************************************************************/ package io.github.dsheirer.spectrum; +import io.github.dsheirer.dsp.filter.Window; +import io.github.dsheirer.dsp.filter.Window.WindowType; import io.github.dsheirer.properties.SystemProperties; import io.github.dsheirer.sample.Buffer; import io.github.dsheirer.sample.Listener; @@ -30,8 +32,6 @@ import io.github.dsheirer.util.ThreadPool; import org.jtransforms.fft.FloatFFT_1D; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.dsp.filter.Window; -import io.github.dsheirer.dsp.filter.Window.WindowType; import java.util.Arrays; import java.util.Iterator; diff --git a/src/main/java/io/github/dsheirer/spectrum/SpectralDisplayPanel.java b/src/main/java/io/github/dsheirer/spectrum/SpectralDisplayPanel.java index d02b2f92..6ade9244 100644 --- a/src/main/java/io/github/dsheirer/spectrum/SpectralDisplayPanel.java +++ b/src/main/java/io/github/dsheirer/spectrum/SpectralDisplayPanel.java @@ -23,6 +23,9 @@ import io.github.dsheirer.controller.channel.Channel; import io.github.dsheirer.controller.channel.ChannelModel; import io.github.dsheirer.controller.channel.ChannelProcessingManager; import io.github.dsheirer.controller.channel.ChannelUtils; +import io.github.dsheirer.dsp.filter.Window.WindowType; +import io.github.dsheirer.dsp.filter.smoothing.SmoothingFilter.SmoothingType; +import io.github.dsheirer.module.decode.DecoderType; import io.github.dsheirer.properties.SystemProperties; import io.github.dsheirer.sample.Listener; import io.github.dsheirer.sample.SampleType; @@ -46,9 +49,6 @@ import io.github.dsheirer.spectrum.menu.SmoothingTypeItem; import net.miginfocom.swing.MigLayout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.dsp.filter.Window.WindowType; -import io.github.dsheirer.dsp.filter.smoothing.SmoothingFilter.SmoothingType; -import io.github.dsheirer.module.decode.DecoderType; import javax.swing.*; import javax.swing.event.ChangeEvent; diff --git a/src/main/java/io/github/dsheirer/spectrum/SpectrumPanel.java b/src/main/java/io/github/dsheirer/spectrum/SpectrumPanel.java index 80c11cc0..54738e6f 100644 --- a/src/main/java/io/github/dsheirer/spectrum/SpectrumPanel.java +++ b/src/main/java/io/github/dsheirer/spectrum/SpectrumPanel.java @@ -18,6 +18,12 @@ ******************************************************************************/ package io.github.dsheirer.spectrum; +import io.github.dsheirer.dsp.filter.smoothing.GaussianSmoothingFilter; +import io.github.dsheirer.dsp.filter.smoothing.NoSmoothingFilter; +import io.github.dsheirer.dsp.filter.smoothing.RectangularSmoothingFilter; +import io.github.dsheirer.dsp.filter.smoothing.SmoothingFilter; +import io.github.dsheirer.dsp.filter.smoothing.SmoothingFilter.SmoothingType; +import io.github.dsheirer.dsp.filter.smoothing.TriangularSmoothingFilter; import io.github.dsheirer.settings.ColorSetting; import io.github.dsheirer.settings.ColorSetting.ColorSettingName; import io.github.dsheirer.settings.Setting; @@ -26,12 +32,6 @@ import io.github.dsheirer.settings.SettingsManager; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import io.github.dsheirer.dsp.filter.smoothing.GaussianSmoothingFilter; -import io.github.dsheirer.dsp.filter.smoothing.NoSmoothingFilter; -import io.github.dsheirer.dsp.filter.smoothing.RectangularSmoothingFilter; -import io.github.dsheirer.dsp.filter.smoothing.SmoothingFilter; -import io.github.dsheirer.dsp.filter.smoothing.SmoothingFilter.SmoothingType; -import io.github.dsheirer.dsp.filter.smoothing.TriangularSmoothingFilter; import javax.swing.*; import java.awt.*; diff --git a/src/main/java/io/github/dsheirer/spectrum/menu/FFTWindowTypeItem.java b/src/main/java/io/github/dsheirer/spectrum/menu/FFTWindowTypeItem.java index da6492bc..843cc0a0 100644 --- a/src/main/java/io/github/dsheirer/spectrum/menu/FFTWindowTypeItem.java +++ b/src/main/java/io/github/dsheirer/spectrum/menu/FFTWindowTypeItem.java @@ -1,7 +1,7 @@ package io.github.dsheirer.spectrum.menu; -import io.github.dsheirer.spectrum.DFTProcessor; import io.github.dsheirer.dsp.filter.Window.WindowType; +import io.github.dsheirer.spectrum.DFTProcessor; import javax.swing.*; import java.awt.event.ActionEvent; diff --git a/src/main/java/io/github/dsheirer/spectrum/menu/SmoothingItem.java b/src/main/java/io/github/dsheirer/spectrum/menu/SmoothingItem.java index 3116c907..f99436ca 100644 --- a/src/main/java/io/github/dsheirer/spectrum/menu/SmoothingItem.java +++ b/src/main/java/io/github/dsheirer/spectrum/menu/SmoothingItem.java @@ -1,7 +1,7 @@ package io.github.dsheirer.spectrum.menu; -import io.github.dsheirer.spectrum.SpectralDisplayAdjuster; import io.github.dsheirer.dsp.filter.smoothing.SmoothingFilter; +import io.github.dsheirer.spectrum.SpectralDisplayAdjuster; import javax.swing.*; import javax.swing.event.ChangeEvent; diff --git a/src/main/java/io/github/dsheirer/spectrum/menu/SmoothingTypeItem.java b/src/main/java/io/github/dsheirer/spectrum/menu/SmoothingTypeItem.java index d4ab408e..c3f7df99 100644 --- a/src/main/java/io/github/dsheirer/spectrum/menu/SmoothingTypeItem.java +++ b/src/main/java/io/github/dsheirer/spectrum/menu/SmoothingTypeItem.java @@ -1,7 +1,7 @@ package io.github.dsheirer.spectrum.menu; -import io.github.dsheirer.spectrum.SpectralDisplayAdjuster; import io.github.dsheirer.dsp.filter.smoothing.SmoothingFilter.SmoothingType; +import io.github.dsheirer.spectrum.SpectralDisplayAdjuster; import javax.swing.*; import java.awt.event.ActionEvent;