meerk40t 0.9.3001__py2.py3-none-any.whl → 0.9.7020__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- meerk40t/__init__.py +1 -1
- meerk40t/balormk/balor_params.py +167 -167
- meerk40t/balormk/clone_loader.py +457 -457
- meerk40t/balormk/controller.py +1566 -1512
- meerk40t/balormk/cylindermod.py +64 -0
- meerk40t/balormk/device.py +966 -1959
- meerk40t/balormk/driver.py +778 -591
- meerk40t/balormk/galvo_commands.py +1194 -0
- meerk40t/balormk/gui/balorconfig.py +237 -111
- meerk40t/balormk/gui/balorcontroller.py +191 -184
- meerk40t/balormk/gui/baloroperationproperties.py +116 -115
- meerk40t/balormk/gui/corscene.py +845 -0
- meerk40t/balormk/gui/gui.py +179 -147
- meerk40t/balormk/livelightjob.py +466 -382
- meerk40t/balormk/mock_connection.py +131 -109
- meerk40t/balormk/plugin.py +133 -135
- meerk40t/balormk/usb_connection.py +306 -301
- meerk40t/camera/__init__.py +1 -1
- meerk40t/camera/camera.py +514 -397
- meerk40t/camera/gui/camerapanel.py +1241 -1095
- meerk40t/camera/gui/gui.py +58 -58
- meerk40t/camera/plugin.py +441 -399
- meerk40t/ch341/__init__.py +27 -27
- meerk40t/ch341/ch341device.py +628 -628
- meerk40t/ch341/libusb.py +595 -589
- meerk40t/ch341/mock.py +171 -171
- meerk40t/ch341/windriver.py +157 -157
- meerk40t/constants.py +13 -0
- meerk40t/core/__init__.py +1 -1
- meerk40t/core/bindalias.py +550 -539
- meerk40t/core/core.py +47 -47
- meerk40t/core/cutcode/cubiccut.py +73 -73
- meerk40t/core/cutcode/cutcode.py +315 -312
- meerk40t/core/cutcode/cutgroup.py +141 -137
- meerk40t/core/cutcode/cutobject.py +192 -185
- meerk40t/core/cutcode/dwellcut.py +37 -37
- meerk40t/core/cutcode/gotocut.py +29 -29
- meerk40t/core/cutcode/homecut.py +29 -29
- meerk40t/core/cutcode/inputcut.py +34 -34
- meerk40t/core/cutcode/linecut.py +33 -33
- meerk40t/core/cutcode/outputcut.py +34 -34
- meerk40t/core/cutcode/plotcut.py +335 -335
- meerk40t/core/cutcode/quadcut.py +61 -61
- meerk40t/core/cutcode/rastercut.py +168 -148
- meerk40t/core/cutcode/waitcut.py +34 -34
- meerk40t/core/cutplan.py +1843 -1316
- meerk40t/core/drivers.py +330 -329
- meerk40t/core/elements/align.py +801 -669
- meerk40t/core/elements/branches.py +1858 -1507
- meerk40t/core/elements/clipboard.py +229 -219
- meerk40t/core/elements/element_treeops.py +4595 -2837
- meerk40t/core/elements/element_types.py +125 -105
- meerk40t/core/elements/elements.py +4315 -3617
- meerk40t/core/elements/files.py +117 -64
- meerk40t/core/elements/geometry.py +473 -224
- meerk40t/core/elements/grid.py +467 -316
- meerk40t/core/elements/materials.py +158 -94
- meerk40t/core/elements/notes.py +50 -38
- meerk40t/core/elements/offset_clpr.py +934 -912
- meerk40t/core/elements/offset_mk.py +963 -955
- meerk40t/core/elements/penbox.py +339 -267
- meerk40t/core/elements/placements.py +300 -83
- meerk40t/core/elements/render.py +785 -687
- meerk40t/core/elements/shapes.py +2618 -2092
- meerk40t/core/elements/testcases.py +105 -0
- meerk40t/core/elements/trace.py +651 -563
- meerk40t/core/elements/tree_commands.py +415 -409
- meerk40t/core/elements/undo_redo.py +116 -58
- meerk40t/core/elements/wordlist.py +319 -200
- meerk40t/core/exceptions.py +9 -9
- meerk40t/core/laserjob.py +220 -220
- meerk40t/core/logging.py +63 -63
- meerk40t/core/node/blobnode.py +83 -86
- meerk40t/core/node/bootstrap.py +105 -103
- meerk40t/core/node/branch_elems.py +40 -31
- meerk40t/core/node/branch_ops.py +45 -38
- meerk40t/core/node/branch_regmark.py +48 -41
- meerk40t/core/node/cutnode.py +29 -32
- meerk40t/core/node/effect_hatch.py +375 -257
- meerk40t/core/node/effect_warp.py +398 -0
- meerk40t/core/node/effect_wobble.py +441 -309
- meerk40t/core/node/elem_ellipse.py +404 -309
- meerk40t/core/node/elem_image.py +1082 -801
- meerk40t/core/node/elem_line.py +358 -292
- meerk40t/core/node/elem_path.py +259 -201
- meerk40t/core/node/elem_point.py +129 -102
- meerk40t/core/node/elem_polyline.py +310 -246
- meerk40t/core/node/elem_rect.py +376 -286
- meerk40t/core/node/elem_text.py +445 -418
- meerk40t/core/node/filenode.py +59 -40
- meerk40t/core/node/groupnode.py +138 -74
- meerk40t/core/node/image_processed.py +777 -766
- meerk40t/core/node/image_raster.py +156 -113
- meerk40t/core/node/layernode.py +31 -31
- meerk40t/core/node/mixins.py +135 -107
- meerk40t/core/node/node.py +1427 -1304
- meerk40t/core/node/nutils.py +117 -114
- meerk40t/core/node/op_cut.py +463 -335
- meerk40t/core/node/op_dots.py +296 -251
- meerk40t/core/node/op_engrave.py +414 -311
- meerk40t/core/node/op_image.py +755 -369
- meerk40t/core/node/op_raster.py +787 -522
- meerk40t/core/node/place_current.py +37 -40
- meerk40t/core/node/place_point.py +329 -126
- meerk40t/core/node/refnode.py +58 -47
- meerk40t/core/node/rootnode.py +225 -219
- meerk40t/core/node/util_console.py +48 -48
- meerk40t/core/node/util_goto.py +84 -65
- meerk40t/core/node/util_home.py +61 -61
- meerk40t/core/node/util_input.py +102 -102
- meerk40t/core/node/util_output.py +102 -102
- meerk40t/core/node/util_wait.py +65 -65
- meerk40t/core/parameters.py +709 -707
- meerk40t/core/planner.py +875 -785
- meerk40t/core/plotplanner.py +656 -652
- meerk40t/core/space.py +120 -113
- meerk40t/core/spoolers.py +706 -705
- meerk40t/core/svg_io.py +1836 -1549
- meerk40t/core/treeop.py +534 -445
- meerk40t/core/undos.py +278 -124
- meerk40t/core/units.py +784 -680
- meerk40t/core/view.py +393 -322
- meerk40t/core/webhelp.py +62 -62
- meerk40t/core/wordlist.py +513 -504
- meerk40t/cylinder/cylinder.py +247 -0
- meerk40t/cylinder/gui/cylindersettings.py +41 -0
- meerk40t/cylinder/gui/gui.py +24 -0
- meerk40t/device/__init__.py +1 -1
- meerk40t/device/basedevice.py +322 -123
- meerk40t/device/devicechoices.py +50 -0
- meerk40t/device/dummydevice.py +163 -128
- meerk40t/device/gui/defaultactions.py +618 -602
- meerk40t/device/gui/effectspanel.py +114 -0
- meerk40t/device/gui/formatterpanel.py +253 -290
- meerk40t/device/gui/warningpanel.py +337 -260
- meerk40t/device/mixins.py +13 -13
- meerk40t/dxf/__init__.py +1 -1
- meerk40t/dxf/dxf_io.py +766 -554
- meerk40t/dxf/plugin.py +47 -35
- meerk40t/external_plugins.py +79 -79
- meerk40t/external_plugins_build.py +28 -28
- meerk40t/extra/cag.py +112 -116
- meerk40t/extra/coolant.py +403 -0
- meerk40t/extra/encode_detect.py +204 -0
- meerk40t/extra/ezd.py +1165 -1165
- meerk40t/extra/hershey.py +834 -340
- meerk40t/extra/imageactions.py +322 -316
- meerk40t/extra/inkscape.py +628 -622
- meerk40t/extra/lbrn.py +424 -424
- meerk40t/extra/outerworld.py +283 -0
- meerk40t/extra/param_functions.py +1542 -1556
- meerk40t/extra/potrace.py +257 -253
- meerk40t/extra/serial_exchange.py +118 -0
- meerk40t/extra/updater.py +602 -453
- meerk40t/extra/vectrace.py +147 -146
- meerk40t/extra/winsleep.py +83 -83
- meerk40t/extra/xcs_reader.py +597 -0
- meerk40t/fill/fills.py +781 -335
- meerk40t/fill/patternfill.py +1061 -1061
- meerk40t/fill/patterns.py +614 -567
- meerk40t/grbl/control.py +87 -87
- meerk40t/grbl/controller.py +990 -903
- meerk40t/grbl/device.py +1084 -768
- meerk40t/grbl/driver.py +989 -771
- meerk40t/grbl/emulator.py +532 -497
- meerk40t/grbl/gcodejob.py +783 -767
- meerk40t/grbl/gui/grblconfiguration.py +373 -298
- meerk40t/grbl/gui/grblcontroller.py +485 -271
- meerk40t/grbl/gui/grblhardwareconfig.py +269 -153
- meerk40t/grbl/gui/grbloperationconfig.py +105 -0
- meerk40t/grbl/gui/gui.py +147 -116
- meerk40t/grbl/interpreter.py +44 -44
- meerk40t/grbl/loader.py +22 -22
- meerk40t/grbl/mock_connection.py +56 -56
- meerk40t/grbl/plugin.py +294 -264
- meerk40t/grbl/serial_connection.py +93 -88
- meerk40t/grbl/tcp_connection.py +81 -79
- meerk40t/grbl/ws_connection.py +112 -0
- meerk40t/gui/__init__.py +1 -1
- meerk40t/gui/about.py +2042 -296
- meerk40t/gui/alignment.py +1644 -1608
- meerk40t/gui/autoexec.py +199 -0
- meerk40t/gui/basicops.py +791 -670
- meerk40t/gui/bufferview.py +77 -71
- meerk40t/gui/busy.py +232 -133
- meerk40t/gui/choicepropertypanel.py +1662 -1469
- meerk40t/gui/consolepanel.py +706 -542
- meerk40t/gui/devicepanel.py +687 -581
- meerk40t/gui/dialogoptions.py +110 -107
- meerk40t/gui/executejob.py +316 -306
- meerk40t/gui/fonts.py +90 -90
- meerk40t/gui/functionwrapper.py +252 -0
- meerk40t/gui/gui_mixins.py +729 -0
- meerk40t/gui/guicolors.py +205 -182
- meerk40t/gui/help_assets/help_assets.py +218 -201
- meerk40t/gui/helper.py +154 -0
- meerk40t/gui/hersheymanager.py +1440 -846
- meerk40t/gui/icons.py +3422 -2747
- meerk40t/gui/imagesplitter.py +555 -508
- meerk40t/gui/keymap.py +354 -344
- meerk40t/gui/laserpanel.py +897 -806
- meerk40t/gui/laserrender.py +1470 -1232
- meerk40t/gui/lasertoolpanel.py +805 -793
- meerk40t/gui/magnetoptions.py +436 -0
- meerk40t/gui/materialmanager.py +2944 -0
- meerk40t/gui/materialtest.py +1722 -1694
- meerk40t/gui/mkdebug.py +646 -359
- meerk40t/gui/mwindow.py +163 -140
- meerk40t/gui/navigationpanels.py +2605 -2467
- meerk40t/gui/notes.py +143 -142
- meerk40t/gui/opassignment.py +414 -410
- meerk40t/gui/operation_info.py +310 -299
- meerk40t/gui/plugin.py +500 -328
- meerk40t/gui/position.py +714 -669
- meerk40t/gui/preferences.py +901 -650
- meerk40t/gui/propertypanels/attributes.py +1461 -1131
- meerk40t/gui/propertypanels/blobproperty.py +117 -114
- meerk40t/gui/propertypanels/consoleproperty.py +83 -80
- meerk40t/gui/propertypanels/gotoproperty.py +77 -0
- meerk40t/gui/propertypanels/groupproperties.py +223 -217
- meerk40t/gui/propertypanels/hatchproperty.py +489 -469
- meerk40t/gui/propertypanels/imageproperty.py +2244 -1384
- meerk40t/gui/propertypanels/inputproperty.py +59 -58
- meerk40t/gui/propertypanels/opbranchproperties.py +82 -80
- meerk40t/gui/propertypanels/operationpropertymain.py +1890 -1638
- meerk40t/gui/propertypanels/outputproperty.py +59 -58
- meerk40t/gui/propertypanels/pathproperty.py +389 -380
- meerk40t/gui/propertypanels/placementproperty.py +1214 -383
- meerk40t/gui/propertypanels/pointproperty.py +140 -136
- meerk40t/gui/propertypanels/propertywindow.py +313 -181
- meerk40t/gui/propertypanels/rasterwizardpanels.py +996 -912
- meerk40t/gui/propertypanels/regbranchproperties.py +76 -0
- meerk40t/gui/propertypanels/textproperty.py +770 -755
- meerk40t/gui/propertypanels/waitproperty.py +56 -55
- meerk40t/gui/propertypanels/warpproperty.py +121 -0
- meerk40t/gui/propertypanels/wobbleproperty.py +255 -204
- meerk40t/gui/ribbon.py +2471 -2210
- meerk40t/gui/scene/scene.py +1100 -1051
- meerk40t/gui/scene/sceneconst.py +22 -22
- meerk40t/gui/scene/scenepanel.py +439 -349
- meerk40t/gui/scene/scenespacewidget.py +365 -365
- meerk40t/gui/scene/widget.py +518 -505
- meerk40t/gui/scenewidgets/affinemover.py +215 -215
- meerk40t/gui/scenewidgets/attractionwidget.py +315 -309
- meerk40t/gui/scenewidgets/bedwidget.py +120 -97
- meerk40t/gui/scenewidgets/elementswidget.py +137 -107
- meerk40t/gui/scenewidgets/gridwidget.py +785 -745
- meerk40t/gui/scenewidgets/guidewidget.py +765 -765
- meerk40t/gui/scenewidgets/laserpathwidget.py +66 -66
- meerk40t/gui/scenewidgets/machineoriginwidget.py +86 -86
- meerk40t/gui/scenewidgets/nodeselector.py +28 -28
- meerk40t/gui/scenewidgets/rectselectwidget.py +592 -346
- meerk40t/gui/scenewidgets/relocatewidget.py +33 -33
- meerk40t/gui/scenewidgets/reticlewidget.py +83 -83
- meerk40t/gui/scenewidgets/selectionwidget.py +2958 -2756
- meerk40t/gui/simpleui.py +362 -333
- meerk40t/gui/simulation.py +2451 -2094
- meerk40t/gui/snapoptions.py +208 -203
- meerk40t/gui/spoolerpanel.py +1227 -1180
- meerk40t/gui/statusbarwidgets/defaultoperations.py +480 -353
- meerk40t/gui/statusbarwidgets/infowidget.py +520 -483
- meerk40t/gui/statusbarwidgets/opassignwidget.py +356 -355
- meerk40t/gui/statusbarwidgets/selectionwidget.py +172 -171
- meerk40t/gui/statusbarwidgets/shapepropwidget.py +754 -236
- meerk40t/gui/statusbarwidgets/statusbar.py +272 -260
- meerk40t/gui/statusbarwidgets/statusbarwidget.py +268 -270
- meerk40t/gui/statusbarwidgets/strokewidget.py +267 -251
- meerk40t/gui/themes.py +200 -78
- meerk40t/gui/tips.py +590 -0
- meerk40t/gui/toolwidgets/circlebrush.py +35 -35
- meerk40t/gui/toolwidgets/toolcircle.py +248 -242
- meerk40t/gui/toolwidgets/toolcontainer.py +82 -77
- meerk40t/gui/toolwidgets/tooldraw.py +97 -90
- meerk40t/gui/toolwidgets/toolellipse.py +219 -212
- meerk40t/gui/toolwidgets/toolimagecut.py +25 -132
- meerk40t/gui/toolwidgets/toolline.py +39 -144
- meerk40t/gui/toolwidgets/toollinetext.py +79 -236
- meerk40t/gui/toolwidgets/toollinetext_inline.py +296 -0
- meerk40t/gui/toolwidgets/toolmeasure.py +163 -216
- meerk40t/gui/toolwidgets/toolnodeedit.py +2088 -2074
- meerk40t/gui/toolwidgets/toolnodemove.py +92 -94
- meerk40t/gui/toolwidgets/toolparameter.py +754 -668
- meerk40t/gui/toolwidgets/toolplacement.py +108 -108
- meerk40t/gui/toolwidgets/toolpoint.py +68 -59
- meerk40t/gui/toolwidgets/toolpointlistbuilder.py +294 -0
- meerk40t/gui/toolwidgets/toolpointmove.py +183 -0
- meerk40t/gui/toolwidgets/toolpolygon.py +288 -403
- meerk40t/gui/toolwidgets/toolpolyline.py +38 -196
- meerk40t/gui/toolwidgets/toolrect.py +211 -207
- meerk40t/gui/toolwidgets/toolrelocate.py +72 -72
- meerk40t/gui/toolwidgets/toolribbon.py +598 -113
- meerk40t/gui/toolwidgets/tooltabedit.py +546 -0
- meerk40t/gui/toolwidgets/tooltext.py +98 -89
- meerk40t/gui/toolwidgets/toolvector.py +213 -204
- meerk40t/gui/toolwidgets/toolwidget.py +39 -39
- meerk40t/gui/usbconnect.py +98 -91
- meerk40t/gui/utilitywidgets/buttonwidget.py +18 -18
- meerk40t/gui/utilitywidgets/checkboxwidget.py +90 -90
- meerk40t/gui/utilitywidgets/controlwidget.py +14 -14
- meerk40t/gui/utilitywidgets/cyclocycloidwidget.py +343 -340
- meerk40t/gui/utilitywidgets/debugwidgets.py +148 -0
- meerk40t/gui/utilitywidgets/handlewidget.py +27 -27
- meerk40t/gui/utilitywidgets/harmonograph.py +450 -447
- meerk40t/gui/utilitywidgets/openclosewidget.py +40 -40
- meerk40t/gui/utilitywidgets/rotationwidget.py +54 -54
- meerk40t/gui/utilitywidgets/scalewidget.py +75 -75
- meerk40t/gui/utilitywidgets/seekbarwidget.py +183 -183
- meerk40t/gui/utilitywidgets/togglewidget.py +142 -142
- meerk40t/gui/utilitywidgets/toolbarwidget.py +8 -8
- meerk40t/gui/wordlisteditor.py +985 -931
- meerk40t/gui/wxmeerk40t.py +1447 -1169
- meerk40t/gui/wxmmain.py +5644 -4112
- meerk40t/gui/wxmribbon.py +1591 -1076
- meerk40t/gui/wxmscene.py +1631 -1453
- meerk40t/gui/wxmtree.py +2416 -2089
- meerk40t/gui/wxutils.py +1769 -1099
- meerk40t/gui/zmatrix.py +102 -102
- meerk40t/image/__init__.py +1 -1
- meerk40t/image/dither.py +429 -0
- meerk40t/image/imagetools.py +2793 -2269
- meerk40t/internal_plugins.py +150 -130
- meerk40t/kernel/__init__.py +63 -12
- meerk40t/kernel/channel.py +259 -212
- meerk40t/kernel/context.py +538 -538
- meerk40t/kernel/exceptions.py +41 -41
- meerk40t/kernel/functions.py +463 -414
- meerk40t/kernel/jobs.py +100 -100
- meerk40t/kernel/kernel.py +3828 -3571
- meerk40t/kernel/lifecycles.py +71 -71
- meerk40t/kernel/module.py +49 -49
- meerk40t/kernel/service.py +147 -147
- meerk40t/kernel/settings.py +383 -343
- meerk40t/lihuiyu/controller.py +883 -876
- meerk40t/lihuiyu/device.py +1181 -1069
- meerk40t/lihuiyu/driver.py +1466 -1372
- meerk40t/lihuiyu/gui/gui.py +127 -106
- meerk40t/lihuiyu/gui/lhyaccelgui.py +377 -363
- meerk40t/lihuiyu/gui/lhycontrollergui.py +741 -651
- meerk40t/lihuiyu/gui/lhydrivergui.py +470 -446
- meerk40t/lihuiyu/gui/lhyoperationproperties.py +238 -237
- meerk40t/lihuiyu/gui/tcpcontroller.py +226 -190
- meerk40t/lihuiyu/interpreter.py +53 -53
- meerk40t/lihuiyu/laserspeed.py +450 -450
- meerk40t/lihuiyu/loader.py +90 -90
- meerk40t/lihuiyu/parser.py +404 -404
- meerk40t/lihuiyu/plugin.py +101 -102
- meerk40t/lihuiyu/tcp_connection.py +111 -109
- meerk40t/main.py +231 -165
- meerk40t/moshi/builder.py +788 -781
- meerk40t/moshi/controller.py +505 -499
- meerk40t/moshi/device.py +495 -442
- meerk40t/moshi/driver.py +862 -696
- meerk40t/moshi/gui/gui.py +78 -76
- meerk40t/moshi/gui/moshicontrollergui.py +538 -522
- meerk40t/moshi/gui/moshidrivergui.py +87 -75
- meerk40t/moshi/plugin.py +43 -43
- meerk40t/network/console_server.py +140 -57
- meerk40t/network/kernelserver.py +10 -9
- meerk40t/network/tcp_server.py +142 -140
- meerk40t/network/udp_server.py +103 -77
- meerk40t/network/web_server.py +404 -0
- meerk40t/newly/controller.py +1158 -1144
- meerk40t/newly/device.py +874 -732
- meerk40t/newly/driver.py +540 -412
- meerk40t/newly/gui/gui.py +219 -188
- meerk40t/newly/gui/newlyconfig.py +116 -101
- meerk40t/newly/gui/newlycontroller.py +193 -186
- meerk40t/newly/gui/operationproperties.py +51 -51
- meerk40t/newly/mock_connection.py +82 -82
- meerk40t/newly/newly_params.py +56 -56
- meerk40t/newly/plugin.py +1214 -1246
- meerk40t/newly/usb_connection.py +322 -322
- meerk40t/rotary/gui/gui.py +52 -46
- meerk40t/rotary/gui/rotarysettings.py +240 -232
- meerk40t/rotary/rotary.py +202 -98
- meerk40t/ruida/control.py +291 -91
- meerk40t/ruida/controller.py +138 -1088
- meerk40t/ruida/device.py +676 -231
- meerk40t/ruida/driver.py +534 -472
- meerk40t/ruida/emulator.py +1494 -1491
- meerk40t/ruida/exceptions.py +4 -4
- meerk40t/ruida/gui/gui.py +71 -76
- meerk40t/ruida/gui/ruidaconfig.py +239 -72
- meerk40t/ruida/gui/ruidacontroller.py +187 -184
- meerk40t/ruida/gui/ruidaoperationproperties.py +48 -47
- meerk40t/ruida/loader.py +54 -52
- meerk40t/ruida/mock_connection.py +57 -109
- meerk40t/ruida/plugin.py +124 -87
- meerk40t/ruida/rdjob.py +2084 -945
- meerk40t/ruida/serial_connection.py +116 -0
- meerk40t/ruida/tcp_connection.py +146 -0
- meerk40t/ruida/udp_connection.py +73 -0
- meerk40t/svgelements.py +9671 -9669
- meerk40t/tools/driver_to_path.py +584 -579
- meerk40t/tools/geomstr.py +5583 -4680
- meerk40t/tools/jhfparser.py +357 -292
- meerk40t/tools/kerftest.py +904 -890
- meerk40t/tools/livinghinges.py +1168 -1033
- meerk40t/tools/pathtools.py +987 -949
- meerk40t/tools/pmatrix.py +234 -0
- meerk40t/tools/pointfinder.py +942 -942
- meerk40t/tools/polybool.py +941 -940
- meerk40t/tools/rasterplotter.py +1660 -547
- meerk40t/tools/shxparser.py +1047 -901
- meerk40t/tools/ttfparser.py +726 -446
- meerk40t/tools/zinglplotter.py +595 -593
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7020.dist-info}/LICENSE +21 -21
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7020.dist-info}/METADATA +150 -139
- meerk40t-0.9.7020.dist-info/RECORD +446 -0
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7020.dist-info}/WHEEL +1 -1
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7020.dist-info}/top_level.txt +0 -1
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7020.dist-info}/zip-safe +1 -1
- meerk40t/balormk/elementlightjob.py +0 -159
- meerk40t-0.9.3001.dist-info/RECORD +0 -437
- test/bootstrap.py +0 -63
- test/test_cli.py +0 -12
- test/test_core_cutcode.py +0 -418
- test/test_core_elements.py +0 -144
- test/test_core_plotplanner.py +0 -397
- test/test_core_viewports.py +0 -312
- test/test_drivers_grbl.py +0 -108
- test/test_drivers_lihuiyu.py +0 -443
- test/test_drivers_newly.py +0 -113
- test/test_element_degenerate_points.py +0 -43
- test/test_elements_classify.py +0 -97
- test/test_elements_penbox.py +0 -22
- test/test_file_svg.py +0 -176
- test/test_fill.py +0 -155
- test/test_geomstr.py +0 -1523
- test/test_geomstr_nodes.py +0 -18
- test/test_imagetools_actualize.py +0 -306
- test/test_imagetools_wizard.py +0 -258
- test/test_kernel.py +0 -200
- test/test_laser_speeds.py +0 -3303
- test/test_length.py +0 -57
- test/test_lifecycle.py +0 -66
- test/test_operations.py +0 -251
- test/test_operations_hatch.py +0 -57
- test/test_ruida.py +0 -19
- test/test_spooler.py +0 -22
- test/test_tools_rasterplotter.py +0 -29
- test/test_wobble.py +0 -133
- test/test_zingl.py +0 -124
- {test → meerk40t/cylinder}/__init__.py +0 -0
- /meerk40t/{core/element_commands.py → cylinder/gui/__init__.py} +0 -0
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7020.dist-info}/entry_points.txt +0 -0
meerk40t/grbl/device.py
CHANGED
@@ -1,768 +1,1084 @@
|
|
1
|
-
"""
|
2
|
-
GRBL Device
|
3
|
-
|
4
|
-
Defines the interactions between the device service and the meerk40t's viewport.
|
5
|
-
Registers relevant commands and options.
|
6
|
-
"""
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
from ..core.
|
13
|
-
from ..core.
|
14
|
-
from ..core.
|
15
|
-
from ..
|
16
|
-
from .
|
17
|
-
from .
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
"""
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
self.
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
self
|
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
|
-
"attr": "
|
81
|
-
"object": self,
|
82
|
-
"default":
|
83
|
-
"type":
|
84
|
-
"label": _("
|
85
|
-
"tip": _(
|
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
|
-
self.
|
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
|
-
self.
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
)
|
238
|
-
self.
|
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
|
-
"tip": _(
|
384
|
-
"
|
385
|
-
),
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
"
|
390
|
-
"
|
391
|
-
"
|
392
|
-
"
|
393
|
-
"
|
394
|
-
"tip": _("
|
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
|
-
channel(
|
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
|
-
@self.
|
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
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
)
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
)
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
1
|
+
"""
|
2
|
+
GRBL Device
|
3
|
+
|
4
|
+
Defines the interactions between the device service and the meerk40t's viewport.
|
5
|
+
Registers relevant commands and options.
|
6
|
+
"""
|
7
|
+
|
8
|
+
from time import sleep
|
9
|
+
|
10
|
+
from meerk40t.kernel import CommandSyntaxError, Service, signal_listener
|
11
|
+
|
12
|
+
from ..core.laserjob import LaserJob
|
13
|
+
from ..core.spoolers import Spooler
|
14
|
+
from ..core.units import MM_PER_INCH, Length
|
15
|
+
from ..core.view import View
|
16
|
+
from ..device.mixins import Status
|
17
|
+
from .controller import GrblController
|
18
|
+
from .driver import GRBLDriver
|
19
|
+
from meerk40t.device.devicechoices import get_effect_choices
|
20
|
+
|
21
|
+
|
22
|
+
class GRBLDevice(Service, Status):
|
23
|
+
"""
|
24
|
+
GRBLDevice is driver for the Gcode Controllers
|
25
|
+
"""
|
26
|
+
|
27
|
+
def __init__(self, kernel, path, *args, choices=None, **kwargs):
|
28
|
+
self.hardware_config = {}
|
29
|
+
self.permit_tcp = True
|
30
|
+
self.permit_ws = True
|
31
|
+
self.permit_serial = True
|
32
|
+
|
33
|
+
Service.__init__(self, kernel, path)
|
34
|
+
Status.__init__(self)
|
35
|
+
self.name = "GRBLDevice"
|
36
|
+
self.extension = "gcode"
|
37
|
+
if choices is not None:
|
38
|
+
for c in choices:
|
39
|
+
attr = c.get("attr")
|
40
|
+
default = c.get("default")
|
41
|
+
if attr is not None and default is not None:
|
42
|
+
setattr(self, attr, default)
|
43
|
+
|
44
|
+
# self.redlight_preferred = False
|
45
|
+
|
46
|
+
self.setting(str, "label", path)
|
47
|
+
_ = self._
|
48
|
+
choices = [
|
49
|
+
{
|
50
|
+
"attr": "label",
|
51
|
+
"object": self,
|
52
|
+
"default": "grbl",
|
53
|
+
"type": str,
|
54
|
+
"label": _("Label"),
|
55
|
+
"tip": _("What is this device called."),
|
56
|
+
"width": 250,
|
57
|
+
"signals": "device;renamed",
|
58
|
+
},
|
59
|
+
{
|
60
|
+
"attr": "bedwidth",
|
61
|
+
"object": self,
|
62
|
+
"default": "235mm",
|
63
|
+
"type": Length,
|
64
|
+
"label": _("Width"),
|
65
|
+
"tip": _("Width of the laser bed."),
|
66
|
+
"subsection": "_10_Dimensions",
|
67
|
+
"nonzero": True,
|
68
|
+
},
|
69
|
+
{
|
70
|
+
"attr": "bedheight",
|
71
|
+
"object": self,
|
72
|
+
"default": "235mm",
|
73
|
+
"type": Length,
|
74
|
+
"label": _("Height"),
|
75
|
+
"tip": _("Height of the laser bed."),
|
76
|
+
"subsection": "_10_Dimensions",
|
77
|
+
"nonzero": True,
|
78
|
+
},
|
79
|
+
{
|
80
|
+
"attr": "laserspot",
|
81
|
+
"object": self,
|
82
|
+
"default": "0.3mm",
|
83
|
+
"type": Length,
|
84
|
+
"label": _("Laserspot"),
|
85
|
+
"tip": _("Laser spot size"),
|
86
|
+
"subsection": "_10_Dimensions",
|
87
|
+
"nonzero": True,
|
88
|
+
},
|
89
|
+
{
|
90
|
+
"attr": "scale_x",
|
91
|
+
"object": self,
|
92
|
+
"default": 1.000,
|
93
|
+
"type": float,
|
94
|
+
"label": _("X-Axis"),
|
95
|
+
"tip": _(
|
96
|
+
"Scale factor for the X-axis. Board units to actual physical units."
|
97
|
+
),
|
98
|
+
"subsection": "_20_Scale",
|
99
|
+
},
|
100
|
+
{
|
101
|
+
"attr": "scale_y",
|
102
|
+
"object": self,
|
103
|
+
"default": 1.000,
|
104
|
+
"type": float,
|
105
|
+
"label": _("Y-Axis"),
|
106
|
+
"tip": _(
|
107
|
+
"Scale factor for the Y-axis. Board units to actual physical units."
|
108
|
+
),
|
109
|
+
"subsection": "_20_Scale",
|
110
|
+
},
|
111
|
+
{
|
112
|
+
"attr": "user_margin_x",
|
113
|
+
"object": self,
|
114
|
+
"default": "0",
|
115
|
+
"type": str,
|
116
|
+
"label": _("X-Margin"),
|
117
|
+
"tip": _(
|
118
|
+
"Margin for the X-axis. This will be a kind of unused space at the left side."
|
119
|
+
),
|
120
|
+
"subsection": "_30_User Offset",
|
121
|
+
},
|
122
|
+
{
|
123
|
+
"attr": "user_margin_y",
|
124
|
+
"object": self,
|
125
|
+
"default": "0",
|
126
|
+
"type": str,
|
127
|
+
"label": _("Y-Margin"),
|
128
|
+
"tip": _(
|
129
|
+
"Margin for the Y-axis. This will be a kind of unused space at the top."
|
130
|
+
),
|
131
|
+
"subsection": "_30_User Offset",
|
132
|
+
},
|
133
|
+
{
|
134
|
+
"attr": "flip_x",
|
135
|
+
"object": self,
|
136
|
+
"default": False,
|
137
|
+
"type": bool,
|
138
|
+
"label": _("Flip X"),
|
139
|
+
"tip": _(
|
140
|
+
"+X is standard for grbl but sometimes settings can flip that."
|
141
|
+
),
|
142
|
+
"subsection": "_40_Flip Axis",
|
143
|
+
},
|
144
|
+
{
|
145
|
+
"attr": "flip_y",
|
146
|
+
"object": self,
|
147
|
+
"default": True,
|
148
|
+
"type": bool,
|
149
|
+
"label": _("Flip Y"),
|
150
|
+
"tip": _(
|
151
|
+
"-Y is standard for grbl but sometimes settings can flip that."
|
152
|
+
),
|
153
|
+
"subsection": "_40_Flip Axis",
|
154
|
+
},
|
155
|
+
{
|
156
|
+
"attr": "swap_xy",
|
157
|
+
"object": self,
|
158
|
+
"default": False,
|
159
|
+
"type": bool,
|
160
|
+
"label": _("Swap XY"),
|
161
|
+
"tip": _(
|
162
|
+
"Swaps the X and Y axis. This happens before the FlipX and FlipY."
|
163
|
+
),
|
164
|
+
"subsection": "_50_Axis corrections",
|
165
|
+
},
|
166
|
+
{
|
167
|
+
"attr": "home_corner",
|
168
|
+
"object": self,
|
169
|
+
"default": "auto",
|
170
|
+
"type": str,
|
171
|
+
"style": "combo",
|
172
|
+
"choices": [
|
173
|
+
"auto",
|
174
|
+
"top-left",
|
175
|
+
"top-right",
|
176
|
+
"bottom-left",
|
177
|
+
"bottom-right",
|
178
|
+
"center",
|
179
|
+
],
|
180
|
+
"label": _("Force Declared Home"),
|
181
|
+
"tip": _("Override native home location"),
|
182
|
+
"subsection": "_60_Home position",
|
183
|
+
},
|
184
|
+
{
|
185
|
+
"attr": "signal_updates",
|
186
|
+
"object": self,
|
187
|
+
"default": True,
|
188
|
+
"type": bool,
|
189
|
+
"label": _("Device Position"),
|
190
|
+
"tip": _(
|
191
|
+
"Do you want to see some indicator about the current device position?"
|
192
|
+
),
|
193
|
+
"section": "_95_" + _("Screen updates"),
|
194
|
+
"signals": "restart",
|
195
|
+
},
|
196
|
+
]
|
197
|
+
self.register_choices("bed_dim", choices)
|
198
|
+
|
199
|
+
self.register_choices("grbl-effects", get_effect_choices(self))
|
200
|
+
|
201
|
+
# This device prefers to display power level in percent
|
202
|
+
self.setting(bool, "use_percent_for_power_display", True)
|
203
|
+
# This device prefers to display speed in mm/min
|
204
|
+
self.setting(bool, "use_mm_min_for_speed_display", False)
|
205
|
+
|
206
|
+
# Tuple contains 4 value pairs: Speed Low, Speed High, Power Low, Power High, each with enabled, value
|
207
|
+
self.setting(
|
208
|
+
list, "dangerlevel_op_cut", (False, 0, False, 0, False, 0, False, 0)
|
209
|
+
)
|
210
|
+
self.setting(
|
211
|
+
list, "dangerlevel_op_engrave", (False, 0, False, 0, False, 0, False, 0)
|
212
|
+
)
|
213
|
+
self.setting(
|
214
|
+
list, "dangerlevel_op_hatch", (False, 0, False, 0, False, 0, False, 0)
|
215
|
+
)
|
216
|
+
self.setting(
|
217
|
+
list, "dangerlevel_op_raster", (False, 0, False, 0, False, 0, False, 0)
|
218
|
+
)
|
219
|
+
self.setting(
|
220
|
+
list, "dangerlevel_op_image", (False, 0, False, 0, False, 0, False, 0)
|
221
|
+
)
|
222
|
+
self.setting(
|
223
|
+
list, "dangerlevel_op_dots", (False, 0, False, 0, False, 0, False, 0)
|
224
|
+
)
|
225
|
+
self.view = View(
|
226
|
+
self.bedwidth,
|
227
|
+
self.bedheight,
|
228
|
+
dpi_x=1000.0,
|
229
|
+
dpi_y=1000.0,
|
230
|
+
)
|
231
|
+
self.view_mm = View(
|
232
|
+
self.bedwidth,
|
233
|
+
self.bedheight,
|
234
|
+
dpi_x=MM_PER_INCH,
|
235
|
+
dpi_y=MM_PER_INCH,
|
236
|
+
)
|
237
|
+
self.realize()
|
238
|
+
self.settings = dict()
|
239
|
+
self.state = 0
|
240
|
+
|
241
|
+
def update(choice_dict):
|
242
|
+
"""
|
243
|
+
Sets the choices and display of the serial_port values dynamically
|
244
|
+
@param choice_dict:
|
245
|
+
@return:
|
246
|
+
"""
|
247
|
+
try:
|
248
|
+
import serial.tools.list_ports
|
249
|
+
|
250
|
+
ports = serial.tools.list_ports.comports()
|
251
|
+
serial_interface = [x.device for x in ports]
|
252
|
+
serial_interface_display = [str(x) for x in ports]
|
253
|
+
|
254
|
+
choice_dict["choices"] = serial_interface
|
255
|
+
choice_dict["display"] = serial_interface_display
|
256
|
+
except ImportError:
|
257
|
+
choice_dict["choices"] = ["UNCONFIGURED"]
|
258
|
+
choice_dict["display"] = ["pyserial-not-installed"]
|
259
|
+
|
260
|
+
from platform import system
|
261
|
+
is_linux = system() == "Linux"
|
262
|
+
choices = [
|
263
|
+
{
|
264
|
+
"attr": "serial_port",
|
265
|
+
"object": self,
|
266
|
+
"default": "UNCONFIGURED",
|
267
|
+
"type": str,
|
268
|
+
"style": "combosmall" if is_linux else "option",
|
269
|
+
"label": "",
|
270
|
+
"tip": _("What serial interface does this device connect to?"),
|
271
|
+
"section": "_10_Serial Interface",
|
272
|
+
"subsection": "_00_",
|
273
|
+
"dynamic": update,
|
274
|
+
"exclusive": not is_linux,
|
275
|
+
},
|
276
|
+
{
|
277
|
+
"attr": "baud_rate",
|
278
|
+
"object": self,
|
279
|
+
"default": 115200,
|
280
|
+
"type": int,
|
281
|
+
"label": _("Baud Rate"),
|
282
|
+
"tip": _("Baud Rate of the device"),
|
283
|
+
"section": "_10_Serial Interface",
|
284
|
+
"subsection": "_00_",
|
285
|
+
},
|
286
|
+
]
|
287
|
+
if self.permit_serial:
|
288
|
+
self.register_choices("serial", choices)
|
289
|
+
|
290
|
+
choices = [
|
291
|
+
{
|
292
|
+
"attr": "address",
|
293
|
+
"object": self,
|
294
|
+
"default": "localhost",
|
295
|
+
"type": str,
|
296
|
+
"label": _("Address"),
|
297
|
+
# "style": "address",
|
298
|
+
"tip": _("IP address/host name of the GRBL device"),
|
299
|
+
"signals": "update_interface",
|
300
|
+
},
|
301
|
+
{
|
302
|
+
"attr": "port",
|
303
|
+
"object": self,
|
304
|
+
"default": 23,
|
305
|
+
"type": int,
|
306
|
+
"label": _("Port"),
|
307
|
+
"tip": _("TCP Port of the GRBL device"),
|
308
|
+
"lower": 0,
|
309
|
+
"upper": 65535,
|
310
|
+
"signals": "update_interface",
|
311
|
+
},
|
312
|
+
]
|
313
|
+
if self.permit_tcp:
|
314
|
+
self.register_choices("tcp", choices)
|
315
|
+
|
316
|
+
try:
|
317
|
+
import websocket
|
318
|
+
except ImportError:
|
319
|
+
self.permit_ws = False
|
320
|
+
choices = [
|
321
|
+
{
|
322
|
+
"attr": "address",
|
323
|
+
"object": self,
|
324
|
+
"default": "localhost",
|
325
|
+
"type": str,
|
326
|
+
"label": _("Address"),
|
327
|
+
# "style": "address",
|
328
|
+
"tip": _("IP address/host name of the GRBL device"),
|
329
|
+
"signals": "update_interface",
|
330
|
+
},
|
331
|
+
{
|
332
|
+
"attr": "port",
|
333
|
+
"object": self,
|
334
|
+
"default": 81,
|
335
|
+
"type": int,
|
336
|
+
"label": _("Port"),
|
337
|
+
"tip": _("TCP Port of the device (usually 81)"),
|
338
|
+
"lower": 0,
|
339
|
+
"upper": 65535,
|
340
|
+
"signals": "update_interface",
|
341
|
+
},
|
342
|
+
]
|
343
|
+
if self.permit_ws:
|
344
|
+
self.register_choices("ws", choices)
|
345
|
+
list_interfaces = []
|
346
|
+
list_display = []
|
347
|
+
if self.permit_serial:
|
348
|
+
list_interfaces.append("serial")
|
349
|
+
list_display.append(_("Serial"))
|
350
|
+
if self.permit_tcp:
|
351
|
+
list_interfaces.append("tcp")
|
352
|
+
list_display.append(_("TCP-Network"))
|
353
|
+
if self.permit_ws:
|
354
|
+
list_interfaces.append("ws")
|
355
|
+
list_display.append(_("WebSocket-Network"))
|
356
|
+
list_interfaces.append("mock")
|
357
|
+
list_display.append(_("Mock"))
|
358
|
+
choices = [
|
359
|
+
{
|
360
|
+
"attr": "interface",
|
361
|
+
"object": self,
|
362
|
+
"default": "serial",
|
363
|
+
"style": "combosmall",
|
364
|
+
"choices": list_interfaces,
|
365
|
+
"display": list_display,
|
366
|
+
"type": str,
|
367
|
+
"label": _("Interface Type"),
|
368
|
+
"tip": _("Select the interface type for the grbl device"),
|
369
|
+
"section": "_20_Protocol",
|
370
|
+
"signals": "update_interface",
|
371
|
+
},
|
372
|
+
]
|
373
|
+
self.register_choices("interface", choices)
|
374
|
+
|
375
|
+
choices = [
|
376
|
+
{
|
377
|
+
"attr": "use_m3",
|
378
|
+
"object": self,
|
379
|
+
"default": False,
|
380
|
+
"type": bool,
|
381
|
+
"label": _("Use M3"),
|
382
|
+
"section": "_5_Config",
|
383
|
+
"tip": _(
|
384
|
+
"Uses M3 rather than M4 for laser start (see GRBL docs for additional info)"
|
385
|
+
),
|
386
|
+
},
|
387
|
+
{
|
388
|
+
"attr": "extended_alarm_clear",
|
389
|
+
"object": self,
|
390
|
+
"default": False,
|
391
|
+
"type": bool,
|
392
|
+
"label": _("Reset on 'Clear Alarm'"),
|
393
|
+
"section": "_5_Config",
|
394
|
+
"tip": _("Reset the controller too on a 'Clear Alarm' command"),
|
395
|
+
},
|
396
|
+
{
|
397
|
+
"attr": "interp",
|
398
|
+
"object": self,
|
399
|
+
"default": 5,
|
400
|
+
"type": int,
|
401
|
+
"label": _("Curve Interpolation"),
|
402
|
+
"section": "_5_Config",
|
403
|
+
"tip": _("Distance of the curve interpolation in mils"),
|
404
|
+
},
|
405
|
+
{
|
406
|
+
"attr": "has_endstops",
|
407
|
+
"object": self,
|
408
|
+
"default": False,
|
409
|
+
"type": bool,
|
410
|
+
"label": _("Device has endstops"),
|
411
|
+
"section": "_5_Config",
|
412
|
+
"tip": _(
|
413
|
+
"If the device has endstops, then the laser can home itself to this position = physical home ($H)"
|
414
|
+
),
|
415
|
+
},
|
416
|
+
{
|
417
|
+
"attr": "use_red_dot",
|
418
|
+
"object": self,
|
419
|
+
"default": False,
|
420
|
+
"type": bool,
|
421
|
+
"label": _("Simulate reddot"),
|
422
|
+
"tip": _(
|
423
|
+
"If active then you can turn on the laser at a very low power to get a visual representation "
|
424
|
+
+ "of the current position to help with focusing and positioning. Use with care!"
|
425
|
+
),
|
426
|
+
"signals": "icons", # Update ribbonbar if needed
|
427
|
+
"section": "_10_Red Dot",
|
428
|
+
},
|
429
|
+
{
|
430
|
+
"attr": "red_dot_level",
|
431
|
+
"object": self,
|
432
|
+
"default": 30,
|
433
|
+
"type": int,
|
434
|
+
"style": "slider",
|
435
|
+
"min": 0,
|
436
|
+
"max": 200,
|
437
|
+
"label": _("Reddot Laser strength"),
|
438
|
+
"trailer": "/1000",
|
439
|
+
"tip": _(
|
440
|
+
"Provide the power level of the red dot indicator, needs to be under the critical laser strength to not burn the material"
|
441
|
+
),
|
442
|
+
"conditional": (self, "use_red_dot"),
|
443
|
+
"section": "_10_Red Dot",
|
444
|
+
},
|
445
|
+
{
|
446
|
+
"attr": "max_vector_speed",
|
447
|
+
"object": self,
|
448
|
+
"default": 140,
|
449
|
+
"type": float,
|
450
|
+
"label": _("Max vector speed"),
|
451
|
+
"trailer": "mm/s",
|
452
|
+
"tip": _(
|
453
|
+
"What is the highest reliable speed your laser is able to perform vector operations, i.e. engraving or cutting.\n"
|
454
|
+
"You can finetune this in the Warning Sections of this configuration dialog."
|
455
|
+
),
|
456
|
+
"section": "_20_" + _("Maximum speeds"),
|
457
|
+
"subsection": "_10_",
|
458
|
+
},
|
459
|
+
{
|
460
|
+
"attr": "max_raster_speed",
|
461
|
+
"object": self,
|
462
|
+
"default": 750,
|
463
|
+
"type": float,
|
464
|
+
"label": _("Max raster speed"),
|
465
|
+
"trailer": "mm/s",
|
466
|
+
"tip": _(
|
467
|
+
"What is the highest reliable speed your laser is able to perform raster or image operations.\n"
|
468
|
+
"You can finetune this in the Warning Sections of this configuration dialog."
|
469
|
+
),
|
470
|
+
"section": "_20_" + _("Maximum speeds"),
|
471
|
+
"subsection": "_10_",
|
472
|
+
},
|
473
|
+
{
|
474
|
+
"attr": "limit_buffer",
|
475
|
+
"object": self,
|
476
|
+
"default": True,
|
477
|
+
"type": bool,
|
478
|
+
"label": _("Limit the controller buffer size"),
|
479
|
+
"tip": _("Enables the controller buffer limit."),
|
480
|
+
"section": "_30_Controller Buffer",
|
481
|
+
},
|
482
|
+
{
|
483
|
+
"attr": "max_buffer",
|
484
|
+
"object": self,
|
485
|
+
"default": 200,
|
486
|
+
"trailer": _("lines"),
|
487
|
+
"type": int,
|
488
|
+
"label": _("Controller Buffer"),
|
489
|
+
"tip": _(
|
490
|
+
"This is the limit of the controller buffer size. Prevents full writing to the controller."
|
491
|
+
),
|
492
|
+
"conditional": (self, "limit_buffer"),
|
493
|
+
"section": "_30_Controller Buffer",
|
494
|
+
},
|
495
|
+
{
|
496
|
+
"attr": "device_coolant",
|
497
|
+
"object": self,
|
498
|
+
"default": "",
|
499
|
+
"type": str,
|
500
|
+
"style": "option",
|
501
|
+
"label": _("Coolant"),
|
502
|
+
"tip": _(
|
503
|
+
"Does this device has a method to turn on / off a coolant associated to it?"
|
504
|
+
),
|
505
|
+
"section": "_99_" + _("Coolant Support"),
|
506
|
+
"dynamic": self.cool_helper,
|
507
|
+
"signals": "coolant_changed",
|
508
|
+
},
|
509
|
+
]
|
510
|
+
self.register_choices("grbl-advanced", choices)
|
511
|
+
|
512
|
+
choices = [
|
513
|
+
{
|
514
|
+
"attr": "require_validator",
|
515
|
+
"object": self,
|
516
|
+
"default": False,
|
517
|
+
"type": bool,
|
518
|
+
"label": _("Require Validator"),
|
519
|
+
"tip": _(
|
520
|
+
"Do not validate the connection without seeing the welcome message at start."
|
521
|
+
),
|
522
|
+
"section": "_40_Validation",
|
523
|
+
},
|
524
|
+
{
|
525
|
+
"attr": "welcome",
|
526
|
+
"object": self,
|
527
|
+
"default": "Grbl",
|
528
|
+
"type": str,
|
529
|
+
"label": _("Welcome Validator"),
|
530
|
+
"tip": _(
|
531
|
+
"If for some reason the device needs a different welcome validator than 'Grbl' (default), for example, somewhat custom grbl-like firmware"
|
532
|
+
),
|
533
|
+
"section": "_40_Validation",
|
534
|
+
},
|
535
|
+
{
|
536
|
+
"attr": "reset_on_connect",
|
537
|
+
"object": self,
|
538
|
+
"default": False,
|
539
|
+
"type": bool,
|
540
|
+
"label": _("Reset on connect"),
|
541
|
+
"tip": _(
|
542
|
+
"On connection, send the device a softreset message as soon as connection is established."
|
543
|
+
),
|
544
|
+
"section": "_40_Validation",
|
545
|
+
},
|
546
|
+
{
|
547
|
+
"attr": "boot_connect_sequence",
|
548
|
+
"object": self,
|
549
|
+
"default": True,
|
550
|
+
"type": bool,
|
551
|
+
"label": _("Check sequence on connect."),
|
552
|
+
"tip": _("On connection, check the standard GRBL info for the device."),
|
553
|
+
"section": "_40_Validation",
|
554
|
+
},
|
555
|
+
{
|
556
|
+
"attr": "buffer_mode",
|
557
|
+
"object": self,
|
558
|
+
"default": "buffered",
|
559
|
+
"type": str,
|
560
|
+
"style": "combo",
|
561
|
+
"choices": ["buffered", "sync"],
|
562
|
+
"label": _("Sending Protocol"),
|
563
|
+
"tip": _(
|
564
|
+
"Buffered sends data as long as the planning buffer permits it being sent. Sync requires an 'ok' between each line sent."
|
565
|
+
),
|
566
|
+
"section": "_20_Protocol",
|
567
|
+
"subsection": "_00_",
|
568
|
+
},
|
569
|
+
{
|
570
|
+
"attr": "planning_buffer_size",
|
571
|
+
"object": self,
|
572
|
+
"default": 128,
|
573
|
+
"type": int,
|
574
|
+
"label": _("Planning Buffer Size"),
|
575
|
+
"tip": _("Size of Planning Buffer"),
|
576
|
+
"section": "_20_Protocol",
|
577
|
+
"subsection": "_00_",
|
578
|
+
},
|
579
|
+
{
|
580
|
+
"attr": "line_end",
|
581
|
+
"object": self,
|
582
|
+
"default": "CR",
|
583
|
+
"type": str,
|
584
|
+
"style": "combosmall",
|
585
|
+
"choices": ["CR", "LF", "CRLF"],
|
586
|
+
"label": _("Line Ending"),
|
587
|
+
"tip": _(
|
588
|
+
"CR for carriage return (\\r), LF for line feed(\\n), CRLF for both"
|
589
|
+
),
|
590
|
+
"section": "_20_Protocol",
|
591
|
+
},
|
592
|
+
{
|
593
|
+
"attr": "connect_delay",
|
594
|
+
"object": self,
|
595
|
+
"default": 0,
|
596
|
+
"trailer": _("ms"),
|
597
|
+
"type": int,
|
598
|
+
"label": _("Post Connection Delay"),
|
599
|
+
"tip": _(
|
600
|
+
"Delay the GRBL communications after initial connect. (Some slow boot devices may need this)"
|
601
|
+
),
|
602
|
+
"section": "_40_Validation",
|
603
|
+
},
|
604
|
+
{
|
605
|
+
"attr": "startup_commands",
|
606
|
+
"object": self,
|
607
|
+
"default": "",
|
608
|
+
"type": str,
|
609
|
+
"style": "multiline",
|
610
|
+
"label": _("Startup commands"),
|
611
|
+
"tip": _(
|
612
|
+
"Which commands should be sent to the device on a successful connect?"
|
613
|
+
),
|
614
|
+
"section": "_40_Validation",
|
615
|
+
},
|
616
|
+
]
|
617
|
+
self.register_choices("protocol", choices)
|
618
|
+
|
619
|
+
self.driver = GRBLDriver(self)
|
620
|
+
self.controller = GrblController(self)
|
621
|
+
self.driver.out_pipe = self.controller.write
|
622
|
+
self.driver.out_real = self.controller.realtime
|
623
|
+
|
624
|
+
self.spooler = Spooler(self, driver=self.driver)
|
625
|
+
|
626
|
+
self.add_service_delegate(self.controller)
|
627
|
+
self.add_service_delegate(self.spooler)
|
628
|
+
self.add_service_delegate(self.driver)
|
629
|
+
|
630
|
+
self.viewbuffer = ""
|
631
|
+
self.kernel.root.coolant.claim_coolant(self, self.device_coolant)
|
632
|
+
|
633
|
+
_ = self.kernel.translation
|
634
|
+
|
635
|
+
if self.permit_serial:
|
636
|
+
self._register_console_serial()
|
637
|
+
|
638
|
+
@self.console_command(
|
639
|
+
("gcode", "grbl"),
|
640
|
+
help=_("Send raw gcode to the device"),
|
641
|
+
input_type=None,
|
642
|
+
)
|
643
|
+
def gcode(command, channel, _, data=None, remainder=None, **kwgs):
|
644
|
+
if remainder is not None:
|
645
|
+
channel(remainder)
|
646
|
+
self.driver(remainder + self.driver.line_end) # , real=True)
|
647
|
+
# self.channel("grbl/send")(remainder + self.driver.line_end)
|
648
|
+
|
649
|
+
@self.console_command(
|
650
|
+
("gcode_realtime", "grbl_realtime"),
|
651
|
+
help=_("Send raw gcode to the device (via realtime channel)"),
|
652
|
+
input_type=None,
|
653
|
+
)
|
654
|
+
def gcode_realtime(command, channel, _, data=None, remainder=None, **kwgs):
|
655
|
+
if remainder is not None:
|
656
|
+
channel(remainder)
|
657
|
+
self.driver(remainder + self.driver.line_end, real=True)
|
658
|
+
|
659
|
+
@self.console_command(
|
660
|
+
"grbl_validate",
|
661
|
+
help=_("Force grbl validation for the connection"),
|
662
|
+
input_type=None,
|
663
|
+
)
|
664
|
+
def grbl_validate(command, channel, _, data=None, remainder=None, **kwgs):
|
665
|
+
channel(_("Forced grbl validation."))
|
666
|
+
self.controller.force_validate()
|
667
|
+
|
668
|
+
@self.console_command(
|
669
|
+
"soft_reset",
|
670
|
+
help=_("Send realtime soft reset gcode to the device"),
|
671
|
+
input_type=None,
|
672
|
+
)
|
673
|
+
def soft_reset(command, channel, _, data=None, remainder=None, **kwgs):
|
674
|
+
self.driver.reset()
|
675
|
+
self.laser_status = "idle"
|
676
|
+
|
677
|
+
@self.console_command(
|
678
|
+
"estop",
|
679
|
+
help=_("Send estop to the laser"),
|
680
|
+
input_type=None,
|
681
|
+
)
|
682
|
+
def estop(command, channel, _, data=None, remainder=None, **kwgs):
|
683
|
+
self.driver.reset()
|
684
|
+
self.laser_status = "idle"
|
685
|
+
|
686
|
+
@self.console_command(
|
687
|
+
"clear_alarm",
|
688
|
+
help=_("Send clear_alarm to the laser"),
|
689
|
+
input_type=None,
|
690
|
+
)
|
691
|
+
def clear_alarm(command, channel, _, data=None, remainder=None, **kwgs):
|
692
|
+
self.driver.clear_alarm()
|
693
|
+
self.laser_status = "idle"
|
694
|
+
|
695
|
+
@self.console_command(
|
696
|
+
"pause",
|
697
|
+
help=_("Send realtime soft pause/resume gcode to the device"),
|
698
|
+
input_type=None,
|
699
|
+
)
|
700
|
+
def pause(command, channel, _, data=None, remainder=None, **kwgs):
|
701
|
+
if self.driver.paused:
|
702
|
+
self.driver.resume()
|
703
|
+
else:
|
704
|
+
self.driver.pause()
|
705
|
+
self.signal("pause")
|
706
|
+
|
707
|
+
@self.console_command(
|
708
|
+
"resume",
|
709
|
+
help=_("Send realtime resume gcode to the device"),
|
710
|
+
input_type=None,
|
711
|
+
)
|
712
|
+
def resume(command, channel, _, data=None, remainder=None, **kwgs):
|
713
|
+
self.driver.resume()
|
714
|
+
self.signal("pause")
|
715
|
+
|
716
|
+
@kernel.console_command(
|
717
|
+
"+xforward",
|
718
|
+
hidden=True,
|
719
|
+
)
|
720
|
+
def plus_x_forward(data, **kwgs):
|
721
|
+
feed = 2000
|
722
|
+
step = feed / 600
|
723
|
+
self(f".timerright 0 0.1 .gcode $J=G91G21X{step}F{feed}")
|
724
|
+
|
725
|
+
@kernel.console_command(
|
726
|
+
"-xforward",
|
727
|
+
hidden=True,
|
728
|
+
)
|
729
|
+
def minus_x_forward(data, **kwgs):
|
730
|
+
self(".timerright -oq")
|
731
|
+
# self.controller.realtime("\x85")
|
732
|
+
|
733
|
+
@kernel.console_command(
|
734
|
+
"+xbackward",
|
735
|
+
hidden=True,
|
736
|
+
)
|
737
|
+
def plus_x_backward(data, **kwgs):
|
738
|
+
feed = 2000
|
739
|
+
step = feed / 600
|
740
|
+
self(f".timerleft 0 0.1 .gcode $J=G91G21X-{step}F{feed}")
|
741
|
+
|
742
|
+
@kernel.console_command(
|
743
|
+
"-xbackward",
|
744
|
+
hidden=True,
|
745
|
+
)
|
746
|
+
def minus_x_backward(data, **kwgs):
|
747
|
+
self(".timerleft -oq")
|
748
|
+
|
749
|
+
@kernel.console_command(
|
750
|
+
"+yforward",
|
751
|
+
hidden=True,
|
752
|
+
)
|
753
|
+
def plus_y_forward(data, **kwgs):
|
754
|
+
feed = 2000
|
755
|
+
step = feed / 600
|
756
|
+
self(f".timertop 0 0.1 .gcode $J=G91G21Y{step}F{feed}")
|
757
|
+
|
758
|
+
@kernel.console_command(
|
759
|
+
"-yforward",
|
760
|
+
hidden=True,
|
761
|
+
)
|
762
|
+
def minus_y_forward(data, **kwgs):
|
763
|
+
self(".timertop -oq")
|
764
|
+
# self.controller.realtime("\x85")
|
765
|
+
|
766
|
+
@kernel.console_command(
|
767
|
+
"+ybackward",
|
768
|
+
hidden=True,
|
769
|
+
)
|
770
|
+
def plus_y_backward(data, **kwgs):
|
771
|
+
feed = 2000
|
772
|
+
step = feed / 600
|
773
|
+
self(f".timerbottom 0 0.1 .gcode $J=G91G21Y-{step}F{feed}")
|
774
|
+
|
775
|
+
@kernel.console_command(
|
776
|
+
"-ybackward",
|
777
|
+
hidden=True,
|
778
|
+
)
|
779
|
+
def minus_y_backward(data, **kwgs):
|
780
|
+
self(".timerbottom -oq")
|
781
|
+
# self.controller.realtime("\x85")
|
782
|
+
|
783
|
+
@kernel.console_command(
|
784
|
+
"grbl_binds",
|
785
|
+
hidden=True,
|
786
|
+
)
|
787
|
+
def grbl_binds(data, **kwgs):
|
788
|
+
self("bind a +xbackward")
|
789
|
+
self("bind d +xforward")
|
790
|
+
self("bind s +ybackward")
|
791
|
+
self("bind w +yforward")
|
792
|
+
|
793
|
+
@self.console_option(
|
794
|
+
"strength", "s", type=int, help="Set the dot laser strength."
|
795
|
+
)
|
796
|
+
@self.console_argument("off", type=str)
|
797
|
+
@self.console_command(
|
798
|
+
"red",
|
799
|
+
help=_("Turns redlight on/off"),
|
800
|
+
)
|
801
|
+
def red_dot_on(
|
802
|
+
command, channel, _, off=None, strength=None, remainder=None, **kwgs
|
803
|
+
):
|
804
|
+
if not self.use_red_dot:
|
805
|
+
channel("Red Dot feature is not enabled, see config")
|
806
|
+
# self.redlight_preferred = False
|
807
|
+
return
|
808
|
+
if not self.spooler.is_idle:
|
809
|
+
channel("Won't interfere with a running job, abort...")
|
810
|
+
return
|
811
|
+
if strength is not None:
|
812
|
+
if 0 <= strength <= 1000:
|
813
|
+
self.red_dot_level = strength
|
814
|
+
channel(
|
815
|
+
f"Laser strength for red dot is now: {self.red_dot_level/10.0}%"
|
816
|
+
)
|
817
|
+
if off == "off":
|
818
|
+
self.driver.laser_off()
|
819
|
+
# self.driver.grbl("G0")
|
820
|
+
self.driver.move_mode = 0
|
821
|
+
# self.redlight_preferred = False
|
822
|
+
channel("Turning off redlight.")
|
823
|
+
self.signal("grbl_red_dot", False)
|
824
|
+
else:
|
825
|
+
# self.redlight_preferred = True
|
826
|
+
# self.driver.set("power", int(self.red_dot_level / 100 * 1000))
|
827
|
+
self.driver._clean()
|
828
|
+
self.driver.laser_on(power=int(self.red_dot_level), speed=1000)
|
829
|
+
# By default, any move is a G0 move which will not activate the laser,
|
830
|
+
# so we need to switch to G1 mode:
|
831
|
+
self.driver.move_mode = 1
|
832
|
+
# An arbitrary move to turn the laser really on!
|
833
|
+
# self.driver.grbl("G1")
|
834
|
+
channel("Turning on redlight.")
|
835
|
+
self.signal("grbl_red_dot", True)
|
836
|
+
|
837
|
+
@self.console_option(
|
838
|
+
"idonotlovemyhouse",
|
839
|
+
type=bool,
|
840
|
+
action="store_true",
|
841
|
+
help=_("override one second laser fire pulse duration"),
|
842
|
+
)
|
843
|
+
@self.console_argument("time", type=float, help=_("laser fire pulse duration"))
|
844
|
+
@self.console_command(
|
845
|
+
"pulse",
|
846
|
+
help=_("pulse <time>: Pulse the laser in place."),
|
847
|
+
)
|
848
|
+
def pulse(command, channel, _, time=None, idonotlovemyhouse=False, **kwgs):
|
849
|
+
if time is None:
|
850
|
+
channel(_("Must specify a pulse time in milliseconds."))
|
851
|
+
return
|
852
|
+
if time > 1000.0:
|
853
|
+
channel(
|
854
|
+
_(
|
855
|
+
'"{time}ms" exceeds 1 second limit to fire a standing laser.'
|
856
|
+
).format(time=time)
|
857
|
+
)
|
858
|
+
try:
|
859
|
+
if not idonotlovemyhouse:
|
860
|
+
return
|
861
|
+
except IndexError:
|
862
|
+
return
|
863
|
+
|
864
|
+
if self.spooler.is_idle:
|
865
|
+
self.driver.laser_on(power=1000, speed=1000)
|
866
|
+
sleep(time / 1000)
|
867
|
+
self.driver.laser_off()
|
868
|
+
label = _("Pulse laser for {time}ms").format(time=time)
|
869
|
+
channel(label)
|
870
|
+
else:
|
871
|
+
channel(_("Pulse laser failed: Busy"))
|
872
|
+
return
|
873
|
+
|
874
|
+
@self.console_argument("filename", type=str)
|
875
|
+
@self.console_command("save_job", help=_("save job export"), input_type="plan")
|
876
|
+
def gcode_save(channel, _, filename, data=None, **kwgs):
|
877
|
+
if filename is None:
|
878
|
+
raise CommandSyntaxError
|
879
|
+
try:
|
880
|
+
with open(filename, "w") as f:
|
881
|
+
# f.write(b"(MeerK40t)\n")
|
882
|
+
driver = GRBLDriver(self)
|
883
|
+
job = LaserJob(filename, list(data.plan), driver=driver)
|
884
|
+
driver.out_pipe = f.write
|
885
|
+
driver.out_real = f.write
|
886
|
+
job.execute()
|
887
|
+
|
888
|
+
except (PermissionError, OSError):
|
889
|
+
channel(_("Could not save: {filename}").format(filename=filename))
|
890
|
+
|
891
|
+
@self.console_command(
|
892
|
+
"grblinterpreter", help=_("activate the grbl interpreter.")
|
893
|
+
)
|
894
|
+
def grblinterpreter(channel, _, **kwgs):
|
895
|
+
try:
|
896
|
+
self.open_as("interpreter/grbl", "grblinterpreter")
|
897
|
+
channel(
|
898
|
+
_("Grbl Interpreter attached to {device}").format(device=str(self))
|
899
|
+
)
|
900
|
+
except KeyError:
|
901
|
+
channel(_("Interpreter cannot be attached to any device."))
|
902
|
+
return
|
903
|
+
|
904
|
+
@self.console_argument(
|
905
|
+
"index", type=int, help=_("macro to run (1-5).")
|
906
|
+
)
|
907
|
+
@self.console_command(
|
908
|
+
"macro",
|
909
|
+
help=_("Send a predefined macro to the device."),
|
910
|
+
)
|
911
|
+
def run_macro(command, channel, _, index=None, remainder=None, **kwargs):
|
912
|
+
for idx in range(5):
|
913
|
+
macrotext = self.setting(str, f"macro_{idx}", "")
|
914
|
+
if index is None:
|
915
|
+
for idx in range(5):
|
916
|
+
macrotext = self.setting(str, f"macro_{idx}", "")
|
917
|
+
channel(f"Content of macro {idx + 1}:")
|
918
|
+
for no, line in enumerate(macrotext.splitlines()):
|
919
|
+
channel (f"{no:2d}: {line}")
|
920
|
+
return
|
921
|
+
err = True
|
922
|
+
try:
|
923
|
+
macro_index = int(index) -1
|
924
|
+
if 0 <= macro_index <= 4:
|
925
|
+
err = False
|
926
|
+
except ValueError:
|
927
|
+
pass
|
928
|
+
if err:
|
929
|
+
channel(f"Invalid macro-number '{index}', valid: 1-5")
|
930
|
+
if remainder is not None:
|
931
|
+
remainder.strip()
|
932
|
+
# channel(f"Remainder: {remainder}")
|
933
|
+
if remainder:
|
934
|
+
channel(f"Redefining macro {index} to:")
|
935
|
+
macrotext = remainder.replace("|", "\n")
|
936
|
+
for line in macrotext.splitlines():
|
937
|
+
channel(line)
|
938
|
+
setattr(self, f"macro_{macro_index}", macrotext)
|
939
|
+
return
|
940
|
+
|
941
|
+
macrotext = self.setting(str, f"macro_{macro_index}", "")
|
942
|
+
# channel(f"{macro_index}: {macrotext}")
|
943
|
+
for line in macrotext.splitlines():
|
944
|
+
channel(f"> {line}")
|
945
|
+
if line.startswith("#"):
|
946
|
+
continue
|
947
|
+
self.driver(f"{line}{self.driver.line_end}")
|
948
|
+
|
949
|
+
@property
|
950
|
+
def safe_label(self):
|
951
|
+
"""
|
952
|
+
Provides a safe label without spaces or / which could cause issues when used in timer or other names.
|
953
|
+
@return:
|
954
|
+
"""
|
955
|
+
if not hasattr(self, "label"):
|
956
|
+
return self.name
|
957
|
+
name = self.label.replace(" ", "-")
|
958
|
+
return name.replace("/", "-")
|
959
|
+
|
960
|
+
def _register_console_serial(self):
|
961
|
+
_ = self.kernel.translation
|
962
|
+
|
963
|
+
@self.console_argument("com")
|
964
|
+
@self.console_option("baud", "b")
|
965
|
+
@self.console_command(
|
966
|
+
"serial",
|
967
|
+
help=_("link the serial connection"),
|
968
|
+
input_type=None,
|
969
|
+
)
|
970
|
+
def serial_connection(
|
971
|
+
command,
|
972
|
+
channel,
|
973
|
+
_,
|
974
|
+
data=None,
|
975
|
+
com=None,
|
976
|
+
baud=115200,
|
977
|
+
remainder=None,
|
978
|
+
**kwgs,
|
979
|
+
):
|
980
|
+
if com is None:
|
981
|
+
import serial.tools.list_ports
|
982
|
+
|
983
|
+
ports = serial.tools.list_ports.comports()
|
984
|
+
|
985
|
+
channel("Available COM ports")
|
986
|
+
for x in ports:
|
987
|
+
channel(str(x))
|
988
|
+
|
989
|
+
def location(self):
|
990
|
+
if self.permit_tcp and self.interface == "tcp":
|
991
|
+
return f"{self.address}:{self.port}"
|
992
|
+
if self.permit_ws and self.interface == "ws":
|
993
|
+
return f"ws://{self.address}:{self.port}"
|
994
|
+
elif self.permit_serial and self.interface == "serial":
|
995
|
+
return f"{self.serial_port.lower()}:{self.baud_rate}"
|
996
|
+
else:
|
997
|
+
return "mock"
|
998
|
+
|
999
|
+
def service_attach(self, *args, **kwargs):
|
1000
|
+
self.realize()
|
1001
|
+
|
1002
|
+
@property
|
1003
|
+
def current(self):
|
1004
|
+
"""
|
1005
|
+
@return: the location in units for the current known position.
|
1006
|
+
"""
|
1007
|
+
return self.view.iposition(self.driver.native_x, self.driver.native_y)
|
1008
|
+
|
1009
|
+
@property
|
1010
|
+
def native(self):
|
1011
|
+
"""
|
1012
|
+
@return: the location in device native units for the current known position.
|
1013
|
+
"""
|
1014
|
+
return self.driver.native_x, self.driver.native_y
|
1015
|
+
|
1016
|
+
@signal_listener("scale_x")
|
1017
|
+
@signal_listener("scale_y")
|
1018
|
+
@signal_listener("bedwidth")
|
1019
|
+
@signal_listener("bedheight")
|
1020
|
+
@signal_listener("home_corner")
|
1021
|
+
@signal_listener("flip_x")
|
1022
|
+
@signal_listener("flip_y")
|
1023
|
+
@signal_listener("swap_xy")
|
1024
|
+
@signal_listener("user_margin_x")
|
1025
|
+
@signal_listener("user_margin_y")
|
1026
|
+
def realize(self, origin=None, *args):
|
1027
|
+
if origin is not None and origin != self.path:
|
1028
|
+
return
|
1029
|
+
corner = self.setting(str, "home_corner")
|
1030
|
+
home_dx = 0
|
1031
|
+
home_dy = 0
|
1032
|
+
if corner == "auto":
|
1033
|
+
pass
|
1034
|
+
elif corner == "top-left":
|
1035
|
+
home_dx = 1 if self.flip_x else 0
|
1036
|
+
home_dy = 1 if self.flip_y else 0
|
1037
|
+
elif corner == "top-right":
|
1038
|
+
home_dx = 0 if self.flip_x else 1
|
1039
|
+
home_dy = 1 if self.flip_y else 0
|
1040
|
+
elif corner == "bottom-left":
|
1041
|
+
home_dx = 1 if self.flip_x else 0
|
1042
|
+
home_dy = 0 if self.flip_y else 1
|
1043
|
+
elif corner == "bottom-right":
|
1044
|
+
home_dx = 0 if self.flip_x else 1
|
1045
|
+
home_dy = 0 if self.flip_y else 1
|
1046
|
+
elif corner == "center":
|
1047
|
+
home_dx = 0.5
|
1048
|
+
home_dy = 0.5
|
1049
|
+
self.view.set_dims(self.bedwidth, self.bedheight)
|
1050
|
+
self.view.set_margins(self.user_margin_x, self.user_margin_y)
|
1051
|
+
self.view.transform(
|
1052
|
+
user_scale_x=self.scale_x,
|
1053
|
+
user_scale_y=self.scale_y,
|
1054
|
+
flip_x=self.flip_x,
|
1055
|
+
flip_y=self.flip_y,
|
1056
|
+
swap_xy=self.swap_xy,
|
1057
|
+
origin_x=home_dx,
|
1058
|
+
origin_y=home_dy,
|
1059
|
+
)
|
1060
|
+
|
1061
|
+
self.view_mm.set_dims(self.bedwidth, self.bedheight)
|
1062
|
+
self.view_mm.transform(
|
1063
|
+
user_scale_x=self.scale_x,
|
1064
|
+
user_scale_y=self.scale_y,
|
1065
|
+
flip_x=self.flip_x,
|
1066
|
+
flip_y=self.flip_y,
|
1067
|
+
swap_xy=self.swap_xy,
|
1068
|
+
origin_x=home_dx,
|
1069
|
+
origin_y=home_dy,
|
1070
|
+
)
|
1071
|
+
|
1072
|
+
# x, y = self.view.position(0, 0)
|
1073
|
+
# print (f"Test for 0,0 gives: {x:.2f}, {y:.2f}")
|
1074
|
+
# x, y = self.view.iposition(x, y)
|
1075
|
+
# print (f"Reverse gives: {x:.2f}, {y:.2f}")
|
1076
|
+
self.signal("view;realized")
|
1077
|
+
|
1078
|
+
def cool_helper(self, choice_dict):
|
1079
|
+
self.kernel.root.coolant.coolant_choice_helper(self)(choice_dict)
|
1080
|
+
|
1081
|
+
def get_raster_instructions(self):
|
1082
|
+
return {
|
1083
|
+
"gantry": True,
|
1084
|
+
}
|