def pl_send_new_data(self, block_name, time_line, data): """ This function is called by plugins to send new data for a single block. :param block_name: Name of the block :param time_line: A time vector :param data: Data containing the values in a hash array of signal names as key. :return: """ if not isinstance(time_line, list): raise pe.WrongType("time", list) if not isinstance(data, dict): raise pe.WrongType("data", dict) dataHash = data dataHash[CORE_TIME_SIGNAL] = time_line opt = DOptionalData(DATA=dataHash) opt.data_source_id = self.__id__ opt.block_name = block_name event = Event.data.NewData(self.__id__, 0, opt, None) self._Core_event_queue__.put(event)
def pl_send_new_data(self, block_name, time_line, data): """ This function is called by plugins to send new data for a single block. :param block_name: Name of the block :param time_line: A time vector :param data: Data containing the values in a hash array of signal names as key. :return: """ if not isinstance(time_line, list): raise pe.WrongType("time", list) if not isinstance(data, dict): raise pe.WrongType("data", dict) dataHash = data dataHash[CORE_TIME_SIGNAL] = time_line opt = DOptionalData(DATA = dataHash) opt.data_source_id = self.__id__ opt.block_name = block_name event = Event.data.NewData(self.__id__, 0, opt, None) self._Core_event_queue__.put(event)
def _send_parameter_change(self, data, block): """ Internal function, should be not directly used anymore. :param data: :param block: :return: """ opt = DOptionalData(DATA=data) opt.data_source_id = self.__id__ opt.is_parameter = True if isinstance(block, DBlock) is False and isinstance(block, str) is False: raise pe.WrongType("block", [DBlock, str]) if isinstance(block, DBlock): opt.block_name = block.name if isinstance(block, str): opt.block_name = block event = Event.data.NewData(self.__id__, 0, opt, None) self._Core_event_queue__.put(event)
def _send_parameter_change(self, data, block): """ Internal function, should be not directly used anymore. :param data: :param block: :return: """ opt = DOptionalData(DATA=data) opt.data_source_id = self.__id__ opt.is_parameter = True if isinstance(block, DBlock) is False and isinstance(block, str) is False: raise pe.WrongType("block", [DBlock, str]) if isinstance(block, DBlock): opt.block_name = block.name if isinstance(block, str): opt.block_name = block event = Event.data.NewData(self.__id__, 0, opt, None) self._Core_event_queue__.put(event)