revert default of poll to False
Before the introduction of the Property, the default of the poll property was False. I feel that this is a better default, as the programmer should think about which parameters really need to be polled. + change comment about poll property (meaning depends on Poller) + change name of Status datatype to StatusType (avoid name conflicts with Status enum type) Change-Id: Ie405b10ce8dfe85b235dbe78c910b5b5ee22cbb1 Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/21407 Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de> Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
@ -40,7 +40,7 @@ __all__ = [
|
|||||||
'BoolType', 'EnumType',
|
'BoolType', 'EnumType',
|
||||||
'BLOBType', 'StringType',
|
'BLOBType', 'StringType',
|
||||||
'TupleOf', 'ArrayOf', 'StructOf',
|
'TupleOf', 'ArrayOf', 'StructOf',
|
||||||
'CommandType',
|
'CommandType', 'StatusType',
|
||||||
]
|
]
|
||||||
|
|
||||||
# *DEFAULT* limits for IntRange/ScaledIntegers transport serialisation
|
# *DEFAULT* limits for IntRange/ScaledIntegers transport serialisation
|
||||||
@ -941,7 +941,7 @@ class LimitsType(StructOf):
|
|||||||
return limits
|
return limits
|
||||||
|
|
||||||
|
|
||||||
class Status(TupleOf):
|
class StatusType(TupleOf):
|
||||||
# shorten initialisation and allow acces to status enumMembers from status values
|
# shorten initialisation and allow acces to status enumMembers from status values
|
||||||
def __init__(self, enum):
|
def __init__(self, enum):
|
||||||
TupleOf.__init__(self, EnumType(enum), StringType())
|
TupleOf.__init__(self, EnumType(enum), StringType())
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
from secop.datatypes import CommandType, DataType, StringType, BoolType, EnumType, DataTypeType, ValueType, OrType, \
|
from secop.datatypes import CommandType, DataType, StringType, BoolType, EnumType, DataTypeType, ValueType, OrType, \
|
||||||
NoneOr, TextType
|
NoneOr, TextType, IntRange
|
||||||
from secop.errors import ProgrammingError
|
from secop.errors import ProgrammingError
|
||||||
from secop.properties import HasProperties, Property
|
from secop.properties import HasProperties, Property
|
||||||
|
|
||||||
@ -82,12 +82,14 @@ class Parameter(Accessible):
|
|||||||
from the config file if specified there
|
from the config file if specified there
|
||||||
|
|
||||||
poll can be:
|
poll can be:
|
||||||
- False (never poll this parameter)
|
- False or 0 (never poll this parameter), this is the default
|
||||||
- True (poll this every pollinterval)
|
- True or 1 (poll this parameter)
|
||||||
- positive int (poll every N(th) pollinterval)
|
- for any other integer, the meaning depends on the used poller
|
||||||
- negative int (normally poll every N(th) pollinterval, if module is busy, poll every pollinterval)
|
meaning for the default simple poller:
|
||||||
|
- True or 1 (poll this every pollinterval)
|
||||||
note: Drivable (and derived classes) poll with 10 fold frequency if module is busy....
|
- positive int (poll every N(th) pollinterval)
|
||||||
|
- negative int (normally poll every N(th) pollinterval, if module is busy, poll every pollinterval)
|
||||||
|
note: Drivable (and derived classes) poll with 10 fold frequency if module is busy....
|
||||||
"""
|
"""
|
||||||
|
|
||||||
properties = {
|
properties = {
|
||||||
@ -107,7 +109,7 @@ class Parameter(Accessible):
|
|||||||
ValueType(), export=False, default=None, mandatory=False),
|
ValueType(), export=False, default=None, mandatory=False),
|
||||||
'export': Property('Is this parameter accessible via SECoP? (vs. internal parameter)',
|
'export': Property('Is this parameter accessible via SECoP? (vs. internal parameter)',
|
||||||
OrType(BoolType(), StringType()), export=False, default=True),
|
OrType(BoolType(), StringType()), export=False, default=True),
|
||||||
'poll': Property('Polling indicator', ValueType(), export=False, default=True), # check default value!
|
'poll': Property('Polling indicator', IntRange(), export=False, default=False),
|
||||||
'optional': Property('[Internal] is this parameter optional?', BoolType(), export=False, default=False),
|
'optional': Property('[Internal] is this parameter optional?', BoolType(), export=False, default=False),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user