summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2015-03-17 13:55:14 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2015-03-17 13:57:51 +0100
commitf83189da7a96f19d7186e623426b39bafed0c714 (patch)
tree6b476214405765c55709f1cfa74ebf333a0264f7
parent175b7e29e2e1076add453e1d1dd758ddfcc23811 (diff)
downloaduca-f83189da7a96f19d7186e623426b39bafed0c714.tar.gz
uca-f83189da7a96f19d7186e623426b39bafed0c714.tar.bz2
uca-f83189da7a96f19d7186e623426b39bafed0c714.tar.xz
uca-f83189da7a96f19d7186e623426b39bafed0c714.zip
tango: provide an "image" attribute
-rwxr-xr-xtango/Uca8
1 files changed, 7 insertions, 1 deletions
diff --git a/tango/Uca b/tango/Uca
index f08ef20..4ba7108 100755
--- a/tango/Uca
+++ b/tango/Uca
@@ -6,7 +6,7 @@ import numpy as np
import PyTango
from gi.repository import Uca, GObject
from PyTango import Attr, AttrWriteType, DevState
-from PyTango.server import Device, DeviceMeta, device_property, command, server_run
+from PyTango.server import Device, DeviceMeta, attribute, device_property, command, server_run
try:
import tifffile
@@ -65,6 +65,9 @@ class Camera(Device):
camera = device_property(dtype=str, default_value='mock')
+ image = attribute(label="Image", dtype=[[np.uint16]],
+ max_dim_x=4096, max_dim_y=4096)
+
def init_device(self):
Device.init_device(self)
self.set_state(DevState.ON)
@@ -123,6 +126,9 @@ class Camera(Device):
else:
np.savez(open(path, 'wb'), frame)
+ def read_image(self):
+ return self.grab()
+
if __name__ == '__main__':
server_run((Camera,))