mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-16 10:37:26 -05:00
Partial check-in for work on R820T tuner controller. Controller class is not yet functional or complete.
This commit is contained in:
@@ -22,17 +22,13 @@ import javax.xml.bind.annotation.XmlAttribute;
|
|||||||
import source.tuner.TunerConfiguration;
|
import source.tuner.TunerConfiguration;
|
||||||
import source.tuner.TunerType;
|
import source.tuner.TunerType;
|
||||||
import source.tuner.rtl.RTL2832TunerController.SampleRate;
|
import source.tuner.rtl.RTL2832TunerController.SampleRate;
|
||||||
import source.tuner.rtl.r820t.R820TTunerController.R820TEnhanceGain;
|
|
||||||
import source.tuner.rtl.r820t.R820TTunerController.R820TGain;
|
|
||||||
import source.tuner.rtl.r820t.R820TTunerController.R820TLNAGain;
|
|
||||||
import source.tuner.rtl.r820t.R820TTunerController.R820TMixerGain;
|
|
||||||
|
|
||||||
public class R820TTunerConfiguration extends TunerConfiguration
|
public class R820TTunerConfiguration extends TunerConfiguration
|
||||||
{
|
{
|
||||||
private R820TGain mMasterGain = R820TGain.AUTOMATIC;
|
// private R820TGain mMasterGain = R820TGain.AUTOMATIC;
|
||||||
private R820TMixerGain mMixerGain = R820TMixerGain.AUTOMATIC;
|
// private R820TMixerGain mMixerGain = R820TMixerGain.AUTOMATIC;
|
||||||
private R820TLNAGain mLNAGain = R820TLNAGain.AUTOMATIC;
|
// private R820TLNAGain mLNAGain = R820TLNAGain.AUTOMATIC;
|
||||||
private R820TEnhanceGain mEnhanceGain = R820TEnhanceGain.AUTOMATIC;
|
// private R820TEnhanceGain mEnhanceGain = R820TEnhanceGain.AUTOMATIC;
|
||||||
private double mFrequencyCorrection = -12.0d;
|
private double mFrequencyCorrection = -12.0d;
|
||||||
private SampleRate mSampleRate = SampleRate.RATE_1_200MHZ;
|
private SampleRate mSampleRate = SampleRate.RATE_1_200MHZ;
|
||||||
|
|
||||||
@@ -55,50 +51,50 @@ public class R820TTunerConfiguration extends TunerConfiguration
|
|||||||
return TunerType.ELONICS_E4000;
|
return TunerType.ELONICS_E4000;
|
||||||
}
|
}
|
||||||
|
|
||||||
@XmlAttribute( name = "master_gain" )
|
// @XmlAttribute( name = "master_gain" )
|
||||||
public R820TGain getMasterGain()
|
// public R820TGain getMasterGain()
|
||||||
{
|
// {
|
||||||
return mMasterGain;
|
// return mMasterGain;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public void setMasterGain( R820TGain gain )
|
// public void setMasterGain( R820TGain gain )
|
||||||
{
|
// {
|
||||||
mMasterGain = gain;
|
// mMasterGain = gain;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@XmlAttribute( name = "mixer_gain" )
|
// @XmlAttribute( name = "mixer_gain" )
|
||||||
public R820TMixerGain getMixerGain()
|
// public R820TMixerGain getMixerGain()
|
||||||
{
|
// {
|
||||||
return mMixerGain;
|
// return mMixerGain;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public void setMixerGain( R820TMixerGain mixerGain )
|
// public void setMixerGain( R820TMixerGain mixerGain )
|
||||||
{
|
// {
|
||||||
mMixerGain = mixerGain;
|
// mMixerGain = mixerGain;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@XmlAttribute( name = "lna_gain" )
|
// @XmlAttribute( name = "lna_gain" )
|
||||||
public R820TLNAGain getLNAGain()
|
// public R820TLNAGain getLNAGain()
|
||||||
{
|
// {
|
||||||
return mLNAGain;
|
// return mLNAGain;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public void setLNAGain( R820TLNAGain lnaGain )
|
// public void setLNAGain( R820TLNAGain lnaGain )
|
||||||
{
|
// {
|
||||||
mLNAGain = lnaGain;
|
// mLNAGain = lnaGain;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@XmlAttribute( name = "enhance_gain" )
|
// @XmlAttribute( name = "enhance_gain" )
|
||||||
public R820TEnhanceGain getEnhanceGain()
|
// public R820TEnhanceGain getEnhanceGain()
|
||||||
{
|
// {
|
||||||
return mEnhanceGain;
|
// return mEnhanceGain;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public void setEnhanceGain( R820TEnhanceGain enhanceGain )
|
// public void setEnhanceGain( R820TEnhanceGain enhanceGain )
|
||||||
{
|
// {
|
||||||
mEnhanceGain = enhanceGain;
|
// mEnhanceGain = enhanceGain;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@XmlAttribute( name = "frequency_correction" )
|
@XmlAttribute( name = "frequency_correction" )
|
||||||
public double getFrequencyCorrection()
|
public double getFrequencyCorrection()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -49,10 +49,6 @@ import source.tuner.TunerConfiguration;
|
|||||||
import source.tuner.TunerConfigurationAssignment;
|
import source.tuner.TunerConfigurationAssignment;
|
||||||
import source.tuner.TunerType;
|
import source.tuner.TunerType;
|
||||||
import source.tuner.rtl.RTL2832TunerController.SampleRate;
|
import source.tuner.rtl.RTL2832TunerController.SampleRate;
|
||||||
import source.tuner.rtl.r820t.R820TTunerController.R820TEnhanceGain;
|
|
||||||
import source.tuner.rtl.r820t.R820TTunerController.R820TGain;
|
|
||||||
import source.tuner.rtl.r820t.R820TTunerController.R820TLNAGain;
|
|
||||||
import source.tuner.rtl.r820t.R820TTunerController.R820TMixerGain;
|
|
||||||
import controller.ResourceManager;
|
import controller.ResourceManager;
|
||||||
|
|
||||||
public class R820TTunerConfigurationPanel extends JPanel
|
public class R820TTunerConfigurationPanel extends JPanel
|
||||||
@@ -69,10 +65,10 @@ public class R820TTunerConfigurationPanel extends JPanel
|
|||||||
private JTextField mName;
|
private JTextField mName;
|
||||||
|
|
||||||
private JSpinner mFrequencyCorrection;
|
private JSpinner mFrequencyCorrection;
|
||||||
private JComboBox<R820TGain> mComboMasterGain;
|
// private JComboBox<R820TGain> mComboMasterGain;
|
||||||
private JComboBox<R820TMixerGain> mComboMixerGain;
|
// private JComboBox<R820TMixerGain> mComboMixerGain;
|
||||||
private JComboBox<R820TLNAGain> mComboLNAGain;
|
// private JComboBox<R820TLNAGain> mComboLNAGain;
|
||||||
private JComboBox<R820TEnhanceGain> mComboEnhanceGain;
|
// private JComboBox<R820TEnhanceGain> mComboEnhanceGain;
|
||||||
|
|
||||||
private JComboBox<SampleRate> mComboSampleRate;
|
private JComboBox<SampleRate> mComboSampleRate;
|
||||||
|
|
||||||
@@ -126,21 +122,21 @@ public class R820TTunerConfigurationPanel extends JPanel
|
|||||||
|
|
||||||
mComboConfigurations.setSelectedItem( mSelectedConfig );
|
mComboConfigurations.setSelectedItem( mSelectedConfig );
|
||||||
|
|
||||||
mComboConfigurations.addActionListener( new ActionListener()
|
// mComboConfigurations.addActionListener( new ActionListener()
|
||||||
{
|
// {
|
||||||
@Override
|
// @Override
|
||||||
public void actionPerformed( ActionEvent e )
|
// public void actionPerformed( ActionEvent e )
|
||||||
{
|
// {
|
||||||
R820TTunerConfiguration selected =
|
// R820TTunerConfiguration selected =
|
||||||
(R820TTunerConfiguration)mComboConfigurations
|
// (R820TTunerConfiguration)mComboConfigurations
|
||||||
.getItemAt( mComboConfigurations.getSelectedIndex() );
|
// .getItemAt( mComboConfigurations.getSelectedIndex() );
|
||||||
|
//
|
||||||
if( selected != null )
|
// if( selected != null )
|
||||||
{
|
// {
|
||||||
update( selected );
|
// update( selected );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
add( mComboConfigurations, "span 2,wrap" );
|
add( mComboConfigurations, "span 2,wrap" );
|
||||||
|
|
||||||
@@ -270,301 +266,301 @@ public class R820TTunerConfigurationPanel extends JPanel
|
|||||||
gainPanel.setBorder( BorderFactory.createTitledBorder( "Gain" ) );
|
gainPanel.setBorder( BorderFactory.createTitledBorder( "Gain" ) );
|
||||||
|
|
||||||
/* Master Gain Control */
|
/* Master Gain Control */
|
||||||
mComboMasterGain = new JComboBox<R820TGain>( R820TGain.values() );
|
// mComboMasterGain = new JComboBox<R820TGain>( R820TGain.values() );
|
||||||
mComboMasterGain.setSelectedItem( mSelectedConfig.getMasterGain() );
|
// mComboMasterGain.setSelectedItem( mSelectedConfig.getMasterGain() );
|
||||||
|
//
|
||||||
mComboMasterGain.addActionListener( new ActionListener()
|
// mComboMasterGain.addActionListener( new ActionListener()
|
||||||
{
|
// {
|
||||||
@Override
|
// @Override
|
||||||
public void actionPerformed( ActionEvent arg0 )
|
// public void actionPerformed( ActionEvent arg0 )
|
||||||
{
|
// {
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
R820TGain gain = (R820TGain)mComboMasterGain.getSelectedItem();
|
// R820TGain gain = (R820TGain)mComboMasterGain.getSelectedItem();
|
||||||
|
//
|
||||||
mController.setGain( (R820TGain)mComboMasterGain.getSelectedItem(), true );
|
// mController.setGain( (R820TGain)mComboMasterGain.getSelectedItem(), true );
|
||||||
|
//
|
||||||
if( gain == R820TGain.MANUAL )
|
// if( gain == R820TGain.MANUAL )
|
||||||
{
|
// {
|
||||||
mComboMixerGain.setSelectedItem(
|
// mComboMixerGain.setSelectedItem(
|
||||||
mController.getMixerGain( true ) );
|
// mController.getMixerGain( true ) );
|
||||||
mComboMixerGain.setEnabled( true );
|
// mComboMixerGain.setEnabled( true );
|
||||||
|
//
|
||||||
mComboLNAGain.setSelectedItem(
|
// mComboLNAGain.setSelectedItem(
|
||||||
mController.getLNAGain( true ) );
|
// mController.getLNAGain( true ) );
|
||||||
mComboLNAGain.setEnabled( true );
|
// mComboLNAGain.setEnabled( true );
|
||||||
|
//
|
||||||
mComboEnhanceGain.setEnabled( true );
|
// mComboEnhanceGain.setEnabled( true );
|
||||||
mComboEnhanceGain.setSelectedItem(
|
// mComboEnhanceGain.setSelectedItem(
|
||||||
mController.getEnhanceGain( true ) );
|
// mController.getEnhanceGain( true ) );
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
mComboMixerGain.setEnabled( false );
|
// mComboMixerGain.setEnabled( false );
|
||||||
mComboMixerGain.setSelectedItem( gain.getMixerGain() );
|
// mComboMixerGain.setSelectedItem( gain.getMixerGain() );
|
||||||
|
//
|
||||||
mComboLNAGain.setEnabled( false );
|
// mComboLNAGain.setEnabled( false );
|
||||||
mComboLNAGain.setSelectedItem( gain.getLNAGain() );
|
// mComboLNAGain.setSelectedItem( gain.getLNAGain() );
|
||||||
|
//
|
||||||
mComboEnhanceGain.setEnabled( false );
|
// mComboEnhanceGain.setEnabled( false );
|
||||||
mComboEnhanceGain.setSelectedItem( gain.getEnhanceGain() );
|
// mComboEnhanceGain.setSelectedItem( gain.getEnhanceGain() );
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
mSelectedConfig.setMasterGain( gain );
|
// mSelectedConfig.setMasterGain( gain );
|
||||||
save();
|
// save();
|
||||||
}
|
// }
|
||||||
catch ( UsbException e )
|
// catch ( UsbException e )
|
||||||
{
|
// {
|
||||||
JOptionPane.showMessageDialog(
|
// JOptionPane.showMessageDialog(
|
||||||
R820TTunerConfigurationPanel.this,
|
// R820TTunerConfigurationPanel.this,
|
||||||
"E4K Tuner Controller - couldn't apply the gain "
|
// "E4K Tuner Controller - couldn't apply the gain "
|
||||||
+ "setting - " + e.getLocalizedMessage() );
|
// + "setting - " + e.getLocalizedMessage() );
|
||||||
|
//
|
||||||
Log.error( "E4K Tuner Controller - couldn't apply "
|
// Log.error( "E4K Tuner Controller - couldn't apply "
|
||||||
+ "gain setting - " + e.getLocalizedMessage() );
|
// + "gain setting - " + e.getLocalizedMessage() );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
} );
|
// } );
|
||||||
mComboMasterGain.setToolTipText( "<html>Select <b>AUTOMATIC</b> for auto "
|
// mComboMasterGain.setToolTipText( "<html>Select <b>AUTOMATIC</b> for auto "
|
||||||
+ "gain, <b>MANUAL</b> to enable<br> independent control of "
|
// + "gain, <b>MANUAL</b> to enable<br> independent control of "
|
||||||
+ "<i>Mixer</i>, <i>LNA</i> and <i>Enhance</i> gain<br>"
|
// + "<i>Mixer</i>, <i>LNA</i> and <i>Enhance</i> gain<br>"
|
||||||
+ "settings, or one of the individual gain settings for<br>"
|
// + "settings, or one of the individual gain settings for<br>"
|
||||||
+ "semi-manual gain control</html>" );
|
// + "semi-manual gain control</html>" );
|
||||||
gainPanel.add( mComboMasterGain );
|
// gainPanel.add( mComboMasterGain );
|
||||||
gainPanel.add( new JLabel( "Master" ), "wrap" );
|
// gainPanel.add( new JLabel( "Master" ), "wrap" );
|
||||||
|
//
|
||||||
/* Mixer Gain Control */
|
// /* Mixer Gain Control */
|
||||||
mComboMixerGain = new JComboBox<R820TMixerGain>( R820TMixerGain.values() );
|
// mComboMixerGain = new JComboBox<R820TMixerGain>( R820TMixerGain.values() );
|
||||||
mComboMixerGain.setSelectedItem( mSelectedConfig.getMixerGain() );
|
// mComboMixerGain.setSelectedItem( mSelectedConfig.getMixerGain() );
|
||||||
mComboMixerGain.addActionListener( new ActionListener()
|
// mComboMixerGain.addActionListener( new ActionListener()
|
||||||
{
|
// {
|
||||||
@Override
|
// @Override
|
||||||
public void actionPerformed( ActionEvent arg0 )
|
// public void actionPerformed( ActionEvent arg0 )
|
||||||
{
|
// {
|
||||||
EventQueue.invokeLater( new Runnable()
|
// EventQueue.invokeLater( new Runnable()
|
||||||
{
|
// {
|
||||||
@Override
|
// @Override
|
||||||
public void run()
|
// public void run()
|
||||||
{
|
// {
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
R820TMixerGain mixerGain =
|
// R820TMixerGain mixerGain =
|
||||||
(R820TMixerGain)mComboMixerGain.getSelectedItem();
|
// (R820TMixerGain)mComboMixerGain.getSelectedItem();
|
||||||
|
//
|
||||||
if( mComboMixerGain.isEnabled() )
|
// if( mComboMixerGain.isEnabled() )
|
||||||
{
|
// {
|
||||||
mController.setMixerGain( mixerGain, true );
|
// mController.setMixerGain( mixerGain, true );
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
mSelectedConfig.setMixerGain( mixerGain );
|
// mSelectedConfig.setMixerGain( mixerGain );
|
||||||
save();
|
// save();
|
||||||
}
|
// }
|
||||||
catch ( UsbException e )
|
// catch ( UsbException e )
|
||||||
{
|
// {
|
||||||
JOptionPane.showMessageDialog(
|
// JOptionPane.showMessageDialog(
|
||||||
R820TTunerConfigurationPanel.this,
|
// R820TTunerConfigurationPanel.this,
|
||||||
"E4K Tuner Controller - couldn't apply the mixer "
|
// "E4K Tuner Controller - couldn't apply the mixer "
|
||||||
+ "gain setting - " + e.getLocalizedMessage() );
|
// + "gain setting - " + e.getLocalizedMessage() );
|
||||||
|
//
|
||||||
Log.error( "E4K Tuner Controller - couldn't apply mixer "
|
// Log.error( "E4K Tuner Controller - couldn't apply mixer "
|
||||||
+ "gain setting - " + e.getLocalizedMessage() );
|
// + "gain setting - " + e.getLocalizedMessage() );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
} );
|
// } );
|
||||||
}
|
// }
|
||||||
} );
|
// } );
|
||||||
mComboMixerGain.setToolTipText( "<html>Mixer Gain. Set master gain "
|
// mComboMixerGain.setToolTipText( "<html>Mixer Gain. Set master gain "
|
||||||
+ "to <b>MASTER</b> to enable adjustment</html>" );
|
// + "to <b>MASTER</b> to enable adjustment</html>" );
|
||||||
mComboMixerGain.setEnabled( false );
|
// mComboMixerGain.setEnabled( false );
|
||||||
gainPanel.add( mComboMixerGain );
|
// gainPanel.add( mComboMixerGain );
|
||||||
gainPanel.add( new JLabel( "Mixer" ), "wrap" );
|
// gainPanel.add( new JLabel( "Mixer" ), "wrap" );
|
||||||
|
//
|
||||||
/* LNA Gain Control */
|
// /* LNA Gain Control */
|
||||||
mComboLNAGain = new JComboBox<R820TLNAGain>( R820TLNAGain.values() );
|
// mComboLNAGain = new JComboBox<R820TLNAGain>( R820TLNAGain.values() );
|
||||||
mComboLNAGain.setSelectedItem( mSelectedConfig.getLNAGain() );
|
// mComboLNAGain.setSelectedItem( mSelectedConfig.getLNAGain() );
|
||||||
mComboLNAGain.addActionListener( new ActionListener()
|
// mComboLNAGain.addActionListener( new ActionListener()
|
||||||
{
|
// {
|
||||||
@Override
|
// @Override
|
||||||
public void actionPerformed( ActionEvent arg0 )
|
// public void actionPerformed( ActionEvent arg0 )
|
||||||
{
|
// {
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
R820TLNAGain lnaGain = (R820TLNAGain)mComboLNAGain.getSelectedItem();
|
// R820TLNAGain lnaGain = (R820TLNAGain)mComboLNAGain.getSelectedItem();
|
||||||
|
//
|
||||||
if( mComboLNAGain.isEnabled() )
|
// if( mComboLNAGain.isEnabled() )
|
||||||
{
|
// {
|
||||||
mController.setLNAGain( lnaGain, true );
|
// mController.setLNAGain( lnaGain, true );
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
mSelectedConfig.setLNAGain( lnaGain );
|
// mSelectedConfig.setLNAGain( lnaGain );
|
||||||
save();
|
// save();
|
||||||
}
|
// }
|
||||||
catch ( UsbException e )
|
// catch ( UsbException e )
|
||||||
{
|
// {
|
||||||
JOptionPane.showMessageDialog(
|
// JOptionPane.showMessageDialog(
|
||||||
R820TTunerConfigurationPanel.this,
|
// R820TTunerConfigurationPanel.this,
|
||||||
"E4K Tuner Controller - couldn't apply the LNA "
|
// "E4K Tuner Controller - couldn't apply the LNA "
|
||||||
+ "gain setting - " + e.getLocalizedMessage() );
|
// + "gain setting - " + e.getLocalizedMessage() );
|
||||||
|
//
|
||||||
Log.error( "E4K Tuner Controller - couldn't apply LNA "
|
// Log.error( "E4K Tuner Controller - couldn't apply LNA "
|
||||||
+ "gain setting - " + e.getLocalizedMessage() );
|
// + "gain setting - " + e.getLocalizedMessage() );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
} );
|
// } );
|
||||||
mComboLNAGain.setToolTipText( "<html>LNA Gain. Set master gain "
|
// mComboLNAGain.setToolTipText( "<html>LNA Gain. Set master gain "
|
||||||
+ "to <b>MANUAL</b> to enable adjustment</html>" );
|
// + "to <b>MANUAL</b> to enable adjustment</html>" );
|
||||||
mComboLNAGain.setEnabled( false );
|
// mComboLNAGain.setEnabled( false );
|
||||||
gainPanel.add( mComboLNAGain );
|
// gainPanel.add( mComboLNAGain );
|
||||||
gainPanel.add( new JLabel( "LNA" ), "wrap" );
|
// gainPanel.add( new JLabel( "LNA" ), "wrap" );
|
||||||
|
//
|
||||||
/* Enhance Gain Control */
|
// /* Enhance Gain Control */
|
||||||
mComboEnhanceGain = new JComboBox<R820TEnhanceGain>( R820TEnhanceGain.values() );
|
// mComboEnhanceGain = new JComboBox<R820TEnhanceGain>( R820TEnhanceGain.values() );
|
||||||
mComboEnhanceGain.setSelectedItem( mSelectedConfig.getEnhanceGain() );
|
// mComboEnhanceGain.setSelectedItem( mSelectedConfig.getEnhanceGain() );
|
||||||
mComboEnhanceGain.addActionListener( new ActionListener()
|
// mComboEnhanceGain.addActionListener( new ActionListener()
|
||||||
{
|
// {
|
||||||
@Override
|
// @Override
|
||||||
public void actionPerformed( ActionEvent arg0 )
|
// public void actionPerformed( ActionEvent arg0 )
|
||||||
{
|
// {
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
R820TEnhanceGain enhanceGain =
|
// R820TEnhanceGain enhanceGain =
|
||||||
(R820TEnhanceGain)mComboEnhanceGain.getSelectedItem();
|
// (R820TEnhanceGain)mComboEnhanceGain.getSelectedItem();
|
||||||
|
//
|
||||||
if( mComboEnhanceGain.isEnabled() )
|
// if( mComboEnhanceGain.isEnabled() )
|
||||||
{
|
// {
|
||||||
mController.setEnhanceGain( enhanceGain, true );
|
// mController.setEnhanceGain( enhanceGain, true );
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
mSelectedConfig.setEnhanceGain( enhanceGain );
|
// mSelectedConfig.setEnhanceGain( enhanceGain );
|
||||||
save();
|
// save();
|
||||||
}
|
// }
|
||||||
catch ( UsbException e )
|
// catch ( UsbException e )
|
||||||
{
|
// {
|
||||||
JOptionPane.showMessageDialog(
|
// JOptionPane.showMessageDialog(
|
||||||
R820TTunerConfigurationPanel.this,
|
// R820TTunerConfigurationPanel.this,
|
||||||
"E4K Tuner Controller - couldn't apply the enhance "
|
// "E4K Tuner Controller - couldn't apply the enhance "
|
||||||
+ "gain setting - " + e.getLocalizedMessage() );
|
// + "gain setting - " + e.getLocalizedMessage() );
|
||||||
|
//
|
||||||
Log.error( "E4K Tuner Controller - couldn't apply enhance "
|
// Log.error( "E4K Tuner Controller - couldn't apply enhance "
|
||||||
+ "gain setting - " + e.getLocalizedMessage() );
|
// + "gain setting - " + e.getLocalizedMessage() );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
} );
|
// } );
|
||||||
mComboEnhanceGain.setToolTipText( "<html>Enhance Gain. Set master gain "
|
// mComboEnhanceGain.setToolTipText( "<html>Enhance Gain. Set master gain "
|
||||||
+ "to <b>MANUAL</b> to enable adjustment</html>" );
|
// + "to <b>MANUAL</b> to enable adjustment</html>" );
|
||||||
mComboEnhanceGain.setEnabled( false );
|
// mComboEnhanceGain.setEnabled( false );
|
||||||
gainPanel.add( mComboEnhanceGain );
|
// gainPanel.add( mComboEnhanceGain );
|
||||||
gainPanel.add( new JLabel( "Enhance" ), "wrap" );
|
// gainPanel.add( new JLabel( "Enhance" ), "wrap" );
|
||||||
|
//
|
||||||
add( gainPanel, "span" );
|
// add( gainPanel, "span" );
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* Create a new configuration
|
// * Create a new configuration
|
||||||
*/
|
// */
|
||||||
mNewConfiguration = new JButton( "New" );
|
// mNewConfiguration = new JButton( "New" );
|
||||||
|
//
|
||||||
mNewConfiguration.addActionListener( new ActionListener()
|
// mNewConfiguration.addActionListener( new ActionListener()
|
||||||
{
|
// {
|
||||||
@Override
|
// @Override
|
||||||
public void actionPerformed( ActionEvent e )
|
// public void actionPerformed( ActionEvent e )
|
||||||
{
|
// {
|
||||||
TunerConfiguration config =
|
// TunerConfiguration config =
|
||||||
mResourceManager.getSettingsManager()
|
// mResourceManager.getSettingsManager()
|
||||||
.addNewTunerConfiguration(
|
// .addNewTunerConfiguration(
|
||||||
TunerType.ELONICS_E4000,
|
// TunerType.ELONICS_E4000,
|
||||||
"New Configuration" );
|
// "New Configuration" );
|
||||||
|
//
|
||||||
mComboConfigurations.setModel( getModel() );
|
// mComboConfigurations.setModel( getModel() );
|
||||||
|
//
|
||||||
mComboConfigurations.setSelectedItem( config );
|
// mComboConfigurations.setSelectedItem( config );
|
||||||
|
//
|
||||||
repaint();
|
// repaint();
|
||||||
}
|
// }
|
||||||
} );
|
// } );
|
||||||
|
//
|
||||||
add( mNewConfiguration );
|
// add( mNewConfiguration );
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* Delete the currently selected configuration
|
// * Delete the currently selected configuration
|
||||||
*/
|
// */
|
||||||
mDeleteConfiguration = new JButton( "Delete" );
|
// mDeleteConfiguration = new JButton( "Delete" );
|
||||||
|
//
|
||||||
mDeleteConfiguration.addActionListener( new ActionListener()
|
// mDeleteConfiguration.addActionListener( new ActionListener()
|
||||||
{
|
// {
|
||||||
@Override
|
// @Override
|
||||||
public void actionPerformed( ActionEvent e )
|
// public void actionPerformed( ActionEvent e )
|
||||||
{
|
// {
|
||||||
R820TTunerConfiguration selected =
|
// R820TTunerConfiguration selected =
|
||||||
(R820TTunerConfiguration)mComboConfigurations
|
// (R820TTunerConfiguration)mComboConfigurations
|
||||||
.getItemAt( mComboConfigurations.getSelectedIndex() );
|
// .getItemAt( mComboConfigurations.getSelectedIndex() );
|
||||||
|
//
|
||||||
if( selected != null )
|
// if( selected != null )
|
||||||
{
|
// {
|
||||||
int n = JOptionPane.showConfirmDialog(
|
// int n = JOptionPane.showConfirmDialog(
|
||||||
R820TTunerConfigurationPanel.this,
|
// R820TTunerConfigurationPanel.this,
|
||||||
"Are you sure you want to delete '"
|
// "Are you sure you want to delete '"
|
||||||
+ selected.getName() + "'?",
|
// + selected.getName() + "'?",
|
||||||
"Are you sure?",
|
// "Are you sure?",
|
||||||
JOptionPane.YES_NO_OPTION );
|
// JOptionPane.YES_NO_OPTION );
|
||||||
|
//
|
||||||
if( n == JOptionPane.YES_OPTION )
|
// if( n == JOptionPane.YES_OPTION )
|
||||||
{
|
// {
|
||||||
mResourceManager.getSettingsManager()
|
// mResourceManager.getSettingsManager()
|
||||||
.deleteTunerConfiguration( selected );
|
// .deleteTunerConfiguration( selected );
|
||||||
|
//
|
||||||
mComboConfigurations.setModel( getModel() );
|
// mComboConfigurations.setModel( getModel() );
|
||||||
|
//
|
||||||
mComboConfigurations.setSelectedIndex( 0 );
|
// mComboConfigurations.setSelectedIndex( 0 );
|
||||||
|
//
|
||||||
repaint();
|
// repaint();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
} );
|
// } );
|
||||||
|
//
|
||||||
add( mDeleteConfiguration, "wrap" );
|
// add( mDeleteConfiguration, "wrap" );
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* Updates gui controls with the values from the tuner configuration
|
// * Updates gui controls with the values from the tuner configuration
|
||||||
* @param config - tuner configuration
|
// * @param config - tuner configuration
|
||||||
*/
|
// */
|
||||||
private void update( R820TTunerConfiguration config )
|
// private void update( R820TTunerConfiguration config )
|
||||||
{
|
// {
|
||||||
mSelectedConfig = config;
|
// mSelectedConfig = config;
|
||||||
|
//
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
mController.apply( config );
|
// mController.apply( config );
|
||||||
|
//
|
||||||
mName.setText( config.getName() );
|
// mName.setText( config.getName() );
|
||||||
mFrequencyCorrection.setValue( config.getFrequencyCorrection() );
|
// mFrequencyCorrection.setValue( config.getFrequencyCorrection() );
|
||||||
|
//
|
||||||
mComboMixerGain.setSelectedItem( mSelectedConfig.getMixerGain() );
|
// mComboMixerGain.setSelectedItem( mSelectedConfig.getMixerGain() );
|
||||||
mComboLNAGain.setSelectedItem( mSelectedConfig.getLNAGain() );
|
// mComboLNAGain.setSelectedItem( mSelectedConfig.getLNAGain() );
|
||||||
mComboEnhanceGain.setSelectedItem( mSelectedConfig.getEnhanceGain() );
|
// mComboEnhanceGain.setSelectedItem( mSelectedConfig.getEnhanceGain() );
|
||||||
|
//
|
||||||
/* Apply master gain last so that the Mixer, LNA, and Enhance gain
|
// /* Apply master gain last so that the Mixer, LNA, and Enhance gain
|
||||||
* settings are updated with the master setting where necessary */
|
// * settings are updated with the master setting where necessary */
|
||||||
mComboMasterGain.setSelectedItem( mSelectedConfig.getMasterGain() );
|
// mComboMasterGain.setSelectedItem( mSelectedConfig.getMasterGain() );
|
||||||
|
//
|
||||||
mComboSampleRate.setSelectedItem( mSelectedConfig.getSampleRate() );
|
// mComboSampleRate.setSelectedItem( mSelectedConfig.getSampleRate() );
|
||||||
|
//
|
||||||
mResourceManager.getSettingsManager().setSelectedTunerConfiguration(
|
// mResourceManager.getSettingsManager().setSelectedTunerConfiguration(
|
||||||
TunerType.ELONICS_E4000, mController.getUniqueID(), config );
|
// TunerType.ELONICS_E4000, mController.getUniqueID(), config );
|
||||||
}
|
// }
|
||||||
catch ( SourceException e1 )
|
// catch ( SourceException e1 )
|
||||||
{
|
// {
|
||||||
JOptionPane.showMessageDialog(
|
// JOptionPane.showMessageDialog(
|
||||||
R820TTunerConfigurationPanel.this,
|
// R820TTunerConfigurationPanel.this,
|
||||||
"E4K Tuner Controller - couldn't "
|
// "E4K Tuner Controller - couldn't "
|
||||||
+ "apply the tuner configuration settings - " +
|
// + "apply the tuner configuration settings - " +
|
||||||
e1.getLocalizedMessage() );
|
// e1.getLocalizedMessage() );
|
||||||
|
//
|
||||||
Log.error( "E4K Tuner Controller - couldn't apply "
|
// Log.error( "E4K Tuner Controller - couldn't apply "
|
||||||
+ "config [" + config.getName() + "] - " +
|
// + "config [" + config.getName() + "] - " +
|
||||||
e1.getLocalizedMessage() );
|
// e1.getLocalizedMessage() );
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user