summaryrefslogtreecommitdiffstats
path: root/tango
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2015-03-17 11:10:46 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2015-03-17 11:12:16 +0100
commit175b7e29e2e1076add453e1d1dd758ddfcc23811 (patch)
tree4d39716a3adfa3dca9c0c097fbf8b167a409a5fa /tango
parent76479e9860ee7875b46de1ab47c5062179cffdc4 (diff)
downloaduca-175b7e29e2e1076add453e1d1dd758ddfcc23811.tar.gz
uca-175b7e29e2e1076add453e1d1dd758ddfcc23811.tar.bz2
uca-175b7e29e2e1076add453e1d1dd758ddfcc23811.tar.xz
uca-175b7e29e2e1076add453e1d1dd758ddfcc23811.zip
tango: map enums to UShort
Not nice but will do the trick.
Diffstat (limited to 'tango')
-rwxr-xr-xtango/Uca11
1 files changed, 9 insertions, 2 deletions
diff --git a/tango/Uca b/tango/Uca
index 47f4021..f08ef20 100755
--- a/tango/Uca
+++ b/tango/Uca
@@ -16,7 +16,7 @@ except ImportError:
HAVE_TIFFFILE = False
-def get_tango_type(prop):
+def get_tango_type(obj_type):
mapping = {
GObject.TYPE_BOOLEAN: PyTango.CmdArgType.DevBoolean,
GObject.TYPE_CHAR: PyTango.CmdArgType.DevUChar,
@@ -27,9 +27,16 @@ def get_tango_type(prop):
GObject.TYPE_LONG: PyTango.CmdArgType.DevLong,
GObject.TYPE_DOUBLE: PyTango.CmdArgType.DevDouble,
GObject.TYPE_STRING: PyTango.CmdArgType.DevString,
+ GObject.TYPE_ENUM: PyTango.CmdArgType.DevShort,
}
- return mapping.get(prop, None)
+ tango_type = mapping.get(obj_type, None)
+
+ if tango_type is not None:
+ return tango_type
+
+ if obj_type.is_a(GObject.TYPE_ENUM):
+ return PyTango.CmdArgType.DevUShort
def get_tango_write_type(prop):