Пример #1
0
    def checkRelayChannel(channel):
        """Check that the digital channel number is valid.
        Verify that the channel number is one of the legal channel numbers.
        Channel numbers are 0-based.

        :param channel: The channel number to check.
        """
        if not hal.checkRelayChannel(channel):
            raise IndexError("Requested relay channel number %d is out of range [0, %d)." % (channel, SensorUtil.kRelayChannels))
Пример #2
0
    def checkRelayChannel(channel: int) -> None:
        """Check that the digital channel number is valid.
        Verify that the channel number is one of the legal channel numbers.
        Channel numbers are 0-based.

        :param channel: The channel number to check.
        """
        if not hal.checkRelayChannel(channel):
            raise IndexError(
                "Requested relay channel number %d is out of range [0, %d)."
                % (channel, SensorUtil.kRelayChannels)
            )