public class TLcdRadar extends Object implements ILcdOriented, ILcdDataObject, ILcdBounded
The radar antenna is usually represented in the center of the display. Concentric circles represent the distance from the center and the height above ground. As the radar antenna rotates, a radial trace on the radar sweeps in unison around the center point.
The distance out from the center of the radar position indicates range, and the angle around the center is the azimuth to the target.
While it is rotating 360 degrees around the radar site at a fixed elevation angle, the radar antenna sends pulses. For the next rotation, it can change angle or proceed at the same angle according to requirements. The return echoes from the targets are received by the antenna and processed as radar sweeps.
TLcdRadar
can be used to display radar sweeps. You specify the radar position by setting the appropriate reference
on the containing model. The ILcdOriented
interface is implemented to get the azimuth of the most recently received radar sweep.
This code snippet demonstrates how to create a model reference for the radar position:
double radarRotation = Math.toRadians(0); //determines the up-direction of the radar TLcdLonLatPoint radarPosition = new TLcdLonLatPoint(4, 50); ILcdModelReference modelReference = new TLcdGridReference( new TLcdGeodeticDatum(), new TLcdAzimuthalEquidistant(radarPosition.getX(), radarPosition.getY()), 0, 0, 1.0, //scale 1.0, //unit radarRotation );While using
TLcdRadar
, keep in mind that:
addRadarSweep
calls are made with the same start and end azimuth, but with a different start range. In that case, the cell lengths in both calls must be equal or an integer multiple of each other.Constructor and Description |
---|
TLcdRadar(TLcdDataType aDataType)
Create a new instance of
TLcdRadar with the specified data type. |
Modifier and Type | Method and Description |
---|---|
void |
addRadarSweep(long aTimeStamp,
double aStartAzimuth,
double aEndAzimuth,
int aStartCell,
double aCellLength,
int aBitResolution,
int[] aCellAmplitudes,
int aCellCount)
Add a radar record provided by the sweep.
|
Object |
clone() |
ILcdBounds |
getBounds()
Returns the
ILcdBounds by which the geometry of this ILcdBounded object
is bounded. |
TLcdDataType |
getDataType()
Returns the type of this data object.
|
double |
getOrientation()
Returns the orientation of this object in degrees.
|
Object |
getValue(String aPropertyName)
Convenience method that returns the value of the property with the given name.
|
Object |
getValue(TLcdDataProperty aProperty)
Returns the value of the given property.
|
boolean |
hasValue(String aPropertyName)
Indicates whether this data object has a value for the given property.
|
boolean |
hasValue(TLcdDataProperty aProperty)
Indicates whether this data object has a value for the given property.
|
void |
setValue(String aPropertyName,
Object aValue)
Convenience method that sets the value of the property with the given name.
|
void |
setValue(TLcdDataProperty aProperty,
Object aValue)
Sets the value of the given property for this data object.
|
public TLcdRadar(TLcdDataType aDataType)
TLcdRadar
with the specified data type. The given TLcdDataType
must be
TLcdRadarVideoDataTypes.RADAR_VIDEO_DATA_TYPE
, or a sub-type thereof. That TLcdDataType
has the
RadarRange
property. The value for RadarRange
is determined by the data that is given to
addRadarSweep(long, double, double, int, double, int, int[], int)
aDataType
- the data type for radar.public ILcdBounds getBounds()
ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.
If the geometry does not allow retrieving valid bounds (for example a polyline with 0 points)
the return value is unspecified.
It is highly recommended to return an undefined
bounds.
You can create undefined bounds using the default constructors
of TLcdLonLatBounds
or TLcdXYBounds
.
getBounds
in interface ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.public void addRadarSweep(long aTimeStamp, double aStartAzimuth, double aEndAzimuth, int aStartCell, double aCellLength, int aBitResolution, int[] aCellAmplitudes, int aCellCount)
TLcdRadar
documentation for limitations.
You must call this method within a write lock, using TLcdLockUtil.writeLock(model)
and event mode ILcdModel.FIRE_LATER
.
aTimeStamp
- The timestamp of the sweep in milliseconds since the epoch.aStartAzimuth
- The azimuth at which the sweep starts in degrees clock-wise from the up-direction.aEndAzimuth
- The azimuth at which the sweep ends in degrees clock-wise from the up-direction.aStartCell
- The offset in number of cells at which the given sweep starts. You need this when the data
of a single sweep line is split over multiple messages, for instance.aCellLength
- The radial size of the radar cells, in meters.aBitResolution
- The bit resolution used for the coding of the video data. Expressed in the number of bits
that can be used for the amplitudes of the cells. The maximum value is 32.aCellAmplitudes
- The amplitudes of the cells. Each element in the array represents a single cell in the sweep
line. The values are all treated as unsigned integers. See Integer.toUnsignedLong(int)
.
This TLcdRadar
makes a copy of the given data. This means that you can reuse the
integer array for radar video messages you receive afterwards.aCellCount
- The valid cell count. This is the number of cells in the given amplitudes array.TLcdRadar
public double getOrientation()
ILcdOriented
If there is no rotation known for this object, return Double.NaN
.
getOrientation
in interface ILcdOriented
NaN
if undefined.public TLcdDataType getDataType()
null
.getDataType
in interface ILcdDataObject
public Object getValue(TLcdDataProperty aProperty)
Returns the value of the given property.
If the property is a collection, the returned value will never be null. If the property has not been set, an empty collection of the appropriate type will be returned (Set, List or Map).
The property must not be null, and must be declared in the data object's type
or in one of its super types.
Otherwise an IllegalArgumentException
is thrown.
getValue
in interface ILcdDataObject
aProperty
- the property for which the value is to be returnedpublic Object getValue(String aPropertyName)
Convenience method that returns the value of the property with the given name.
If more than one property exists with the given name, the most specific property should be used (this is the property defined by the most specialized type in this object's data type hierarchy). SeeILcdDataObject.getValue(TLcdDataProperty)
for more information.getValue
in interface ILcdDataObject
aPropertyName
- the name of the property of which the value is to be returnedTLcdDataType.getProperty(String)
public void setValue(TLcdDataProperty aProperty, Object aValue)
Sets the value of the given property for this data object. The implementation is allowed to throw an exception if the given value can't be set.
The given property must be declared in thedata object's type
or in one of its super types. In
other words, getDataType().getProperties().contains( aProperty ) should always be true.
Otherwise, the implementation should throw an IllegalArgumentException
.setValue
in interface ILcdDataObject
aProperty
- the property for which the value is to be setaValue
- the value to setTLcdDataType.getProperty(String)
public void setValue(String aPropertyName, Object aValue)
Convenience method that sets the value of the property with the given name.
If more than one property exists with the given name, the most specific property should be used (this is the property defined by the most specialized type in this object's data type hierarchy). SeeILcdDataObject.setValue(TLcdDataProperty, Object)
for more information.setValue
in interface ILcdDataObject
aPropertyName
- the name of the property of which the value is to be setaValue
- the value to setpublic boolean hasValue(TLcdDataProperty aProperty)
aProperty
is from the right data type
, and this instance has a value for it: returns true
aProperty
is from the right data type
, and this instance has no value for it: returns false
aProperty
is not from the right data type
: not allowed, you will get IllegalArgumentExceptionaProperty
is null
: not allowed, you will get NullPointerExceptionhasValue
in interface ILcdDataObject
aProperty
- the property for which to return whether a value is present or not.true
if this data object has a value for the given property, false
otherwise.public boolean hasValue(String aPropertyName)
ILcdDataObject.hasValue(TLcdDataProperty)
for more information.hasValue
in interface ILcdDataObject
aPropertyName
- the name of the property for which to return whether a value is present
or not.true
if this data object has a value for the property with the given name,
false
otherwise.