Skip to content
Snippets Groups Projects
Commit 5198cc30 authored by Auke Klazema's avatar Auke Klazema
Browse files

SW-705: Fix mising function

parent d50a48da
Branches
No related tags found
No related merge requests found
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
import logging import logging
from lofar.messaging.rpc import RPCClient, RPCClientContextManagerMixin from lofar.messaging import RPCClient, RPCClientContextManagerMixin, DEFAULT_BUSNAME, \
DEFAULT_BROKER, DEFAULT_RPC_TIMEOUT
from lofar.mac.config import DEFAULT_OBSERVATION_CONTROL_SERVICE_NAME from lofar.mac.config import DEFAULT_OBSERVATION_CONTROL_SERVICE_NAME
''' Simple RPC client for Service ObservationControl2 ''' Simple RPC client for Service ObservationControl2
...@@ -34,5 +35,12 @@ class ObservationControlRPCClient(RPCClientContextManagerMixin): ...@@ -34,5 +35,12 @@ class ObservationControlRPCClient(RPCClientContextManagerMixin):
super().__init__() super().__init__()
self._rpc_client = rpc_client self._rpc_client = rpc_client
@staticmethod
def create(exchange=DEFAULT_BUSNAME, broker=DEFAULT_BROKER, timeout=DEFAULT_RPC_TIMEOUT):
"""Create a OTDBRPC connecting to the given exchange/broker on the default DEFAULT_OTDB_SERVICENAME service"""
return ObservationControlRPCClient(
RPCClient(service_name=DEFAULT_OBSERVATION_CONTROL_SERVICE_NAME,
exchange=exchange, broker=broker, timeout=timeout))
def abort_observation(self, sas_id): def abort_observation(self, sas_id):
return self._rpc_client.execute('AbortObservation', sas_id=sas_id) return self._rpc_client.execute('AbortObservation', sas_id=sas_id)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment