beremiz

Fix bug when modifying slave position

2012-09-23, Laurent Bessard
6d0d94cd0fe0
Parents 49242019a9ca
Children b1801bf4365c
Fix bug when modifying slave position
--- a/etherlab/etherlab.py Sun Sep 23 23:25:57 2012 +0200
+++ b/etherlab/etherlab.py Sun Sep 23 23:52:47 2012 +0200
@@ -123,12 +123,14 @@
self.CTNParent.SetSlaveAlias(position, value)
return value, True
+ value, refresh = ConfigTreeNode.SetParamsAttribute(self, path, value)
+
# Filter IEC_Channel, Slave_Type and Alias that have specific behavior
- if path == "BaseParams.IEC_Channel":
+ if path == "BaseParams.IEC_Channel" and value != position:
self.CTNParent.SetSlavePosition(position, value)
- return ConfigTreeNode.SetParamsAttribute(self, path, value)
-
+ return value, refresh
+
def GetSlaveInfos(self):
return self.CTNParent.GetSlaveInfos(self.GetSlavePos())