Package xal.smf.scada
Class BatchConnectionTest
java.lang.Object
xal.smf.scada.BatchConnectionTest
Class for checking the connectivity of many EPICS channels simultaneously.
Ported from XAL on Jul 15, 2014.
· Jonathan M. Freed
- Since:
- Mar 11, 2011
- Author:
- Christopher K. Allen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal class
This class is used is a Channel Access connection monitor. -
Constructor Summary
ConstructorsConstructorDescriptionBatchConnectionTest
(AcceleratorNode smfDev) Creates a newBatchConnectionTest
object for the given accelerator device. -
Method Summary
Modifier and TypeMethodDescriptionReturns a copy of the current set of channels that passed the connectivity test (even if some channels in the original batch failed).void
setChecking
(boolean bolChecking) Force the connection checking on or off.boolean
testConnection
(Class<?> clsScada, double dblTmOut) Test the given (implied) SCADA class for channel connectivity of . its SCADA fields All the channels for the set of PVs are identified (i.e., read back, set, etc.) then the connections are tested in batch mode, rather than serially.boolean
testConnection
(Collection<ScadaFieldDescriptor> setFds, double dblTmOut) Test the given set of PV field descriptors for channel connectivity.
-
Constructor Details
-
BatchConnectionTest
Creates a newBatchConnectionTest
object for the given accelerator device.- Parameters:
smfDev
- accelerator hardware under test- Since:
- Mar 11, 2011
-
-
Method Details
-
setChecking
public void setChecking(boolean bolChecking) Force the connection checking on or off. If connection checking is turned off the checking methods (
andtestConnection(Class, double)
) perform no operation and return a value oftestConnection(Collection, double)
true
.- Parameters:
bolChecking
- iftrue
then connection checking continues as normal iffalse
then connection checking is turned off regardless- Since:
- Mar 28, 2011
-
testConnection
public boolean testConnection(Class<?> clsScada, double dblTmOut) throws BadStructException, BadChannelException Test the given (implied) SCADA class for channel connectivity of . its SCADA fields All the channels for the set of PVs are identified (i.e., read back, set, etc.) then the connections are tested in batch mode, rather than serially. Thus, the given timeout until failure applies to all the channels at once.- Parameters:
clsScada
- class type of the SCADA data structure under testdblTmOut
- timeout before connectivity test fails (in seconds)- Returns:
true
if all connections are available,false
otherwise- Throws:
BadStructException
- the given class has no SCADA field annotationsBadChannelException
- bad channel handle, no channel bound to it- Since:
- Mar 16, 2011
- See Also:
-
testConnection
public boolean testConnection(Collection<ScadaFieldDescriptor> setFds, double dblTmOut) throws BadChannelException, IllegalArgumentException Test the given set of PV field descriptors for channel connectivity. All the channels for the set of PVs are identified (i.e., read back, set, etc.) then the connections are tested in batch mode, rather than serially. Thus, the given timeout until failure applies to all the channels at once.- Parameters:
setFds
- set of field descriptorsdblTmOut
- timeout before connectivity test fails (in seconds)- Returns:
true
if all channels described in the list are connected,false
otherwise- Throws:
BadChannelException
- bad channel handle, no channel bound to itIllegalArgumentException
- the given collection of descriptors is empty- Since:
- Mar 11, 2011
-
getConnectedChannels
Returns a copy of the current set of channels that passed the connectivity test (even if some channels in the original batch failed).- Returns:
- (copy) set channels from the original batch that we able to connect
- Since:
- Mar 11, 2011
-