-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy path__init__.py
622 lines (512 loc) · 21.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
# coding=utf-8
from __future__ import absolute_import
import math
from datetime import datetime
import flask
import octoprint.plugin
from flask import request
from octoprint.events import Events
from octoprint.util.comm import MachineCom
from octoprint_SpoolManager.DatabaseManager import DatabaseManager
from octoprint_SpoolManager.Odometer import FilamentOdometer
from octoprint_SpoolManager.api import Transformer
from octoprint_SpoolManager.api.SpoolManagerAPI import SpoolManagerAPI
from octoprint_SpoolManager.common import StringUtils
from octoprint_SpoolManager.common.SettingsKeys import SettingsKeys
class SpoolmanagerPlugin(
SpoolManagerAPI,
octoprint.plugin.SimpleApiPlugin,
octoprint.plugin.SettingsPlugin,
octoprint.plugin.AssetPlugin,
octoprint.plugin.TemplatePlugin,
octoprint.plugin.StartupPlugin,
octoprint.plugin.EventHandlerPlugin,
):
def initialize(self):
self._logger.info("Start initializing")
# DATABASE
self.databaseConnectionProblemConfirmed = False
sqlLoggingEnabled = self._settings.get_boolean([SettingsKeys.SETTINGS_KEY_SQL_LOGGING_ENABLED])
self._databaseManager = DatabaseManager(self._logger, sqlLoggingEnabled)
databaseSettings = self._buildDatabaseSettingsFromPluginSettings()
# init database
self._databaseManager.initDatabase(databaseSettings, self._sendMessageToClient)
# OTHER STUFF
self._filamentOdometer = None
self._filamentOdometer = FilamentOdometer()
# TODO no idea what this thing is doing in detail self._filamentOdometer.set_g90_extruder(self._settings.getBoolean(["feature", "g90InfluencesExtruder"]))
self._filamentManagerPluginImplementation = None
self._filamentManagerPluginImplementationState = None
self._lastPrintState = None
self.metaDataFilamentLength = None
self.alreadyCanceled = False
self._logger.info("Done initializing")
pass
################################################################################################### public functions
def checkRemainingFilament(self):
shouldWarn = self._settings.get_boolean([SettingsKeys.SETTINGS_KEY_WARN_IF_FILAMENT_NOT_ENOUGH])
if (shouldWarn == False):
return True
# - check, if spool change in pause-mode
# - check if new spool fits for current printjob
selectedSpool = self.loadSelectedSpool()
if (selectedSpool == None or self.metaDataFilamentLength == None):
return False
# need attributes present: diameter, density, totalWeight
warningMessage = "Following fields not set in Spool '" + selectedSpool.displayName + "': "
missing = False
diameter = selectedSpool.diameter
density = selectedSpool.density
totalWeight = selectedSpool.totalWeight
usedWeight = selectedSpool.usedWeight
if (diameter == None):
missing = True
warningMessage += "diameter "
if (density == None):
missing = True
warningMessage += "density "
if (totalWeight == None):
missing = True
warningMessage += "total weight"
if (usedWeight == None):
usedWeight = 0.0
if (missing == True):
self._sendMessageToClient("warning", "Filament prediction not possible!", warningMessage)
return False
warningMessage = "One of the needed fields are not a number in Spool '" + selectedSpool.displayName + "': "
notANumber = False
try:
diameter = float(diameter)
except ValueError:
notANumber = True
warningMessage += "diameter "
try:
density = float(density)
except ValueError:
notANumber = True
warningMessage += "density "
try:
totalWeight = float(totalWeight)
except ValueError:
notANumber = True
warningMessage += "total weight "
try:
usedWeight = float(usedWeight)
except ValueError:
notANumber = True
warningMessage += "used weight "
if (notANumber == True):
self._sendMessageToClient("warning", "Filament prediction not possible!", warningMessage)
return False
# Benötigtes Gewicht = gewicht(geplante länge, durchmesser, dichte)
requiredWeight = int(self._calculateWeight(self.metaDataFilamentLength, diameter, density))
# Vorhanden Gewicht = Gesamtgewicht - Verbrauchtes Gewicht
remainingWeight = totalWeight - usedWeight
if (remainingWeight < requiredWeight):
self._sendMessageToClient("warning", "Filament not enough!",
"Required '" + str(requiredWeight) + "g' available from Spool '" + str(remainingWeight) + "g'!")
return False
return True
################################################################################################## private functions
def _sendDataToClient(self, payloadDict):
self._plugin_manager.send_plugin_message(self._identifier,
payloadDict)
def _sendMessageToClient(self, type, title, message):
self._logger.warning("SendToClient: " + type + "#" + title + "#" + message)
title = "SPM:" + title
self._sendDataToClient(dict(action="showPopUp",
type=type,
title= title,
message=message))
def _checkForMissingPluginInfos(self, sendToClient=False):
pluginInfo = self._getPluginInformation("filamentmanager")
self._filamentManagerPluginImplementationState = pluginInfo[0]
self._filamentManagerPluginImplementation = pluginInfo[1]
self._logger.info("Plugin-State: "
"filamentmanager=" + self._filamentManagerPluginImplementationState + " ")
pass
# get the plugin with status information
# [0] == status-string
# [1] == implementaiton of the plugin
def _getPluginInformation(self, pluginKey):
status = None
implementation = None
if pluginKey in self._plugin_manager.plugins:
plugin = self._plugin_manager.plugins[pluginKey]
if plugin != None:
if (plugin.enabled == True):
status = "enabled"
# for OP 1.4.x we need to check agains "icompatible"-attribute
if (hasattr(plugin, 'incompatible') ):
if (plugin.incompatible == False):
implementation = plugin.implementation
else:
status = "incompatible"
else:
# OP 1.3.x
implementation = plugin.implementation
pass
else:
status = "disabled"
else:
status = "missing"
return [status, implementation]
def _calculateWeight(self, length, diameter, density):
radius = diameter / 2.0;
volume = length * math.pi * (radius * radius) / 1000
result = volume * density
return result
def _buildDatabaseSettingsFromPluginSettings(self):
databaseSettings = DatabaseManager.DatabaseSettings()
databaseSettings.useExternal = self._settings.get([SettingsKeys.SETTINGS_KEY_DATABASE_USE_EXTERNAL])
databaseSettings.type = self._settings.get([SettingsKeys.SETTINGS_KEY_DATABASE_TYPE])
databaseSettings.host = self._settings.get([SettingsKeys.SETTINGS_KEY_DATABASE_HOST])
databaseSettings.port = self._settings.get_int([SettingsKeys.SETTINGS_KEY_DATABASE_PORT])
databaseSettings.name = self._settings.get([SettingsKeys.SETTINGS_KEY_DATABASE_NAME])
databaseSettings.user = self._settings.get([SettingsKeys.SETTINGS_KEY_DATABASE_USER])
databaseSettings.password = self._settings.get([SettingsKeys.SETTINGS_KEY_DATABASE_PASSWORD])
pluginDataBaseFolder = self.get_plugin_data_folder()
databaseSettings.baseFolder = pluginDataBaseFolder
databaseSettings.fileLocation = self._databaseManager.buildDefaultDatabaseFileLocation(databaseSettings.baseFolder)
return databaseSettings
# common states: STATE_CONNECTING("Connecting"), STATE_OPERATIONAL("Operational"),
# STATE_STARTING("Startinf..."), STATE_PRINTING("Printing or Sendind"), STATE_CANCELLING("Cancelling"),
# STATE_PAUSING("Pausing"), STATE_PAUSED("Paused"), STATE_RESUMING("Resuming"), STATE_FINISHING("Finishing"), STATE_CLOSED("Offline")
# Normal flow:
# - OPERATIONAL
# - STARTING
# - PRINTING
# - FINISHING
# - OPERATIONAL
# Cancel
# - ...
# - PRINTING
# -CANCELLING
# - OPERATIONAL
# Pause -> Resume
# - STARTING
# - PRINTING
# - PAUSING
# - PAUSED
# - RESUMING
# - PRINTING
# - FINISHING
# - OPERATIONAL
# Pause -> Restart
# - PRINTING
# - PAUSING
# - PAUSED
# - STARTING
# - PRINTING
# def _on_printer_state_changed(self, payload):
# printerState = payload['state_id']
# print("###################### " +str(printerState))
# if payload['state_id'] == "PRINTING":
# if self._lastPrintState == "PAUSED":
# # resuming print
# self.filamentOdometer.reset_extruded_length()
# else:
# # starting new print
# self.filamentOdometer.reset()
# self.odometerEnabled = self._settings.getBoolean(["enableOdometer"])
# self.pauseEnabled = self._settings.getBoolean(["autoPause"])
# self._logger.debug("Printer State: %s" % payload["state_string"])
# self._logger.debug("Odometer: %s" % ("On" if self.odometerEnabled else "Off"))
# self._logger.debug("AutoPause: %s" % ("On" if self.pauseEnabled and self.odometerEnabled else "Off"))
# elif self._lastPrintState == "PRINTING":
# # print state changed from printing => update filament usage
# self._logger.debug("Printer State: %s" % payload["state_string"])
# if self.odometerEnabled:
# self.odometerEnabled = False # disabled because we don't want to track manual extrusion
#
# self.currentExtrusion = self.filamentOdometer.get_extrusion()
#
# # update last print state
# self._lastPrintState = payload['state_id']
def _on_printJobStarted(self):
# starting new print
self._filamentOdometer.reset()
spoolModel = self.loadSelectedSpool()
if (spoolModel != None):
if (StringUtils.isEmpty(spoolModel.firstUse) == True):
firstUse = datetime.now()
spoolModel.firstUse = firstUse
self._databaseManager.saveSpool(spoolModel)
self._sendDataToClient(dict(
action="reloadTable"
))
pass
#### print job finished
def _on_printJobFinished(self, printStatus, payload):
spoolModel = self.loadSelectedSpool()
if (spoolModel == None):
self._logger.warning("No spool selected, could not update values after print")
return
# - Last usage datetime
lastUsage = datetime.now()
spoolModel.lastUse = lastUsage
# - Used length
currentExtrusionForAllTools = self._filamentOdometer.getExtrusionForAllTools()
# if (len(currentExtrusionForAllTools) == 0):
# self._logger.warning("Odomenter could not detect any extrusion")
# return
currentExtrusionLenght = currentExtrusionForAllTools # TODO Support of multi-tool
self._logger.info("Extruded filament length: " + str(currentExtrusionLenght))
spoolUsedLength = 0.0 if StringUtils.isEmpty(spoolModel.usedLength) == True else spoolModel.usedLength
self._logger.info("Current Spool filament length: " + str(spoolUsedLength))
newUsedLength = spoolUsedLength + currentExtrusionLenght
self._logger.info("New Spool filament length: " + str(newUsedLength))
spoolModel.usedLength = newUsedLength
# - Used weight
diameter = spoolModel.diameter
density = spoolModel.density
if (diameter == None or density == None):
self._logger.warning("Could not update spool weight, because diameter or density not set in spool '"+spoolModel.displayName+"'")
else:
usedWeight = self._calculateWeight(currentExtrusionLenght, diameter, density)
spoolUsedWeight = 0.0 if spoolModel.usedWeight == None else spoolModel.usedWeight
newUsedWeight = spoolUsedWeight + usedWeight
spoolModel.usedWeight = newUsedWeight
self._databaseManager.saveSpool(spoolModel)
self._sendDataToClient(dict(
action = "reloadTable and sidebarSpools"
))
pass
def _on_clientOpened(self, payload):
# start-workaround https://github.com/foosel/OctoPrint/issues/3400
import time
time.sleep(3)
selectedSpoolAsDict = None
# Check if database is available
# connected = self._databaseManager.reConnectToDatabase()
# self._logger.info("ClientOpened. Database connected:"+str(connected))
connectionErrorResult = self._databaseManager.testDatabaseConnection()
# Don't show already shown message
if (self.databaseConnectionProblemConfirmed == False and
connectionErrorResult != None):
databaseErrorMessageDict = self._databaseManager.getCurrentErrorMessageDict();
# The databaseErrorMessages should always be present in that case.
if (databaseErrorMessageDict != None):
self._logger.error(databaseErrorMessageDict)
self._sendDataToClient(dict(action = "showConnectionProblem",
type = databaseErrorMessageDict["type"],
title = databaseErrorMessageDict["title"],
message = databaseErrorMessageDict["message"]))
# Send plugin storage information
## Storage
if (connectionErrorResult == None):
selectedSpool = self.loadSelectedSpool()
if (selectedSpool):
selectedSpoolAsDict = Transformer.transformSpoolModelToDict(selectedSpool)
else:
# spool not found
pass
pluginNotWorking = connectionErrorResult != None
self._sendDataToClient(dict(action = "initalData",
selectedSpool = selectedSpoolAsDict,
isFilamentManagerPluginAvailable = self._filamentManagerPluginImplementation != None,
pluginNotWorking = pluginNotWorking
))
pass
def _on_clientClosed(self, payload):
self.databaseConnectionProblemConfirmed = False
def _on_file_selectionChanged(self, payload):
if ("origin" in payload and "path" in payload):
metadata = self._file_manager.get_metadata(payload["origin"], payload["path"])
if ("analysis" in metadata):
if ("filament" in metadata["analysis"]):
allFilemants = metadata["analysis"]["filament"]
# TODO support multiple tools and not only tool0 (or first you got)
if (allFilemants):
for toolIndex in range(5):
toolName = "tool" + str(toolIndex)
if (toolName in allFilemants):
self.metaDataFilamentLength = allFilemants[toolName]["length"]
self.checkRemainingFilament()
return
self.metaDataFilamentLength = 0.0
pass
######################################################################################### Hooks and public functions
def on_after_startup(self):
# check if needed plugins were available
self._checkForMissingPluginInfos()
pass
# Listen to all g-code which where already sent to the printer (thread: comm.sending_thread)
def on_sentGCodeHook(self, comm_instance, phase, cmd, cmd_type, gcode, *args, **kwargs):
# TODO maybe later via a queue
self._filamentOdometer.parse(gcode, cmd)
# if self.pauseEnabled and self.check_threshold():
# self._logger.info("Filament is running out, pausing print")
# self._printer.pause_print()
pass
def on_event(self, event, payload):
# if event == Events.PRINTER_STATE_CHANGED:
if (Events.CLIENT_OPENED == event):
self._on_clientOpened(payload)
return
if (Events.CLIENT_CLOSED == event):
self._on_clientClosed(payload)
return
elif (Events.PRINT_STARTED == event):
self.alreadyCanceled = False
self._on_printJobStarted()
elif (Events.PRINT_DONE == event):
self._on_printJobFinished("success", payload)
elif (Events.PRINT_FAILED == event):
if self.alreadyCanceled == False:
self._on_printJobFinished("failed", payload)
elif (Events.PRINT_CANCELLED == event):
self.alreadyCanceled = True
self._on_printJobFinished("canceled", payload)
if (Events.FILE_SELECTED == event or
Events.FILE_DESELECTED == event or
Events.UPDATED_FILES == event):
self._on_file_selectionChanged(payload)
return
pass
def on_settings_save(self, data):
# # default save function
octoprint.plugin.SettingsPlugin.on_settings_save(self, data)
#
# databaseSettings = self._buildDatabaseSettingsFromPluginSettings()
#
# self._databaseManager.assignNewDatabaseSettings(databaseSettings)
# testResult = self._databaseManager.testDatabaseConnection(databaseSettings)
# if (testResult != None):
# # TODO Send to client
# pass
# to allow the frontend to trigger an update
def on_api_get(self, request):
if len(request.values) != 0:
action = request.values["action"]
# deceide if you want the reset function in you settings dialog
if "isResetSettingsEnabled" == action:
return flask.jsonify(enabled="true")
if "resetSettings" == action:
self._settings.set([], self.get_settings_defaults())
self._settings.save()
return flask.jsonify(self.get_settings_defaults())
# because of some race conditions, we can't push the initalDate during client-open event. So we provide the settings on request
if "additionalSettingsValues" == action:
return flask.jsonify({
"isFilamentManagerPluginAvailable":self._filamentManagerPluginImplementation != None
})
##~~ SettingsPlugin mixin
def get_settings_defaults(self):
settings = dict()
# Not visible
settings[SettingsKeys.SETTINGS_KEY_SELECTED_SPOOL_DATABASE_ID] = None
settings[SettingsKeys.SETTINGS_KEY_HIDE_EMPTY_SPOOL_IN_SIDEBAR] = False
settings[SettingsKeys.SETTINGS_KEY_HIDE_INACTIVE_SPOOL_IN_SIDEBAR] = True
## Genral
settings[SettingsKeys.SETTINGS_KEY_REMINDER_SELECTING_SPOOL] = True
settings[SettingsKeys.SETTINGS_KEY_WARN_IF_SPOOL_NOT_SELECTED] = True
settings[SettingsKeys.SETTINGS_KEY_WARN_IF_FILAMENT_NOT_ENOUGH] = True
settings[SettingsKeys.SETTINGS_KEY_CURRENCY_SYMBOL] = "€"
## QR-Code
settings[SettingsKeys.SETTINGS_KEY_QR_CODE_ENABLED] = True
settings[SettingsKeys.SETTINGS_KEY_QR_CODE_FILL_COLOR] = "darkgreen"
settings[SettingsKeys.SETTINGS_KEY_QR_CODE_BACKGROUND_COLOR] = "white"
settings[SettingsKeys.SETTINGS_KEY_QR_CODE_WIDTH] = "100"
settings[SettingsKeys.SETTINGS_KEY_QR_CODE_HEIGHT] = "100"
## Export / Import
settings[SettingsKeys.SETTINGS_KEY_IMPORT_CSV_MODE] = SettingsKeys.KEY_IMPORTCSV_MODE_APPEND
## Debugging
settings[SettingsKeys.SETTINGS_KEY_SQL_LOGGING_ENABLED] = False
## Database
## nested settings are not working, because if only a few attributes are changed it only returns these few attribuets, instead the default values + adjusted values
settings[SettingsKeys.SETTINGS_KEY_DATABASE_USE_EXTERNAL] = False
datbaseLocation = DatabaseManager.buildDefaultDatabaseFileLocation(self.get_plugin_data_folder())
settings[SettingsKeys.SETTINGS_KEY_DATABASE_LOCAL_FILELOCATION] = datbaseLocation
settings[SettingsKeys.SETTINGS_KEY_DATABASE_TYPE] = "sqlite"
# settings[SettingsKeys.SETTINGS_KEY_DATABASE_TYPE] = "postgres"
settings[SettingsKeys.SETTINGS_KEY_DATABASE_HOST] = "localhost"
settings[SettingsKeys.SETTINGS_KEY_DATABASE_PORT] = 5432
settings[SettingsKeys.SETTINGS_KEY_DATABASE_NAME] = "SpoolDatabase"
settings[SettingsKeys.SETTINGS_KEY_DATABASE_USER] = "Olli"
settings[SettingsKeys.SETTINGS_KEY_DATABASE_PASSWORD] = "illO"
# {
# "localDatabaseFileLocation": "",
# "type": "postgres",
# "host": "localhost",
# "port": 5432,
# "databaseName": "SpoolDatabase",
# "user": "Olli",
# "password": "illO"
# }
return settings
##~~ TemplatePlugin mixin
def get_template_configs(self):
return [
dict(type="tab", name="Spools"),
dict(type="settings", custom_bindings=True, name="Spool Manager")
]
##~~ AssetPlugin mixin
def get_assets(self):
# Define your plugin's asset files to automatically include in the
# core UI here.
return dict(
js=[
"js/quill.min.js",
"js/select2.min.js",
"js/jquery.datetimepicker.full.min.js",
"js/tinycolor.js",
"js/pick-a-color.js",
"js/ResetSettingsUtilV3.js",
"js/ComponentFactory.js",
"js/TableItemHelper.js",
"js/SpoolManager.js",
"js/SpoolManager-APIClient.js",
"js/SpoolManager-EditSpoolDialog.js",
"js/SpoolManager-ImportDialog.js",
"js/SpoolManager-DatabaseConnectionProblemDialog.js"
],
css=[
"css/quill.snow.css",
"css/select2.min.css",
"css/jquery.datetimepicker.min.css",
"css/pick-a-color-1.1.8.min.css",
"css/SpoolManager.css"
],
less=["less/SpoolManager.less"]
)
##~~ Softwareupdate hook
def get_update_information(self):
# Define the configuration for your plugin to use with the Software Update
# Plugin here. See https://github.com/foosel/OctoPrint/wiki/Plugin:-Software-Update
# for details.
return dict(
SpoolManager=dict(
displayName="SpoolManager Plugin",
displayVersion=self._plugin_version,
# version check: github repository
type="github_release",
user="OllisGit",
repo="OctoPrint-SpoolManager",
current=self._plugin_version,
# update method: pip
pip="https://github.com/OllisGit/OctoPrint-SpoolManager/releases/latest/download/master.zip"
)
)
def message_on_connect(self, comm, script_type, script_name, *args, **kwargs):
print(script_name)
if not script_type == "gcode" or not script_name == "afterPrinterConnected":
return None
prefix = None
postfix = "M117 OctoPrint connected"
variables = dict(myvariable="Hi! I'm a variable!")
return prefix, postfix, variables
# If you want your plugin to be registered within OctoPrint under a different name than what you defined in setup.py
# ("OctoPrint-PluginSkeleton"), you may define that here. Same goes for the other metadata derived from setup.py that
# can be overwritten via __plugin_xyz__ control properties. See the documentation for that.
__plugin_name__ = "SpoolManager Plugin"
__plugin_pythoncompat__ = ">=2.7,<4"
def __plugin_load__():
global __plugin_implementation__
__plugin_implementation__ = SpoolmanagerPlugin()
global __plugin_hooks__
__plugin_hooks__ = {
"octoprint.plugin.softwareupdate.check_config": __plugin_implementation__.get_update_information,
"octoprint.comm.protocol.gcode.sent": __plugin_implementation__.on_sentGCodeHook,
"octoprint.comm.protocol.scripts": __plugin_implementation__.message_on_connect
}