fastcs-pandablocks 0.2.0a3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ from ._version import __version__
2
+
3
+ __all__ = ["__version__"]
@@ -0,0 +1,9 @@
1
+ """Interface for ``python -m fastcs_pandablocks``."""
2
+
3
+ from fastcs.launch import launch
4
+
5
+ from fastcs_pandablocks.panda.panda_controller import PandaController
6
+
7
+ from ._version import __version__
8
+
9
+ launch(PandaController, version=__version__)
@@ -0,0 +1,34 @@
1
+ # file generated by setuptools-scm
2
+ # don't change, don't track in version control
3
+
4
+ __all__ = [
5
+ "__version__",
6
+ "__version_tuple__",
7
+ "version",
8
+ "version_tuple",
9
+ "__commit_id__",
10
+ "commit_id",
11
+ ]
12
+
13
+ TYPE_CHECKING = False
14
+ if TYPE_CHECKING:
15
+ from typing import Tuple
16
+ from typing import Union
17
+
18
+ VERSION_TUPLE = Tuple[Union[int, str], ...]
19
+ COMMIT_ID = Union[str, None]
20
+ else:
21
+ VERSION_TUPLE = object
22
+ COMMIT_ID = object
23
+
24
+ version: str
25
+ __version__: str
26
+ __version_tuple__: VERSION_TUPLE
27
+ version_tuple: VERSION_TUPLE
28
+ commit_id: COMMIT_ID
29
+ __commit_id__: COMMIT_ID
30
+
31
+ __version__ = version = '0.2.0a3'
32
+ __version_tuple__ = version_tuple = (0, 2, 0, 'a3')
33
+
34
+ __commit_id__ = commit_id = None
File without changes
@@ -0,0 +1,4 @@
1
+ from .block_controller import BlockController
2
+ from .blocks import Blocks
3
+
4
+ __all__ = ["Blocks", "BlockController"]
@@ -0,0 +1,48 @@
1
+ from collections.abc import Callable, Coroutine
2
+ from typing import Any
3
+
4
+ from fastcs.attributes import Attribute, AttrR
5
+ from fastcs.controllers import Controller, ControllerVector
6
+ from fastcs.datatypes import DataType, String
7
+
8
+ from fastcs_pandablocks.types import PandaName
9
+
10
+
11
+ class BlockControllerVector(ControllerVector):
12
+ """Vector containing numbered panda blocks."""
13
+
14
+
15
+ class BlockController(Controller):
16
+ """Controller for handling a panda block."""
17
+
18
+ def __init__(
19
+ self,
20
+ panda_name: PandaName,
21
+ put_value_to_panda: Callable[
22
+ [PandaName, DataType, Any], Coroutine[None, None, None]
23
+ ],
24
+ label: str | None = None,
25
+ ios: list | None = None,
26
+ ):
27
+ self.description = label
28
+ self.panda_name = panda_name
29
+ self.put_value_to_panda = put_value_to_panda
30
+
31
+ self.panda_name_to_attribute: dict[PandaName, Attribute] = {}
32
+
33
+ super().__init__(ios=ios)
34
+
35
+ async def initialise(self):
36
+ if self.description is not None:
37
+ self.add_attribute(
38
+ PandaName("LABEL"),
39
+ AttrR(
40
+ String(),
41
+ description="Label from metadata.",
42
+ initial_value=self.description,
43
+ ),
44
+ )
45
+
46
+ def add_attribute(self, name: PandaName, attr: Attribute) -> None:
47
+ self.panda_name_to_attribute[name] = attr
48
+ super().add_attribute(name.attribute_name, attr)