Class Signal
- All Implemented Interfaces:
Cloneable,DataListener
Data structure for storing all the properties of a beam profile signal. This includes the signal values, the location of the value within the beam pipe, and the number of samples. Noise characteristics may also be present.
This structure is equipped for direct acquisition of WireHarp
device profile data measurements. The data structure is derived from the
ScadaStruct base class in order to use that data I/O mechanism
already in place.
This type is intended to serve as attributes for a larger data structure
containing the beam profiles in multiple transverse planes. That aggregating
structure is expected to set up the necessary connections for data
acquisition use by the base class ScadaRecord, namely by
instantiating instances with the constructor
Signal(List (protected access). It is
still possible to use a Signal object directly by annotating it
with the annotation.
AScada.Record
Ported from XAL on Jul 15, 2014.
· Jonathan M. Freed
- Since:
- Jan 30, 2013
- Author:
- Christopher K. Allen
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class xal.smf.scada.ScadaRecord
ScadaRecord.IFieldDescriptor -
Constructor Summary
ConstructorsModifierConstructorDescriptionSignal()Creates a new, uninitialized instance ofSignalwhich is not connected to any XAL channels.protectedSignal(List<ScadaFieldDescriptor> lstFldDscr) Creates a new instance of Signal and initializes the SCADA operations with the given field descriptors. -
Method Summary
Modifier and TypeMethodDescriptionvoidPerforms an averaging operation with the givenSignalobject using the given averaging factor.clone()Creates a deep copy of this object.static SignalCreates and returns a newSignalobject containing no data and incapable of any data acquisition.static SignalcreateConnectedSignal(ASignal annSig) Creates a new instance of theSignalclass which is connected to a given device whose signal fields are described in the given annotation.Returns a (unique) string identifier that identifies the persistent data format that belongs to thisSignalclass.intgetCnt()double[]getPos()double[]getVal()voidsetCnt(int cnt) voidsetPos(double[] pos) voidsetVal(double[] val) toString()Write out the contents of this signal.voidupdate(DataAdaptor daptSrc) Read in the values of the data structure fields from the data source behind the data adaptor interface.Methods inherited from class xal.smf.scada.ScadaRecord
getFieldDescriptor, getFieldDescriptorMap, getFieldDescriptors, loadHardwareValues, setFieldFromPV, setHardwareValues, setPvFromField, write
-
Constructor Details
-
Signal
Creates a new, uninitialized instance ofSignalwhich is not connected to any XAL channels.- Throws:
BadStructException- no SCADA fields (@AScada.Field) were found in data structure- Since:
- Feb 7, 2013
-
Signal
Creates a new instance of Signal and initializes the SCADA operations with the given field descriptors.- Parameters:
lstFldDscr- array of field descriptors used for communication with hardware- Throws:
BadStructException- no SCADA fields were found in argument- Since:
- Feb 1, 2013
-
-
Method Details
-
createBlankSignal
Creates and returns a newSignalobject containing no data and incapable of any data acquisition. This type of object is primarily used for data processing.- Returns:
- an empty, unattached signal object
- Since:
- Apr 19, 2012
-
createConnectedSignal
public static Signal createConnectedSignal(ASignal annSig) throws BadStructException, ScadaAnnotationException Creates a new instance of the
Signalclass which is connected to a given device whose signal fields are described in the given annotation. When created here, theSignalobject becomes a fully functionaland can automatically acquire data from the connected device.ScadaRecordNOTES:
· The returned
Signalobject may not have all fields connected. Only those fields for which the given annotation has non-empty values will be connected. This could cause complications for signals requiring such fields and should be checked.- Parameters:
annSig- annotation class containing the meta-data describing the signal connections- Returns:
- operational
ScadaRecordclass capable of data acquisition - Throws:
ScadaAnnotationException- field in the annotation is not accessible, does not exist, or enumerationSignal.FIELDis corruptBadStructException- a required field of the given annotation is empty- Since:
- Feb 7, 2013
-
getCnt
public int getCnt() -
setCnt
public void setCnt(int cnt) -
getPos
public double[] getPos() -
setPos
public void setPos(double[] pos) -
getVal
public double[] getVal() -
setVal
public void setVal(double[] val) -
average
Performs an averaging operation with the given
Signalobject using the given averaging factor. The quantities within this data structure are averaged in place with that of the given signal structure. Letting λ denote the provided averaging factor, which is in the interval [0,1], the new values of this signal, 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 insigAcq.NOTES:
· Nothing is done to the position values in the signal, they are unchanged of current writing.
· The standard deviation is weighted vectorally.- Parameters:
sigAcq- signal u to average into this one vdblWtFac- weighting factor λ ∈ [0,1] for argument u- Throws:
IllegalArgumentException- the provided signal is not the same size as this signal- Since:
- May 1, 2014
-
dataLabel
Returns a (unique) string identifier that identifies the persistent data format that belongs to thisSignalclass.- Returns:
- a tag that identifies the receiver's type
- Since:
- Jan 30, 2013
- See Also:
-
update
Description copied from class:ScadaRecordRead in the values of the data structure fields from the data source behind the data adaptor interface. The attributes of the data source are the field names, the values are taken from there.- Specified by:
updatein interfaceDataListener- Overrides:
updatein classScadaRecord- Parameters:
daptSrc- The adaptor from which to update the data- Throws:
MissingResourceException- a data field was missing from the data sourceBadStructException- data structure fields are ill-defined/incompatible- Since:
- Oct 14, 2014
- See Also:
-
toString
Write out the contents of this signal.- Overrides:
toStringin classScadaRecord- Returns:
- a representation of the signal as a string of (pos,val) pairs
- Since:
- Mar 12, 2010
- See Also:
-
clone
Creates a deep copy of this object. All arrays and field descriptors are duplicated.- Overrides:
clonein classScadaRecord- Throws:
CloneNotSupportedException- Since:
- Apr 19, 2012
- See Also:
-