add Module.setExport to change the export flag
Change-Id: I245845e30cf51ba762ac9b949a0adf188bf16efc
This commit is contained in:
+16
-2
@@ -439,8 +439,9 @@ class Module(HasAccessibles):
|
||||
if not self.export: # do not export parameters of a module not exported
|
||||
accessible.export = False
|
||||
self.accessibles[name] = accessible
|
||||
if accessible.export:
|
||||
self.accessiblename2attr[accessible.export] = name
|
||||
self.setExport(name, accessible.export)
|
||||
# if accessible.export:
|
||||
# self.accessiblename2attr[accessible.export] = name
|
||||
if isinstance(accessible, Parameter):
|
||||
self.parameters[name] = accessible
|
||||
if isinstance(accessible, Command):
|
||||
@@ -502,6 +503,19 @@ class Module(HasAccessibles):
|
||||
# this checks again for datatype and sets the timestamp
|
||||
setattr(self, pname, pobj.value)
|
||||
|
||||
def setExport(self, pname, flag):
|
||||
"""change the export flag of a parameter or command
|
||||
|
||||
to be called in "meth:checkProperties() when needed """
|
||||
pobj = self.accessibles[pname]
|
||||
if flag:
|
||||
pobj.export = True
|
||||
pobj.fixExport()
|
||||
self.accessiblename2attr[pobj.export] = pname
|
||||
else:
|
||||
self.accessiblename2attr.pop(pobj.export, None)
|
||||
pobj.export = False
|
||||
|
||||
def announceUpdate(self, pname, value=None, err=None, timestamp=None, validate=True):
|
||||
"""announce a changed value or readerror
|
||||
|
||||
|
||||
Reference in New Issue
Block a user