Print 'unknown G/M code' warnings to console once
parent
0bb17818e1
commit
957213321e
|
@ -72,6 +72,8 @@ class gcode(object):
|
||||||
pathType = 'CUSTOM';
|
pathType = 'CUSTOM';
|
||||||
startCodeDone = False
|
startCodeDone = False
|
||||||
currentLayer = []
|
currentLayer = []
|
||||||
|
unknownGcodes={}
|
||||||
|
unknownMcodes={}
|
||||||
currentPath = gcodePath('move', pathType, layerThickness, pos.copy())
|
currentPath = gcodePath('move', pathType, layerThickness, pos.copy())
|
||||||
currentPath.list[0].e = totalExtrusion
|
currentPath.list[0].e = totalExtrusion
|
||||||
currentPath.list[0].extrudeAmountMultiply = extrudeAmountMultiply
|
currentPath.list[0].extrudeAmountMultiply = extrudeAmountMultiply
|
||||||
|
@ -220,7 +222,9 @@ class gcode(object):
|
||||||
if z is not None:
|
if z is not None:
|
||||||
posOffset.z = pos.z - z
|
posOffset.z = pos.z - z
|
||||||
else:
|
else:
|
||||||
print "Unknown G code:" + str(G)
|
if G not in unknownGcodes:
|
||||||
|
print "Unknown G code:" + str(G)
|
||||||
|
unknownGcodes[G] = True
|
||||||
else:
|
else:
|
||||||
M = self.getCodeInt(line, 'M')
|
M = self.getCodeInt(line, 'M')
|
||||||
if M is not None:
|
if M is not None:
|
||||||
|
@ -267,7 +271,9 @@ class gcode(object):
|
||||||
if s != None:
|
if s != None:
|
||||||
extrudeAmountMultiply = s / 100.0
|
extrudeAmountMultiply = s / 100.0
|
||||||
else:
|
else:
|
||||||
print "Unknown M code:" + str(M)
|
if M not in unknownMcodes:
|
||||||
|
print "Unknown M code:" + str(M)
|
||||||
|
unknownMcodes[M] = True
|
||||||
self.layerList.append(currentLayer)
|
self.layerList.append(currentLayer)
|
||||||
self.extrusionAmount = maxExtrusion
|
self.extrusionAmount = maxExtrusion
|
||||||
self.totalMoveTimeMinute = totalMoveTimeMinute
|
self.totalMoveTimeMinute = totalMoveTimeMinute
|
||||||
|
|
Loading…
Reference in New Issue