Source code for imageSourcePy.CameraImageSourceMdl

#############################################################################
# Author: parenti
# Created on April 5, 2024, 08:30 AM
# Copyright (C) European XFEL GmbH Schenefeld. All rights reserved.
#############################################################################

from karabo.middlelayer import AccessMode, Hash, VectorString, slot

from ._version import version as deviceVersion
from .ImageSourceMdl import ImageSource
from .scenes import get_scene


[docs]class CameraImageSource(ImageSource): """ Base class for camera devices. It is derived from the ImageSource class, and provides a default scene. """ # provide version for classVersion property __version__ = deviceVersion availableScenes = VectorString( displayedName="Available Scenes", displayType="Scenes", accessMode=AccessMode.READONLY, defaultValue=["scene"]) interfaces = VectorString( displayedName="Abstract Interfaces", description="The names of the interfaces device complies with", defaultValue=["Camera"], accessMode=AccessMode.READONLY)
[docs] @slot def requestScene(self, params): """Fulfill a scene request from another device. """ payload = Hash("success", False) name = params.get("name", default="scene") if name == "scene": payload.set("success", True) payload.set("name", name) payload.set("data", get_scene(self.deviceId)) return Hash("type", "deviceScene", "origin", self.deviceId, "payload", payload)