Source code for laborchestrator.sila_server.generated.simulationcontroller.simulationcontroller_base
# Generated by sila2.code_generator; sila2.__version__: 0.10.3
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING
from sila2.server import FeatureImplementationBase, MetadataDict
from .simulationcontroller_types import StartRealMode_Responses, StartSimulationMode_Responses
if TYPE_CHECKING:
from ...server import Server
[docs]
class SimulationControllerBase(FeatureImplementationBase, ABC):
parent_server: Server
def __init__(self, parent_server: Server):
"""
This Feature provides control over the simulation behaviour of a SiLA Server.
A SiLA Server can run in two modes:
(a) Real Mode - with real activities, e.g. addressing or controlling real hardware, e.g. through serial/CANBus commands,
writing to real databases, moving real objects etc.
(b) Simulation Mode - where every command is only simulated and responses are just example returns.
Note that certain commands and properties might not be affected by this feature if they
do not interact with the real world.
"""
super().__init__(parent_server=parent_server)
[docs]
@abstractmethod
def get_SimulationMode(self, *, metadata: MetadataDict) -> bool:
"""
Indication whether SiLA Server is in Simulation Mode or not.
:param metadata: The SiLA Client Metadata attached to the call
:return: Indication whether SiLA Server is in Simulation Mode or not.
"""
pass
[docs]
@abstractmethod
def StartSimulationMode(self, *, metadata: MetadataDict) -> StartSimulationMode_Responses:
"""
Sets the SiLA Server to run in Simulation Mode, i.e. all following commands are executed in simulation mode.
The Simulation Mode can only be entered, if all hardware operations have been safely terminated
or are in a controlled, safe state.
The simulation mode can be stopped by issuing the 'Start Real Mode' command.
:param metadata: The SiLA Client Metadata attached to the call
"""
pass
[docs]
@abstractmethod
def StartRealMode(self, *, metadata: MetadataDict) -> StartRealMode_Responses:
"""
Sets the SiLA Server to run in real mode, i.e. all following commands are executed with real-world
interactions, like serial port/CAN communication, motor actions etc.
If the server is in Simulation Mode it can be interrupted at any time. A re-initialization of
the hardware might be required. The Real Mode can be stopped by issuing the 'Start Simulation Mode' command.
:param metadata: The SiLA Client Metadata attached to the call
"""
pass