/
__init__.py
720 lines (601 loc) · 26.1 KB
/
__init__.py
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
# coding=utf-8
"""OctoPrint plugin adding the ability to prevent printing in rectangular or circular regions."""
# Thoughts on improvements:
# - Add a way to persist the defined regions for the selected file and restore them if the file
# is selected again later?
# - Perhaps add comments into the gcode file itself to define the regions?
# Could possibly add comments that could be used by the cancelobject plugin
# - If stored as metadata, make sure to compare file hash to ensure it's the same file data
#
# - Figure out a way to determine we've reached the end script and should no longer exclude moves?
# Likewise, a similar setting for determining when the start gcode has finished.
# Perhaps use a similar method to the Cancel Object plugin, which processes the file when it's
# uploaded to find specific comment markers and adds @-commands at that point
#
# - Is a setting needed for controlling how big a retraction is recorded as one that needs to be
# recovered after exiting an excluded region (e.g. ignore small retractions like E-0.03)?
# What could a reasonable limit be for the default?
#
# - Interpret M207 / M208 - Firmware retraction settings?
#
# - Add support for multiple extruders? (gcode cmd: "T#" - selects tool #) Each tool should
# have its own extruder position/axis. What about the other axes?
# Each tool has its own offsets and x axis position
# From Marlin source (Marlin_main.cpp:11201):
# current_position[Y_AXIS] -=
# hotend_offset[Y_AXIS][active_extruder] - hotend_offset[Y_AXIS][tmp_extruder];
# current_position[Z_AXIS] -=
# hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder];
from __future__ import absolute_import
import logging
import re
import flask
from flask_login import current_user
import pkg_resources
import octoprint.plugin
from octoprint.events import Events
from octoprint.settings import settings
from .GcodeHandlers import GcodeHandlers
from .ExcludeRegionState import ExcludeRegionState
from .RectangularRegion import RectangularRegion
from .CircularRegion import CircularRegion
from .ExcludedGcode import ExcludedGcode, EXCLUDE_ALL, EXCLUDE_MERGE
from .AtCommandAction import AtCommandAction, ENABLE_EXCLUSION, DISABLE_EXCLUSION
__plugin_name__ = "Exclude Region"
__plugin_implementation__ = None
__plugin_hooks__ = None
EXCLUDED_REGIONS_CHANGED = "ExcludedRegionsChanged"
LOG_MODE_OCTOPRINT = "octoprint"
LOG_MODE_DEDICATED = "dedicated"
LOG_MODE_BOTH = "both"
# Regex for splitting a string containing multiple lines of Gcode
# Per RS274/NGC, line separator can be CR, LF or CRLF
REGEX_SPLIT_GCODE_LINES = re.compile("\\r\\n|\\n|\\r")
# Regex for removing leading and trailing whitespace and comments starting with ";"
# Example: " M117 I like traffic lights; but not when they are red" -> "M117 I like traffic lights"
REGEX_TRIM_GCODE = re.compile("^\\s*([^;]*?)\\s*(?:;.*)?$")
# The following would permit semicolons in double-quote strings, as mentioned in the RepRap GCode
# documentation, but that doesn't seem to be supported by OctoPrint or Marlin.
# REGEX_TRIM_GCODE = re.compile("^\\s*((?:[^;\"]*?|\"(?:[^\"]|\"\")*\")*)\\s*(?:;.*)?$")
# It also appears that neither Octoprint nor Marlin support comments enclosed in parenthesis
# pylint: disable=global-statement
def __plugin_load__():
"""Initialize OctoPrint plugin meta properties."""
global __plugin_implementation__
__plugin_implementation__ = ExcludeRegionPlugin()
global __plugin_hooks__
__plugin_hooks__ = {
"octoprint.plugin.softwareupdate.check_config":
__plugin_implementation__.getUpdateInformation,
"octoprint.comm.protocol.atcommand.queuing":
__plugin_implementation__.handleAtCommandQueuing,
"octoprint.comm.protocol.gcode.queuing": __plugin_implementation__.handleGcodeQueuing
}
class ExcludeRegionPlugin( # pylint: disable=too-many-instance-attributes
octoprint.plugin.AssetPlugin,
octoprint.plugin.TemplatePlugin,
octoprint.plugin.SettingsPlugin,
octoprint.plugin.SimpleApiPlugin,
octoprint.plugin.EventHandlerPlugin
): # pylint: disable=too-many-ancestors
"""
OctoPrint plugin adding the ability to prevent printing in rectangular or circular regions.
Attributes
----------
clearRegionsAfterPrintFinishes : boolean
Whether to clear the exclusion regions after the next print completes or not. Populated
from the setting of the same name.
mayShrinkRegionsWhilePrinting : boolean
Whether exclude regions may be deleted or reduced in size when actively printing. Populated
from the setting of the same name.
_activePrintJob : boolean
Whether a print is currently in progress or not.
state : ExcludeRegionState
ExcludeRegionState instance for managing the current plugin state
gcodeHandlers : GcodeHandlers
GcodeHandlers instance providing the actual Gcode processing
"""
def __init__(self):
"""
Declare plugin-specific properties to satisfy pylint.
The actual initialization is performed by the initialize method.
"""
self._activePrintJob = None
self._loggingMode = None
self._pluginLoggingHandler = None
self.clearRegionsAfterPrintFinishes = None
self.mayShrinkRegionsWhilePrinting = None
self.state = None
self.gcodeHandlers = None
super(ExcludeRegionPlugin, self).__init__()
def initialize(self):
"""
Perform plugin initialization.
This method is automatically invoked by OctoPrint when the plugin is loaded, and is called
after all injected properties are populated.
"""
self._activePrintJob = False
self.state = ExcludeRegionState(self._logger)
self.gcodeHandlers = GcodeHandlers(self.state, self._logger)
self._handleSettingsUpdated()
self._notifyExcludedRegionsChanged()
self._logger.debug(
"Initialization complete: Installed plugin version=%s",
self._plugin_version
)
def getUpdateInformation(self):
"""Return the information necessary for OctoPrint to check for new plugin versions."""
return dict(
excluderegion=dict(
displayName=__plugin_name__,
displayVersion=self._plugin_version,
type="github_release",
user="bradcfisher",
repo="OctoPrint-ExcludeRegionPlugin",
current=self._plugin_version,
pip="https://github.com/bradcfisher/OctoPrint-ExcludeRegionPlugin/archive/{target_version}.zip" # nopep8
)
)
# ~~ AssetPlugin
def get_assets(self):
"""Define the static assets the plugin offers."""
octoprintVersion = pkg_resources.parse_version(octoprint.__version__)
jsFiles = ["js/excluderegion.js"]
# The modified gcode renderer is not needed for 1.3.10rc1 and above
if (octoprintVersion < pkg_resources.parse_version("1.3.10rc1")):
self._logger.info(
"Octoprint {} is pre 1.3.10rc1, including renderer.js to override gcode viewer",
octoprint.__display_version__
)
jsFiles.insert(0, "js/renderer.js")
return dict(
js=jsFiles,
css=["css/excluderegion.css"]
)
# ~~ TemplatePlugin
def get_template_configs(self):
"""Register the custom settings interface with OctoPrint."""
return [
dict(type="settings", custom_bindings=True)
]
# ~~ SettingsPlugin
def get_settings_defaults(self):
"""Return a dictionary of the default plugin settings."""
return dict(
clearRegionsAfterPrintFinishes=False,
mayShrinkRegionsWhilePrinting=False,
loggingMode=LOG_MODE_OCTOPRINT,
enteringExcludedRegionGcode=None,
exitingExcludedRegionGcode=None,
extendedExcludeGcodes=[
{
"gcode": "G4",
"mode": EXCLUDE_ALL,
"description": "Ignore all dwell commands in an excluded area to reduce " +
"delays while excluding"
},
{
"gcode": "M204",
"mode": EXCLUDE_MERGE,
"description": "Record default acceleration changes while excluding and " +
"apply the most recent values in a single command after " +
"exiting the excluded area"
},
{
"gcode": "M205",
"mode": EXCLUDE_MERGE,
"description": "Record advanced setting changes while excluding and apply " +
"the most recent values in a single command after exiting the " +
"excluded area"
}
],
atCommandActions=[
{
"command": "ExcludeRegion",
"parameterPattern": "^\\s*(enable|on)(\\s|$)",
"action": ENABLE_EXCLUSION,
"description": "Default action to enable exclusion"
},
{
"command": "ExcludeRegion",
"parameterPattern": "^\\s*(disable|off)(\\s|$)",
"action": DISABLE_EXCLUSION,
"description": "Default action to disable exclusion"
}
]
)
def get_settings_version(self):
"""Return the plugin settings version supported by this version of the plugin."""
return 1
def get_settings_preprocessors(self):
"""
Return setting preprocessors to invoke when setting/getting setting values.
This method defines preprocessors for setting the 'extendedExcludeGcodes' and
'atCommandActions' settings to ensure the lists are stored in sorted order.
"""
return (
# preprocessors for setters
{
"extendedExcludeGcodes":
lambda value: sorted(value, key=lambda item: item["gcode"].upper()),
"atCommandActions":
lambda value: sorted(value, key=lambda item: item["command"].upper())
},
# preprocessors for getters
{}
)
# ~~ SimpleApiPlugin
def get_api_commands(self):
"""
Define the POST command API endpoints for the plugin.
The following endpoints are defined:
/api/plugin/excluderegion/addExcludeRegion
------------------------------------------
Defines a new excluded region.
Example POST data to add a rectangular region:
.. code-block:: javascript
{
"type" : "RectangularRegion",
"x1" : 1,
"y1" : 1,
"x2" : 2,
"y2" : 2
}
Example POST data to add a circular region:
.. code-block:: javascript
{
"type" : "CircularRegion",
"cx" : 1,
"cy" : 1,
"r" : 1
}
/api/plugin/excluderegion/updateExcludeRegion
---------------------------------------------
Replaces an existing exclusion region with a new region. An error will be returned if
the specified id doesn't match an existing region.
Example POST data to update a region:
.. code-block:: javascript
{
"id" : "...uuid...",
"type" : "CircularRegion",
"cx" : 2,
"cy" : 2,
"r" : 1
}
/api/plugin/excluderegion/deleteExcludeRegion
---------------------------------------------
Delete the region with the specified id.
Example POST data to delete a region:
.. code-block:: javascript
{
"id" : "...uuid..."
}
"""
return dict(
addExcludeRegion=["type"],
updateExcludeRegion=["type", "id"],
deleteExcludeRegion=["id"],
)
def on_api_command(self, command, data):
"""Route API requests to their implementations."""
if current_user.is_anonymous():
return "Insufficient rights", 403
self._logger.debug("API command received: %s", data)
if (command == "deleteExcludeRegion"):
return self._handleDeleteExcludeRegion(data.get("id"))
else:
regionType = data.get("type")
if (regionType == "RectangularRegion"):
region = RectangularRegion(**data)
elif (regionType == "CircularRegion"):
region = CircularRegion(**data)
else:
return "Invalid type", 400
if (command == "addExcludeRegion"):
return self._handleAddExcludeRegion(region)
elif (command == "updateExcludeRegion"):
return self._handleUpdateExcludeRegion(region)
return "Invalid command", 400
def on_api_get(self, request):
"""
Generate response to GET request '/api/plugin/excluderegion'.
The response is encoded in JSON and has the following structure:
.. code-block:: javascript
{
"excluded_regions": [
{
"type": "RectangularRegion",
"id": "...uuid...",
"x1": 1, "y1": 1, "x2": 2, "y2": 2
},
{
"type": "CircularRegion",
"id": "...uuid...",
"cx": 1, "cy": 1, "r": 2
}
// etc ...
]
}
"""
return flask.jsonify(
excluded_regions=[region.toDict() for region in self.state.excludedRegions]
)
# ~~ EventHandlerPlugin
def on_event(self, event, payload):
"""
Intercept server events and perform any processing necessary.
Actions taken include:
- Remove all excluded regions when a new Gcode file is selected
- Reset the internal state when a new print is started
- Respond to setting updates
- Remove all excluded regions when printing completes (if configured to do so)
Parameters
----------
event : string
The event that occurred
payload : dict
Additional event data
"""
self._logger.debug("Event received: event=%s payload=%s", event, payload)
if (event == Events.FILE_SELECTED):
self._logger.info("File selected, resetting internal state")
self.state.resetState(True)
self._notifyExcludedRegionsChanged()
elif (event == Events.SETTINGS_UPDATED):
self._handleSettingsUpdated()
elif (event == Events.PRINT_STARTED):
self._logger.info("Printing started")
self.state.resetState()
self._activePrintJob = True
elif (event in (
Events.PRINT_DONE,
Events.PRINT_FAILED,
Events.PRINT_CANCELLING,
Events.PRINT_CANCELLED,
Events.ERROR
)):
self._logger.info("Printing stopped: event=%s", event)
self._activePrintJob = False
if (self.clearRegionsAfterPrintFinishes):
self.state.resetState(True)
self._notifyExcludedRegionsChanged()
# ~~ ExcludeRegionPlugin
@property
def isActivePrintJob(self):
"""Whether a print is currently in progress or not."""
return self._activePrintJob
@property
def loggingMode(self):
"""Return the current logging mode."""
return self._loggingMode
@loggingMode.setter
def loggingMode(self, loggingMode):
"""
Set a new logging mode for the plugin.
Parameters
----------
loggingMode : String
The new logging mode to apply. May be one of LOG_MODE_OCTOPRINT, LOG_MODE_DEDICATED,
or LOG_MODE_BOTH.
"""
if (self._loggingMode == loggingMode):
return
if (loggingMode not in (LOG_MODE_DEDICATED, LOG_MODE_OCTOPRINT, LOG_MODE_BOTH)):
raise AttributeError("Invalid mode value")
if (self._loggingMode is not None):
# Write a message to the previous log if a mode has been previously set
self._logger.info(
"Changing logging mode from '%s' to '%s'",
self._loggingMode, loggingMode
)
if (loggingMode in (LOG_MODE_DEDICATED, LOG_MODE_BOTH)):
if (self._pluginLoggingHandler is None):
self._pluginLoggingHandler = logging.handlers.RotatingFileHandler(
self._settings.get_plugin_logfile_path(),
maxBytes=2*1024*1024,
backupCount=3
)
self._pluginLoggingHandler.setFormatter(
logging.Formatter("%(asctime)s %(levelname)-8s %(message)s")
)
self._pluginLoggingHandler.setLevel(logging.DEBUG)
if (self._loggingMode == LOG_MODE_OCTOPRINT):
# Any other mode means the handler is already added
self._logger.addHandler(self._pluginLoggingHandler)
self._logger.propagate = (loggingMode == LOG_MODE_BOTH)
elif (self._pluginLoggingHandler is not None): # LOG_MODE_OCTOPRINT
self._logger.removeHandler(self._pluginLoggingHandler)
self._logger.propagate = True
self._loggingMode = loggingMode
# Write a message to the new log
self._logger.info("Logging mode set to '%s'", self._loggingMode)
def _handleAddExcludeRegion(self, region):
"""
Add a new exclusion region.
Parameters
----------
region : Region
The new region to add
Returns
-------
None | Tuple(string, status_code)
Returns None if the operation was successful, and an error status tuple if the specified
region has the same id as an existing region.
"""
try:
self.state.addRegion(region)
self._notifyExcludedRegionsChanged()
return None
except ValueError as err:
return err.args[0], 409
def _handleDeleteExcludeRegion(self, idToDelete):
"""
Remove the region with the specified id.
Parameters
----------
idToDelete : string
The id of the region to remove.
Returns
-------
None | Tuple(string, status_code)
Returns None if the operation was successful, and an error status tuple if the region
cannot be deleted.
"""
if (not self.mayShrinkRegionsWhilePrinting and self.isActivePrintJob):
return "Cannot delete region while printing", 409
if (self.state.deleteRegion(idToDelete)):
self._notifyExcludedRegionsChanged()
return None
def _handleUpdateExcludeRegion(self, newRegion):
"""
Replace an existing region with a new one.
Parameters
----------
region : Region
The new region to use as a replacement for an existing one with a matching id.
Returns
-------
None | Tuple(string, status_code)
Returns None if the operation was successful, and an error status tuple if the new
region does not have an id or the modified region is required to fully contain the
original area.
"""
try:
self.state.replaceRegion(
newRegion,
not self.mayShrinkRegionsWhilePrinting and self.isActivePrintJob
)
self._notifyExcludedRegionsChanged()
return None
except ValueError as err:
return err.args[0], 409
def _notifyExcludedRegionsChanged(self):
"""
Send an 'excludedRegionsChanged' event to any interested listeners.
The event sent has the following structure:
.. code-block:: javascript
{
"event": "excludedRegionsChanged",
"excluded_regions": [
{
"type": "RectangularRegion",
"id": "...uuid...",
"x1": 1, "y1": 1, "x2": 2, "y2": 2
},
{
"type": "CircularRegion",
"id": "...uuid...",
"cx": 1, "cy": 1, "r": 2
}
// etc ...
]
}
"""
self._plugin_manager.send_plugin_message(
self._identifier,
dict(
event=EXCLUDED_REGIONS_CHANGED,
excluded_regions=[region.toDict() for region in self.state.excludedRegions]
)
)
@staticmethod
def _splitGcodeScript(gcodeString):
"""
Split multiple lines of Gcode at line breaks and remove comments and blank lines.
Parameters
----------
gcodeString : string
The Gcode string to split and sanitize
Returns
-------
List of string
The sanitized list of Gcode commands
"""
if (gcodeString is None):
return None
tmp = REGEX_SPLIT_GCODE_LINES.split(gcodeString)
gcodeCommands = []
for gcode in tmp:
gcode = REGEX_TRIM_GCODE.match(gcode).group(1)
if (gcode != ""):
gcodeCommands.append(gcode)
if (not gcodeCommands):
gcodeCommands = None
return gcodeCommands
def _handleSettingsUpdated(self):
"""Update internal state when a settings change is detected."""
self.clearRegionsAfterPrintFinishes = \
self._settings.getBoolean(["clearRegionsAfterPrintFinishes"])
self.mayShrinkRegionsWhilePrinting = \
self._settings.getBoolean(["mayShrinkRegionsWhilePrinting"])
self.state.g90InfluencesExtruder = \
settings().getBoolean(["feature", "g90InfluencesExtruder"])
self.state.enteringExcludedRegionGcode = \
self._splitGcodeScript(self._settings.get(["enteringExcludedRegionGcode"]))
self.state.exitingExcludedRegionGcode = \
self._splitGcodeScript(self._settings.get(["exitingExcludedRegionGcode"]))
extendedExcludeGcodes = {}
for val in self._settings.get(["extendedExcludeGcodes"]):
val = ExcludedGcode(
val["gcode"],
val["mode"],
val["description"]
)
extendedExcludeGcodes[val.gcode] = val
self.state.extendedExcludeGcodes = extendedExcludeGcodes
atCommandActions = {}
for val in self._settings.get(["atCommandActions"]):
val = AtCommandAction(
val["command"],
val["parameterPattern"],
val["action"],
val["description"]
)
entry = atCommandActions.get(val.command)
if (entry is None):
atCommandActions[val.command] = [val]
else:
entry.append(val)
self.state.atCommandActions = atCommandActions
self.loggingMode = self._settings.get(["loggingMode"])
self._logger.info(
"Setting update detected: g90InfluencesExtruder=%s, " +
"clearRegionsAfterPrintFinishes=%s, mayShrinkRegionsWhilePrinting=%s, " +
"loggingMode=%s, " +
"enteringExcludedRegionGcode=%s, exitingExcludedRegionGcode=%s, " +
"extendedExcludeGcodes=%s, atCommandActions=%s",
self.state.g90InfluencesExtruder,
self.clearRegionsAfterPrintFinishes, self.mayShrinkRegionsWhilePrinting,
self._loggingMode,
self.state.enteringExcludedRegionGcode,
self.state.exitingExcludedRegionGcode,
extendedExcludeGcodes, atCommandActions
)
def handleGcodeQueuing( # pylint: disable=too-many-arguments,unused-argument
self, commInstance, phase, cmd, cmdType, gcode, subcode=None, tags=None
):
"""Gcode processing handler for octoprint.comm.protocol.gcode.queuing plugin hook."""
if (self._logger.isEnabledFor(logging.DEBUG)):
self._logger.debug(
"handleGcodeQueuing: " +
"phase=%s, cmd=%s, cmdType=%s, gcode=%s, subcode=%s, tags=%s, " +
"(isActivePrintJob=%s, isExclusionEnabled=%s, excluding=%s)",
phase, cmd, cmdType, gcode, subcode, tags,
self.isActivePrintJob, self.state.isExclusionEnabled(),
self.state.excluding
)
if (gcode and self.isActivePrintJob):
return self.gcodeHandlers.handleGcode(cmd, gcode, subcode)
return None
def handleAtCommandQueuing(self, commInstance, phase, cmd, parameters, tags=None):
"""Command processing handler for octoprint.comm.protocol.atcommand.queuing plugin hook."""
self._logger.debug(
"handleAtCommandQueuing: " +
"phase=%s, command=%s, parameters=%s, tags=%s, " +
"(isActivePrintJob=%s, isExclusionEnabled=%s, excluding=%s)",
phase, cmd, parameters, tags,
self.isActivePrintJob, self.state.isExclusionEnabled(),
self.state.excluding
)
if (self.isActivePrintJob):
self.gcodeHandlers.handleAtCommand(commInstance, cmd, parameters)