14 Commits

Author SHA1 Message Date
Alexander Zaft
15d38d7cc1 all: remove coding cookies
Change-Id: I53a4d79c3ebc50b8aed43a5ef1fa6538f8059a47
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/32251
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>
2024-01-29 14:06:06 +01:00
da15df076a fetched mlz version
- before some chamges in the gerrit pipline

Change-Id: I33eb2d75f83345a7039d0fb709e66defefb1c3e0
2023-05-02 15:25:11 +02:00
34b93adef0 more merges from gerrit
Change-Id: I13441cd8889dd39f74a2dd1a85e75a1b76bb93c8
2022-03-08 10:52:14 +01:00
77acda840a fix tests from mlz repo
- fix omit_unchanged
- names too short
+ other pylint complains
Change-Id: I3c277b461fad1a5fdf8e76ff1cc42b8742d1de16

Change-Id: I58fb64f91bcc2efef20df68f5c63a64315413286
2021-11-12 17:16:59 +01:00
e38cd11bfe fix parameter inheritance using MRO
+ no update on unhchanged values within 1 sec

Change-Id: I3e3d50bb5541e8d4da2badc3133d243dd0a3b892
2021-10-06 08:32:47 +02:00
fe041bac0a after running isort
Change-Id: I6d7dbb8dee9480fc9242529089a1b40f17f068e7
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/25052
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
2021-02-26 17:27:13 +01:00
07b758c3dd removed old style syntax
- removed secop/metaclass.py
- moved code from ModuleMeta to modules.HasAccessibles.__init_subclass__
- reworked properties:
  assignment obj.property = value now always allowed
- reworked Parameters and Command to be true descriptors
- Command must now be solely used as decorator
- renamed 'usercommand' to 'Command'
- command methods no longer start with 'do_'
- reworked mechanism to determine accessible order:
  the attribute paramOrder, if given, determines order of accessibles
+ fixed some issues makeing the IDE more happy
+ simplified code for StatusType and added a test for it

Change-Id: I8045cf38ee6f4d4862428272df0b12a7c8abaca7
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/25049
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
2021-02-26 17:27:13 +01:00
2d98fe8812 allow to set exported properties in code
Actually, only property values set in the configuration can
be exported, as values equal to the default are not exported.
For this, the mechanism of overwriting properties by class attributes
has to be modified.

Change-Id: I4388d1fbb36393e863556fbbc8df800dd4800c87
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/22161
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
2020-01-15 13:24:11 +01:00
f5af074015 simple possiblity for overriding properties
When a class attribute is assigned with the same name as a property
from an inherited class, the property default is overridden.
If the type does not match, a ProgrammingError is raised.

Change-Id: Ifdab5c8bbdaae008370a9b297c770f5c04db9311
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/21989
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
2019-12-11 09:14:25 +01:00
f4d572966c use Properties from secop.properties for datatypes
this change is triggered by the fact, that assigining a unit
in the config file did no longer work.

this change has several implications:
1) secop.properties must not import secop.datatypes:
   - as ValueType can not be imported, the default behaviour with
     'mandatory' and 'default' arguments was slightly changed
   - instead of checking for DataType when exporting, a try/except
     was used
2) the datatype of datatype properties is sometimes not yet defined.
   a stub is used in this cases instead, which is later replaced by
   the proper datatype. The number of stubs may be reduced, but this
   should be done in a later change, as the diff will be much less
   readable.
3) in config files, datatype properties can be changed like parameter
   properties. HasProperties.setProperties/checkProperties/getProperties
   are overridden for this.

the config editor seems still to work, an issue (probably py3) had
to be fixed there

Change-Id: I1efddf51f2c760510e913dbcaa099e8a89c9cab5
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/21399
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
2019-10-11 16:46:29 +02:00
Enrico Faulhaber
70a9c42a7a Remove py2 support
Change-Id: Ieeaeb3b8efcae004e94aea6c1d2703c9782a8650
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/21320
Tested-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
2019-09-26 10:32:01 +02:00
04032079d7 fix some remaining py3 incompatibilites
- None <= 0  is invalid in py3
- restrict BLOBType to bytes (may be changed after migration to py3)
- remove long
- use list(<dict>.items()) when dict is changed within loop
- allow initialization of properties in HasProperties without
  supercall to base class
- <dict>.values() can not be indexed
- adapted/removed various tests. additional tests might be added
  after definitive migration to py3

after this change, all the tests run with py3, also secop-server and
secop-gui were tested with an example, but other code might still contain
py3 incompatibilities

Change-Id: I881c6972aeabb8494a21a6cbc7ffeddfd4f5d4f8
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/21306
Tested-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Reviewed-by: Bjoern Pedersen <bjoern.pedersen@frm2.tum.de>
2019-09-26 10:31:21 +02:00
Enrico Faulhaber
95d50fb51e Provide Properties with a description
useful für gui+auto generated docu

Change-Id: I0a2f7dc4b3c745145dd4b03956d15d33731cf980
Reviewed-on: https://forge.frm2.tum.de/review/20949
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Tested-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
2019-07-24 13:37:44 +02:00
Enrico Faulhaber
f6d8f823d9 rework property handling
+ DataType validators are shifted to __call__
+ as_json is moved to export_datatape()
+ new HasProperties Base Mixin for Modules/DataTypes
+ accessibles can be accessed via iterator of a module
+ properties are properly 'derived' and checked, are set with .setPropertyValue

remember: parameters only have properties, so use getPropertyValue()

Change-Id: Iae0273f971aacb00fe6bf05e6a4d24a6d1be881a
Reviewed-on: https://forge.frm2.tum.de/review/20635
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
2019-07-16 10:56:17 +02:00