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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstantABORT="Abort"static final StringConstantCYCLE="Cycle"static final StringConstantCYCLE_TOP="CycleTop"static final StringConstantDEVICE="Device"static final StringConstantDEVICE_FINAL_VALUE="Device:FinalValue"static final StringConstantDEVICE_MAX_LIMIT="Device:MaxLimit"static final StringConstantDEVICE_MIN_LIMIT="Device:MinLimit"static final StringConstantDURATION="Duration"protected booleanIf it is linear based.static final StringConstantPROGRESS="Progress"static final StringConstantSTATUS="Status"static final StringConstantSTATUS_DESC="Status:Desc"static final StringConstantSTATUS_LAST="Status:Last"static final StringConstantSTATUS_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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Application has now reference to Database.voidConfigures the internals of this application, provides reference to configuration with root inside applications tag.protected voidconfigureDevice(org.apache.commons.configuration.HierarchicalConfiguration config) configureDevice.protected abstract voiddoAbort()doAbort.protected abstract voiddoCycle()doCycle.protected abstract voiddoCycleTop.protected abstract voidThis method is called from activate and initiate asynchonous get for metadata.protected voidgetAsyncMetadata(String pvName) Defautl implementation ofgetAsyncMetadata(), which uses PV to get remote metadata asynchronously.final CyclingParametersgetCyclingParameters(String name) getCyclingParameters.Getter for the fielddevice.Getter for the fieldmetaData.Getter for the fieldparameters.protected voidnotifyRecordChange(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 voidnotifyRecordWrite(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 MetaDataImplement this to provide inital metadata for the cycler.protected MetaDatarestoreMetaData(String pvName) Restores metadata from local persistency store, which is identified by PV name.protected voidsetProgress(double p) setProgress.protected voidsetStatus.final voidstoreCyclingParameters(String name, CyclingParameters param) storeCyclingParameters.protected voidupdateDuration.protected voidupdateLastTimeCycled.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- aStringobject- Returns:
- a
CyclingParametersobject
-
storeCyclingParameters
storeCyclingParameters.
- Parameters:
name- aStringobjectparam- aCyclingParametersobject
-
getMetaData
Getter for the field
metaData.- Returns:
- a
MetaDataobject
-
getDevice
Getter for the field
device.- Returns:
- a
Stringobject
-
getParameters
Getter for the field
parameters.- Returns:
- a
CyclingParametersobject
-
configureDevice
protected void configureDevice(org.apache.commons.configuration.HierarchicalConfiguration config) configureDevice.
- Parameters:
config- aHierarchicalConfigurationobject
-
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:
configurein interfaceApplication- Overrides:
configurein classAbstractApplication- Parameters:
name- aStringobjectconfig- configuration with room inside application tag.
-
restoreMetaData
Implement this to provide inital metadata for the cycler. If possible use helper methodrestoreMetaData(String).- Returns:
- a
MetaDataobject
-
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- aCyclingParametersobject
-
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:
activatein interfaceApplication- Overrides:
activatein 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:
notifyRecordChangein classAbstractApplication- Parameters:
name- the name of record, that triggered change.alarmOnly- iftruethen 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:
notifyRecordWritein 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.Statusobject
-