Commit bc43ccf6 authored by Pavel Vainerman's avatar Pavel Vainerman

(python): Исправил ошибку в UInterface (неверно работал с UGlobal::to_sid)

parent 9b104e46
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
Name: libuniset Name: libuniset
Version: 1.6 Version: 1.6
Release: alt13 Release: alt14
Summary: UniSet - library for building distributed industrial control systems Summary: UniSet - library for building distributed industrial control systems
...@@ -319,6 +319,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname ...@@ -319,6 +319,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
%exclude %_pkgconfigdir/libUniSet.pc %exclude %_pkgconfigdir/libUniSet.pc
%changelog %changelog
* Sat Oct 26 2013 Pavel Vainerman <pv@altlinux.ru> 1.6-alt14
- (python): fixed bug in UInterface
* Thu Oct 24 2013 Pavel Vainerman <pv@altlinux.ru> 1.6-alt13 * Thu Oct 24 2013 Pavel Vainerman <pv@altlinux.ru> 1.6-alt13
- (python): add getArgParam, getArgInt and checkArg functions for UGlobal.py - (python): add getArgParam, getArgInt and checkArg functions for UGlobal.py
......
...@@ -22,6 +22,9 @@ def to_int(s): ...@@ -22,6 +22,9 @@ def to_int(s):
if s.__class__.__name__ == "int": if s.__class__.__name__ == "int":
return s return s
if s.__class__.__name__ == "float":
return int(s)
if len(s)>2 and s[0] == '0' and s[1] == 'x': if len(s)>2 and s[0] == '0' and s[1] == 'x':
return int(s,16) return int(s,16)
......
...@@ -103,3 +103,21 @@ class UInterface(): ...@@ -103,3 +103,21 @@ class UInterface():
return "" return ""
raise UException("(setValue): Unknown interface %s"%self.utype) raise UException("(setValue): Unknown interface %s"%self.utype)
def getShortName(self,s_node):
if self.itype == "uniset":
return self.i.getShortName(s_node)
if self.itype == "modbus":
return ""
raise UException("(getShortName): Unknown interface %s"%self.utype)
def getNodeID(self,s_node):
if self.itype == "uniset":
return self.i.getNodeID(s_node)
if self.itype == "modbus":
return None
raise UException("(getNodeID): Unknown interface %s"%self.utype)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment