Add influences property to parameters/commands

Change-Id: Ica1cc40155cae9b6f52788c8559399030c07d379
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/31234
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>
This commit is contained in:
Alexander Zaft
2023-05-31 08:52:23 +02:00
parent 3b92688b84
commit 815e91ae26
2 changed files with 8 additions and 2 deletions

View File

@ -27,7 +27,7 @@ import inspect
from frappy.datatypes import BoolType, CommandType, DataType, \
DataTypeType, EnumType, NoneOr, OrType, FloatRange, \
StringType, StructOf, TextType, TupleOf, ValueType
StringType, StructOf, TextType, TupleOf, ValueType, ArrayOf
from frappy.errors import BadValueError, WrongTypeError, ProgrammingError
from frappy.properties import HasProperties, Property
from frappy.lib import generalConfig
@ -168,6 +168,9 @@ class Parameter(Accessible):
or the minimum time between updates of equal values [sec]''',
OrType(FloatRange(0), EnumType(always=0, never=999999999, default=-1)),
export=False, default=-1)
influences = Property(
'optional hint about effected parameters', ArrayOf(StringType()),
extname='influences', export=True, mandatory=False, default=[])
# used on the instance copy only
# value = None
@ -363,6 +366,9 @@ class Command(Accessible):
result = Property(
'datatype of the result from the command, or None', NoneOr(DataTypeType()),
export=False, mandatory=True)
influences = Property(
'optional hint about effected parameters', ArrayOf(StringType()),
extname='influences', export=True, mandatory=False, default=[])
func = None

View File

@ -245,7 +245,7 @@ def test_ModuleMagic():
'group', 'export', 'relative_resolution',
'visibility', 'unit', 'default', 'value', 'datatype', 'fmtstr',
'absolute_resolution', 'max', 'min', 'readonly', 'constant',
'description', 'needscfg', 'update_unchanged'}
'description', 'needscfg', 'update_unchanged', 'influences'}
# check on the level of classes
# this checks Newclass1 too, as it is inherited by Newclass2