def validateCommand(self, runId: str, command: ControlCommand) -> CommandResponse: """ Validates the given command Args: runId (str): unique id for this command command (ControlCommand): contains the command Returns: CommandResponse a subclass of CommandResponse (only Accepted, Invalid or Locked are allowed) """ return Accepted(runId)
def validateCommand(self, runId: str, command: ControlCommand) -> CommandResponse: """ Overrides the base class validate method to verify that the given command is valid. Args: runId (str): unique id for this command command (ControlCommand): contains the ControlCommand from CSW Returns: CommandResponse an instance of one of these command responses: Accepted, Invalid, Locked (OnewayResponse in CSW) """ return Accepted(runId)
def validateCommand(self, runId: str, command: ControlCommand) -> CommandResponse: """ Overrides the base class validate method to verify that the given command is valid. Args: runId (str): unique id for this command command (ControlCommand): contains the command Returns: CommandResponse a subclass of CommandResponse (only Accepted, Invalid or Locked are allowed) """ return Accepted(runId)
def onOneway(self, runId: str, command: ControlCommand) -> CommandResponse: """ Overrides the base class onOneway method to handle commands from a CSW component. Args: runId (str): unique id for this command command (ControlCommand): contains the ControlCommand from CSW Returns: CommandResponse an instance of one of these command responses: Accepted, Invalid, Locked (OnewayResponse in CSW) """ n = len(command.paramSet) print(f"MyComponentHandlers Received oneway {str(command)} with {n} params") # filt = command.get("filter").values[0] # encoder = command.get("encoder").values[0] # print(f"filter = {filt}, encoder = {encoder}") return Accepted(runId)