# HG changeset patch
# User Laurent Bessard
# Date 1340130485 -7200
# Node ID de4817ce8b5018e592d58f2deb20db7a0a611da0
# Parent  71678bd14f43a54d4c2baeae7a714dc7ddd9025c
Fix bug when modifying node parameters

diff -r 71678bd14f43 -r de4817ce8b50 etherlab/etherlab.py
--- a/etherlab/etherlab.py	Mon Jun 11 02:37:23 2012 +0200
+++ b/etherlab/etherlab.py	Tue Jun 19 20:28:05 2012 +0200
@@ -122,6 +122,8 @@
             return params
         
     def SetParamsAttribute(self, path, value):
+        position = self.BaseParams.getIEC_Channel()
+        
         if path == "SlaveParams.Type":
             self.CTNParent.SetSlaveType(position, value)
             slave_type = self.CTNParent.GetSlaveType(self.GetSlavePos())
@@ -131,7 +133,6 @@
             self.CTNParent.SetSlaveAlias(position, value)
             return value, True
         
-        position = self.BaseParams.getIEC_Channel()
         value, changed = ConfigTreeNode.SetParamsAttribute(self, path, value)
         # Filter IEC_Channel, Slave_Type and Alias that have specific behavior
         if path == "BaseParams.IEC_Channel":