mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
Compare commits
1 Commits
2566-P25P1
...
697-hackrf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c05fd33ca6 |
@@ -101,6 +101,7 @@ import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCIn
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCMessageUpdate;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCMotorolaGroupRegroupChannelGrant;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCNetworkStatusBroadcast;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCProtectionParameterBroadcast;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCRFSSStatusBroadcast;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCStatusUpdate;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCTelephoneInterconnectChannelGrant;
|
||||
@@ -598,7 +599,6 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
||||
|
||||
//Network configuration messages
|
||||
case OSP_ADJACENT_STATUS_BROADCAST:
|
||||
case OSP_ADJACENT_STATUS_BROADCAST_UNCOORDINATED_BAND_PLAN:
|
||||
mNetworkConfigurationMonitor.process(ambtc);
|
||||
break;
|
||||
case OSP_NETWORK_STATUS_BROADCAST:
|
||||
@@ -678,6 +678,14 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
||||
mu.getShortDataMessage());
|
||||
}
|
||||
break;
|
||||
case OSP_ADJACENT_STATUS_BROADCAST_UNCOORDINATED_BAND_PLAN:
|
||||
if(ambtc instanceof AMBTCProtectionParameterBroadcast ppb)
|
||||
{
|
||||
broadcastEvent(ambtc, DecodeEventType.RESPONSE, "USE ENCRYPTION " + ppb.getEncryptionKey() +
|
||||
" OUTBOUND MI:" + ppb.getOutboundMessageIndicator() +
|
||||
" INBOUND MI:" + ppb.getInboundMessageIndicator());
|
||||
}
|
||||
break;
|
||||
case OSP_ROAMING_ADDRESS_UPDATE:
|
||||
broadcastEvent(ambtc.getIdentifiers(), ambtc.getTimestamp(), DecodeEventType.RESPONSE,
|
||||
"ROAMING ADDRESS UPDATE");
|
||||
|
||||
@@ -35,7 +35,6 @@ import io.github.dsheirer.module.decode.p25.phase1.message.lc.standard.LCSeconda
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.lc.standard.LCSystemServiceBroadcast;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.AMBTCMessage;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCAdjacentStatusBroadcast;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCAdjacentStatusBroadcastUncoordinated;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCNetworkStatusBroadcast;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCRFSSStatusBroadcast;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.TSBKMessage;
|
||||
@@ -199,7 +198,6 @@ public class P25P1NetworkConfigurationMonitor
|
||||
switch(ambtc.getHeader().getOpcode())
|
||||
{
|
||||
case OSP_ADJACENT_STATUS_BROADCAST:
|
||||
case OSP_ADJACENT_STATUS_BROADCAST_UNCOORDINATED_BAND_PLAN:
|
||||
if(ambtc instanceof AMBTCAdjacentStatusBroadcast)
|
||||
{
|
||||
AMBTCAdjacentStatusBroadcast aasb = (AMBTCAdjacentStatusBroadcast)ambtc;
|
||||
@@ -504,24 +502,14 @@ public class P25P1NetworkConfigurationMonitor
|
||||
if(mAMBTCNeighborSites.containsKey(site))
|
||||
{
|
||||
AMBTCAdjacentStatusBroadcast ambtc = mAMBTCNeighborSites.get(site);
|
||||
sb.append(" ");
|
||||
if(ambtc instanceof AMBTCAdjacentStatusBroadcastUncoordinated unc)
|
||||
{
|
||||
sb.append("WACN:").append(unc.getWacn()).append(" ");
|
||||
}
|
||||
sb.append("SYSTEM:").append(format(ambtc.getSystem(), 3));
|
||||
sb.append(" SYSTEM:").append(format(ambtc.getSystem(), 3));
|
||||
sb.append(" NAC:").append(format(ambtc.getNAC(), 3));
|
||||
sb.append(" RFSS:").append(format(ambtc.getRfss(), 2));
|
||||
sb.append(" SITE:").append(format(ambtc.getSite(), 2));
|
||||
sb.append(" LRA:").append(format(ambtc.getLocationRegistrationArea(), 2));
|
||||
sb.append(" CHANNEL:").append(ambtc.getChannel());
|
||||
sb.append(" DOWNLINK:").append(ambtc.getChannel().getDownlinkFrequency());
|
||||
sb.append(" UPLINK:").append(ambtc.getChannel().getUplinkFrequency());
|
||||
if(ambtc instanceof AMBTCAdjacentStatusBroadcastUncoordinated unc)
|
||||
{
|
||||
sb.append(" SERVICES:").append(unc.getSystemServiceClass());
|
||||
}
|
||||
sb.append("\n");
|
||||
sb.append(" UPLINK:").append(ambtc.getChannel().getUplinkFrequency()).append("\n");
|
||||
}
|
||||
if(mLCNeighborSites.containsKey(site))
|
||||
{
|
||||
|
||||
@@ -37,7 +37,6 @@ import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.isp.AMBTCUn
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.isp.AMBTCUnitToUnitAnswerResponse;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.isp.AMBTCUnitToUnitVoiceServiceRequest;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCAdjacentStatusBroadcast;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCAdjacentStatusBroadcastUncoordinated;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCCallAlert;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCFrequencyBandUpdateTDMA;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCGroupAffiliationQuery;
|
||||
@@ -48,6 +47,7 @@ import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCIn
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCMessageUpdate;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCMotorolaGroupRegroupChannelGrant;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCNetworkStatusBroadcast;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCProtectionParameterBroadcast;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCRFSSStatusBroadcast;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCRoamingAddressResponse;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCRoamingAddressUpdate;
|
||||
@@ -337,7 +337,7 @@ public class PDUMessageFactory
|
||||
case OSP_NETWORK_STATUS_BROADCAST:
|
||||
return new AMBTCNetworkStatusBroadcast(pduSequence, nac, timestamp);
|
||||
case OSP_ADJACENT_STATUS_BROADCAST_UNCOORDINATED_BAND_PLAN:
|
||||
return new AMBTCAdjacentStatusBroadcastUncoordinated(pduSequence, nac, timestamp);
|
||||
return new AMBTCProtectionParameterBroadcast(pduSequence, nac, timestamp);
|
||||
case OSP_RFSS_STATUS_BROADCAST:
|
||||
return new AMBTCRFSSStatusBroadcast(pduSequence, nac, timestamp);
|
||||
case OSP_ROAMING_ADDRESS_UPDATE:
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
* Copyright (C) 2014-2026 Dennis Sheirer
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
* ****************************************************************************
|
||||
*/
|
||||
|
||||
package io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp;
|
||||
|
||||
import io.github.dsheirer.channel.IBandChannelDescriptor;
|
||||
import io.github.dsheirer.identifier.Identifier;
|
||||
import io.github.dsheirer.module.decode.p25.identifier.APCO25Wacn;
|
||||
import io.github.dsheirer.module.decode.p25.identifier.channel.APCO25Channel;
|
||||
import io.github.dsheirer.module.decode.p25.identifier.channel.APCO25ExplicitChannel;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.PDUSequence;
|
||||
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.block.UnconfirmedDataBlock;
|
||||
import io.github.dsheirer.module.decode.p25.reference.SystemServiceClass;
|
||||
|
||||
/**
|
||||
* Adjacent Status Broadcast - Uncoordinated Band Plan (opcode 0x3E), extended/multi-block (AMBTC) format.
|
||||
*
|
||||
* Announces a neighbor site that may belong to a different WACN/system (and band plan) than the current site.
|
||||
* Opcode 0x3E was previously defined as Protection Parameter Broadcast; current TIA-102.AABC revisions reassign it.
|
||||
*
|
||||
* Header: LRA (24-31), flags (32-35), SYSTEM (36-47), RFSS (64-71), SITE (72-79) -- same as opcode 0x3C
|
||||
* Block 0: TRANSMIT CHANNEL (0-15), RECEIVE CHANNEL (16-31), SYSTEM SERVICE CLASS (32-39), WACN (40-59)
|
||||
*
|
||||
* A receive channel of 0xFFFF indicates that no separate receive channel is specified.
|
||||
*/
|
||||
public class AMBTCAdjacentStatusBroadcastUncoordinated extends AMBTCAdjacentStatusBroadcast
|
||||
{
|
||||
private static final int[] BLOCK_0_DOWNLINK_FREQUENCY_BAND = {0, 1, 2, 3};
|
||||
private static final int[] BLOCK_0_DOWNLINK_CHANNEL_NUMBER = {4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
|
||||
private static final int[] BLOCK_0_UPLINK_CHANNEL = {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};
|
||||
private static final int[] BLOCK_0_UPLINK_FREQUENCY_BAND = {16, 17, 18, 19};
|
||||
private static final int[] BLOCK_0_UPLINK_CHANNEL_NUMBER = {20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};
|
||||
private static final int[] BLOCK_0_SYSTEM_SERVICE_CLASS = {32, 33, 34, 35, 36, 37, 38, 39};
|
||||
private static final int[] BLOCK_0_WACN = {40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
|
||||
58, 59};
|
||||
private static final int UNSPECIFIED_CHANNEL = 0xFFFF;
|
||||
|
||||
private IBandChannelDescriptor mChannel;
|
||||
private Identifier mWacn;
|
||||
private SystemServiceClass mSystemServiceClass;
|
||||
|
||||
public AMBTCAdjacentStatusBroadcastUncoordinated(PDUSequence PDUSequence, int nac, long timestamp)
|
||||
{
|
||||
super(PDUSequence, nac, timestamp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getMessageStub());
|
||||
sb.append(" WACN:").append(getWacn());
|
||||
sb.append(" SYSTEM:").append(getSystem());
|
||||
sb.append(" LRA:").append(getLocationRegistrationArea());
|
||||
sb.append(" RFSS:").append(getRfss());
|
||||
sb.append(" SITE:").append(getSite());
|
||||
sb.append(" CHANNEL:").append(getChannel());
|
||||
sb.append(" SERVICES:").append(getSystemServiceClass());
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* WACN of the neighbor site
|
||||
*/
|
||||
public Identifier getWacn()
|
||||
{
|
||||
if(mWacn == null && hasDataBlock(0))
|
||||
{
|
||||
mWacn = APCO25Wacn.create(getDataBlock(0).getMessage().getInt(BLOCK_0_WACN));
|
||||
}
|
||||
|
||||
return mWacn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Services offered by the neighbor site
|
||||
*/
|
||||
public SystemServiceClass getSystemServiceClass()
|
||||
{
|
||||
if(mSystemServiceClass == null)
|
||||
{
|
||||
mSystemServiceClass = new SystemServiceClass(hasDataBlock(0) ?
|
||||
getDataBlock(0).getMessage().getInt(BLOCK_0_SYSTEM_SERVICE_CLASS) : 0);
|
||||
}
|
||||
|
||||
return mSystemServiceClass;
|
||||
}
|
||||
|
||||
private boolean hasUplinkChannel()
|
||||
{
|
||||
return hasDataBlock(0) && getDataBlock(0).getMessage().getInt(BLOCK_0_UPLINK_CHANNEL) != UNSPECIFIED_CHANNEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isExtendedChannel()
|
||||
{
|
||||
return hasUplinkChannel() && super.isExtendedChannel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBandChannelDescriptor getChannel()
|
||||
{
|
||||
if(mChannel == null)
|
||||
{
|
||||
if(hasDataBlock(0))
|
||||
{
|
||||
UnconfirmedDataBlock block = getDataBlock(0);
|
||||
|
||||
if(isExtendedChannel())
|
||||
{
|
||||
mChannel = APCO25ExplicitChannel.create(block.getMessage().getInt(BLOCK_0_DOWNLINK_FREQUENCY_BAND),
|
||||
block.getMessage().getInt(BLOCK_0_DOWNLINK_CHANNEL_NUMBER),
|
||||
block.getMessage().getInt(BLOCK_0_UPLINK_FREQUENCY_BAND),
|
||||
block.getMessage().getInt(BLOCK_0_UPLINK_CHANNEL_NUMBER));
|
||||
}
|
||||
else
|
||||
{
|
||||
mChannel = APCO25Channel.create(block.getMessage().getInt(BLOCK_0_DOWNLINK_FREQUENCY_BAND),
|
||||
block.getMessage().getInt(BLOCK_0_DOWNLINK_CHANNEL_NUMBER));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mChannel = APCO25Channel.create(-1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return mChannel;
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,6 @@ public class AirspyTunerConfiguration extends TunerConfiguration
|
||||
private int mLNAGain = AirspyTunerController.LNA_GAIN_DEFAULT;
|
||||
private boolean mMixerAGC = false;
|
||||
private boolean mLNAAGC = false;
|
||||
private boolean mBiasT = false;
|
||||
|
||||
/**
|
||||
* Default constructor for JAXB
|
||||
@@ -130,15 +129,4 @@ public class AirspyTunerConfiguration extends TunerConfiguration
|
||||
{
|
||||
mLNAAGC = enabled;
|
||||
}
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "bias_t")
|
||||
public boolean isBiasT()
|
||||
{
|
||||
return mBiasT;
|
||||
}
|
||||
|
||||
public void setBiasT(boolean enabled)
|
||||
{
|
||||
mBiasT = enabled;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,22 +183,13 @@ public class AirspyTunerController extends TunerController
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns off the bias-T and closes the device, which also stops streaming.
|
||||
* Closes the device, which also stops streaming.
|
||||
* @param device to close, or null
|
||||
*/
|
||||
private static void closeDevice(AirspyDevice device)
|
||||
{
|
||||
if(device != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
device.setBiasTee(false);
|
||||
}
|
||||
catch(AirspyException | RuntimeException e)
|
||||
{
|
||||
mLog.warn("Error turning off Airspy bias-T before closing the device - " + e.getMessage());
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
device.close();
|
||||
@@ -471,7 +462,6 @@ public class AirspyTunerController extends TunerController
|
||||
setLNAGain(config.getLNAGain());
|
||||
setMixerAGC(config.isMixerAGC());
|
||||
setLNAAGC(config.isLNAAGC());
|
||||
setBiasT(config.isBiasT());
|
||||
|
||||
//Set the gain mode last, so custom values are already set, and linearity and sensitivity modes will
|
||||
//automatically override the custom values.
|
||||
@@ -630,17 +620,6 @@ public class AirspyTunerController extends TunerController
|
||||
execute(device -> device.setLnaAgc(enabled));
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables/disables the Bias-T (RF bias tee) power output for active antennas
|
||||
*
|
||||
* @param enabled true to enable Bias-T, false to disable
|
||||
* @throws SourceException on error
|
||||
*/
|
||||
public void setBiasT(boolean enabled) throws SourceException
|
||||
{
|
||||
execute(device -> device.setBiasTee(enabled));
|
||||
}
|
||||
|
||||
public void setGain(Gain gain) throws SourceException
|
||||
{
|
||||
if(gain != Gain.CUSTOM)
|
||||
|
||||
@@ -66,7 +66,6 @@ public class AirspyTunerEditor extends TunerEditor<AirspyTuner, AirspyTunerConfi
|
||||
private JLabel mMixerGainValueLabel;
|
||||
private JCheckBox mLNAAGCCheckBox;
|
||||
private JCheckBox mMixerAGCCheckBox;
|
||||
private JCheckBox mBiasTCheckBox;
|
||||
|
||||
/**
|
||||
* Constructs an instance
|
||||
@@ -117,8 +116,6 @@ public class AirspyTunerEditor extends TunerEditor<AirspyTuner, AirspyTunerConfi
|
||||
getFrequencyPanel().updateControls();
|
||||
getSampleRateCombo().setEnabled(hasTuner() && !getTuner().getTunerController().isLockedSampleRate());
|
||||
getTunerInfoButton().setEnabled(hasTuner());
|
||||
getBiasTCheckBox().setEnabled(hasTuner());
|
||||
getBiasTCheckBox().setSelected(hasTuner() && hasConfiguration() && getConfiguration().isBiasT());
|
||||
updateGainComponents((hasTuner() && hasConfiguration()) ? getConfiguration().getGain() : null);
|
||||
|
||||
if(hasTuner())
|
||||
@@ -162,9 +159,6 @@ public class AirspyTunerEditor extends TunerEditor<AirspyTuner, AirspyTunerConfi
|
||||
add(new JLabel("Sample Rate:"));
|
||||
add(getSampleRateCombo(), "wrap");
|
||||
|
||||
add(new JLabel(""));
|
||||
add(getBiasTCheckBox(), "wrap");
|
||||
|
||||
add(new JSeparator(), "span,growx,push");
|
||||
add(new JLabel("Gain Control"), "wrap");
|
||||
|
||||
@@ -188,37 +182,6 @@ public class AirspyTunerEditor extends TunerEditor<AirspyTuner, AirspyTunerConfi
|
||||
add(getLNAGainValueLabel());
|
||||
}
|
||||
|
||||
/**
|
||||
* Checkbox to enable/disable Bias-T power for active antennas
|
||||
*/
|
||||
private JCheckBox getBiasTCheckBox()
|
||||
{
|
||||
if(mBiasTCheckBox == null)
|
||||
{
|
||||
mBiasTCheckBox = new JCheckBox("Bias-T");
|
||||
mBiasTCheckBox.setEnabled(false);
|
||||
mBiasTCheckBox.setToolTipText("Enable Bias-T power output for active antennas");
|
||||
mBiasTCheckBox.addActionListener(e ->
|
||||
{
|
||||
if(hasTuner() && !isLoading())
|
||||
{
|
||||
try
|
||||
{
|
||||
getTuner().getController().setBiasT(mBiasTCheckBox.isSelected());
|
||||
save();
|
||||
}
|
||||
catch(Exception e1)
|
||||
{
|
||||
mLog.error("Error setting Bias-T", e1);
|
||||
JOptionPane.showMessageDialog(mBiasTCheckBox, "Couldn't set Bias-T: " + e1.getMessage());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return mBiasTCheckBox;
|
||||
}
|
||||
|
||||
private JCheckBox getLNAAGCCheckBox()
|
||||
{
|
||||
if(mLNAAGCCheckBox == null)
|
||||
@@ -644,7 +607,6 @@ public class AirspyTunerEditor extends TunerEditor<AirspyTuner, AirspyTunerConfi
|
||||
getConfiguration().setLNAGain(getLNAGainSlider().getValue());
|
||||
getConfiguration().setMixerAGC(getMixerAGCCheckBox().isSelected());
|
||||
getConfiguration().setLNAAGC(getLNAAGCCheckBox().isSelected());
|
||||
getConfiguration().setBiasT(getBiasTCheckBox().isSelected());
|
||||
saveConfiguration();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ public class AirspyHfTunerConfiguration extends TunerConfiguration
|
||||
private boolean mAgc;
|
||||
private boolean mLna;
|
||||
private int mAttenuation;
|
||||
private boolean mBiasT;
|
||||
|
||||
/**
|
||||
* Default constructor for JAXB
|
||||
@@ -115,25 +114,6 @@ public class AirspyHfTunerConfiguration extends TunerConfiguration
|
||||
mLna = lna;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the Bias-T power output is enabled. Only applies to devices whose firmware supports a bias-T.
|
||||
* @return bias-T enabled state
|
||||
*/
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "bias_t")
|
||||
public boolean isBiasT()
|
||||
{
|
||||
return mBiasT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Bias-T power output enabled state
|
||||
* @param enabled true to enable
|
||||
*/
|
||||
public void setBiasT(boolean enabled)
|
||||
{
|
||||
mBiasT = enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Attenuation setting.
|
||||
* @return attenuation setting index value.
|
||||
|
||||
@@ -73,8 +73,6 @@ public class AirspyHfTunerController extends TunerController
|
||||
private Attenuation mAttenuation = Attenuation.A0;
|
||||
private boolean mAgcEnabled;
|
||||
private boolean mLnaEnabled;
|
||||
private boolean mBiasTSupported;
|
||||
private boolean mBiasTEnabled;
|
||||
private volatile float mSamplesPerMillisecond = DEFAULT_SAMPLE_RATE.getSampleRate() / 1000.0f;
|
||||
private volatile int mBufferSampleCount = DEFAULT_BUFFER_SAMPLE_COUNT;
|
||||
private boolean mStreaming = false;
|
||||
@@ -118,8 +116,6 @@ public class AirspyHfTunerController extends TunerController
|
||||
|
||||
try
|
||||
{
|
||||
mBiasTSupported = false;
|
||||
mBiasTEnabled = false;
|
||||
mDevice = AirspyHf.open(serialNumber);
|
||||
|
||||
BoardInfo boardInfo = mDevice.boardInfo();
|
||||
@@ -143,8 +139,6 @@ public class AirspyHfTunerController extends TunerController
|
||||
}
|
||||
|
||||
mAvailableSampleRates = Collections.unmodifiableList(sampleRates);
|
||||
mBiasTSupported = detectBiasTSupport(mDevice);
|
||||
mBiasTEnabled = false;
|
||||
|
||||
//Force the sample rate to be applied, since the rate discovery leaves the device at the last rate.
|
||||
mCurrentSampleRate = null;
|
||||
@@ -167,7 +161,6 @@ public class AirspyHfTunerController extends TunerController
|
||||
public void stop()
|
||||
{
|
||||
AirspyHfDevice device;
|
||||
boolean biasTEnabled;
|
||||
|
||||
getLock().lock();
|
||||
|
||||
@@ -176,8 +169,6 @@ public class AirspyHfTunerController extends TunerController
|
||||
device = mDevice;
|
||||
mDevice = null;
|
||||
mStreaming = false;
|
||||
biasTEnabled = mBiasTEnabled;
|
||||
mBiasTEnabled = false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -185,58 +176,9 @@ public class AirspyHfTunerController extends TunerController
|
||||
}
|
||||
|
||||
mNativeBufferBroadcaster.clear();
|
||||
|
||||
if(device != null && biasTEnabled)
|
||||
{
|
||||
try
|
||||
{
|
||||
device.setBiasTee(0);
|
||||
}
|
||||
catch(AirspyHfException | RuntimeException e)
|
||||
{
|
||||
mLog.warn("Error turning off Airspy HF bias-T before closing the device - " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
closeDevice(device);
|
||||
}
|
||||
|
||||
/**
|
||||
* Detects if the device firmware supports a bias-T. Firmware without bias-T support rejects the bias-T commands.
|
||||
* Some firmware (HF+ Discovery R5.0.1) rejects the bias-T count request, so this falls back to turning the bias-T
|
||||
* off, which is a safe probe since the bias-T should be off at startup anyway.
|
||||
* @param device to probe
|
||||
* @return true if the device accepts bias-T commands
|
||||
*/
|
||||
private static boolean detectBiasTSupport(AirspyHfDevice device)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(device.biasTeeCount() > 0)
|
||||
{
|
||||
device.setBiasTee(0);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
catch(AirspyHfException | RuntimeException e)
|
||||
{
|
||||
//Bias-T count not supported - fall through and probe with a bias-T off command.
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
device.setBiasTee(0);
|
||||
return true;
|
||||
}
|
||||
catch(AirspyHfException | RuntimeException e)
|
||||
{
|
||||
mLog.debug("Airspy HF firmware doesn't support bias-T - " + e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the device, which also stops streaming.
|
||||
* @param device to close, or null
|
||||
@@ -506,11 +448,6 @@ public class AirspyHfTunerController extends TunerController
|
||||
setLna(airspyConfig.isLna());
|
||||
setAttenuation(airspyConfig.getAttenuation());
|
||||
setAgc(airspyConfig.isAgc());
|
||||
|
||||
if(isBiasTSupported())
|
||||
{
|
||||
setBiasT(airspyConfig.isBiasT());
|
||||
}
|
||||
}
|
||||
catch(SourceException se)
|
||||
{
|
||||
@@ -733,38 +670,4 @@ public class AirspyHfTunerController extends TunerController
|
||||
execute(device -> device.setAttenuationStep(attenuation.getValue()));
|
||||
mAttenuation = attenuation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the device firmware supports a bias-T, available once the tuner is started.
|
||||
* @return true if supported
|
||||
*/
|
||||
public boolean isBiasTSupported()
|
||||
{
|
||||
return mBiasTSupported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the Bias-T power output is enabled.
|
||||
* @return enabled state
|
||||
*/
|
||||
public boolean getBiasT()
|
||||
{
|
||||
return mBiasTEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables/disables the Bias-T (RF bias tee) power output for active antennas
|
||||
* @param enabled true to enable Bias-T, false to disable
|
||||
* @throws SourceException if the device doesn't support a bias-T or there is an error
|
||||
*/
|
||||
public void setBiasT(boolean enabled) throws SourceException
|
||||
{
|
||||
if(!mBiasTSupported)
|
||||
{
|
||||
throw new SourceException("Airspy HF firmware doesn't support bias-T");
|
||||
}
|
||||
|
||||
execute(device -> device.setBiasTee(enabled ? 1 : 0));
|
||||
mBiasTEnabled = enabled;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ public class AirspyHfTunerEditor extends TunerEditor<AirspyHfTuner,AirspyHfTuner
|
||||
private JComboBox<Attenuation> mAttenuationCombo;
|
||||
private JToggleButton mAgcToggleButton;
|
||||
private JToggleButton mLnaToggleButton;
|
||||
private JToggleButton mBiasTToggleButton;
|
||||
|
||||
/**
|
||||
* Constructs an instance
|
||||
@@ -101,7 +100,6 @@ public class AirspyHfTunerEditor extends TunerEditor<AirspyHfTuner,AirspyHfTuner
|
||||
buttonPanel.setLayout(new MigLayout("insets 0", "[left]", ""));
|
||||
buttonPanel.add(getAgcToggleButton());
|
||||
buttonPanel.add(getLnaToggleButton());
|
||||
buttonPanel.add(getBiasTToggleButton());
|
||||
add(new JLabel(" "));
|
||||
add(buttonPanel, "wrap");
|
||||
|
||||
@@ -127,12 +125,6 @@ public class AirspyHfTunerEditor extends TunerEditor<AirspyHfTuner,AirspyHfTuner
|
||||
getConfiguration().setAgc(getAgcToggleButton().isSelected());
|
||||
getConfiguration().setLna(getLnaToggleButton().isSelected());
|
||||
|
||||
//Only update bias-T when the device supports it, so the saved setting isn't lost on unsupported firmware.
|
||||
if(getTuner().getController().isBiasTSupported())
|
||||
{
|
||||
getConfiguration().setBiasT(getBiasTToggleButton().isSelected());
|
||||
}
|
||||
|
||||
saveConfiguration();
|
||||
}
|
||||
}
|
||||
@@ -166,11 +158,6 @@ public class AirspyHfTunerEditor extends TunerEditor<AirspyHfTuner,AirspyHfTuner
|
||||
getAgcToggleButton().setSelected(getTuner().getController().getAgc());
|
||||
getLnaToggleButton().setEnabled(true);
|
||||
getLnaToggleButton().setSelected(getTuner().getController().getLna());
|
||||
boolean biasTSupported = getTuner().getController().isBiasTSupported();
|
||||
getBiasTToggleButton().setEnabled(biasTSupported);
|
||||
getBiasTToggleButton().setSelected(biasTSupported && getTuner().getController().getBiasT());
|
||||
getBiasTToggleButton().setToolTipText(biasTSupported ? "Enable Bias-T power output for active antennas" :
|
||||
"Bias-T not supported by this device or firmware");
|
||||
getSampleRateCombo().setSelectedItem(getTuner().getController().getCurrentAirspySampleRate());
|
||||
getAttenuationCombo().setEnabled(!getTuner().getController().getAgc());
|
||||
getAttenuationCombo().setSelectedItem(getTuner().getController().getAttenuation());
|
||||
@@ -182,9 +169,6 @@ public class AirspyHfTunerEditor extends TunerEditor<AirspyHfTuner,AirspyHfTuner
|
||||
getAgcToggleButton().setSelected(false);
|
||||
getLnaToggleButton().setEnabled(false);
|
||||
getLnaToggleButton().setSelected(false);
|
||||
getBiasTToggleButton().setEnabled(false);
|
||||
getBiasTToggleButton().setSelected(false);
|
||||
getBiasTToggleButton().setToolTipText("No tuner available");
|
||||
getSampleRateCombo().setEnabled(false);
|
||||
getAttenuationCombo().setEnabled(false);
|
||||
getAttenuationCombo().setSelectedItem(Attenuation.A0);
|
||||
@@ -360,36 +344,4 @@ public class AirspyHfTunerEditor extends TunerEditor<AirspyHfTuner,AirspyHfTuner
|
||||
|
||||
return mLnaToggleButton;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bias-T toggle button, enabled only when the device firmware supports a bias-T.
|
||||
*/
|
||||
private JToggleButton getBiasTToggleButton()
|
||||
{
|
||||
if(mBiasTToggleButton == null)
|
||||
{
|
||||
mBiasTToggleButton = new JToggleButton("Bias-T");
|
||||
mBiasTToggleButton.setToolTipText("Enable Bias-T power output for active antennas");
|
||||
mBiasTToggleButton.setEnabled(false);
|
||||
mBiasTToggleButton.addActionListener(e -> {
|
||||
if(hasTuner() && !isLoading())
|
||||
{
|
||||
try
|
||||
{
|
||||
getTuner().getController().setBiasT(mBiasTToggleButton.isSelected());
|
||||
save();
|
||||
}
|
||||
catch(SourceException se)
|
||||
{
|
||||
mLog.error("Error setting Airspy HF Bias-T", se);
|
||||
mBiasTToggleButton.setSelected(getTuner().getController().getBiasT());
|
||||
JOptionPane.showMessageDialog(AirspyHfTunerEditor.this,
|
||||
"Airspy HF Tuner Controller - couldn't change Bias-T setting " + se.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return mBiasTToggleButton;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ public class FCD1TunerConfiguration extends TunerConfiguration
|
||||
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 boolean mBiasT = false;
|
||||
|
||||
/**
|
||||
* Default constructor for JAXB
|
||||
@@ -133,15 +132,4 @@ public class FCD1TunerConfiguration extends TunerConfiguration
|
||||
{
|
||||
mGainCorrection = value;
|
||||
}
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "bias_t")
|
||||
public boolean isBiasT()
|
||||
{
|
||||
return mBiasT;
|
||||
}
|
||||
|
||||
public void setBiasT(boolean enabled)
|
||||
{
|
||||
mBiasT = enabled;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,6 @@ public class FCD1TunerController extends FCDTunerController
|
||||
private LNAGain mLNAGain;
|
||||
private LNAEnhance mLNAEnhance;
|
||||
private MixerGain mMixerGain;
|
||||
private boolean mBiasTEnabled = false;
|
||||
|
||||
/**
|
||||
* Constructs an instance
|
||||
@@ -124,61 +123,9 @@ public class FCD1TunerController extends FCDTunerController
|
||||
//Re-cast any usb exceptions as source exceptions
|
||||
throw new SourceException("FCD 1 Controller error applying tuner config - " + e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
//Apply the bias-T separately so that a bias-T error doesn't prevent the tuner from starting.
|
||||
try
|
||||
{
|
||||
setBiasT(fcd1.isBiasT());
|
||||
}
|
||||
catch(SourceException se)
|
||||
{
|
||||
mLog.warn("FCD 1 Controller couldn't apply bias-T setting - " + se.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables/disables the Bias-T (RF bias tee) power output for active antennas
|
||||
*
|
||||
* @param enabled true to enable Bias-T, false to disable
|
||||
* @throws SourceException on error
|
||||
*/
|
||||
public void setBiasT(boolean enabled) throws SourceException
|
||||
{
|
||||
try
|
||||
{
|
||||
send(FCDCommand.APP_SET_BIAS_TEE, enabled ? 1 : 0);
|
||||
mBiasTEnabled = enabled;
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
throw new SourceException("Couldn't set FCD Pro bias-T", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns off the bias-T, when enabled, before closing the device.
|
||||
*/
|
||||
@Override
|
||||
public void stop()
|
||||
{
|
||||
if(mBiasTEnabled)
|
||||
{
|
||||
try
|
||||
{
|
||||
setBiasT(false);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
mLog.warn("Error turning off FCD Pro bias-T before closing the device - " + e.getMessage());
|
||||
}
|
||||
|
||||
mBiasTEnabled = false;
|
||||
}
|
||||
|
||||
super.stop();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current LNA Gain value from the controller and stores it
|
||||
*/
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
package io.github.dsheirer.source.tuner.fcd.proV1;
|
||||
|
||||
import io.github.dsheirer.preference.UserPreferences;
|
||||
import io.github.dsheirer.source.SourceException;
|
||||
import io.github.dsheirer.source.tuner.fcd.FCDTuner;
|
||||
import io.github.dsheirer.source.tuner.fcd.proV1.FCD1TunerController.LNAEnhance;
|
||||
import io.github.dsheirer.source.tuner.fcd.proV1.FCD1TunerController.LNAGain;
|
||||
@@ -33,7 +32,6 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
@@ -54,7 +52,6 @@ public class FCD1TunerEditor extends TunerEditor<FCDTuner,FCD1TunerConfiguration
|
||||
private JComboBox<LNAGain> mLnaGainCombo;
|
||||
private JComboBox<LNAEnhance> mLnaEnhanceCombo;
|
||||
private JComboBox<MixerGain> mMixerGainCombo;
|
||||
private JCheckBox mBiasTCheckBox;
|
||||
private CorrectionSpinner mCorrectionDCI;
|
||||
private CorrectionSpinner mCorrectionDCQ;
|
||||
private CorrectionSpinner mGainCorrectionSpinner;
|
||||
@@ -124,7 +121,6 @@ public class FCD1TunerEditor extends TunerEditor<FCDTuner,FCD1TunerConfiguration
|
||||
getMixerGainCombo().setSelectedItem(getConfiguration().getMixerGain());
|
||||
getLnaEnhanceCombo().setSelectedItem(getConfiguration().getLNAEnhance());
|
||||
getLnaGainCombo().setSelectedItem(getConfiguration().getLNAGain());
|
||||
getBiasTCheckBox().setSelected(getConfiguration().isBiasT());
|
||||
getDcCorrectionSpinnerI().setValue(getConfiguration().getInphaseDCCorrection());
|
||||
getDcCorrectionSpinnerQ().setValue(getConfiguration().getQuadratureDCCorrection());
|
||||
getPhaseCorrectionSpinner().setValue(getConfiguration().getGainCorrection());
|
||||
@@ -134,7 +130,6 @@ public class FCD1TunerEditor extends TunerEditor<FCDTuner,FCD1TunerConfiguration
|
||||
getMixerGainCombo().setEnabled(hasTuner());
|
||||
getLnaEnhanceCombo().setEnabled(hasTuner());
|
||||
getLnaGainCombo().setEnabled(hasTuner());
|
||||
getBiasTCheckBox().setEnabled(hasTuner());
|
||||
getDcCorrectionSpinnerI().setEnabled(hasTuner());
|
||||
getDcCorrectionSpinnerQ().setEnabled(hasTuner());
|
||||
getPhaseCorrectionSpinner().setEnabled(hasTuner());
|
||||
@@ -169,8 +164,6 @@ public class FCD1TunerEditor extends TunerEditor<FCDTuner,FCD1TunerConfiguration
|
||||
add(getLnaEnhanceCombo(), "wrap");
|
||||
add(new JLabel("Mixer:"));
|
||||
add(getMixerGainCombo(), "wrap");
|
||||
add(new JLabel(""));
|
||||
add(getBiasTCheckBox(), "wrap");
|
||||
|
||||
add(new JSeparator(), "span,growx,push");
|
||||
add(new JLabel("Correction"), "span,align center");
|
||||
@@ -216,37 +209,6 @@ public class FCD1TunerEditor extends TunerEditor<FCDTuner,FCD1TunerConfiguration
|
||||
return mLnaGainCombo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checkbox to enable/disable Bias-T power for active antennas
|
||||
*/
|
||||
public JCheckBox getBiasTCheckBox()
|
||||
{
|
||||
if(mBiasTCheckBox == null)
|
||||
{
|
||||
mBiasTCheckBox = new JCheckBox("Bias-T");
|
||||
mBiasTCheckBox.setEnabled(false);
|
||||
mBiasTCheckBox.setToolTipText("Enable Bias-T power output for active antennas");
|
||||
mBiasTCheckBox.addActionListener(event ->
|
||||
{
|
||||
if(hasTuner() && !isLoading())
|
||||
{
|
||||
try
|
||||
{
|
||||
getController().setBiasT(mBiasTCheckBox.isSelected());
|
||||
save();
|
||||
}
|
||||
catch(SourceException e)
|
||||
{
|
||||
mLog.error("Couldn't set bias-T for FCD Pro", e);
|
||||
JOptionPane.showMessageDialog(FCD1TunerEditor.this, "Couldn't set Bias-T: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return mBiasTCheckBox;
|
||||
}
|
||||
|
||||
public JComboBox getLnaEnhanceCombo()
|
||||
{
|
||||
if(mLnaEnhanceCombo == null)
|
||||
@@ -424,7 +386,6 @@ public class FCD1TunerEditor extends TunerEditor<FCDTuner,FCD1TunerConfiguration
|
||||
getConfiguration().setLNAEnhance((LNAEnhance) mLnaEnhanceCombo.getSelectedItem());
|
||||
getConfiguration().setLNAGain((LNAGain) mLnaGainCombo.getSelectedItem());
|
||||
getConfiguration().setMixerGain((MixerGain) mMixerGainCombo.getSelectedItem());
|
||||
getConfiguration().setBiasT(getBiasTCheckBox().isSelected());
|
||||
double dci = ((SpinnerNumberModel)mCorrectionDCI.getModel()).getNumber().doubleValue();
|
||||
getConfiguration().setInphaseDCCorrection(dci);
|
||||
double dcq = ((SpinnerNumberModel)mCorrectionDCQ.getModel()).getNumber().doubleValue();
|
||||
|
||||
@@ -27,7 +27,6 @@ public class FCD2TunerConfiguration extends TunerConfiguration
|
||||
{
|
||||
private boolean mGainLNA = true;
|
||||
private boolean mGainMixer = true;
|
||||
private boolean mBiasT = false;
|
||||
|
||||
/**
|
||||
* Default constructor for JAXB
|
||||
@@ -70,15 +69,4 @@ public class FCD2TunerConfiguration extends TunerConfiguration
|
||||
{
|
||||
mGainMixer = gain;
|
||||
}
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "bias_t")
|
||||
public boolean isBiasT()
|
||||
{
|
||||
return mBiasT;
|
||||
}
|
||||
|
||||
public void setBiasT(boolean enabled)
|
||||
{
|
||||
mBiasT = enabled;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ public class FCD2TunerController extends FCDTunerController
|
||||
public static final int MINIMUM_TUNABLE_FREQUENCY_HZ = 150000;
|
||||
public static final int MAXIMUM_TUNABLE_FREQUENCY_HZ = 2050000000;
|
||||
public static final int SAMPLE_RATE = 192000;
|
||||
private boolean mBiasTEnabled = false;
|
||||
|
||||
/**
|
||||
* Constructs an instance
|
||||
@@ -99,48 +98,6 @@ public class FCD2TunerController extends FCDTunerController
|
||||
send(FCDCommand.APP_SET_MIXER_GAIN, enabled ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables/disables the Bias-T (RF bias tee) power output for active antennas
|
||||
*
|
||||
* @param enabled true to enable Bias-T, false to disable
|
||||
* @throws SourceException on error
|
||||
*/
|
||||
public void setBiasT(boolean enabled) throws SourceException
|
||||
{
|
||||
try
|
||||
{
|
||||
send(FCDCommand.APP_SET_BIAS_TEE, enabled ? 1 : 0);
|
||||
mBiasTEnabled = enabled;
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
throw new SourceException("Couldn't set FCD Pro Plus bias-T", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns off the bias-T, when enabled, before closing the device.
|
||||
*/
|
||||
@Override
|
||||
public void stop()
|
||||
{
|
||||
if(mBiasTEnabled)
|
||||
{
|
||||
try
|
||||
{
|
||||
setBiasT(false);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
mLog.warn("Error turning off FCD Pro Plus bias-T before closing the device - " + e.getMessage());
|
||||
}
|
||||
|
||||
mBiasTEnabled = false;
|
||||
}
|
||||
|
||||
super.stop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(TunerConfiguration config) throws SourceException
|
||||
{
|
||||
@@ -151,7 +108,6 @@ public class FCD2TunerController extends FCDTunerController
|
||||
{
|
||||
setLNAGain(fcd2.getGainLNA());
|
||||
setMixerGain(fcd2.getGainMixer());
|
||||
setBiasT(fcd2.isBiasT());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JSeparator;
|
||||
import javax.swing.SpinnerNumberModel;
|
||||
|
||||
@@ -46,7 +45,6 @@ public class FCD2TunerEditor extends TunerEditor<FCDTuner, FCD2TunerConfiguratio
|
||||
private JButton mTunerInfoButton;
|
||||
private JCheckBox mLnaGainCheckBox;
|
||||
private JCheckBox mMixerGainCheckBox;
|
||||
private JCheckBox mBiasTCheckBox;
|
||||
|
||||
/**
|
||||
* Constructs an instance
|
||||
@@ -108,13 +106,11 @@ public class FCD2TunerEditor extends TunerEditor<FCDTuner, FCD2TunerConfiguratio
|
||||
getTunerInfoButton().setEnabled(hasTuner());
|
||||
getLnaGainCheckBox().setEnabled(hasTuner());
|
||||
getMixerGainCheckBox().setEnabled(hasTuner());
|
||||
getBiasTCheckBox().setEnabled(hasTuner());
|
||||
|
||||
if(hasTuner() && hasConfiguration())
|
||||
{
|
||||
getLnaGainCheckBox().setSelected(getConfiguration().getGainLNA());
|
||||
getMixerGainCheckBox().setSelected(getConfiguration().getGainMixer());
|
||||
getBiasTCheckBox().setSelected(getConfiguration().isBiasT());
|
||||
}
|
||||
|
||||
setLoading(false);
|
||||
@@ -139,12 +135,8 @@ public class FCD2TunerEditor extends TunerEditor<FCDTuner, FCD2TunerConfiguratio
|
||||
add(getFrequencyPanel(), "wrap");
|
||||
|
||||
add(new JSeparator(), "span,growx,push");
|
||||
JPanel checkBoxPanel = new JPanel();
|
||||
checkBoxPanel.setLayout(new MigLayout("insets 0", "[left][left][left]", ""));
|
||||
checkBoxPanel.add(getLnaGainCheckBox());
|
||||
checkBoxPanel.add(getMixerGainCheckBox());
|
||||
checkBoxPanel.add(getBiasTCheckBox());
|
||||
add(checkBoxPanel, "span,align left");
|
||||
add(getLnaGainCheckBox());
|
||||
add(getMixerGainCheckBox());
|
||||
}
|
||||
|
||||
public JButton getTunerInfoButton()
|
||||
@@ -212,37 +204,6 @@ public class FCD2TunerEditor extends TunerEditor<FCDTuner, FCD2TunerConfiguratio
|
||||
return mMixerGainCheckBox;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checkbox to enable/disable Bias-T power for active antennas
|
||||
*/
|
||||
public JCheckBox getBiasTCheckBox()
|
||||
{
|
||||
if(mBiasTCheckBox == null)
|
||||
{
|
||||
mBiasTCheckBox = new JCheckBox("Bias-T");
|
||||
mBiasTCheckBox.setEnabled(false);
|
||||
mBiasTCheckBox.setToolTipText("Enable Bias-T power output for active antennas");
|
||||
mBiasTCheckBox.addActionListener(event ->
|
||||
{
|
||||
if(hasTuner() && !isLoading())
|
||||
{
|
||||
try
|
||||
{
|
||||
getController().setBiasT(getBiasTCheckBox().isSelected());
|
||||
save();
|
||||
}
|
||||
catch(SourceException e)
|
||||
{
|
||||
mLog.error("Couldn't set bias-T for FCD2", e);
|
||||
JOptionPane.showMessageDialog(mBiasTCheckBox, "Couldn't set Bias-T: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return mBiasTCheckBox;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTunerLockState(boolean locked)
|
||||
{
|
||||
@@ -294,7 +255,6 @@ public class FCD2TunerEditor extends TunerEditor<FCDTuner, FCD2TunerConfiguratio
|
||||
getConfiguration().setAutoPPMCorrectionEnabled(getAutoPPMCheckBox().isSelected());
|
||||
getConfiguration().setGainLNA(getLnaGainCheckBox().isSelected());
|
||||
getConfiguration().setGainMixer(getMixerGainCheckBox().isSelected());
|
||||
getConfiguration().setBiasT(getBiasTCheckBox().isSelected());
|
||||
saveConfiguration();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user