From 815e91ae268d6d3db9fb16621b8b49ee06fbff8a Mon Sep 17 00:00:00 2001 From: Alexander Zaft Date: Wed, 31 May 2023 08:52:23 +0200 Subject: [PATCH] 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 Reviewed-by: Markus Zolliker Reviewed-by: Alexander Zaft --- frappy/params.py | 8 +++++++- test/test_modules.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/frappy/params.py b/frappy/params.py index 526738cf..428ed781 100644 --- a/frappy/params.py +++ b/frappy/params.py @@ -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 diff --git a/test/test_modules.py b/test/test_modules.py index 9c64a3ac..7da78536 100644 --- a/test/test_modules.py +++ b/test/test_modules.py @@ -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