mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
Updates playlist editor with Add, Copy/Clone and Delete channel
functionality
This commit is contained in:
@@ -43,18 +43,18 @@ public class DecodeConfigFactory
|
||||
case AM:
|
||||
retVal = new DecodeConfigAM();
|
||||
break;
|
||||
case NBFM:
|
||||
retVal = new DecodeConfigNBFM();
|
||||
case LTR_NET:
|
||||
retVal = new DecodeConfigLTRNet();
|
||||
break;
|
||||
case LTR_STANDARD:
|
||||
retVal = new DecodeConfigLTRStandard();
|
||||
break;
|
||||
case LTR_NET:
|
||||
retVal = new DecodeConfigLTRNet();
|
||||
break;
|
||||
case MPT1327:
|
||||
retVal = new DecodeConfigMPT1327();
|
||||
break;
|
||||
case NBFM:
|
||||
retVal = new DecodeConfigNBFM();
|
||||
break;
|
||||
case PASSPORT:
|
||||
retVal = new DecodeConfigPassport();
|
||||
break;
|
||||
@@ -68,4 +68,73 @@ public class DecodeConfigFactory
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a copy of the configuration
|
||||
*/
|
||||
public static DecodeConfiguration copy( DecodeConfiguration config )
|
||||
{
|
||||
if( config != null )
|
||||
{
|
||||
switch( config.getDecoderType() )
|
||||
{
|
||||
case AM:
|
||||
DecodeConfigAM originalAM = (DecodeConfigAM)config;
|
||||
DecodeConfigAM copyAM = new DecodeConfigAM();
|
||||
copyAM.setAFC( originalAM.getAFC() );
|
||||
copyAM.setAFCMaximumCorrection( originalAM.getAFCMaximumCorrection() );
|
||||
return copyAM;
|
||||
case LTR_NET:
|
||||
DecodeConfigLTRNet originalLTRNet = (DecodeConfigLTRNet)config;
|
||||
DecodeConfigLTRNet copyLTRNet = new DecodeConfigLTRNet();
|
||||
copyLTRNet.setAFC( originalLTRNet.getAFC() );
|
||||
copyLTRNet.setAFCMaximumCorrection( originalLTRNet.getAFCMaximumCorrection() );
|
||||
copyLTRNet.setMessageDirection( originalLTRNet.getMessageDirection() );
|
||||
return copyLTRNet;
|
||||
case LTR_STANDARD:
|
||||
DecodeConfigLTRStandard originalLTRStandard = (DecodeConfigLTRStandard)config;
|
||||
DecodeConfigLTRStandard copyLTRStandard = new DecodeConfigLTRStandard();
|
||||
copyLTRStandard.setAFC( originalLTRStandard.getAFC() );
|
||||
copyLTRStandard.setAFCMaximumCorrection( originalLTRStandard.getAFCMaximumCorrection() );
|
||||
copyLTRStandard.setMessageDirection( originalLTRStandard.getMessageDirection() );
|
||||
return copyLTRStandard;
|
||||
case MPT1327:
|
||||
DecodeConfigMPT1327 originalMPT = (DecodeConfigMPT1327)config;
|
||||
DecodeConfigMPT1327 copyMPT = new DecodeConfigMPT1327();
|
||||
copyMPT.setAFC( originalMPT.getAFC() );
|
||||
copyMPT.setAFCMaximumCorrection( originalMPT.getAFCMaximumCorrection() );
|
||||
copyMPT.setCallTimeout( originalMPT.getCallTimeout() );
|
||||
copyMPT.setChannelMapName( originalMPT.getChannelMapName() );
|
||||
copyMPT.setSync( originalMPT.getSync() );
|
||||
copyMPT.setTrafficChannelPoolSize( originalMPT.getTrafficChannelPoolSize() );
|
||||
return copyMPT;
|
||||
case NBFM:
|
||||
DecodeConfigNBFM originalNBFM = (DecodeConfigNBFM)config;
|
||||
DecodeConfigNBFM copyNBFM = new DecodeConfigNBFM();
|
||||
copyNBFM.setAFC( originalNBFM.getAFC() );
|
||||
copyNBFM.setAFCMaximumCorrection( originalNBFM.getAFCMaximumCorrection() );
|
||||
return copyNBFM;
|
||||
case P25_PHASE1:
|
||||
DecodeConfigP25Phase1 originalP25 = (DecodeConfigP25Phase1)config;
|
||||
DecodeConfigP25Phase1 copyP25 = new DecodeConfigP25Phase1();
|
||||
copyP25.setAFC( originalP25.getAFC() );
|
||||
copyP25.setAFCMaximumCorrection( originalP25.getAFCMaximumCorrection() );
|
||||
copyP25.setIgnoreDataCalls( originalP25.getIgnoreDataCalls() );
|
||||
copyP25.setModulation( originalP25.getModulation() );
|
||||
copyP25.setTrafficChannelPoolSize( originalP25.getTrafficChannelPoolSize() );
|
||||
return copyP25;
|
||||
case PASSPORT:
|
||||
DecodeConfigPassport originalPass = (DecodeConfigPassport)config;
|
||||
DecodeConfigPassport copyPass = new DecodeConfigPassport();
|
||||
copyPass.setAFC( originalPass.getAFC() );
|
||||
copyPass.setAFCMaximumCorrection( originalPass.getAFCMaximumCorrection() );
|
||||
return copyPass;
|
||||
default:
|
||||
throw new IllegalArgumentException( "Unrecognized decoder "
|
||||
+ "configuration type:" + config.getDecoderType() );
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user