remove support for declaring parameters/commands as accessibles

use parameters/commands for this

Change-Id: I41f68c7f65f0ea451e639092a44a8ff8f5710bfc
Reviewed-on: https://forge.frm2.tum.de/review/20275
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Tested-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
This commit is contained in:
Enrico Faulhaber
2019-03-28 17:46:46 +01:00
parent 568e214a91
commit 752f8f8093
9 changed files with 44 additions and 47 deletions

View File

@ -88,7 +88,7 @@ class ModuleMeta(type):
for base in reversed(bases):
if hasattr(base, "accessibles"):
accessibles_list.append(base.accessibles)
for accessibles in [attrs.get('accessibles', {}), parameters, commands, overrides]:
for accessibles in [parameters, commands, overrides]:
accessibles_list.append(accessibles)
accessibles = {} # unordered dict of accessibles, will be sorted later
for accessibles_dict in accessibles_list:
@ -121,10 +121,9 @@ class ModuleMeta(type):
if isinstance(v.datatype, EnumType) and not v.datatype._enum.name:
v.datatype._enum.name = k
# newtype.accessibles will be used in 3 places only:
# newtype.accessibles will be used in 2 places only:
# 1) for inheritance (see above)
# 2) for the describing message
# 3) by code needing to access the Parameter/Command object (i.e. checking datatypes)
newtype.accessibles = OrderedDict(sorted(accessibles.items(), key=lambda item: item[1].ctr))
# check validity of Parameter entries