Class AbstractCyclingApplication
java.lang.Object
org.scictrl.csshell.epics.server.application.AbstractApplication
org.scictrl.csshell.epics.server.application.cycling.AbstractCyclingApplication
- All Implemented Interfaces:
Application
,OnDemandValueProcessor.ValueProvider
- Direct Known Subclasses:
CyclingApplication
,ITestCyclingApplication
Abstract AbstractCyclingApplication class.
- Author:
- igor@scictrl.com
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
ConstantABORT="Abort"
static final String
ConstantCYCLE="Cycle"
static final String
ConstantCYCLE_TOP="CycleTop"
static final String
ConstantDEVICE="Device"
static final String
ConstantDEVICE_FINAL_VALUE="Device:FinalValue"
static final String
ConstantDEVICE_MAX_LIMIT="Device:MaxLimit"
static final String
ConstantDEVICE_MIN_LIMIT="Device:MinLimit"
static final String
ConstantDURATION="Duration"
protected boolean
If it is linear based.static final String
ConstantPROGRESS="Progress"
static final String
ConstantSTATUS="Status"
static final String
ConstantSTATUS_DESC="Status:Desc"
static final String
ConstantSTATUS_LAST="Status:Last"
static final String
ConstantSTATUS_LAST_STR="Status:Last:Str"
Fields inherited from class org.scictrl.csshell.epics.server.application.AbstractApplication
database, DEFAULT_NAME_DELIMITER, dynamicRecordCreator, ERROR_SUM, LINK_ERROR, LINK_ERROR_STRING, links, log, name, NAME_DELIMITER, nameDelimiter, records
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
Application has now reference to Database.void
Configures the internals of this application, provides reference to configuration with root inside applications tag.protected void
configureDevice
(org.apache.commons.configuration.HierarchicalConfiguration config) configureDevice.protected abstract void
doAbort()
doAbort.protected abstract void
doCycle()
doCycle.protected abstract void
doCycleTop.protected abstract void
This method is called from activate and initiate asynchonous get for metadata.protected void
getAsyncMetadata
(String pvName) Defautl implementation ofgetAsyncMetadata()
, which uses PV to get remote metadata asynchronously.final CyclingParameters
getCyclingParameters
(String name) getCyclingParameters.Getter for the fielddevice
.Getter for the fieldmetaData
.Getter for the fieldparameters
.protected void
notifyRecordChange
(String name, boolean alarmOnly) This method is called whenever record value changed for any record, which belongs to this application (it was added to the applicationAbstractApplication.addRecord(String, Record)
).protected void
notifyRecordWrite
(String name) This method is called whenever record value has been written for any record, which belongs to this application (it was added to the applicationAbstractApplication.addRecord(String, Record)
).protected abstract MetaData
Implement this to provide inital metadata for the cycler.protected MetaData
restoreMetaData
(String pvName) Restores metadata from local persistency store, which is identified by PV name.protected void
setProgress
(double p) setProgress.protected void
setStatus.final void
storeCyclingParameters
(String name, CyclingParameters param) storeCyclingParameters.protected void
updateDuration.protected void
updateLastTimeCycled.Methods inherited from class org.scictrl.csshell.epics.server.application.AbstractApplication
addRecord, addRecordOfCommandProcessor, addRecordOfMemoryValueProcessor, addRecordOfMemoryValueProcessor, addRecordOfMemoryValueProcessor, addRecordOfMemoryValueProcessor, addRecordOfMemoryValueProcessor, addRecordOfMemoryValueProcessor, addRecordOfMemoryValueProcessor, addRecordOfMemoryValueProcessor, addRecordOfMemoryValueProcessor, addRecordOfOnDemandProcessor, addRecordOfOnLinkValueProcessor, configure, connectLinks, createNewStore, fullRecordName, getLinks, getName, getNameDelimiter, getNotNull, getRecord, getRecordErrorSum, getRecordLinkError, getRecordNames, getRecords, getStore, getStore, getValue, initialize, isActivated, isDynamicRecordCreator, log4debug, log4error, log4error, log4info, notifyLinkChange, processLinkChange, pushDoneCommandProcessor, reconnectLinks, resetOnDemandProcessor, restore, store, toString, updateErrorSum, updateErrorSum, updateLinkError, updateLinkError
-
Field Details
-
DURATION
ConstantDURATION="Duration"
- See Also:
-
DEVICE
ConstantDEVICE="Device"
- See Also:
-
PROGRESS
ConstantPROGRESS="Progress"
- See Also:
-
CYCLE
ConstantCYCLE="Cycle"
- See Also:
-
CYCLE_TOP
ConstantCYCLE_TOP="CycleTop"
- See Also:
-
ABORT
ConstantABORT="Abort"
- See Also:
-
STATUS
ConstantSTATUS="Status"
- See Also:
-
STATUS_DESC
ConstantSTATUS_DESC="Status:Desc"
- See Also:
-
STATUS_LAST
ConstantSTATUS_LAST="Status:Last"
- See Also:
-
STATUS_LAST_STR
ConstantSTATUS_LAST_STR="Status:Last:Str"
- See Also:
-
DEVICE_MAX_LIMIT
ConstantDEVICE_MAX_LIMIT="Device:MaxLimit"
- See Also:
-
DEVICE_MIN_LIMIT
ConstantDEVICE_MIN_LIMIT="Device:MinLimit"
- See Also:
-
DEVICE_FINAL_VALUE
ConstantDEVICE_FINAL_VALUE="Device:FinalValue"
- See Also:
-
linear
protected boolean linearIf it is linear based.
-
-
Constructor Details
-
AbstractCyclingApplication
public AbstractCyclingApplication()Constructor.
-
-
Method Details
-
getCyclingParameters
getCyclingParameters.
- Parameters:
name
- aString
object- Returns:
- a
CyclingParameters
object
-
storeCyclingParameters
storeCyclingParameters.
- Parameters:
name
- aString
objectparam
- aCyclingParameters
object
-
getMetaData
Getter for the field
metaData
.- Returns:
- a
MetaData
object
-
getDevice
Getter for the field
device
.- Returns:
- a
String
object
-
getParameters
Getter for the field
parameters
.- Returns:
- a
CyclingParameters
object
-
configureDevice
protected void configureDevice(org.apache.commons.configuration.HierarchicalConfiguration config) configureDevice.
- Parameters:
config
- aHierarchicalConfiguration
object
-
configure
public void configure(String name, org.apache.commons.configuration.HierarchicalConfiguration config) Configures the internals of this application, provides reference to configuration with root inside applications tag. Server structure is not yet initialized, so does not have reference to Database, the Database reference will be available during activate call.- Specified by:
configure
in interfaceApplication
- Overrides:
configure
in classAbstractApplication
- Parameters:
name
- aString
objectconfig
- configuration with room inside application tag.
-
restoreMetaData
Implement this to provide inital metadata for the cycler. If possible use helper methodrestoreMetaData(String)
.- Returns:
- a
MetaData
object
-
restoreMetaData
Restores metadata from local persistency store, which is identified by PV name.- Parameters:
pvName
- the name of PV that provides the metadata.- Returns:
- metadata from local presistancy store
-
updateLastTimeCycled
protected void updateLastTimeCycled()updateLastTimeCycled.
-
updateDuration
updateDuration.
- Parameters:
p
- aCyclingParameters
object
-
activate
public void activate()Application has now reference to Database. Application might want to connect to other records on this server or PVs on other servers. This can not be done until all records from configuration has been loaded. Call to this method signals application that records has been loaded and linking to other values can be commenced.- Specified by:
activate
in interfaceApplication
- Overrides:
activate
in classAbstractApplication
-
getAsyncMetadata
This method is called from activate and initiate asynchonous get for metadata. If possible- Throws:
Exception
- if fails
-
getAsyncMetadata
Defautl implementation ofgetAsyncMetadata()
, which uses PV to get remote metadata asynchronously. -
notifyRecordChange
This method is called whenever record value changed for any record, which belongs to this application (it was added to the applicationAbstractApplication.addRecord(String, Record)
). Implementation class should override this method to intercept the update.- Overrides:
notifyRecordChange
in classAbstractApplication
- Parameters:
name
- the name of record, that triggered change.alarmOnly
- iftrue
then only alarm has been changed
-
notifyRecordWrite
This method is called whenever record value has been written for any record, which belongs to this application (it was added to the applicationAbstractApplication.addRecord(String, Record)
). Implementation class should override this method to intercept the update.- Overrides:
notifyRecordWrite
in classAbstractApplication
- Parameters:
name
- the name of record, that triggered change.
-
doAbort
protected abstract void doAbort()doAbort.
-
doCycle
protected abstract void doCycle()doCycle.
-
doCycleTop
protected abstract void doCycleTop()doCycleTop.
-
setProgress
protected void setProgress(double p) setProgress.
- Parameters:
p
- a double
-
setStatus
setStatus.
- Parameters:
status
- aAbstractCyclingApplication.Status
object
-