Example #1
0
    def pl_send_new_parameter_list(self, parameters):
        """
        Used to inform the PaPI framework about all DParameters provided by this plugins.

        :param parameters: List of DParameters
        :return:
        """

        if not isinstance(parameters, list):
            raise pe.WrongType("parameters", list)

        if len(parameters) == 0:
            raise pe.WrongLength("parameters", len(parameters), ">0")

        parameter_list_to_send = [
        ]  # The callback handler cannot be send over process boundaries, so we need to remove it before sending
        for i in range(len(parameters)):
            parameter = parameters[i]
            if not isinstance(parameter, DParameter):
                raise pe.WrongType('parameters[' + str(i) + ']', DParameter)

            self.__plugin_parameter_list[parameter.name] = parameter
            tmp_parameter = copy.copy(parameter)
            tmp_parameter.callback_function_handler = None
            parameter_list_to_send.append(tmp_parameter)

        opt = DOptionalData()
        opt.parameter_list = parameter_list_to_send

        event = Event.data.NewParameter(self.__id__, 0, opt)
        self._Core_event_queue__.put(event)
Example #2
0
    def pl_send_new_event_list(self, events):
        """
        Used to inform the PaPI framework about all DEvents provided by this plugins.

        :param events: List of DEvents
        :return:
        """

        if not isinstance(events, list):
            raise pe.WrongType("events", list)

        if len(events) == 0:
            raise pe.WrongLength("events", len(events), ">0")

        for i in range(len(events)):
            event = events[i]
            if not isinstance(event, DEvent):
                raise pe.WrongType('events[' + str(i) + ']', DEvent)

        self.pl_send_new_block_list(events)
Example #3
0
    def pl_send_new_block_list(self, blocks):
        """
        Used to inform the PaPI framework about all DBlocks provided by this plugins.

        :param blocks: List of DBlocks
        :return:
        """

        if not isinstance(blocks, list):
            raise pe.WrongType("blocks", list)

        if len(blocks) == 0:
            raise pe.WrongLength("blocks", len(blocks), ">0")

        for i in range(len(blocks)):
            block = blocks[i]
            if not isinstance(block, DBlock):
                raise pe.WrongType('blocks[' + str(i) + ']', DBlock)

        opt = DOptionalData()
        opt.block_list = blocks
        event = Event.data.NewBlock(self.__id__, 0, opt)
        self._Core_event_queue__.put(event)
Example #4
0
    def pl_send_new_parameter_list(self, parameters):
        """
        Used to inform the PaPI framework about all DParameters provided by this plugins.

        :param parameters: List of DParameters
        :return:
        """

        if not isinstance(parameters, list):
            raise pe.WrongType("parameters", list)

        if len(parameters) == 0:
            raise pe.WrongLength("parameters", len(parameters), ">0")

        for i in range(len(parameters)):
            parameter = parameters[i]
            if not isinstance(parameter, DParameter):
                raise pe.WrongType('parameters[' + str(i) + ']', DParameter)

        opt = DOptionalData()
        opt.parameter_list = parameters

        event = Event.data.NewParameter(self.__id__, 0, opt)
        self._Core_event_queue__.put(event)