Closes #71 - frequency controller throws exception when exceeding min/max tuning limits of a tuner.

Updated code to show dialog to user whenever the tuning limit has been exceeded.  Added new InvalidFrequencyException that includes the requested invalid frequency and the valid frequency limit that was exceeded
This commit is contained in:
Denny
2016-06-04 08:21:28 -04:00
parent bf5ded53e2
commit 078a6fddce
14 changed files with 516 additions and 391 deletions

View File

@@ -405,7 +405,7 @@ public class AirspyTunerController extends TunerController
* Sets the sample rate to the rate specified by the index value in the
* available sample rates map
*
* @param index to a sample rate in the available samples rates map.
* @param rate to a sample rate in the available samples rates map.
*
* @throws IllegalArgumentException if index is not a valid rate index
* @throws LibUsbException if there was a read error or if this operation
@@ -414,7 +414,7 @@ public class AirspyTunerController extends TunerController
* @throws UsbException if there was a USB error
*/
public void setSampleRate( AirspySampleRate rate ) throws
LibUsbException, UsbException
LibUsbException, UsbException, SourceException
{
if( rate.getRate() != mSampleRate )
{

View File

@@ -167,7 +167,7 @@ public class AirspyTunerEditor extends TunerConfigurationEditor
mController.setSampleRate( rate );
save();
}
catch ( LibUsbException | UsbException e1 )
catch ( LibUsbException | UsbException | SourceException e1 )
{
JOptionPane.showMessageDialog( AirspyTunerEditor.this,
"Couldn't set sample rate to " + rate.getLabel() );