Exemplo n.º 1
0
    def get(self) -> Value:
        """Read the current value of the solenoid.

        :returns: The current value of the solenoid.
        """
        if hal.getSolenoid(self.forwardHandle):
            return self.Value.kForward
        if hal.getSolenoid(self.reverseHandle):
            return self.Value.kReverse
        return self.Value.kOff
Exemplo n.º 2
0
    def get(self):
        """Read the current value of the solenoid.

        :returns: The current value of the solenoid.
        :rtype: :class:`DoubleSolenoid.Value`
        """
        if hal.getSolenoid(self.forwardHandle):
            return self.Value.kForward
        if hal.getSolenoid(self.reverseHandle):
            return self.Value.kReverse
        return self.Value.kOff
Exemplo n.º 3
0
    def get(self):
        """Read the current value of the solenoid.

        :returns: The current value of the solenoid.
        :rtype: :class:`DoubleSolenoid.Value`
        """
        if hal.getSolenoid(self.forwardPort):
            return self.Value.kForward
        if hal.getSolenoid(self.reversePort):
            return self.Value.kReverse
        return self.Value.kOff
Exemplo n.º 4
0
    def get(self):
        """Read the current value of the solenoid.

        :returns: True if the solenoid output is on or false if the solenoid output is off.
        :rtype: bool
        """
        return hal.getSolenoid(self.solenoidHandle)
Exemplo n.º 5
0
    def get(self):
        """Read the current value of the solenoid.

        :returns: The current value of the solenoid.
        :rtype: bool
        """
        return hal.getSolenoid(self.port)
Exemplo n.º 6
0
    def get(self):
        """Read the current value of the solenoid.

        :returns: True if the solenoid output is on or false if the solenoid output is off.
        :rtype: bool
        """
        return hal.getSolenoid(self.solenoidHandle)
Exemplo n.º 7
0
    def get(self):
        """Read the current value of the solenoid.

        :returns: The current value of the solenoid.
        :rtype: bool
        """
        with self.mutex:
            return hal.getSolenoid(self.port)
Exemplo n.º 8
0
    def getAll(self):
        """Read all 8 solenoids from the module used by this solenoid as a
        single byte.

        :returns: The current value of all 8 solenoids on this module.
        """
        with self.mutex:
            value = 0
            for i in range(SensorBase.kSolenoidChannels):
                value |= (1 if hal.getSolenoid(self.ports[i]) else 0) << i
            return value
Exemplo n.º 9
0
    def getAll(self):
        """Read all 8 solenoids from the module used by this solenoid as a
        single byte.

        :returns: The current value of all 8 solenoids on this module.
        """
        with self.mutex:
            value = 0
            for i in range(SensorBase.kSolenoidChannels):
                value |= (1 if hal.getSolenoid(self.ports[i]) else 0) << i
            return value
Exemplo n.º 10
0
 def get(self):
     return hal.getSolenoid(self.solenoidHandle)