From 7af4d572aba987f3904572034557b6c7379b9f63 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Wed, 29 Jul 2020 14:11:28 +0200 Subject: [PATCH] Param(..., initwrite=True) works only with poll=True check this when creating a Parameter Change-Id: I5d45f25fd67682de45b51c842323e9582f69e6e3 Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/23547 Tested-by: Jenkins Automated Tests Reviewed-by: Enrico Faulhaber Reviewed-by: Markus Zolliker --- secop/params.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/secop/params.py b/secop/params.py index f32068d..40904a6 100644 --- a/secop/params.py +++ b/secop/params.py @@ -139,8 +139,11 @@ class Parameter(Accessible): datatype.setProperty('unit', unit) super(Parameter, self).__init__(**kwds) - if self.readonly and self.initwrite: - raise ProgrammingError('can not have both readonly and initwrite!') + if self.initwrite: + if self.readonly: + raise ProgrammingError('can not have both readonly and initwrite!') + if not self.poll: + raise ProgrammingError('only polled parameters can have initwrite!') if self.constant is not None: self.properties['readonly'] = True