mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
Converted frequency to long primitive type (from integer) in anticipation of HackRF support which requires frequencies greater than 2.147 GHz, which is the max hertz value that can be represented by an integer primitive.
This commit is contained in:
@@ -20,10 +20,10 @@ package source.tuner;
|
||||
public class TunerChannel implements Comparable<TunerChannel>
|
||||
{
|
||||
private Type mType;
|
||||
private int mFrequency;
|
||||
private long mFrequency;
|
||||
private int mBandwidth;
|
||||
|
||||
public TunerChannel( Type type, int frequency, int bandwidth )
|
||||
public TunerChannel( Type type, long frequency, int bandwidth )
|
||||
{
|
||||
mType = type;
|
||||
mFrequency = frequency;
|
||||
@@ -40,12 +40,12 @@ public class TunerChannel implements Comparable<TunerChannel>
|
||||
mType = type;
|
||||
}
|
||||
|
||||
public int getFrequency()
|
||||
public long getFrequency()
|
||||
{
|
||||
return mFrequency;
|
||||
}
|
||||
|
||||
public void setFrequency( int frequency )
|
||||
public void setFrequency( long frequency )
|
||||
{
|
||||
mFrequency = frequency;
|
||||
}
|
||||
@@ -60,12 +60,12 @@ public class TunerChannel implements Comparable<TunerChannel>
|
||||
mBandwidth = bandwidth;
|
||||
}
|
||||
|
||||
public int getMinFrequency()
|
||||
public long getMinFrequency()
|
||||
{
|
||||
return mFrequency - ( mBandwidth / 2 );
|
||||
}
|
||||
|
||||
public int getMaxFrequency()
|
||||
public long getMaxFrequency()
|
||||
{
|
||||
return mFrequency + ( mBandwidth / 2 );
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public class TunerChannel implements Comparable<TunerChannel>
|
||||
* Indicates if any part of this tuner channel is contained within the
|
||||
* minimum and maximum frequency values.
|
||||
*/
|
||||
public boolean isWithin( int minimum, int maximum )
|
||||
public boolean isWithin( long minimum, long maximum )
|
||||
{
|
||||
return ( ( minimum <= getMinFrequency() && getMinFrequency() <= maximum ) ||
|
||||
( minimum <= getMaxFrequency() && getMaxFrequency() <= maximum ) );
|
||||
|
||||
Reference in New Issue
Block a user