<commit_before># Touchy is Copyright (c) 2009  <NAME> <<EMAIL>>
#
# Touchy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Touchy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.



# self.mcodes = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 30, 48, 49, 50, 51,
#                52, 53, 60, 61, 62, 63, 64, 65, 66, 67, 68)
# 
# self.gcodes = (0, 10, 20, 30, 40, 50, 51, 52, 53, 70, 80, 100,
#                170, 171, 180, 181, 190, 191, 200, 210, 280, 281,
#                300, 301, 330, 331, 382, 383, 384, 385, 400, 410,
#                411, 420, 421, 430, 431, 490, 530, 540, 550, 560,
#                570, 580, 590, 591, 592, 593, 610, 611, 640, 730,
#                760, 800, 810, 820, 830, 840, 850, 860, 870, 880,
#                890, 900, 901, 910, 911, 920, 921, 922, 923, 930,
#                940, 950, 960, 970, 980, 990)

class mdi:
    def __init__(self, emc):
        self.clear()
        self.emc = emc
        self.emcstat = emc.stat()
        self.emccommand = emc.command()

        self.emcstat.poll()
        am = self.emcstat.axis_mask

        self.axes = []
        self.polar = 0
        axisnames = ['X', 'Y', 'Z', 'A', 'B', 'C', 'U', 'V', 'W']
        for i in range(9):
           if am & (1<<i):
               self.axes.append(axisnames[i])

        self.gcode = 'M2'

        self.codes = {
            'M3' : [_('Spindle CW'), 'S'],
            'M4' : [_('Spindle CCW'), 'S'],
            'M6' : [_('Tool change'), 'T'],
            'M66' : [_('Input control'), 'P', 'E', 'L', 'Q'],

            # 'A' means 'the axes'
            'G0' : [_('Straight rapid'), 'A'],
            'G00' : [_('Straight rapid'), 'A'],
            'G1' : [_('Straight feed'), 'A', 'F'],
            'G01' : [_('Straight feed'), 'A', 'F'],
            'G2' : [_('Arc CW'), 'A', 'I', 'J', 'K', 'R', 'F'],
            'G02' : [_('Arc CW'), 'A', 'I', 'J', 'K', 'R', 'F'],
            'G3' : [_('Arc CCW'), 'A', 'I', 'J', 'K', 'R', 'F'],
            'G03' : [_('Arc CCW'), 'A', 'I', 'J', 'K', 'R', 'F'],<commit_msg>Touchy: MDI support for M61<commit_after># Touchy is Copyright (c) 2009  <NAME> <<EMAIL>>
#
# Touchy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Touchy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.



# self.mcodes = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 30, 48, 49, 50, 51,
#                52, 53, 60, 61, 62, 63, 64, 65, 66, 67, 68)
# 
# self.gcodes = (0, 10, 20, 30, 40, 50, 51, 52, 53, 70, 80, 100,
#                170, 171, 180, 181, 190, 191, 200, 210, 280, 281,
#                300, 301, 330, 331, 382, 383, 384, 385, 400, 410,
#                411, 420, 421, 430, 431, 490, 530, 540, 550, 560,
#                570, 580, 590, 591, 592, 593, 610, 611, 640, 730,
#                760, 800, 810, 820, 830, 840, 850, 860, 870, 880,
#                890, 900, 901, 910, 911, 920, 921, 922, 923, 930,
#                940, 950, 960, 970, 980, 990)

class mdi:
    def __init__(self, emc):
        self.clear()
        self.emc = emc
        self.emcstat = emc.stat()
        self.emccommand = emc.command()

        self.emcstat.poll()
        am = self.emcstat.axis_mask

        self.axes = []
        self.polar = 0
        axisnames = ['X', 'Y', 'Z', 'A', 'B', 'C', 'U', 'V', 'W']
        for i in range(9):
           if am & (1<<i):
               self.axes.append(axisnames[i])

        self.gcode = 'M2'

        self.codes = {
            'M3' : [_('Spindle CW'), 'S'],
            'M4' : [_('Spindle CCW'), 'S'],
            'M6' : [_('Tool change'), 'T'],
            'M61' : [_('Set tool number'), 'Q'],
            'M66' : [_('Input control'), 'P', 'E', 'L', 'Q'],

            # 'A' means 'the axes'
            'G0' : [_('Straight rapid'), 'A'],
            'G00' : [_('Straight rapid'), 'A'],
            'G1' : [_('Straight feed'), 'A', 'F'],
            'G01' : [_('Straight feed'), 'A', 'F'],
            'G2' : [_('Arc CW'), 'A', 'I', 'J', 'K', 'R', 'F'],
            'G02' : [_('Arc CW'), 'A', 'I', 'J', 'K', 'R', 'F'],
            'G3' : [_('Arc CCW'), 'A', 'I', 'J', 'K', 'R', 'F'],
            'G03' : [_('Arc CCW'), 'A', 'I', 'J', 'K', 'R', 'F'],
{'fraction_non_alphanumeric': 0.19946091644204852, 'fraction_numerical': 0.12108646070910221, 'mean_word_length': 2.009357454772302, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 28, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2738207', 'n_tokens_mistral': 2306, 'n_tokens_neox': 1750, 'n_words': 622}