コード例 #1
0
    def __init__(self, ctrl):
        self.ctrl = ctrl

        config = {
            "Logitech Logitech RumblePad 2 USB": {
                "deadband": 0.1,
                "axes": [ABS_X, ABS_Y, ABS_RZ, ABS_Z],
                "dir": [1, -1, -1, 1],
                "arrows": [ABS_HAT0X, ABS_HAT0Y],
                "speed": [0x120, 0x121, 0x122, 0x123],
                "lock": [0x124, 0x125],
            },
            "default": {
                "deadband": 0.1,
                "axes": [ABS_X, ABS_Y, ABS_RY, ABS_RX],
                "dir": [1, -1, -1, 1],
                "arrows": [ABS_HAT0X, ABS_HAT0Y],
                "speed": [0x133, 0x130, 0x131, 0x134],
                "lock": [0x136, 0x137],
            }
        }

        super().__init__(config)

        self.v = [0.0] * 4
        self.lastV = self.v
        self.callback()

        self.processor = inevent.InEvent(ctrl.ioloop, self, types=['js'])
コード例 #2
0
    def __init__(self, ctrl):
        super().__init__(ctrl.log.get('JogHandler'))

        self.ctrl = ctrl
        self.log = ctrl.log.get('Jog')

        self.v = [0.0] * 4
        self.lastV = self.v
        self.callback()

        self.processor = inevent.InEvent(ctrl.ioloop,
                                         self,
                                         types=['js'],
                                         log=ctrl.log.get('InEvent'))
コード例 #3
0
ファイル: Jog.py プロジェクト: myCNCmaking/bbctrl-firmware
    def __init__(self, ctrl):
        self.ctrl = ctrl

        config = {
            "deadband": 0.1,
            "axes": [ABS_X, ABS_Y, ABS_RZ, ABS_Z],
            "arrows": [ABS_HAT0X, ABS_HAT0Y],
            "speed": [0x120, 0x121, 0x122, 0x123],
            "activate": [0x124, 0x126, 0x125, 0x127],
            }

        super().__init__(config)

        self.v = [0.0] * 4
        self.lastV = self.v
        self.callback()

        self.processor = inevent.InEvent(ctrl.ioloop, self,
                                         types = "js kbd".split())