Updates playlist editor with Add, Copy/Clone and Delete channel

functionality
This commit is contained in:
denny
2016-01-24 10:31:31 -05:00
parent 61f68c08e8
commit da924e8b3a
7 changed files with 337 additions and 68 deletions

View File

@@ -23,14 +23,17 @@ import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlTransient;
import module.decode.DecoderType;
import module.decode.config.AuxDecodeConfiguration;
import module.decode.config.DecodeConfigFactory;
import module.decode.config.DecodeConfiguration;
import module.log.EventLogType;
import module.log.config.EventLogConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import record.RecorderType;
import record.config.RecordConfiguration;
import source.SourceType;
import source.config.SourceConfigFactory;
@@ -115,6 +118,50 @@ public class Channel extends Configuration implements IFrequencyChangeProcessor
{
mChannelID = UNIQUE_ID++;
}
/**
* Creates a (new) deep copy of this channel
*/
public Channel copyOf()
{
Channel channel = new Channel( mName );
channel.setSystem( mSystem );
channel.setSite( mSite );
channel.setAliasListName( mAliasListName );
AuxDecodeConfiguration aux = new AuxDecodeConfiguration();
for( DecoderType auxType: aux.getAuxDecoders() )
{
aux.addAuxDecoder( auxType );
}
channel.setAuxDecodeConfiguration( aux );
channel.setDecodeConfiguration( DecodeConfigFactory.copy( mDecodeConfiguration ) );
EventLogConfiguration log = new EventLogConfiguration();
for( EventLogType logType: mEventLogConfiguration.getLoggers() )
{
log.addLogger( logType );
}
channel.setEventLogConfiguration( log );
RecordConfiguration record = new RecordConfiguration();
for( RecorderType recordType: mRecordConfiguration.getRecorders() )
{
record.addRecorder( recordType );
}
channel.setRecordConfiguration( record );
channel.setSourceConfiguration( SourceConfigFactory.copy( mSourceConfiguration ) );
return channel;
}
//TODO: remove this
/**