public abstract class SignalSet extends java.lang.Object implements DataListener
Base class for data structures contains profile data as measured by the wire scanner
(ergo the identifier SignalSet
. Note that these guys are different
from the other data structures in that they all have common structure.
Thus I have used a different (more simple, I hope) implementation
to populate them. Each derived class supplies its out (field name, PV descriptor)
pairs to the constructor just as in the base class.
This class is essentially an active data structure which populates itself with the measurement data from the diagnostic hardware.
A data set composed of beam profile signals measured from each plane of the wire harp.
The data from each plane is available through the class attributes of type
.
WireScanner.Signal
The channel handles needed to connect the Signal
attributes to the
wire harp device are specified in the derived classes by annotating it with the
annotation.
WireScanner.ASignal
Ported from XAL on Jul 15, 2014.
· Jonathan M. Freed
Modifier and Type | Field and Description |
---|---|
Signal |
dia
The diagonal measurement signal
|
Signal |
hor
The horizontal measurement signal
|
Signal |
ver
The vertical measurement signal
|
Modifier | Constructor and Description |
---|---|
protected |
SignalSet()
Create a new, uninitialized
SignalSet object initialize
with values fetched from the given device. |
protected |
SignalSet(DataAdaptor daSrc)
Creates a new instance of
SignalSet and initialize the signal data from the given
data source. |
protected |
SignalSet(ProfileDevice smfDev)
Create a new
SignalSet object initializing it
with values acquired from the given device. |
Modifier and Type | Method and Description |
---|---|
void |
average(SignalSet setCombine,
double dblWtFac)
Averages all the signals in the signal set using the given averaging factor.
|
java.lang.String |
dataLabel()
Label used for parameter set identification.
|
static java.util.List<ScadaFieldDescriptor> |
getFieldDescriptorList(java.lang.Class<? extends SignalSet> clsData)
Returns the set of field descriptors for (field, channel)
pairs used by the given
SignalSet -derived class. |
java.util.List<ScadaFieldDescriptor> |
getFieldDescriptors()
Returns the set of all SCADA field descriptors describing the
data acquisition channels.
|
Signal |
getSignal(ProfileDevice.ANGLE angle)
Returns the signal object of this set corresponding to the give
profile angle.
|
void |
loadHardwareValues(ProfileDevice smfDev)
Populate the fields of this data set by acquiring the current
values of the signal process variables of the given device.
|
void |
setSignal(ProfileDevice.ANGLE angle,
Signal signal)
Sets the signal for the given measurement angle to the given signal
object.
|
java.lang.String |
toString()
Write out a text description of the data structure field
values.
|
void |
update(DataAdaptor daptSrc)
Load the contents of this data set
from the persistent store behind the
DataListener interface. |
void |
write(DataAdaptor adaptor)
Write out the contents of this measurement data
set to the given data store.
|
public Signal hor
public Signal ver
public Signal dia
protected SignalSet() throws ScadaAnnotationException
SignalSet
object initialize
with values fetched from the given device.ScadaAnnotationException
- this class is not annotated with ASignal.ASet
,
or the annotation is corruptprotected SignalSet(ProfileDevice smfDev) throws ScadaAnnotationException, ConnectionException, GetException, BadStructException
SignalSet
object initializing it
with values acquired from the given device.smfDev
- data acquisition deviceScadaAnnotationException
- the ASignal.ASet
annotations are incompleteConnectionException
- unable to connect to a parameter read back channelGetException
- general CA GET exception while fetch field valueBadStructException
- the DAQ data structure and DAQ channels are incompatible, bad definitionprotected SignalSet(DataAdaptor daSrc) throws java.lang.IllegalArgumentException, java.lang.IllegalAccessException
SignalSet
and initialize the signal data from the given
data source.daSrc
- data source using the DataAdaptor
interfacejava.lang.IllegalAccessException
- if an underlying Signal
field is inaccessible.java.lang.IllegalArgumentException
- general field incompatibility exceptionpublic static java.util.List<ScadaFieldDescriptor> getFieldDescriptorList(java.lang.Class<? extends SignalSet> clsData) throws ScadaAnnotationException
Returns the set of field descriptors for (field, channel)
pairs used by the givenSignalSet
-derived class. The given
signal set must be annotated with the annotation ASignal.ASet
for the operation to succeed.
Only the descriptors for which the SignalSet
annotation has values
will be returned. This, of course, includes fields for which SignalSet
has default values.
clsData
- the SignalSet
-derived child class
with ASignal.ASet annotationsSignalSet
annotation.ScadaAnnotationException
- the ASignal.ASet
annotation was missingpublic java.util.List<ScadaFieldDescriptor> getFieldDescriptors()
ASignal.ASet
the Signal
attributes
will be connected in the zero-argument constructor.public Signal getSignal(ProfileDevice.ANGLE angle)
angle
- measurement angle of the desired signalpublic void setSignal(ProfileDevice.ANGLE angle, Signal signal)
angle
- measurement angle of the modified signalsignal
- new signal for the given measurement anglepublic void loadHardwareValues(ProfileDevice smfDev) throws BadStructException, ConnectionException, GetException
smfDev
- hardware device from which the signal data is acquiredBadStructException
- data structure fields are ill-defined/incompatibleConnectionException
- unable to connect to a descriptor read back channelGetException
- unable to get PV value from channel access orpublic void average(SignalSet setCombine, double dblWtFac) throws java.lang.IllegalArgumentException
SignalSignal.average(Signal, double)
for additional information.setCombine
- signal set to average into this onedblWtFac
- averaging magnitude λ ∈ [0,1]java.lang.IllegalArgumentException
- the provided signal is not the same size as this signalpublic java.lang.String dataLabel()
dataLabel
in interface DataListener
gov.sns.tools.data.DataListener#dataLabel()
public void update(DataAdaptor daptSrc) throws java.util.MissingResourceException, BadStructException
DataListener
interface.update
in interface DataListener
daptSrc
- data sourcejava.util.MissingResourceException
- a data field was missing from the data sourceBadStructException
- data structure fields are ill-defined/incompatiblegov.sns.tools.data.DataListener#update(gov.sns.tools.data.DataAdaptor)
public void write(DataAdaptor adaptor)
write
in interface DataListener
adaptor
- data store exposing DataListener
interfacegov.sns.tools.data.DataListener#write(gov.sns.tools.data.DataAdaptor)
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()