@AScada public class SignalAttrs extends ScadaRecord
Ported from XAL on Jul 15, 2014.
· Jonathan M. Freed
Modifier and Type | Class and Description |
---|---|
static class |
SignalAttrs.ATTRS
Enumeration of the signal properties data fields.
|
ScadaRecord.IFieldDescriptor
Modifier and Type | Field and Description |
---|---|
double |
amp
Maximum value of the signal over baseline
|
double |
area
Area under the signal curve minus baseline
|
double |
mean
Axis location of the center of mass
|
double |
offset
Value of the signal baseline, i.e., sensor output at zero input
|
double |
stdev
The statistical standard deviation
|
Modifier | Constructor and Description |
---|---|
|
SignalAttrs()
Creates a new, uninitialized instance of
SignalAttrs which
is not connected to any hardware. |
protected |
SignalAttrs(java.util.List<ScadaFieldDescriptor> lstPfdSet)
Create a new
SignalAttrs object. |
protected |
SignalAttrs(java.util.List<ScadaFieldDescriptor> lstPfdSet,
AcceleratorNode ws)
Create a new, initialized
SignalAttrs object. |
Modifier and Type | Method and Description |
---|---|
void |
average(SignalAttrs sigAcq,
double dblWtFac)
Performs an averaging operation with the given
SignalAttrs object using the
given weighting factor. |
static SignalAttrs |
createConnectedSignal(ASignalAttrs annAttrs)
Creates a new instance of the
Signal class which is connected
to a given device whose signal fields are described in the given annotation. |
java.lang.String |
dataLabel()
Label used for parameter set identification.
|
void |
update(DataAdaptor daptSrc)
Loads the data structure from the given data source while respecting
the various data format versions.
|
void |
write(DataAdaptor daptSink)
Save the data structure field values to the given data sink behind
the
DataAdaptor interface. |
clone, getFieldDescriptor, getFieldDescriptorMap, getFieldDescriptors, loadHardwareValues, setFieldFromPV, setHardwareValues, setPvFromField, toString
public double amp
public double offset
public double area
public double mean
public double stdev
public SignalAttrs()
SignalAttrs
which
is not connected to any hardware.protected SignalAttrs(java.util.List<ScadaFieldDescriptor> lstPfdSet)
SignalAttrs
object.lstPfdSet
- list of PV descriptors for each data fieldprotected SignalAttrs(java.util.List<ScadaFieldDescriptor> lstPfdSet, AcceleratorNode ws) throws ConnectionException, GetException
SignalAttrs
object. Data
field values are taken immediately from the diagnostic devices.lstPfdSet
- field descriptors for this data setws
- hardware device to acquire datajava.lang.IllegalArgumentException
- general field incompatibility exceptionConnectionException
- unable to connect to a parameter read back channelGetException
- general CA GET exception while fetch field valuepublic static SignalAttrs createConnectedSignal(ASignalAttrs annAttrs)
Signal
class which is connected
to a given device whose signal fields are described in the given annotation.
When created here, the Signal
object becomes a fully functional
ScadaRecord
and can automatically acquire data from the
connected device.annAttrs
- annotation class containing the meta-data describing the signal connectionsScadaRecord
class capable of data acquisitionjava.lang.IllegalAccessException
- a needed field in the annotation is not publicly accessiblepublic void average(SignalAttrs sigAcq, double dblWtFac) throws java.lang.IllegalArgumentException
Performs an averaging operation with the given SignalAttrs
object using the
given weighting factor. The quantities within this data structure are averaged in
place with that of the given signal attributes structure. Letting λ denote the
provided averaging factor, which is in the interval [0,1], the new values of this
structure, say v' are given by the formula
v' = λu + (1 - λ)v
where v is the previous value of v' and u is the new value
of v in sigAcq
.
sigAcq
- signal u to average into this one vdblWtFac
- weighting factor λ ∈ [0,1] for argument ujava.lang.IllegalArgumentException
- the provided signal is not the same size as this signalpublic java.lang.String dataLabel()
gov.sns.tools.data.DataListener#dataLabel()
public void update(DataAdaptor daptSrc) throws java.util.MissingResourceException, BadStructException
update
in interface DataListener
update
in class ScadaRecord
daptSrc
- The adaptor from which to update the datajava.util.MissingResourceException
- a data field was missing from the data sourceBadStructException
- data structure fields are ill-defined/incompatibleScadaRecord.update(xal.tools.data.DataAdaptor)
public void write(DataAdaptor daptSink) throws BadStructException
ScadaRecord
DataAdaptor
interface. Each value is stored
as the value of an attribute being the field name.write
in interface DataListener
write
in class ScadaRecord
daptSink
- The adaptor to which the receiver's data is writtenBadStructException
- data structure fields are ill-defined/incompatibleScadaRecord.write(xal.tools.data.DataAdaptor)