Mask¶
-
class
Cauldron.DFW.Keyword.Mask¶ Bases:
Cauldron.types.Mask,Cauldron.DFW.Keyword.Keyword,objectThe base class for KTL and DFW keywords.
A dispatcher-based keyword, which should own its own values.
Attributes Summary
KTL_ALIASESKTL_DISPATCHERKTL_REGISTEREDKTL_TYPEfull_nameFull name. nameKeyword name. servicevalueMap .value to ._last_value, the cauldron internal location of this variable. Methods Summary
callback(function[, remove])Register a function to be called whenever this keyword is set to a new value. check(value)Check that ‘value’ is appropriate for this keyword. modify(value)Modify this keyword’s value. period(period)How often a keyword should be updated. postread(value)Take some action post-read. postwrite(value)Take some action post-write. preread()Take some action before this value is read. prewrite(value)Any actions which need to occur before a value is written. read()Read the value from the authority source. schedule([appointment, cancel])Schedule an update. set(value[, force])Set the keyword to the value provided, and broadcast changes. translate(value)Translate a value into a standard representation. update()Update the value by performing a read. write(value)Write the value to the authority source. Attributes Documentation
-
KTL_ALIASES= ()¶
-
KTL_DISPATCHER= True¶
-
KTL_REGISTERED= True¶
-
KTL_TYPE= 'mask'¶
-
full_name¶ Full name. Includes Keyword and Service name.
-
name¶ Keyword name.
-
service= None¶
-
value¶ Map .value to ._last_value, the cauldron internal location of this variable.
Methods Documentation
-
callback(function, remove=False) [edit on github]¶ Register a function to be called whenever this keyword is set to a new value.
-
check(value) [edit on github]¶ Check that ‘value’ is appropriate for this keyword. If it is not, raise a value error.
This method can be overridden to provide specific behavior in user subclasses.
-
modify(value) [edit on github]¶ Modify this keyword’s value. This is the public function which should be called to change a keyword value.
-
period(period) [edit on github]¶ How often a keyword should be updated.
Note
Cauldron backends are not required to implement this function. If the do not, it will raise an
CauldronAPINotImplementederror.
-
postread(value) [edit on github]¶ Take some action post-read. Called at the end of
update().This method can be overridden to provide specific behavior in user subclasses.
-
postwrite(value) [edit on github]¶ Take some action post-write.
This method can be overridden to provide specific behavior in user subclasses.
-
preread() [edit on github]¶ Take some action before this value is read. Called at the start of
update().This method can be overridden to provide specific behavior in user subclasses.
-
prewrite(value) [edit on github]¶ Any actions which need to occur before a value is written. Called to adjust the value in
modify().This can raise
NoWriteNecessaryif a write is not necessary.This method can be overridden to provide specific behavior in user subclasses.
-
read() [edit on github]¶ Read the value from the authority source. Called to get the value for
update().This method can be overridden to provide specific behavior in user subclasses.
-
schedule(appointment=None, cancel=False) [edit on github]¶ Schedule an update.
Note
Cauldron backends are not required to implement this function. If the do not, it will raise an
CauldronAPINotImplementederror.
-
set(value, force=False) [edit on github]¶ Set the keyword to the value provided, and broadcast changes.
Parameters: - value – The keyword value.
- force (bool) – Whether to force the change, or ignore repeatedly setting a keyword to the same value.
-
translate(value) [edit on github]¶ Translate a value into a standard representation.
For e.g. an enumerated keyword, this should return the ascii representation of the underlying integer.
This method can be overridden to provide specific behavior in user subclasses.
-
update() [edit on github]¶ Update the value by performing a read. This is the public function which should be called when the keyword is read.
-
write(value) [edit on github]¶ Write the value to the authority source. Called to adjust the value in
modify().This method can be overridden to provide specific behavior in user subclasses.
-