mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
CURA-4552 Change names as indicated in the review and making Marlin the
default flavor. Also fix the case in which the read flavor was not in the dict.
This commit is contained in:
parent
cab2e14728
commit
8054bc3d7d
5 changed files with 26 additions and 20 deletions
32
plugins/GCodeReader/RepRapFlavorParser.py
Normal file
32
plugins/GCodeReader/RepRapFlavorParser.py
Normal file
|
@ -0,0 +1,32 @@
|
|||
# Copyright (c) 2017 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from . import FlavorParser
|
||||
|
||||
# This parser is intented for interpret the RepRap Firmware flavor
|
||||
class RepRapFlavorParser(FlavorParser.FlavorParser):
|
||||
|
||||
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
|
||||
|
||||
## Set the absolute positioning
|
||||
# RepRapFlavor code G90 sets position of X, Y, Z, and E to absolute
|
||||
def _gCode90(self, position, params, path):
|
||||
self._is_absolute_positioning = True
|
||||
self._is_absolute_extrusion = True
|
||||
return position
|
||||
|
||||
## Set the relative positioning
|
||||
# RepRapFlavor code G91 sets position of X, Y, Z to relative
|
||||
# For relative E, M83 is used
|
||||
def _gCode91(self, position, params, path):
|
||||
self._is_absolute_positioning = False
|
||||
return position
|
Loading…
Add table
Add a link
Reference in a new issue