|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.model.resource.AntennaElectronicsConfiguration
public class AntennaElectronicsConfiguration
A generalized representation of the configuration of antenna electronics. Configuring the electronics system of an antenna usually means setting switch positions, tuning local oscillators, and setting the number of bits per sample for the output signals.
This class is meant to be able to represent the configuration information
for a wide variety of antenna types. Instances of this class may be
obtained from the AntennaElectronics
class, which can return
its current configuration in this form. Clients that will merely query
a configuration need have no special knowledge of the specific
electronics with which they are dealing. Clients that need to
alter a configuration, however, will likely need to know something
about the targeted electronics and about the conventions suggested
by this class.
In order to remain a fairly generic piece of code, this class makes
heavy use of maps of name-value pairs. The name is always a string
and is meant to be the name of a device, such as a local oscillator
or switch. Concrete implementations of AntennaElectronics
are expected to name all those LOs and switches that can be configured
by an external user via this class. The value portion of a name-value
pair varies depending on the device involved. Each device type will be
covered below. First, though, we suggest a convention for embedded
devices.
Convention for Naming Devices Held in Other Devices
Sometimes a device such as a switch is held in an internal component
of the overall antenna electronics. An internal component might be
an up-converter, a down-converter, or some other device. In order to
distinguish devices held directly by AntennaElectronics
from
those it holds indirectly via its internal components, we suggest
using dot notation. For example, if the electronics wishes to
expose a switch named output in its internal component named
downConverterX, the name it should use when populating
this class is downConverterX.output.
Value Objects for Local Oscillator Settings
The getLoTunings()
method returns a map whose keys are
the names of local oscillators. The values in the maps are the
tuning frequencies for those local oscillators.
Value Objects for Switch Settings
The getSwitchPositions()
method returns a map whose keys
are the names of switches. The values are themselves maps that
give the active input and active output poles for the switch.
The value map will either be empty, have one entry, or have two entries.
It will never be null.
The two valid keys for the value map are input and
output, and the values of these keys represent the
selection of a given input or output pole as the active
input or output pole of that switch.
Value Objects for Transfer Switch Settings
The getTransferSwitchPositions()
method returns a map whose keys
are the names of transfer switches
.
The values in the maps are also strings and the convention is to use
one of these two values: clockwise or counterclockwise.
Also by convention, these values are not case sensitive.
Value Objects for Bits per Digital Samples
The getBitsPerSample()
method returns a map whose keys are
the names of digital samplers. The values in the maps are the
number of bits per sample.
Version Info:
$Revision: 1709 $ |
$Date: 2008-11-14 11:22:37 -0700 (Fri, 14 Nov 2008) $ |
$Author: dharland $ (last person to modify) |
Constructor Summary | |
---|---|
AntennaElectronicsConfiguration(TelescopeType telescope)
Creates a new empty configuration for the given telescope. |
Method Summary | |
---|---|
AntennaElectronicsConfiguration |
clone()
Returns a copy of this configuration. |
boolean |
equals(Object o)
Returns true if o is equal to this configuration. |
static AntennaElectronicsConfiguration |
fromXml(Reader reader)
Creates a new configuration based on the XML data read from reader . |
static AntennaElectronicsConfiguration |
fromXml(String xmlFile)
Creates a new configuration from the XML data in the given file. |
Set<ReceiverBand> |
getBands()
Returns the receiver bands for this configuration. |
SortedMap<String,Integer> |
getBitsPerSample()
Returns a map of digital sampler settings. |
SortedMap<String,Frequency> |
getLoTunings()
Returns a map of local oscillator tunings. |
SortedMap<String,Map<String,String>> |
getSwitchPositions()
Returns a map of switch positions. |
TelescopeType |
getTelescope()
Returns the telescope for which this configuration is intended. |
SortedMap<String,String> |
getTransferSwitchPositions()
Returns a map of transfer switch positions. |
int |
hashCode()
Returns a hash code value for this configuration. |
String |
toXml()
Returns an XML representation of this configuration. |
void |
writeAsXmlTo(Writer writer)
Writes an XML representation of this configuration to writer . |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AntennaElectronicsConfiguration(TelescopeType telescope)
Method Detail |
---|
public TelescopeType getTelescope()
public Set<ReceiverBand> getBands()
The returned set is the one held internally by this configuration, so changes made to it will have an effect on this object. The returned set is guaranteed to be non-null, but it may be empty. The most common situation is for there to be one element in the returned set.
public SortedMap<String,Frequency> getLoTunings()
The returned map is the one held internally by this configuration, so changes made to it will have an effect on this object. The returned map is guaranteed to be non-null, but it may be empty.
public SortedMap<String,Map<String,String>> getSwitchPositions()
The returned map is the one held internally by this configuration, so changes made to it will have an effect on this object. The returned map is guaranteed to be non-null, but it may be empty.
public SortedMap<String,String> getTransferSwitchPositions()
transfer switch
positions.
The keys are the names of switches and the values
are their settings. A setting may be either the string
clockwise or the string counterclockwise.
Implementations of AntennaElectronics
are to treat these values
as case insensitive.
The returned map is the one held internally by this configuration, so changes made to it will have an effect on this object. The returned map is guaranteed to be non-null, but it may be empty.
public SortedMap<String,Integer> getBitsPerSample()
The returned map is the one held internally by this configuration, so changes made to it will have an effect on this object. The returned map is guaranteed to be non-null, but it may be empty.
public String toXml() throws JAXBException
JAXBException
- if anything goes wrong during the conversion to XML.writeAsXmlTo(Writer)
public void writeAsXmlTo(Writer writer) throws JAXBException
writer
.
writer
- the device to which XML is written.
JAXBException
- if anything goes wrong during the conversion to XML.public static AntennaElectronicsConfiguration fromXml(String xmlFile) throws JAXBException, XMLStreamException, FileNotFoundException
xmlFile
- the name of an XML file. This method will attempt to locate
the file by using Class.getResource(String)
.
FileNotFoundException
- if the XML file cannot be found.
JAXBException
- if the schema file used (if any) is malformed, if
the XML file cannot be read, or if the XML file is not
schema-valid.
XMLStreamException
- if there is a problem opening the XML file,
if the XML is not well-formed, or for some other
"unexpected processing conditions".public static AntennaElectronicsConfiguration fromXml(Reader reader) throws JAXBException, XMLStreamException
reader
.
reader
- the source of the XML data.
If this value is null, null is returned.
reader
.
XMLStreamException
- if the XML is not well-formed,
or for some other "unexpected processing conditions".
JAXBException
- if anything else goes wrong during the
transformation.public AntennaElectronicsConfiguration clone()
If anything goes wrong during the cloning procedure,
a RuntimeException
will be thrown.
clone
in class Object
public boolean equals(Object o)
o
is equal to this configuration.
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |