#1489 SDRPlay RSP tuner editors now lock sample rate combo when sourcing channels. (#1490)

Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
Denny Sheirer
2023-03-12 07:21:23 -04:00
committed by GitHub
parent f0dc80437c
commit c788292db8
15 changed files with 201 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2022 Dennis Sheirer
* Copyright (C) 2014-2023 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
@@ -628,19 +628,20 @@ public class AirspyTunerEditor extends TunerEditor<AirspyTuner, AirspyTunerConfi
{
if(hasTuner() && getTuner().getController().isLockedSampleRate())
{
mSampleRateCombo.setToolTipText("Sample Rate is locked. Disable decoding channels to unlock.");
getSampleRateCombo().setToolTipText("Sample Rate is locked. Disable decoding channels to unlock.");
}
else
{
mSampleRateCombo.setToolTipText("Select a sample rate for the tuner");
getSampleRateCombo().setToolTipText("Select a sample rate for the tuner");
}
}
@Override
public void setTunerLockState(boolean locked)
{
super.setTunerLockState(locked);
getFrequencyPanel().updateControls();
getSampleRateCombo().setEnabled(!locked);
updateSampleRateToolTip();
}
private String getTunerInfo()

View File

@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2022 Dennis Sheirer
* Copyright (C) 2014-2023 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
@@ -26,6 +26,7 @@ import io.github.dsheirer.source.tuner.fcd.proV1.FCD1TunerController.MixerGain;
import io.github.dsheirer.source.tuner.manager.DiscoveredTuner;
import io.github.dsheirer.source.tuner.manager.TunerManager;
import io.github.dsheirer.source.tuner.ui.TunerEditor;
import java.text.DecimalFormat;
import net.miginfocom.swing.MigLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -39,7 +40,6 @@ import javax.swing.JSpinner;
import javax.swing.SpinnerModel;
import javax.swing.SpinnerNumberModel;
import javax.swing.SwingConstants;
import java.text.DecimalFormat;
/**
* Funcube Dongle Pro tuner editor
@@ -312,7 +312,7 @@ public class FCD1TunerEditor extends TunerEditor<FCDTuner,FCD1TunerConfiguration
@Override
public void setTunerLockState(boolean locked)
{
super.setTunerLockState(locked);
getFrequencyPanel().updateControls();
}
public JButton getTunerInfoButton()

View File

@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2022 Dennis Sheirer
* Copyright (C) 2014-2023 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
@@ -195,7 +195,7 @@ public class FCD2TunerEditor extends TunerEditor<FCDTuner, FCD2TunerConfiguratio
@Override
public void setTunerLockState(boolean locked)
{
super.setTunerLockState(locked);
getFrequencyPanel().updateControls();
}
private String getTunerInfo()

View File

@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2022 Dennis Sheirer
* Copyright (C) 2014-2023 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
@@ -308,8 +308,9 @@ public class HackRFTunerEditor extends TunerEditor<HackRFTuner,HackRFTunerConfig
@Override
public void setTunerLockState(boolean locked)
{
super.setTunerLockState(locked);
mSampleRateCombo.setEnabled(!locked);
getFrequencyPanel().updateControls();
getSampleRateCombo().setEnabled(!locked);
updateSampleRateToolTip();
}
private String getTunerInfo()

View File

@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2022 Dennis Sheirer
* Copyright (C) 2014-2023 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
@@ -54,7 +54,7 @@ public class RecordingTunerEditor extends TunerEditor<RecordingTuner,RecordingTu
@Override
public void setTunerLockState(boolean locked)
{
super.setTunerLockState(locked);
getFrequencyPanel().updateControls();
}
@Override

View File

@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2022 Dennis Sheirer
* Copyright (C) 2014-2023 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
@@ -97,6 +97,6 @@ public class RTL2832UnknownTunerEditor extends TunerEditor<RTL2832Tuner, RTL2832
@Override
public void setTunerLockState(boolean locked)
{
super.setTunerLockState(locked);
getFrequencyPanel().updateControls();
}
}

View File

@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2022 Dennis Sheirer
* Copyright (C) 2014-2023 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
@@ -400,8 +400,9 @@ public class E4KTunerEditor extends TunerEditor<RTL2832Tuner, E4KTunerConfigurat
@Override
public void setTunerLockState(boolean locked)
{
super.setTunerLockState(locked);
mSampleRateCombo.setEnabled(!locked);
getFrequencyPanel().updateControls();
getSampleRateCombo().setEnabled(!locked);
updateSampleRateToolTip();
}
private String getTunerInfo()

View File

@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2022 Dennis Sheirer
* Copyright (C) 2014-2023 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
@@ -123,6 +123,7 @@ public class R820TTunerEditor extends TunerEditor<RTL2832Tuner,R820TTunerConfigu
@Override
protected void tunerStatusUpdated()
{
mLog.info("Tuner status was updated.");
setLoading(true);
if(hasTuner())
@@ -433,8 +434,9 @@ public class R820TTunerEditor extends TunerEditor<RTL2832Tuner,R820TTunerConfigu
@Override
public void setTunerLockState(boolean locked)
{
super.setTunerLockState(locked);
mSampleRateCombo.setEnabled(!locked);
getFrequencyPanel().updateControls();
getSampleRateCombo().setEnabled(!locked);
updateSampleRateToolTip();
}
private String getTunerInfo()

View File

@@ -106,6 +106,14 @@ public class Rsp1TunerEditor extends RspTunerEditor<Rsp1TunerConfiguration>
return null;
}
@Override
public void setTunerLockState(boolean locked)
{
getFrequencyPanel().updateControls();
getSampleRateCombo().setEnabled(!locked);
updateSampleRateToolTip();
}
@Override
protected void tunerStatusUpdated()
{
@@ -124,6 +132,7 @@ public class Rsp1TunerEditor extends RspTunerEditor<Rsp1TunerConfiguration>
getSampleRateCombo().setEnabled(hasTuner() && !getTuner().getTunerController().isLockedSampleRate());
getSampleRateCombo().setSelectedItem(hasTuner() ? getTunerController().getControlRsp().getSampleRateEnumeration() : null);
updateSampleRateToolTip();
getAgcModeCombo().setEnabled(hasTuner());
if(hasTuner())
@@ -187,4 +196,23 @@ public class Rsp1TunerEditor extends RspTunerEditor<Rsp1TunerConfiguration>
return mSampleRateCombo;
}
/**
* Updates the sample rate tooltip according to the tuner controller's lock state.
*/
private void updateSampleRateToolTip()
{
if(hasTuner() && getTuner().getTunerController().isLockedSampleRate())
{
getSampleRateCombo().setToolTipText("Sample Rate is locked. Disable decoding channels to unlock.");
}
else if(hasTuner())
{
getSampleRateCombo().setToolTipText("Select a sample rate for the tuner");
}
else
{
getSampleRateCombo().setToolTipText("No tuner available");
}
}
}

View File

@@ -117,6 +117,14 @@ public class Rsp1aTunerEditor extends RspTunerEditor<Rsp1aTunerConfiguration>
return null;
}
@Override
public void setTunerLockState(boolean locked)
{
getFrequencyPanel().updateControls();
getSampleRateCombo().setEnabled(!locked);
updateSampleRateToolTip();
}
@Override
protected void tunerStatusUpdated()
{
@@ -135,6 +143,7 @@ public class Rsp1aTunerEditor extends RspTunerEditor<Rsp1aTunerConfiguration>
getSampleRateCombo().setEnabled(hasTuner() && !getTuner().getTunerController().isLockedSampleRate());
getSampleRateCombo().setSelectedItem(hasTuner() ? getTunerController().getControlRsp().getSampleRateEnumeration() : null);
updateSampleRateToolTip();
getAgcModeCombo().setEnabled(hasTuner());
if(hasTuner())
@@ -315,4 +324,24 @@ public class Rsp1aTunerEditor extends RspTunerEditor<Rsp1aTunerConfiguration>
return mRfNotchCheckBox;
}
/**
* Updates the sample rate tooltip according to the tuner controller's lock state.
*/
private void updateSampleRateToolTip()
{
if(hasTuner() && getTuner().getTunerController().isLockedSampleRate())
{
getSampleRateCombo().setToolTipText("Sample Rate is locked. Disable decoding channels to unlock.");
}
else if(hasTuner())
{
getSampleRateCombo().setToolTipText("Select a sample rate for the tuner");
}
else
{
getSampleRateCombo().setToolTipText("No tuner available");
}
}
}

View File

@@ -121,6 +121,14 @@ public class Rsp2TunerEditor extends RspTunerEditor<Rsp2TunerConfiguration>
return null;
}
@Override
public void setTunerLockState(boolean locked)
{
getFrequencyPanel().updateControls();
getSampleRateCombo().setEnabled(!locked);
updateSampleRateToolTip();
}
@Override
protected void tunerStatusUpdated()
{
@@ -139,6 +147,7 @@ public class Rsp2TunerEditor extends RspTunerEditor<Rsp2TunerConfiguration>
getSampleRateCombo().setEnabled(hasTuner() && !getTuner().getTunerController().isLockedSampleRate());
getSampleRateCombo().setSelectedItem(hasTuner() ? getTunerController().getControlRsp().getSampleRateEnumeration() : null);
updateSampleRateToolTip();
getAgcModeCombo().setEnabled(hasTuner());
if(hasTuner())
@@ -360,4 +369,23 @@ public class Rsp2TunerEditor extends RspTunerEditor<Rsp2TunerConfiguration>
return mAntennaSelectionCombo;
}
/**
* Updates the sample rate tooltip according to the tuner controller's lock state.
*/
private void updateSampleRateToolTip()
{
if(hasTuner() && getTuner().getTunerController().isLockedSampleRate())
{
getSampleRateCombo().setToolTipText("Sample Rate is locked. Disable decoding channels to unlock.");
}
else if(hasTuner())
{
getSampleRateCombo().setToolTipText("Select a sample rate for the tuner");
}
else
{
getSampleRateCombo().setToolTipText("No tuner available");
}
}
}

View File

@@ -132,6 +132,14 @@ public class RspDuoTuner1Editor extends RspTunerEditor<RspDuoTuner1Configuration
return null;
}
@Override
public void setTunerLockState(boolean locked)
{
getFrequencyPanel().updateControls();
getSampleRateCombo().setEnabled(!locked);
updateSampleRateToolTip();
}
@Override
protected void tunerStatusUpdated()
{
@@ -146,6 +154,8 @@ public class RspDuoTuner1Editor extends RspTunerEditor<RspDuoTuner1Configuration
}
getTunerStatusLabel().setText(status);
getButtonPanel().updateControls();
mLog.info("Update tuner status - has tuner: " + hasTuner() + " is locked:" + getTuner().getTunerController().isLockedSampleRate());
getFrequencyPanel().updateControls();
clearSampleRates();
@@ -155,6 +165,7 @@ public class RspDuoTuner1Editor extends RspTunerEditor<RspDuoTuner1Configuration
}
getSampleRateCombo().setEnabled(hasTuner() && !getTuner().getTunerController().isLockedSampleRate());
getSampleRateCombo().setSelectedItem(hasTuner() ? getTunerController().getControlRsp().getSampleRateEnumeration() : null);
updateSampleRateToolTip();
getAgcModeCombo().setEnabled(hasTuner());
if(hasTuner())
@@ -455,4 +466,23 @@ public class RspDuoTuner1Editor extends RspTunerEditor<RspDuoTuner1Configuration
return mTunerPreferencesButton;
}
/**
* Updates the sample rate tooltip according to the tuner controller's lock state.
*/
private void updateSampleRateToolTip()
{
if(hasTuner() && getTuner().getTunerController().isLockedSampleRate())
{
getSampleRateCombo().setToolTipText("Sample Rate is locked. Disable decoding channels to unlock.");
}
else if(hasTuner())
{
getSampleRateCombo().setToolTipText("Select a sample rate for the tuner");
}
else
{
getSampleRateCombo().setToolTipText("No tuner available");
}
}
}

View File

@@ -141,6 +141,14 @@ public class RspDuoTuner2Editor extends RspTunerEditor<RspDuoTuner2Configuration
return getDiscoveredRspTuner().getDeviceInfo().getDeviceSelectionMode().isSlaveMode();
}
@Override
public void setTunerLockState(boolean locked)
{
getFrequencyPanel().updateControls();
getSampleRateCombo().setEnabled(!locked);
updateSampleRateToolTip();
}
@Override
protected void tunerStatusUpdated()
{
@@ -172,6 +180,7 @@ public class RspDuoTuner2Editor extends RspTunerEditor<RspDuoTuner2Configuration
}
getSampleRateCombo().setEnabled(hasTuner() && !isSlaveMode() && !getTuner().getTunerController().isLockedSampleRate());
getSampleRateCombo().setSelectedItem(hasTuner() ? getTunerController().getControlRsp().getSampleRateEnumeration() : null);
updateSampleRateToolTip();
getAgcModeCombo().setEnabled(hasTuner());
if(hasTuner())
@@ -437,4 +446,23 @@ public class RspDuoTuner2Editor extends RspTunerEditor<RspDuoTuner2Configuration
return mTunerPreferencesButton;
}
/**
* Updates the sample rate tooltip according to the tuner controller's lock state.
*/
private void updateSampleRateToolTip()
{
if(hasTuner() && getTuner().getTunerController().isLockedSampleRate())
{
getSampleRateCombo().setToolTipText("Sample Rate is locked. Disable decoding channels to unlock.");
}
else if(hasTuner())
{
getSampleRateCombo().setToolTipText("Select a sample rate for the tuner");
}
else
{
getSampleRateCombo().setToolTipText("No tuner available");
}
}
}

View File

@@ -130,6 +130,14 @@ public class RspDxTunerEditor extends RspTunerEditor<RspDxTunerConfiguration>
return null;
}
@Override
public void setTunerLockState(boolean locked)
{
getFrequencyPanel().updateControls();
getSampleRateCombo().setEnabled(!locked);
updateSampleRateToolTip();
}
@Override
protected void tunerStatusUpdated()
{
@@ -148,6 +156,7 @@ public class RspDxTunerEditor extends RspTunerEditor<RspDxTunerConfiguration>
getSampleRateCombo().setEnabled(hasTuner() && !getTuner().getTunerController().isLockedSampleRate());
getSampleRateCombo().setSelectedItem(hasTuner() ? getTunerController().getControlRsp().getSampleRateEnumeration() : null);
updateSampleRateToolTip();
getAgcModeCombo().setEnabled(hasTuner());
if(hasTuner())
@@ -438,4 +447,23 @@ public class RspDxTunerEditor extends RspTunerEditor<RspDxTunerConfiguration>
return mHdrModeBandwidthCombo;
}
/**
* Updates the sample rate tooltip according to the tuner controller's lock state.
*/
private void updateSampleRateToolTip()
{
if(hasTuner() && getTuner().getTunerController().isLockedSampleRate())
{
getSampleRateCombo().setToolTipText("Sample Rate is locked. Disable decoding channels to unlock.");
}
else if(hasTuner())
{
getSampleRateCombo().setToolTipText("Select a sample rate for the tuner");
}
else
{
getSampleRateCombo().setToolTipText("No tuner available");
}
}
}

View File

@@ -547,12 +547,11 @@ public abstract class TunerEditor<T extends Tuner,C extends TunerConfiguration>
/**
* Sets the lock state for the tuner so that the frequency and sample rate controls can be enabled/disabled.
*
* Note: implementing classes should invoke: getFrequencyPanel().updateControls() method.
*
* @param locked true if the tuner is locked.
*/
public void setTunerLockState(boolean locked)
{
getFrequencyPanel().updateControls();
}
public abstract void setTunerLockState(boolean locked);
/**
* Tuner buttons panel