示例#1
0
    def execute_get_metadata(self, channels=None, *args, **kwargs):
        """
        Returns metadata.

        TODO NOTE: metadata aspect not yet specified in the framework. This
        method is just a quick implementation to exercise the functionality
        provided by the underlying TrhphClient.

        @param channels List of channel names to get metadata from, by default
                        [TrhphChannel.INSTRUMENT]
        @retval Dict of channels and metadata outputs
        """

        # NOTE code written in a way that eventually can be moved to parent
        # class with no or minimal changes.

        channels = channels or [TrhphChannel.INSTRUMENT]

        mi_logger.debug("Issuing base execute_get_metadata...")
        (result, valid_channels) = self._check_channel_args(channels)

        for channel in valid_channels:
            proto = self.chan_map[channel]
            result[channel] = proto.execute_get_metadata(*args,
                                                         **kwargs)

        return result
示例#2
0
    def execute_get_power_statuses(self, channels=None, *args, **kwargs):
        """
        Gets the power statuses.

        @param channels List of channel names to execute the operation to,
                by default [TrhphChannel.INSTRUMENT].
        @param timeout Timeout for the wait, self._timeout by default.
        @retval a dict of power statuses per channel
        @throws TimeoutException
        """

        channels = channels or [TrhphChannel.INSTRUMENT]

        mi_logger.debug("Issuing base execute_diagnostics...")
        (result, valid_channels) = self._check_channel_args(channels)

        for channel in valid_channels:
            proto = self.chan_map[channel]
            result[channel] = proto.execute_get_power_statuses(*args,
                                                               **kwargs)

        return result
示例#3
0
    def execute_diagnostics(self, channels=None, num_scans=5, *args, **kwargs):
        """
        Executes the diagnostics operation.

        @param channels List of channel names to execute the operation to,
                by default [TrhphChannel.INSTRUMENT].
        @param num_scans the number of scans for the operation, 5 by default.
        @param timeout Timeout for the wait, self._timeout by default.
        @retval a list of rows, one with values per scan
        @throws TimeoutException
        """

        channels = channels or [TrhphChannel.INSTRUMENT]

        mi_logger.debug("Issuing base execute_diagnostics...")
        (result, valid_channels) = self._check_channel_args(channels)

        for channel in valid_channels:
            proto = self.chan_map[channel]
            result[channel] = proto.execute_diagnostics(num_scans, *args,
                                                        **kwargs)

        return result