meerk40t 0.9.3001__py2.py3-none-any.whl → 0.9.7010__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 +1195 -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 +1844 -1507
- meerk40t/core/elements/clipboard.py +229 -219
- meerk40t/core/elements/element_treeops.py +4561 -2837
- meerk40t/core/elements/element_types.py +125 -105
- meerk40t/core/elements/elements.py +4329 -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 +933 -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/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 +462 -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 +198 -0
- meerk40t/extra/ezd.py +1165 -1165
- meerk40t/extra/hershey.py +835 -340
- meerk40t/extra/imageactions.py +322 -316
- meerk40t/extra/inkscape.py +630 -622
- meerk40t/extra/lbrn.py +424 -424
- meerk40t/extra/outerworld.py +284 -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 +1081 -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 +170 -133
- meerk40t/gui/choicepropertypanel.py +1673 -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 +1430 -846
- meerk40t/gui/icons.py +3422 -2747
- meerk40t/gui/imagesplitter.py +555 -508
- meerk40t/gui/keymap.py +354 -344
- meerk40t/gui/laserpanel.py +892 -806
- meerk40t/gui/laserrender.py +1470 -1232
- meerk40t/gui/lasertoolpanel.py +805 -793
- meerk40t/gui/magnetoptions.py +436 -0
- meerk40t/gui/materialmanager.py +2917 -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 +494 -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 +2468 -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 +589 -346
- meerk40t/gui/scenewidgets/relocatewidget.py +33 -33
- meerk40t/gui/scenewidgets/reticlewidget.py +83 -83
- meerk40t/gui/scenewidgets/selectionwidget.py +2952 -2756
- meerk40t/gui/simpleui.py +357 -333
- meerk40t/gui/simulation.py +2431 -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 +591 -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 +160 -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 +1444 -1169
- meerk40t/gui/wxmmain.py +5578 -4112
- meerk40t/gui/wxmribbon.py +1591 -1076
- meerk40t/gui/wxmscene.py +1635 -1453
- meerk40t/gui/wxmtree.py +2410 -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 +2778 -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 +3809 -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 +102 -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 +390 -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 +672 -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 +940 -940
- meerk40t/tools/rasterplotter.py +1660 -547
- meerk40t/tools/shxparser.py +989 -901
- meerk40t/tools/ttfparser.py +726 -446
- meerk40t/tools/zinglplotter.py +595 -593
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/LICENSE +21 -21
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/METADATA +150 -139
- meerk40t-0.9.7010.dist-info/RECORD +445 -0
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/WHEEL +1 -1
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/top_level.txt +0 -1
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.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.7010.dist-info}/entry_points.txt +0 -0
meerk40t/moshi/builder.py
CHANGED
@@ -1,781 +1,788 @@
|
|
1
|
-
"""
|
2
|
-
Moshiboard Builder
|
3
|
-
|
4
|
-
Builder for Moshiboard command data output information. Allows interactions through simple commands to export the
|
5
|
-
required data to run a Moshiboard.
|
6
|
-
"""
|
7
|
-
import struct
|
8
|
-
|
9
|
-
swizzle_table = [
|
10
|
-
[
|
11
|
-
b"\x00",
|
12
|
-
b"\x01",
|
13
|
-
b"\x40",
|
14
|
-
b"\x03",
|
15
|
-
b"\x10",
|
16
|
-
b"\x21",
|
17
|
-
b"\x50",
|
18
|
-
b"\x23",
|
19
|
-
b"\x04",
|
20
|
-
b"\x09",
|
21
|
-
b"\x44",
|
22
|
-
b"\x0b",
|
23
|
-
b"\x14",
|
24
|
-
b"\x29",
|
25
|
-
b"\x54",
|
26
|
-
b"\x2b",
|
27
|
-
],
|
28
|
-
[
|
29
|
-
b"\x08",
|
30
|
-
b"\x11",
|
31
|
-
b"\x48",
|
32
|
-
b"\x13",
|
33
|
-
b"\x18",
|
34
|
-
b"\x31",
|
35
|
-
b"\x58",
|
36
|
-
b"\x33",
|
37
|
-
b"\x0c",
|
38
|
-
b"\x19",
|
39
|
-
b"\x4c",
|
40
|
-
b"\x1b",
|
41
|
-
b"\x1c",
|
42
|
-
b"\x39",
|
43
|
-
b"\x5c",
|
44
|
-
b"\x3b",
|
45
|
-
],
|
46
|
-
[
|
47
|
-
b"\x80",
|
48
|
-
b"\x05",
|
49
|
-
b"\xc0",
|
50
|
-
b"\x07",
|
51
|
-
b"\x90",
|
52
|
-
b"\x25",
|
53
|
-
b"\xd0",
|
54
|
-
b"\x27",
|
55
|
-
b"\x84",
|
56
|
-
b"\x0d",
|
57
|
-
b"\xc4",
|
58
|
-
b"\x0f",
|
59
|
-
b"\x94",
|
60
|
-
b"\x2d",
|
61
|
-
b"\xd4",
|
62
|
-
b"\x2f",
|
63
|
-
],
|
64
|
-
[
|
65
|
-
b"\x88",
|
66
|
-
b"\x15",
|
67
|
-
b"\xc8",
|
68
|
-
b"\x17",
|
69
|
-
b"\x98",
|
70
|
-
b"\x35",
|
71
|
-
b"\xd8",
|
72
|
-
b"\x37",
|
73
|
-
b"\x8c",
|
74
|
-
b"\x1d",
|
75
|
-
b"\xcc",
|
76
|
-
b"\x1f",
|
77
|
-
b"\x9c",
|
78
|
-
b"\x3d",
|
79
|
-
b"\xdc",
|
80
|
-
b"\x3f",
|
81
|
-
],
|
82
|
-
[
|
83
|
-
b"\x02",
|
84
|
-
b"\x41",
|
85
|
-
b"\x42",
|
86
|
-
b"\x43",
|
87
|
-
b"\x12",
|
88
|
-
b"\x61",
|
89
|
-
b"\x52",
|
90
|
-
b"\x63",
|
91
|
-
b"\x06",
|
92
|
-
b"\x49",
|
93
|
-
b"\x46",
|
94
|
-
b"\x4b",
|
95
|
-
b"\x16",
|
96
|
-
b"\x69",
|
97
|
-
b"\x56",
|
98
|
-
b"\x6b",
|
99
|
-
],
|
100
|
-
[
|
101
|
-
b"\x0a",
|
102
|
-
b"\x51",
|
103
|
-
b"\x4a",
|
104
|
-
b"\x53",
|
105
|
-
b"\x1a",
|
106
|
-
b"\x71",
|
107
|
-
b"\x5a",
|
108
|
-
b"\x73",
|
109
|
-
b"\x0e",
|
110
|
-
b"\x59",
|
111
|
-
b"\x4e",
|
112
|
-
b"\x5b",
|
113
|
-
b"\x1e",
|
114
|
-
b"\x79",
|
115
|
-
b"\x5e",
|
116
|
-
b"\x7b",
|
117
|
-
],
|
118
|
-
[
|
119
|
-
b"\x82",
|
120
|
-
b"\x45",
|
121
|
-
b"\xc2",
|
122
|
-
b"\x47",
|
123
|
-
b"\x92",
|
124
|
-
b"\x65",
|
125
|
-
b"\xd2",
|
126
|
-
b"\x67",
|
127
|
-
b"\x86",
|
128
|
-
b"\x4d",
|
129
|
-
b"\xc6",
|
130
|
-
b"\x4f",
|
131
|
-
b"\x96",
|
132
|
-
b"\x6d",
|
133
|
-
b"\xd6",
|
134
|
-
b"\x6f",
|
135
|
-
],
|
136
|
-
[
|
137
|
-
b"\x8a",
|
138
|
-
b"\x55",
|
139
|
-
b"\xca",
|
140
|
-
b"\x57",
|
141
|
-
b"\x9a",
|
142
|
-
b"\x75",
|
143
|
-
b"\xda",
|
144
|
-
b"\x77",
|
145
|
-
b"\x8e",
|
146
|
-
b"\x5d",
|
147
|
-
b"\xce",
|
148
|
-
b"\x5f",
|
149
|
-
b"\x9e",
|
150
|
-
b"\x7d",
|
151
|
-
b"\xde",
|
152
|
-
b"\x7f",
|
153
|
-
],
|
154
|
-
[
|
155
|
-
b"\x20",
|
156
|
-
b"\x81",
|
157
|
-
b"\x60",
|
158
|
-
b"\x83",
|
159
|
-
b"\x30",
|
160
|
-
b"\xa1",
|
161
|
-
b"\x70",
|
162
|
-
b"\xa3",
|
163
|
-
b"\x24",
|
164
|
-
b"\x89",
|
165
|
-
b"\x64",
|
166
|
-
b"\x8b",
|
167
|
-
b"\x34",
|
168
|
-
b"\xa9",
|
169
|
-
b"\x74",
|
170
|
-
b"\xab",
|
171
|
-
],
|
172
|
-
[
|
173
|
-
b"\x28",
|
174
|
-
b"\x91",
|
175
|
-
b"\x68",
|
176
|
-
b"\x93",
|
177
|
-
b"\x38",
|
178
|
-
b"\xb1",
|
179
|
-
b"\x78",
|
180
|
-
b"\xb3",
|
181
|
-
b"\x2c",
|
182
|
-
b"\x99",
|
183
|
-
b"\x6c",
|
184
|
-
b"\x9b",
|
185
|
-
b"\x3c",
|
186
|
-
b"\xb9",
|
187
|
-
b"\x7c",
|
188
|
-
b"\xbb",
|
189
|
-
],
|
190
|
-
[
|
191
|
-
b"\xa0",
|
192
|
-
b"\x85",
|
193
|
-
b"\xe0",
|
194
|
-
b"\x87",
|
195
|
-
b"\xb0",
|
196
|
-
b"\xa5",
|
197
|
-
b"\xf0",
|
198
|
-
b"\xa7",
|
199
|
-
b"\xa4",
|
200
|
-
b"\x8d",
|
201
|
-
b"\xe4",
|
202
|
-
b"\x8f",
|
203
|
-
b"\xb4",
|
204
|
-
b"\xad",
|
205
|
-
b"\xf4",
|
206
|
-
b"\xaf",
|
207
|
-
],
|
208
|
-
[
|
209
|
-
b"\xa8",
|
210
|
-
b"\x95",
|
211
|
-
b"\xe8",
|
212
|
-
b"\x97",
|
213
|
-
b"\xb8",
|
214
|
-
b"\xb5",
|
215
|
-
b"\xf8",
|
216
|
-
b"\xb7",
|
217
|
-
b"\xac",
|
218
|
-
b"\x9d",
|
219
|
-
b"\xec",
|
220
|
-
b"\x9f",
|
221
|
-
b"\xbc",
|
222
|
-
b"\xbd",
|
223
|
-
b"\xfc",
|
224
|
-
b"\xbf",
|
225
|
-
],
|
226
|
-
[
|
227
|
-
b"\x22",
|
228
|
-
b"\xc1",
|
229
|
-
b"\x62",
|
230
|
-
b"\xc3",
|
231
|
-
b"\x32",
|
232
|
-
b"\xe1",
|
233
|
-
b"\x72",
|
234
|
-
b"\xe3",
|
235
|
-
b"\x26",
|
236
|
-
b"\xc9",
|
237
|
-
b"\x66",
|
238
|
-
b"\xcb",
|
239
|
-
b"\x36",
|
240
|
-
b"\xe9",
|
241
|
-
b"\x76",
|
242
|
-
b"\xeb",
|
243
|
-
],
|
244
|
-
[
|
245
|
-
b"\x2a",
|
246
|
-
b"\xd1",
|
247
|
-
b"\x6a",
|
248
|
-
b"\xd3",
|
249
|
-
b"\x3a",
|
250
|
-
b"\xf1",
|
251
|
-
b"\x7a",
|
252
|
-
b"\xf3",
|
253
|
-
b"\x2e",
|
254
|
-
b"\xd9",
|
255
|
-
b"\x6e",
|
256
|
-
b"\xdb",
|
257
|
-
b"\x3e",
|
258
|
-
b"\xf9",
|
259
|
-
b"\x7e",
|
260
|
-
b"\xfb",
|
261
|
-
],
|
262
|
-
[
|
263
|
-
b"\xa2",
|
264
|
-
b"\xc5",
|
265
|
-
b"\xe2",
|
266
|
-
b"\xc7",
|
267
|
-
b"\xb2",
|
268
|
-
b"\xe5",
|
269
|
-
b"\xf2",
|
270
|
-
b"\xe7",
|
271
|
-
b"\xa6",
|
272
|
-
b"\xcd",
|
273
|
-
b"\xe6",
|
274
|
-
b"\xcf",
|
275
|
-
b"\xb6",
|
276
|
-
b"\xed",
|
277
|
-
b"\xf6",
|
278
|
-
b"\xef",
|
279
|
-
],
|
280
|
-
[
|
281
|
-
b"\xaa",
|
282
|
-
b"\xd5",
|
283
|
-
b"\xea",
|
284
|
-
b"\xd7",
|
285
|
-
b"\xba",
|
286
|
-
b"\xf5",
|
287
|
-
b"\xfa",
|
288
|
-
b"\xf7",
|
289
|
-
b"\xae",
|
290
|
-
b"\xdd",
|
291
|
-
b"\xee",
|
292
|
-
b"\xdf",
|
293
|
-
b"\xbe",
|
294
|
-
b"\xfd",
|
295
|
-
b"\xfe",
|
296
|
-
b"\xff",
|
297
|
-
],
|
298
|
-
]
|
299
|
-
|
300
|
-
MOSHI_SET_OFFSET = 0
|
301
|
-
MOSHI_TERMINATION = 2
|
302
|
-
MOSHI_VECTOR_SPEED = 5
|
303
|
-
MOSHI_RASTER_SPEED = 4
|
304
|
-
MOSHI_CUT_ABS = 15
|
305
|
-
MOSHI_CUT_HORIZ = 14
|
306
|
-
MOSHI_CUT_VERT = 11
|
307
|
-
MOSHI_MOVE_ABS = 7
|
308
|
-
MOSHI_MOVE_HORIZ = 6
|
309
|
-
MOSHI_MOVE_VERT = 3
|
310
|
-
|
311
|
-
MOSHI_FREEMOTOR = 1
|
312
|
-
MOSHI_ESTOP = 1
|
313
|
-
MOSHI_EPILOGUE = 2
|
314
|
-
MOSHI_PROLOGUE = 6
|
315
|
-
# 6 also seen at laser startup.
|
316
|
-
MOSHI_LASER = 7
|
317
|
-
MOSHI_READ = 14
|
318
|
-
# 14 is also sometimes done as a keepalive each 3.4 seconds.
|
319
|
-
|
320
|
-
|
321
|
-
class MoshiBuilder:
|
322
|
-
"""
|
323
|
-
MoshiBuilder builds datablobs of Moshi type. These are series of commands which should be executed as a program
|
324
|
-
within the Moshicontroller.
|
325
|
-
"""
|
326
|
-
|
327
|
-
def __init__(self, channel=None):
|
328
|
-
self.data = bytearray() # Queued additional commands programs.
|
329
|
-
self.channel = channel
|
330
|
-
|
331
|
-
self.last_x = 0
|
332
|
-
self.last_y = 0
|
333
|
-
|
334
|
-
self.offset_x = 0
|
335
|
-
self.offset_y = 0
|
336
|
-
self._vector = None
|
337
|
-
self._stage = 0
|
338
|
-
|
339
|
-
def __len__(self):
|
340
|
-
return len(self.data)
|
341
|
-
|
342
|
-
def clear(self):
|
343
|
-
self.data.clear()
|
344
|
-
self._stage = 0
|
345
|
-
|
346
|
-
def
|
347
|
-
"""
|
348
|
-
Write an 8 bit into to the current program.
|
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
|
-
self.
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
self.
|
404
|
-
self.
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
self.
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
self.
|
420
|
-
self.
|
421
|
-
self.
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
for
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
if
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
self.
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
if
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
self.
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
self.
|
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
|
-
|
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
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
1
|
+
"""
|
2
|
+
Moshiboard Builder
|
3
|
+
|
4
|
+
Builder for Moshiboard command data output information. Allows interactions through simple commands to export the
|
5
|
+
required data to run a Moshiboard.
|
6
|
+
"""
|
7
|
+
import struct
|
8
|
+
|
9
|
+
swizzle_table = [
|
10
|
+
[
|
11
|
+
b"\x00",
|
12
|
+
b"\x01",
|
13
|
+
b"\x40",
|
14
|
+
b"\x03",
|
15
|
+
b"\x10",
|
16
|
+
b"\x21",
|
17
|
+
b"\x50",
|
18
|
+
b"\x23",
|
19
|
+
b"\x04",
|
20
|
+
b"\x09",
|
21
|
+
b"\x44",
|
22
|
+
b"\x0b",
|
23
|
+
b"\x14",
|
24
|
+
b"\x29",
|
25
|
+
b"\x54",
|
26
|
+
b"\x2b",
|
27
|
+
],
|
28
|
+
[
|
29
|
+
b"\x08",
|
30
|
+
b"\x11",
|
31
|
+
b"\x48",
|
32
|
+
b"\x13",
|
33
|
+
b"\x18",
|
34
|
+
b"\x31",
|
35
|
+
b"\x58",
|
36
|
+
b"\x33",
|
37
|
+
b"\x0c",
|
38
|
+
b"\x19",
|
39
|
+
b"\x4c",
|
40
|
+
b"\x1b",
|
41
|
+
b"\x1c",
|
42
|
+
b"\x39",
|
43
|
+
b"\x5c",
|
44
|
+
b"\x3b",
|
45
|
+
],
|
46
|
+
[
|
47
|
+
b"\x80",
|
48
|
+
b"\x05",
|
49
|
+
b"\xc0",
|
50
|
+
b"\x07",
|
51
|
+
b"\x90",
|
52
|
+
b"\x25",
|
53
|
+
b"\xd0",
|
54
|
+
b"\x27",
|
55
|
+
b"\x84",
|
56
|
+
b"\x0d",
|
57
|
+
b"\xc4",
|
58
|
+
b"\x0f",
|
59
|
+
b"\x94",
|
60
|
+
b"\x2d",
|
61
|
+
b"\xd4",
|
62
|
+
b"\x2f",
|
63
|
+
],
|
64
|
+
[
|
65
|
+
b"\x88",
|
66
|
+
b"\x15",
|
67
|
+
b"\xc8",
|
68
|
+
b"\x17",
|
69
|
+
b"\x98",
|
70
|
+
b"\x35",
|
71
|
+
b"\xd8",
|
72
|
+
b"\x37",
|
73
|
+
b"\x8c",
|
74
|
+
b"\x1d",
|
75
|
+
b"\xcc",
|
76
|
+
b"\x1f",
|
77
|
+
b"\x9c",
|
78
|
+
b"\x3d",
|
79
|
+
b"\xdc",
|
80
|
+
b"\x3f",
|
81
|
+
],
|
82
|
+
[
|
83
|
+
b"\x02",
|
84
|
+
b"\x41",
|
85
|
+
b"\x42",
|
86
|
+
b"\x43",
|
87
|
+
b"\x12",
|
88
|
+
b"\x61",
|
89
|
+
b"\x52",
|
90
|
+
b"\x63",
|
91
|
+
b"\x06",
|
92
|
+
b"\x49",
|
93
|
+
b"\x46",
|
94
|
+
b"\x4b",
|
95
|
+
b"\x16",
|
96
|
+
b"\x69",
|
97
|
+
b"\x56",
|
98
|
+
b"\x6b",
|
99
|
+
],
|
100
|
+
[
|
101
|
+
b"\x0a",
|
102
|
+
b"\x51",
|
103
|
+
b"\x4a",
|
104
|
+
b"\x53",
|
105
|
+
b"\x1a",
|
106
|
+
b"\x71",
|
107
|
+
b"\x5a",
|
108
|
+
b"\x73",
|
109
|
+
b"\x0e",
|
110
|
+
b"\x59",
|
111
|
+
b"\x4e",
|
112
|
+
b"\x5b",
|
113
|
+
b"\x1e",
|
114
|
+
b"\x79",
|
115
|
+
b"\x5e",
|
116
|
+
b"\x7b",
|
117
|
+
],
|
118
|
+
[
|
119
|
+
b"\x82",
|
120
|
+
b"\x45",
|
121
|
+
b"\xc2",
|
122
|
+
b"\x47",
|
123
|
+
b"\x92",
|
124
|
+
b"\x65",
|
125
|
+
b"\xd2",
|
126
|
+
b"\x67",
|
127
|
+
b"\x86",
|
128
|
+
b"\x4d",
|
129
|
+
b"\xc6",
|
130
|
+
b"\x4f",
|
131
|
+
b"\x96",
|
132
|
+
b"\x6d",
|
133
|
+
b"\xd6",
|
134
|
+
b"\x6f",
|
135
|
+
],
|
136
|
+
[
|
137
|
+
b"\x8a",
|
138
|
+
b"\x55",
|
139
|
+
b"\xca",
|
140
|
+
b"\x57",
|
141
|
+
b"\x9a",
|
142
|
+
b"\x75",
|
143
|
+
b"\xda",
|
144
|
+
b"\x77",
|
145
|
+
b"\x8e",
|
146
|
+
b"\x5d",
|
147
|
+
b"\xce",
|
148
|
+
b"\x5f",
|
149
|
+
b"\x9e",
|
150
|
+
b"\x7d",
|
151
|
+
b"\xde",
|
152
|
+
b"\x7f",
|
153
|
+
],
|
154
|
+
[
|
155
|
+
b"\x20",
|
156
|
+
b"\x81",
|
157
|
+
b"\x60",
|
158
|
+
b"\x83",
|
159
|
+
b"\x30",
|
160
|
+
b"\xa1",
|
161
|
+
b"\x70",
|
162
|
+
b"\xa3",
|
163
|
+
b"\x24",
|
164
|
+
b"\x89",
|
165
|
+
b"\x64",
|
166
|
+
b"\x8b",
|
167
|
+
b"\x34",
|
168
|
+
b"\xa9",
|
169
|
+
b"\x74",
|
170
|
+
b"\xab",
|
171
|
+
],
|
172
|
+
[
|
173
|
+
b"\x28",
|
174
|
+
b"\x91",
|
175
|
+
b"\x68",
|
176
|
+
b"\x93",
|
177
|
+
b"\x38",
|
178
|
+
b"\xb1",
|
179
|
+
b"\x78",
|
180
|
+
b"\xb3",
|
181
|
+
b"\x2c",
|
182
|
+
b"\x99",
|
183
|
+
b"\x6c",
|
184
|
+
b"\x9b",
|
185
|
+
b"\x3c",
|
186
|
+
b"\xb9",
|
187
|
+
b"\x7c",
|
188
|
+
b"\xbb",
|
189
|
+
],
|
190
|
+
[
|
191
|
+
b"\xa0",
|
192
|
+
b"\x85",
|
193
|
+
b"\xe0",
|
194
|
+
b"\x87",
|
195
|
+
b"\xb0",
|
196
|
+
b"\xa5",
|
197
|
+
b"\xf0",
|
198
|
+
b"\xa7",
|
199
|
+
b"\xa4",
|
200
|
+
b"\x8d",
|
201
|
+
b"\xe4",
|
202
|
+
b"\x8f",
|
203
|
+
b"\xb4",
|
204
|
+
b"\xad",
|
205
|
+
b"\xf4",
|
206
|
+
b"\xaf",
|
207
|
+
],
|
208
|
+
[
|
209
|
+
b"\xa8",
|
210
|
+
b"\x95",
|
211
|
+
b"\xe8",
|
212
|
+
b"\x97",
|
213
|
+
b"\xb8",
|
214
|
+
b"\xb5",
|
215
|
+
b"\xf8",
|
216
|
+
b"\xb7",
|
217
|
+
b"\xac",
|
218
|
+
b"\x9d",
|
219
|
+
b"\xec",
|
220
|
+
b"\x9f",
|
221
|
+
b"\xbc",
|
222
|
+
b"\xbd",
|
223
|
+
b"\xfc",
|
224
|
+
b"\xbf",
|
225
|
+
],
|
226
|
+
[
|
227
|
+
b"\x22",
|
228
|
+
b"\xc1",
|
229
|
+
b"\x62",
|
230
|
+
b"\xc3",
|
231
|
+
b"\x32",
|
232
|
+
b"\xe1",
|
233
|
+
b"\x72",
|
234
|
+
b"\xe3",
|
235
|
+
b"\x26",
|
236
|
+
b"\xc9",
|
237
|
+
b"\x66",
|
238
|
+
b"\xcb",
|
239
|
+
b"\x36",
|
240
|
+
b"\xe9",
|
241
|
+
b"\x76",
|
242
|
+
b"\xeb",
|
243
|
+
],
|
244
|
+
[
|
245
|
+
b"\x2a",
|
246
|
+
b"\xd1",
|
247
|
+
b"\x6a",
|
248
|
+
b"\xd3",
|
249
|
+
b"\x3a",
|
250
|
+
b"\xf1",
|
251
|
+
b"\x7a",
|
252
|
+
b"\xf3",
|
253
|
+
b"\x2e",
|
254
|
+
b"\xd9",
|
255
|
+
b"\x6e",
|
256
|
+
b"\xdb",
|
257
|
+
b"\x3e",
|
258
|
+
b"\xf9",
|
259
|
+
b"\x7e",
|
260
|
+
b"\xfb",
|
261
|
+
],
|
262
|
+
[
|
263
|
+
b"\xa2",
|
264
|
+
b"\xc5",
|
265
|
+
b"\xe2",
|
266
|
+
b"\xc7",
|
267
|
+
b"\xb2",
|
268
|
+
b"\xe5",
|
269
|
+
b"\xf2",
|
270
|
+
b"\xe7",
|
271
|
+
b"\xa6",
|
272
|
+
b"\xcd",
|
273
|
+
b"\xe6",
|
274
|
+
b"\xcf",
|
275
|
+
b"\xb6",
|
276
|
+
b"\xed",
|
277
|
+
b"\xf6",
|
278
|
+
b"\xef",
|
279
|
+
],
|
280
|
+
[
|
281
|
+
b"\xaa",
|
282
|
+
b"\xd5",
|
283
|
+
b"\xea",
|
284
|
+
b"\xd7",
|
285
|
+
b"\xba",
|
286
|
+
b"\xf5",
|
287
|
+
b"\xfa",
|
288
|
+
b"\xf7",
|
289
|
+
b"\xae",
|
290
|
+
b"\xdd",
|
291
|
+
b"\xee",
|
292
|
+
b"\xdf",
|
293
|
+
b"\xbe",
|
294
|
+
b"\xfd",
|
295
|
+
b"\xfe",
|
296
|
+
b"\xff",
|
297
|
+
],
|
298
|
+
]
|
299
|
+
|
300
|
+
MOSHI_SET_OFFSET = 0
|
301
|
+
MOSHI_TERMINATION = 2
|
302
|
+
MOSHI_VECTOR_SPEED = 5
|
303
|
+
MOSHI_RASTER_SPEED = 4
|
304
|
+
MOSHI_CUT_ABS = 15
|
305
|
+
MOSHI_CUT_HORIZ = 14
|
306
|
+
MOSHI_CUT_VERT = 11
|
307
|
+
MOSHI_MOVE_ABS = 7
|
308
|
+
MOSHI_MOVE_HORIZ = 6
|
309
|
+
MOSHI_MOVE_VERT = 3
|
310
|
+
|
311
|
+
MOSHI_FREEMOTOR = 1
|
312
|
+
MOSHI_ESTOP = 1
|
313
|
+
MOSHI_EPILOGUE = 2
|
314
|
+
MOSHI_PROLOGUE = 6
|
315
|
+
# 6 also seen at laser startup.
|
316
|
+
MOSHI_LASER = 7
|
317
|
+
MOSHI_READ = 14
|
318
|
+
# 14 is also sometimes done as a keepalive each 3.4 seconds.
|
319
|
+
|
320
|
+
|
321
|
+
class MoshiBuilder:
|
322
|
+
"""
|
323
|
+
MoshiBuilder builds datablobs of Moshi type. These are series of commands which should be executed as a program
|
324
|
+
within the Moshicontroller.
|
325
|
+
"""
|
326
|
+
|
327
|
+
def __init__(self, channel=None):
|
328
|
+
self.data = bytearray() # Queued additional commands programs.
|
329
|
+
self.channel = channel
|
330
|
+
|
331
|
+
self.last_x = 0
|
332
|
+
self.last_y = 0
|
333
|
+
|
334
|
+
self.offset_x = 0
|
335
|
+
self.offset_y = 0
|
336
|
+
self._vector = None
|
337
|
+
self._stage = 0
|
338
|
+
|
339
|
+
def __len__(self):
|
340
|
+
return len(self.data)
|
341
|
+
|
342
|
+
def clear(self):
|
343
|
+
self.data.clear()
|
344
|
+
self._stage = 0
|
345
|
+
|
346
|
+
def pipe_uint8(self, value):
|
347
|
+
"""
|
348
|
+
Write an 8 bit into to the current program.
|
349
|
+
"""
|
350
|
+
if value > 255:
|
351
|
+
value = 255
|
352
|
+
if value < 0:
|
353
|
+
value = 0
|
354
|
+
self.write(struct.pack("B", value))
|
355
|
+
|
356
|
+
def pipe_int16le(self, value):
|
357
|
+
"""
|
358
|
+
Write a 16 bit little-endian value to the current program.
|
359
|
+
"""
|
360
|
+
if value < -32768:
|
361
|
+
value = -32768
|
362
|
+
elif value > 32767:
|
363
|
+
value = 32767
|
364
|
+
self.write(struct.pack("<h", value))
|
365
|
+
|
366
|
+
def write(self, bytes_to_write):
|
367
|
+
"""
|
368
|
+
Writes data to the queue, this will be moved into the buffer by the thread in a threadsafe manner.
|
369
|
+
|
370
|
+
@param bytes_to_write: data to write to the queue.
|
371
|
+
@return:
|
372
|
+
"""
|
373
|
+
self.data += bytes_to_write
|
374
|
+
return self
|
375
|
+
|
376
|
+
def vector_speed(self, speed_mms, normal_speed_mms):
|
377
|
+
"""
|
378
|
+
Vector Speed Byte. (0x00 position), followed by 2 int8 values.
|
379
|
+
Jog and Normal Speed. These values are limited to integer values which
|
380
|
+
are 1 to 256.
|
381
|
+
|
382
|
+
@return:
|
383
|
+
"""
|
384
|
+
assert self._stage == 0
|
385
|
+
self._stage = 1
|
386
|
+
self._vector = True
|
387
|
+
if self.channel:
|
388
|
+
self.channel(
|
389
|
+
f"Vector Cut Speed: {int(speed_mms)} mm/s Normal Speed: {int(normal_speed_mms)} mm/s"
|
390
|
+
)
|
391
|
+
self.write(swizzle_table[MOSHI_VECTOR_SPEED][0])
|
392
|
+
if speed_mms > 256:
|
393
|
+
speed_mms = 256
|
394
|
+
if speed_mms < 1:
|
395
|
+
speed_mms = 1
|
396
|
+
self.pipe_uint8(speed_mms - 1)
|
397
|
+
self.pipe_uint8(normal_speed_mms - 1)
|
398
|
+
|
399
|
+
def raster_speed(self, speed_mms):
|
400
|
+
"""
|
401
|
+
Write speed for raster programs.
|
402
|
+
"""
|
403
|
+
assert self._stage == 0
|
404
|
+
self._stage = 1
|
405
|
+
if self.channel:
|
406
|
+
self.channel(f"Raster Header Speed: {int(speed_mms)} mm/s")
|
407
|
+
self.write(swizzle_table[MOSHI_RASTER_SPEED][0])
|
408
|
+
speed_cms = int(round(speed_mms / 10))
|
409
|
+
if speed_cms == 0:
|
410
|
+
speed_cms = 1
|
411
|
+
self.pipe_uint8(speed_cms - 1)
|
412
|
+
self._vector = False
|
413
|
+
|
414
|
+
def set_offset(self, z, x, y):
|
415
|
+
"""
|
416
|
+
2nd Command For Jump. (0x03 position), followed by 3 int16le (2)
|
417
|
+
@return:
|
418
|
+
"""
|
419
|
+
assert self._stage == 1
|
420
|
+
self._stage = 2
|
421
|
+
self.offset_x = x
|
422
|
+
self.offset_y = y
|
423
|
+
|
424
|
+
if self.channel:
|
425
|
+
self.channel(f"Set Location z: {int(z)}, x: {int(x)}, y: {int(y)}")
|
426
|
+
self.write(swizzle_table[MOSHI_SET_OFFSET][0])
|
427
|
+
self.pipe_int16le(z) # Unknown, always zero.
|
428
|
+
self.pipe_int16le(x) # x
|
429
|
+
self.pipe_int16le(y) # y
|
430
|
+
|
431
|
+
def termination(self):
|
432
|
+
"""
|
433
|
+
Terminal Commands for Jump/Program. (last 7 bytes). (4)
|
434
|
+
|
435
|
+
@return:
|
436
|
+
"""
|
437
|
+
# assert self._stage == 3
|
438
|
+
self._stage = 4
|
439
|
+
if self.channel:
|
440
|
+
self.channel("Termination.")
|
441
|
+
for i in range(7):
|
442
|
+
self.write(swizzle_table[MOSHI_TERMINATION][0])
|
443
|
+
|
444
|
+
def cut_abs(self, x, y):
|
445
|
+
"""
|
446
|
+
Write an absolute position cut value.
|
447
|
+
|
448
|
+
Laser will cut to this position from the current stored head position.
|
449
|
+
Head position is stored on the Moshiboard
|
450
|
+
"""
|
451
|
+
assert 2 <= self._stage <= 3
|
452
|
+
self._stage = 3
|
453
|
+
if x < 0:
|
454
|
+
x = 0
|
455
|
+
if y < 0:
|
456
|
+
y = 0
|
457
|
+
self.last_x = x
|
458
|
+
self.last_y = y
|
459
|
+
x -= self.offset_x
|
460
|
+
y -= self.offset_y
|
461
|
+
if self.channel:
|
462
|
+
self.channel(f"Cut x: {int(x)} y: {int(y)}")
|
463
|
+
self.write(swizzle_table[MOSHI_CUT_ABS][1])
|
464
|
+
self.pipe_int16le(int(x))
|
465
|
+
self.pipe_int16le(int(y))
|
466
|
+
|
467
|
+
def move_abs(self, x, y):
|
468
|
+
"""
|
469
|
+
Write an absolute position move value.
|
470
|
+
|
471
|
+
Laser will move without cutting to this position from the current stored head position.
|
472
|
+
Head position is stored on the Moshiboard
|
473
|
+
"""
|
474
|
+
assert 2 <= self._stage <= 3
|
475
|
+
self._stage = 3
|
476
|
+
if x < 0:
|
477
|
+
x = 0
|
478
|
+
if y < 0:
|
479
|
+
y = 0
|
480
|
+
self.last_x = x
|
481
|
+
self.last_y = y
|
482
|
+
x -= self.offset_x
|
483
|
+
y -= self.offset_y
|
484
|
+
if self.channel:
|
485
|
+
self.channel(f"Move x: {int(x)} y: {int(y)}")
|
486
|
+
self.write(swizzle_table[MOSHI_MOVE_ABS][0])
|
487
|
+
self.pipe_int16le(int(x))
|
488
|
+
self.pipe_int16le(int(y))
|
489
|
+
|
490
|
+
def move_vertical_abs(self, y):
|
491
|
+
"""
|
492
|
+
Write an absolute position vertical move.
|
493
|
+
|
494
|
+
Laser will move the y position without cutting to the new position from the head position
|
495
|
+
stored in the Moshiboard.
|
496
|
+
"""
|
497
|
+
assert 2 <= self._stage <= 3
|
498
|
+
self._stage = 3
|
499
|
+
|
500
|
+
self.last_y = y
|
501
|
+
y -= self.offset_y
|
502
|
+
if self.channel:
|
503
|
+
self.channel(f"Move Vertical y: {int(y)}")
|
504
|
+
self.write(swizzle_table[MOSHI_MOVE_VERT][0])
|
505
|
+
self.pipe_int16le(int(y))
|
506
|
+
|
507
|
+
def move_horizontal_abs(self, x):
|
508
|
+
"""
|
509
|
+
Write an absolute position horizontal move.
|
510
|
+
|
511
|
+
Laser will move the x position without cutting to the new position from the head position
|
512
|
+
stored in the Moshiboard.
|
513
|
+
"""
|
514
|
+
assert 2 <= self._stage <= 3
|
515
|
+
self._stage = 3
|
516
|
+
self.last_x = x
|
517
|
+
x -= self.offset_x
|
518
|
+
if self.channel:
|
519
|
+
self.channel(f"Move Horizontal x: {int(x)}")
|
520
|
+
self.write(swizzle_table[MOSHI_MOVE_HORIZ][0])
|
521
|
+
self.pipe_int16le(int(x))
|
522
|
+
|
523
|
+
def cut_horizontal_abs(self, x):
|
524
|
+
"""
|
525
|
+
Write an absolute position horizontal cut.
|
526
|
+
|
527
|
+
Laser will cut to the x position with laser firing to the new position from the head position
|
528
|
+
stored in the Moshiboard.
|
529
|
+
"""
|
530
|
+
assert 2 <= self._stage <= 3
|
531
|
+
self._stage = 3
|
532
|
+
self.last_x = x
|
533
|
+
x -= self.offset_x
|
534
|
+
if self.channel:
|
535
|
+
self.channel(f"Cut Horizontal x: {int(x)}")
|
536
|
+
self.write(swizzle_table[MOSHI_CUT_HORIZ][0])
|
537
|
+
self.pipe_int16le(int(x))
|
538
|
+
|
539
|
+
def cut_vertical_abs(self, y):
|
540
|
+
"""
|
541
|
+
Write an absolute position vertical cut.
|
542
|
+
|
543
|
+
Laser will cut to the y position with laser firing to the new position from the head position
|
544
|
+
stored in the Moshiboard
|
545
|
+
"""
|
546
|
+
assert 2 <= self._stage <= 3
|
547
|
+
self._stage = 3
|
548
|
+
self.last_y = y
|
549
|
+
y -= self.offset_y
|
550
|
+
if self.channel:
|
551
|
+
self.channel(f"Cut Vertical y: {int(y)}")
|
552
|
+
self.write(swizzle_table[MOSHI_CUT_VERT][0])
|
553
|
+
self.pipe_int16le(int(y))
|
554
|
+
|
555
|
+
def debug(self, output=print):
|
556
|
+
data = self.data
|
557
|
+
convert = MoshiBuilder.convert
|
558
|
+
|
559
|
+
pos = 0
|
560
|
+
while pos < len(data):
|
561
|
+
cmd = data[pos]
|
562
|
+
cmd = convert(cmd)
|
563
|
+
cmd >>= 4
|
564
|
+
if cmd == 5:
|
565
|
+
output(
|
566
|
+
"Vector Cut Speed: %d (%02x) mm/s Normal Speed: %d mm/s (%02x)"
|
567
|
+
% (
|
568
|
+
data[pos + 1] + 1,
|
569
|
+
data[pos + 1],
|
570
|
+
data[pos + 2] + 1,
|
571
|
+
data[pos + 2],
|
572
|
+
)
|
573
|
+
)
|
574
|
+
pos += 3
|
575
|
+
elif cmd == 4:
|
576
|
+
output(
|
577
|
+
"Raster Header Speed: %d cm/s (%02x)"
|
578
|
+
% (data[pos + 1] + 1, data[pos + 1])
|
579
|
+
)
|
580
|
+
pos += 2
|
581
|
+
elif cmd == 0:
|
582
|
+
z = int.from_bytes(data[pos + 1 : pos + 3], "little", signed=True)
|
583
|
+
x = int.from_bytes(data[pos + 3 : pos + 5], "little", signed=True)
|
584
|
+
y = int.from_bytes(data[pos + 5 : pos + 7], "little", signed=True)
|
585
|
+
output(
|
586
|
+
"Set Location unknown: %d, x: %d, y: %d (%02x%02x,%02x%02x,%02x%02x) "
|
587
|
+
% (
|
588
|
+
z,
|
589
|
+
x,
|
590
|
+
y,
|
591
|
+
data[pos + 1],
|
592
|
+
data[pos + 2],
|
593
|
+
data[pos + 3],
|
594
|
+
data[pos + 4],
|
595
|
+
data[pos + 5],
|
596
|
+
data[pos + 6],
|
597
|
+
)
|
598
|
+
)
|
599
|
+
pos += 7
|
600
|
+
elif cmd == 15:
|
601
|
+
x = int.from_bytes(data[pos + 1 : pos + 3], "little", signed=True)
|
602
|
+
y = int.from_bytes(data[pos + 3 : pos + 5], "little", signed=True)
|
603
|
+
if pos + 5 > len(data):
|
604
|
+
output("Cut Off.")
|
605
|
+
output(data[pos:])
|
606
|
+
return
|
607
|
+
output(
|
608
|
+
"cut x: %d, y: %d (%02x%02x,%02x%02x) "
|
609
|
+
% (
|
610
|
+
x,
|
611
|
+
y,
|
612
|
+
data[pos + 1],
|
613
|
+
data[pos + 2],
|
614
|
+
data[pos + 3],
|
615
|
+
data[pos + 4],
|
616
|
+
)
|
617
|
+
)
|
618
|
+
pos += 5
|
619
|
+
elif cmd == 7:
|
620
|
+
x = int.from_bytes(data[pos + 1 : pos + 3], "little", signed=True)
|
621
|
+
y = int.from_bytes(data[pos + 3 : pos + 5], "little", signed=True)
|
622
|
+
output(
|
623
|
+
"move x: %d, y: %d (%02x%02x,%02x%02x) "
|
624
|
+
% (
|
625
|
+
x,
|
626
|
+
y,
|
627
|
+
data[pos + 1],
|
628
|
+
data[pos + 2],
|
629
|
+
data[pos + 3],
|
630
|
+
data[pos + 4],
|
631
|
+
)
|
632
|
+
)
|
633
|
+
pos += 5
|
634
|
+
elif cmd == 6:
|
635
|
+
p = int.from_bytes(data[pos + 1 : pos + 3], "little", signed=True)
|
636
|
+
output(
|
637
|
+
"move horiz x: %d (%02x%02x) "
|
638
|
+
% (
|
639
|
+
p,
|
640
|
+
data[pos + 1],
|
641
|
+
data[pos + 2],
|
642
|
+
)
|
643
|
+
)
|
644
|
+
pos += 3
|
645
|
+
elif cmd == 3:
|
646
|
+
p = int.from_bytes(data[pos + 1 : pos + 3], "little", signed=True)
|
647
|
+
output(
|
648
|
+
"move vert y: %d (%02x%02x) "
|
649
|
+
% (
|
650
|
+
p,
|
651
|
+
data[pos + 1],
|
652
|
+
data[pos + 2],
|
653
|
+
)
|
654
|
+
)
|
655
|
+
pos += 3
|
656
|
+
elif cmd == 14:
|
657
|
+
p = int.from_bytes(data[pos + 1 : pos + 3], "little", signed=True)
|
658
|
+
output(
|
659
|
+
"cut horiz x: %d (%02x%02x) "
|
660
|
+
% (
|
661
|
+
p,
|
662
|
+
data[pos + 1],
|
663
|
+
data[pos + 2],
|
664
|
+
)
|
665
|
+
)
|
666
|
+
pos += 3
|
667
|
+
elif cmd == 11:
|
668
|
+
p = int.from_bytes(data[pos + 1 : pos + 3], "little", signed=True)
|
669
|
+
output(
|
670
|
+
"cut vert y: %d (%02x%02x) "
|
671
|
+
% (
|
672
|
+
p,
|
673
|
+
data[pos + 1],
|
674
|
+
data[pos + 2],
|
675
|
+
)
|
676
|
+
)
|
677
|
+
pos += 3
|
678
|
+
elif cmd == 2:
|
679
|
+
output("Termination. (7 times)")
|
680
|
+
pos += 1
|
681
|
+
else:
|
682
|
+
output("UNKNOWN COMMAND: %d" % cmd)
|
683
|
+
raise ValueError
|
684
|
+
|
685
|
+
@staticmethod
|
686
|
+
def is_estop(data):
|
687
|
+
return data in swizzle_table[MOSHI_ESTOP]
|
688
|
+
|
689
|
+
@staticmethod
|
690
|
+
def read(output, channel=None):
|
691
|
+
"""
|
692
|
+
The `a7xx` values used before the AC01 commands. Read preamble.
|
693
|
+
|
694
|
+
Also seen randomly 3.2 seconds apart. Maybe keep-alive.
|
695
|
+
@return:
|
696
|
+
"""
|
697
|
+
if channel:
|
698
|
+
channel("Realtime: Read...")
|
699
|
+
output(swizzle_table[MOSHI_READ][0])
|
700
|
+
|
701
|
+
@staticmethod
|
702
|
+
def prologue(output, channel=None):
|
703
|
+
"""
|
704
|
+
Before a jump / program / turned on:
|
705
|
+
@return:
|
706
|
+
"""
|
707
|
+
if channel:
|
708
|
+
channel("Realtime: Prologue")
|
709
|
+
output(swizzle_table[MOSHI_PROLOGUE][0])
|
710
|
+
|
711
|
+
@staticmethod
|
712
|
+
def epilogue(output, channel=None):
|
713
|
+
"""
|
714
|
+
Status 205
|
715
|
+
After a jump / program
|
716
|
+
Status 207
|
717
|
+
Status 205 Done.
|
718
|
+
@return:
|
719
|
+
"""
|
720
|
+
if channel:
|
721
|
+
channel("Realtime: Epilogue")
|
722
|
+
output(swizzle_table[MOSHI_EPILOGUE][0])
|
723
|
+
|
724
|
+
@staticmethod
|
725
|
+
def laser(output, channel=None):
|
726
|
+
"""
|
727
|
+
Laser Command Toggle.
|
728
|
+
@return:
|
729
|
+
"""
|
730
|
+
if channel:
|
731
|
+
channel("Realtime: Laser Active")
|
732
|
+
output(swizzle_table[MOSHI_LASER][0])
|
733
|
+
|
734
|
+
@staticmethod
|
735
|
+
def stop(output, channel=None):
|
736
|
+
"""
|
737
|
+
Estop command.
|
738
|
+
@return:
|
739
|
+
"""
|
740
|
+
if channel:
|
741
|
+
channel("Realtime: Estop")
|
742
|
+
output(swizzle_table[MOSHI_ESTOP][0])
|
743
|
+
|
744
|
+
@staticmethod
|
745
|
+
def freemotor(output, channel=None):
|
746
|
+
"""
|
747
|
+
Estop command.
|
748
|
+
@return:
|
749
|
+
"""
|
750
|
+
if channel:
|
751
|
+
channel("Realtime: Freemotor")
|
752
|
+
output(swizzle_table[MOSHI_FREEMOTOR][0])
|
753
|
+
|
754
|
+
@staticmethod
|
755
|
+
def _swizzle(b, p7, p6, p5, p4, p3, p2, p1, p0):
|
756
|
+
return (
|
757
|
+
((b >> 0) & 1) << p0
|
758
|
+
| ((b >> 1) & 1) << p1
|
759
|
+
| ((b >> 2) & 1) << p2
|
760
|
+
| ((b >> 3) & 1) << p3
|
761
|
+
| ((b >> 4) & 1) << p4
|
762
|
+
| ((b >> 5) & 1) << p5
|
763
|
+
| ((b >> 6) & 1) << p6
|
764
|
+
| ((b >> 7) & 1) << p7
|
765
|
+
)
|
766
|
+
|
767
|
+
@staticmethod
|
768
|
+
def convert(q):
|
769
|
+
"""
|
770
|
+
Translated Moshiboard swizzle into correct Moshi command code.
|
771
|
+
|
772
|
+
Moshiboards command codes have 16 values with 16 different swizzled values. There are
|
773
|
+
two different swizzles depending on the parity of the particular code. These codes are used
|
774
|
+
randomly by Moshi's native software. The board itself reads these all the same.
|
775
|
+
"""
|
776
|
+
if q & 1:
|
777
|
+
return MoshiBuilder._swizzle(q, 7, 6, 2, 4, 3, 5, 1, 0)
|
778
|
+
else:
|
779
|
+
return MoshiBuilder._swizzle(q, 5, 1, 7, 2, 4, 3, 6, 0)
|
780
|
+
|
781
|
+
@staticmethod
|
782
|
+
def reconvert(q):
|
783
|
+
"""
|
784
|
+
Counter-translate a particular command code back into correct values.
|
785
|
+
"""
|
786
|
+
for m in range(5):
|
787
|
+
q = MoshiBuilder.convert(q)
|
788
|
+
return q
|