Package xal.plugin.epics7.server
Class Epics7ServerChannel
java.lang.Object
xal.ca.Channel
xal.plugin.epics7.Epics7Channel
xal.plugin.epics7.server.Epics7ServerChannel
- All Implemented Interfaces:
org.epics.pvaccess.client.ChannelRequester
,org.epics.pvdata.pv.Requester
,IServerChannel
Server channel implementation. It creates PVAccess and CA channels, independently of the signal prefix. This is done
to ensure backwards compatibility.
Gets are done on the PVRecord, while sets are done to both PVRecord and CA PV, so that they are always in sync.
- Author:
- Juan F. Esteban Müller <JuanF.EstebanMuller@ess.eu>
-
Field Summary
Fields inherited from class xal.plugin.epics7.Epics7Channel
ALARM_FIELD, C_DBL_DEF_TIME_EVENT, C_DBL_DEF_TIME_IO, C_S_DEF_PROTOCOL, CONNECTION_EXC, CONTROL_FIELD, DISPLAY_FIELD, STATUS_REQUEST, TIME_REQUEST, TIMESTAMP_FIELD, VALUE_ALARM_FIELD, VALUE_FIELD, VALUE_REQUEST
Fields inherited from class xal.ca.Channel
channelSystem, connectionFlag, connectionProxy, dblTmEvt, dblTmIO, messageCenter, strId
-
Constructor Summary
ConstructorsConstructorDescriptionEpics7ServerChannel
(String signalName, Epics7ServerChannelSystem channelSystem) -
Method Summary
Modifier and TypeMethodDescriptionaddMonitorValStatus
(IEventSinkValStatus listener, int intMaskFire) Setup a value-status monitor on this channeladdMonitorValTime
(IEventSinkValTime listener, int intMaskFire) Setup a value-status-timestamp monitor on this channeladdMonitorValue
(IEventSinkValue listener, int intMaskFire) Setup a value monitor on this channelboolean
connectAndWait
(double timeout) Request a new connection and wait for it no longer than the timeout.void
Terminate the network channel connection and clear all events associated with process variableint
Return size of value array associated with process variableprotected org.epics.pvdata.pv.PVStructure
protected org.epics.pvdata.pv.PVStructure
Return a rawChannelStatusRecord
representing the fetched record for the native type of this channel.Return a rawChannelTimeRecord
representing the fetched record for the native type of this channel.protected void
getRawValueCallback
(IEventSinkValue listener) Handle a callback for getting the raw value for the channel.protected void
getRawValueCallback
(IEventSinkValue listener, boolean attemptConnection) Handle a callback for getting the raw value for the channel.Return a rawChannelRecord
representing the fetched record for the native type of this channel.void
getRawValueTimeCallback
(IEventSinkValTime listener, boolean attemptConnection) Submit a non-blocking Get request with callbackgetUnits()
Convenience method which returns the units for this channel.protected org.epics.pvdata.pv.PVStructure
void
putRawValCallback
(byte[] newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(byte newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(double[] newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(double newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(float[] newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(float newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(int[] newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(int newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(long[] newVal, PutListener listener) Long is not supported in EPICS3, so they are cast to int for CA.void
putRawValCallback
(long newVal, PutListener listener) Long is not supported in EPICS3, so they are cast to int for CA.void
putRawValCallback
(short[] newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(short newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(String[] newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.void
putRawValCallback
(String newVal, PutListener listener) Asynchronously put a raw value to the channel process variable.final void
Request that the channel be connected.void
setLowerAlarmLimit
(Number lowerLimit) Set the lower alarm limitvoid
setLowerCtrlLimit
(Number lowerLimit) Set the lower control limitvoid
setLowerDispLimit
(Number lowerLimit) Set the lower display limitvoid
setLowerWarningLimit
(Number lowerLimit) Set the lower warning limitvoid
setSettable
(boolean settable) Set whether the value of this channel can be changed by the clients.void
Set the unitsvoid
setUpperAlarmLimit
(Number upperLimit) Set the upper alarm limitvoid
setUpperCtrlLimit
(Number upperLimit) Set the upper control limitvoid
setUpperDispLimit
(Number upperLimit) Set the upper display limitvoid
setUpperWarningLimit
(Number upperLimit) Set the upper warning limitMethods inherited from class xal.plugin.epics7.Epics7Channel
channelCreated, channelStateChange, elementType, get, get, getAlarmLimitPVs, getCallback, getCallback, getDriveLimitPVs, getNativeChannel, getOperationLimitPVs, getRawStringStatusRecord, getRawStringTimeRecord, getRawStringValueRecord, getRequesterName, getWarningLimitPVs, message, putRawValCallback, rawLowerAlarmLimit, rawLowerControlLimit, rawLowerDisplayLimit, rawLowerWarningLimit, rawUpperAlarmLimit, rawUpperControlLimit, rawUpperDisplayLimit, rawUpperWarningLimit, readAccess, writeAccess
Methods inherited from class xal.ca.Channel
addConnectionListener, channelName, checkConnection, checkConnection, checkConnection, connectAndWait, flushIO, getArrayValue, getArrByte, getArrByteCallback, getArrDbl, getArrDblCallback, getArrFlt, getArrFltCallback, getArrInt, getArrIntCallback, getArrLong, getArrShort, getArrString, getEventTimeout, getId, getInstance, getInstance, getIoTimeout, getStatusRecord, getStringStatusRecord, getStringTimeRecord, getStringValueRecord, getTimeRecord, getValByte, getValByteCallback, getValDbl, getValDblCallback, getValEnum, getValFlt, getValFltCallback, getValInt, getValIntCallback, getValLong, getValShort, getValString, getValueCallback, getValueCallback, getValueRecord, getValueTimeCallback, getValueTransform, isConnected, isValid, lowerAlarmLimit, lowerControlLimit, lowerDisplayLimit, lowerWarningLimit, pendEvent, pendIO, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putVal, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, putValCallback, removeConnectionListener, setChannelName, setDebugMode, setEventTimeout, setIoTimeout, setValid, upperAlarmLimit, upperControlLimit, upperDisplayLimit, upperWarningLimit
-
Constructor Details
-
Epics7ServerChannel
-
-
Method Details
-
connectAndWait
public boolean connectAndWait(double timeout) Description copied from class:Channel
Request a new connection and wait for it no longer than the timeout.- Overrides:
connectAndWait
in classEpics7Channel
- Parameters:
timeout
- seconds to wait for a connection before giving up- Returns:
- true if the connection was made within the timeout and false if not
-
requestConnection
public final void requestConnection()Description copied from class:Channel
Request that the channel be connected. Connections are made in the background so this method returns immediately upon making the request. The connection will be made in the future as soon as possible. A connection event will be sent to registered connection listeners when the connection has been established.- Overrides:
requestConnection
in classEpics7Channel
-
disconnect
public void disconnect()Description copied from class:Channel
Terminate the network channel connection and clear all events associated with process variable- Overrides:
disconnect
in classEpics7Channel
-
getCaLock
-
getPvaLock
-
elementCount
Description copied from class:Channel
Return size of value array associated with process variable- Overrides:
elementCount
in classEpics7Channel
- Returns:
- number of values in process variable
- Throws:
ConnectionException
- accordingly
-
getDisplay
protected org.epics.pvdata.pv.PVStructure getDisplay()- Overrides:
getDisplay
in classEpics7Channel
-
getVAlueAlarm
protected org.epics.pvdata.pv.PVStructure getVAlueAlarm()- Overrides:
getVAlueAlarm
in classEpics7Channel
-
getControl
protected org.epics.pvdata.pv.PVStructure getControl()- Overrides:
getControl
in classEpics7Channel
-
getUnits
Description copied from class:Channel
Convenience method which returns the units for this channel.- Specified by:
getUnits
in interfaceIServerChannel
- Overrides:
getUnits
in classEpics7Channel
- Returns:
- the units
-
getRawValueRecord
Description copied from class:Channel
Return a rawChannelRecord
representing the fetched record for the native type of this channel. This is a convenient way to get the value of the PV.- Overrides:
getRawValueRecord
in classEpics7Channel
- Returns:
- raw channel record
- Throws:
GetException
- accordingly
-
getRawStatusRecord
Description copied from class:Channel
Return a rawChannelStatusRecord
representing the fetched record for the native type of this channel. This is a convenient way to get the value of the PV along with status.- Overrides:
getRawStatusRecord
in classEpics7Channel
- Returns:
- raw channel record
- Throws:
GetException
- accordingly
-
getRawTimeRecord
Description copied from class:Channel
Return a rawChannelTimeRecord
representing the fetched record for the native type of this channel. This is a convenient way to get the value of the PV along with status and timestamp.- Overrides:
getRawTimeRecord
in classEpics7Channel
- Returns:
- raw channel record
- Throws:
GetException
- accordingly
-
getRawValueCallback
Description copied from class:Channel
Handle a callback for getting the raw value for the channel.- Overrides:
getRawValueCallback
in classEpics7Channel
- Parameters:
listener
- The receiver of the callback.- Throws:
GetException
- accordingly
-
getRawValueCallback
protected void getRawValueCallback(IEventSinkValue listener, boolean attemptConnection) throws GetException Description copied from class:Channel
Handle a callback for getting the raw value for the channel.- Overrides:
getRawValueCallback
in classEpics7Channel
- Parameters:
listener
- The receiver of the callback.attemptConnection
- indicates whether or not to attempt a blocking connection if this channel is not connected- Throws:
GetException
- accordingly
-
getRawValueTimeCallback
public void getRawValueTimeCallback(IEventSinkValTime listener, boolean attemptConnection) throws GetException Description copied from class:Channel
Submit a non-blocking Get request with callback- Overrides:
getRawValueTimeCallback
in classEpics7Channel
- Parameters:
listener
- to receive callback upon completionattemptConnection
- true to attempt connection and false not to attempt connection- Throws:
GetException
- accordingly
-
addMonitorValTime
public Monitor addMonitorValTime(IEventSinkValTime listener, int intMaskFire) throws MonitorException Description copied from class:Channel
Setup a value-status-timestamp monitor on this channel- Overrides:
addMonitorValTime
in classEpics7Channel
- Parameters:
listener
- interface to data sinkintMaskFire
- code specifying when the monitor is fired or'ed combination of {Monitor.VALUE, Monitor.LOG, Monitor.ALARM}- Returns:
- A new monitor
- Throws:
MonitorException
- general monitor failure
-
addMonitorValStatus
public Monitor addMonitorValStatus(IEventSinkValStatus listener, int intMaskFire) throws MonitorException Description copied from class:Channel
Setup a value-status monitor on this channel- Overrides:
addMonitorValStatus
in classEpics7Channel
- Parameters:
listener
- interface to data sinkintMaskFire
- code specifying when the monitor is fired or'ed combination of {Monitor.VALUE, Monitor.LOG, Monitor.ALARM}- Returns:
- A new monitor
- Throws:
MonitorException
- general monitor failure
-
addMonitorValue
Description copied from class:Channel
Setup a value monitor on this channel- Overrides:
addMonitorValue
in classEpics7Channel
- Parameters:
listener
- interface to data sinkintMaskFire
- code specifying when the monitor is fired or'ed combination of {Monitor.VALUE, Monitor.LOG, Monitor.ALARM}- Returns:
- A new monitor
- Throws:
MonitorException
- general monitor failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Overrides:
putRawValCallback
in classEpics7Channel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Overrides:
putRawValCallback
in classEpics7Channel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Overrides:
putRawValCallback
in classEpics7Channel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Overrides:
putRawValCallback
in classEpics7Channel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Long is not supported in EPICS3, so they are cast to int for CA.- Overrides:
putRawValCallback
in classEpics7Channel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Overrides:
putRawValCallback
in classEpics7Channel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Overrides:
putRawValCallback
in classEpics7Channel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Overrides:
putRawValCallback
in classEpics7Channel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Overrides:
putRawValCallback
in classEpics7Channel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Overrides:
putRawValCallback
in classEpics7Channel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Overrides:
putRawValCallback
in classEpics7Channel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Long is not supported in EPICS3, so they are cast to int for CA.- Overrides:
putRawValCallback
in classEpics7Channel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Overrides:
putRawValCallback
in classEpics7Channel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
putRawValCallback
Description copied from class:Channel
Asynchronously put a raw value to the channel process variable. Fire the specified callback when put is complete.- Overrides:
putRawValCallback
in classEpics7Channel
- Parameters:
newVal
- value sent to process variablelistener
- The receiver of the callback event- Throws:
PutException
- general put failure
-
setUnits
Description copied from interface:IServerChannel
Set the units- Specified by:
setUnits
in interfaceIServerChannel
- Parameters:
units
- to apply
-
setLowerDispLimit
Description copied from interface:IServerChannel
Set the lower display limit- Specified by:
setLowerDispLimit
in interfaceIServerChannel
- Parameters:
lowerLimit
- to apply
-
setUpperDispLimit
Description copied from interface:IServerChannel
Set the upper display limit- Specified by:
setUpperDispLimit
in interfaceIServerChannel
- Parameters:
upperLimit
- to apply
-
setLowerAlarmLimit
Description copied from interface:IServerChannel
Set the lower alarm limit- Specified by:
setLowerAlarmLimit
in interfaceIServerChannel
- Parameters:
lowerLimit
- to apply
-
setUpperAlarmLimit
Description copied from interface:IServerChannel
Set the upper alarm limit- Specified by:
setUpperAlarmLimit
in interfaceIServerChannel
- Parameters:
upperLimit
- to apply
-
setLowerWarningLimit
Description copied from interface:IServerChannel
Set the lower warning limit- Specified by:
setLowerWarningLimit
in interfaceIServerChannel
- Parameters:
lowerLimit
- to apply
-
setUpperWarningLimit
Description copied from interface:IServerChannel
Set the upper warning limit- Specified by:
setUpperWarningLimit
in interfaceIServerChannel
- Parameters:
upperLimit
- to apply
-
setLowerCtrlLimit
Description copied from interface:IServerChannel
Set the lower control limit- Specified by:
setLowerCtrlLimit
in interfaceIServerChannel
- Parameters:
lowerLimit
- to apply
-
setUpperCtrlLimit
Description copied from interface:IServerChannel
Set the upper control limit- Specified by:
setUpperCtrlLimit
in interfaceIServerChannel
- Parameters:
upperLimit
- to apply
-
setSettable
public void setSettable(boolean settable) Description copied from interface:IServerChannel
Set whether the value of this channel can be changed by the clients.- Specified by:
setSettable
in interfaceIServerChannel
- Parameters:
settable
- true if it can be changed
-