File: RepRapFlavorParser.py

package info (click to toggle)
cura 5.0.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 122,888 kB
  • sloc: python: 44,572; sh: 81; xml: 32; makefile: 16
file content (38 lines) | stat: -rw-r--r-- 1,137 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.

from . import FlavorParser


class RepRapFlavorParser(FlavorParser.FlavorParser):
    """This parser is intended to interpret the RepRap Firmware g-code flavor."""


    def __init__(self):
        super().__init__()

    def processMCode(self, M, line, position, path):
        if M == 82:
            # Set absolute extrusion mode
            self._is_absolute_extrusion = True
        elif M == 83:
            # Set relative extrusion mode
            self._is_absolute_extrusion = False

    def _gCode90(self, position, params, path):
        """Set the absolute positioning

        RepRapFlavor code G90 sets position of X, Y, Z to absolute
        For absolute E, M82 is used
        """
        self._is_absolute_positioning = True
        return position

    def _gCode91(self, position, params, path):
        """Set the relative positioning

        RepRapFlavor code G91 sets position of X, Y, Z to relative
        For relative E, M83 is used
        """
        self._is_absolute_positioning = False
        return position