fix Parameter/Command copy method
in case the Parameter/Command is subclassed Change-Id: Ib34fc78e72cd04e743e35ef7ccd40b2eae03b614 Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/26450 Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de> Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
parent
7bd166a8a1
commit
3140d454ae
@ -233,7 +233,7 @@ class Parameter(Accessible):
|
|||||||
|
|
||||||
def copy(self):
|
def copy(self):
|
||||||
# deep copy, as datatype might be altered from config
|
# deep copy, as datatype might be altered from config
|
||||||
res = Parameter()
|
res = type(self)()
|
||||||
res.name = self.name
|
res.name = self.name
|
||||||
res.init(self.propertyValues)
|
res.init(self.propertyValues)
|
||||||
res.datatype = res.datatype.copy()
|
res.datatype = res.datatype.copy()
|
||||||
@ -363,7 +363,7 @@ class Command(Accessible):
|
|||||||
return self
|
return self
|
||||||
|
|
||||||
def copy(self):
|
def copy(self):
|
||||||
res = Command()
|
res = type(self)()
|
||||||
res.name = self.name
|
res.name = self.name
|
||||||
res.func = self.func
|
res.func = self.func
|
||||||
res.init(self.propertyValues)
|
res.init(self.propertyValues)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user