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/ruida/controller.py
CHANGED
@@ -1,1088 +1,138 @@
|
|
1
|
-
"""
|
2
|
-
Ruida
|
3
|
-
|
4
|
-
The
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
import
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
FOCUS_Z = b"\xD8\x2E"
|
140
|
-
RAPID_OPTION_LIGHT = b"\x03"
|
141
|
-
RAPID_OPTION_LIGHTORIGIN = b"\x01"
|
142
|
-
RAPID_OPTION_ORIGIN = b"\x00"
|
143
|
-
RAPID_OPTION_NONE = b"\x02"
|
144
|
-
RAPID_MOVE_X = b"\xD9\x00" # options(1), abscoord(5)
|
145
|
-
RAPID_MOVE_Y = b"\xD9\x01" # options(1), abscoord(5)
|
146
|
-
RAPID_MOVE_Z = b"\xD9\x02" # options(1), abscoord(5)
|
147
|
-
RAPID_MOVE_U = b"\xD9\x03" # options(1), abscoord(5)
|
148
|
-
RAPID_FEED_AXIS_MOVE = b"\xD9\x0F" # options(1)
|
149
|
-
RAPID_MOVE_XY = b"\xD9\x10" # options(1), abscoord(5), abscoord(5)
|
150
|
-
RAPID_MOVE_XYU = b"\xD9\x30" # options(1), abscoord(5), abscoord(5), abscoord(5)
|
151
|
-
GET_SETTING = b"\xDA\x00" # memory(2)
|
152
|
-
SET_SETTING = b"\xDA\x01" # memory(2), v0(5), v1(5)
|
153
|
-
DOCUMENT_FILE_UPLOAD = b"\xE5\x00" # file_number(2), v0(5), v1(5)
|
154
|
-
DOCUMENT_FILE_END = b"\xE5\x02"
|
155
|
-
SET_ABSOLUTE = b"\xE6\x01"
|
156
|
-
BLOCK_END = b"\xE7\x00"
|
157
|
-
SET_FILENAME = b"\xE7\x01" # filename (null terminated).
|
158
|
-
PROCESS_TOP_LEFT = b"\xE7\x03" # abscoord(5), abscoord(5)
|
159
|
-
PROCESS_REPEAT = b"\xE7\x04" # v0(2), v1(2), v2(2), v3(2), v4(2), v5(2), v6(2)
|
160
|
-
ARRAY_DIRECTION = b"\xE7\x05" # direction(1)
|
161
|
-
FEED_REPEAT = b"\xE7\x06" # v0(5), v1(5)
|
162
|
-
PROCESS_BOTTOM_RIGHT = b"\xE7\x07" # abscoord(5), abscoord(5)
|
163
|
-
ARRAY_REPEAT = b"\xE7\x08" # v0(2), v1(2), v2(2), v3(2), v4(2), v5(2), v6(2)
|
164
|
-
FEED_LENGTH = b"\xE7\x09" # value(5)
|
165
|
-
UNKNOWN_1 = b"\xE7\x0B" # value(5)
|
166
|
-
ARRAY_MIN_POINT = b"\xE7\x13" # abscoord(5), abscoord(5)
|
167
|
-
ARRAY_MAX_POINT = b"\xE7\x17" # abscoord(5), abscoord(5)
|
168
|
-
ARRAY_ADD = b"\xE7\x23" # abscoord(5), abscoord(5)
|
169
|
-
ARRAY_MIRROR = b"\xE7\x24" # mirror(1)
|
170
|
-
BLOCK_X_SIZE = b"\xE7\x35" # abscoord(5), abscoord(5)
|
171
|
-
BY_TEST = b"\xE7\x35" # 0x11227766
|
172
|
-
DOCUMENT_MIN_POINT = b"\xE7\x50" # abscoord(5), abscoord(5)
|
173
|
-
DOCUMENT_MAX_POINT = b"\xE7\x51" # abscoord(5), abscoord(5)
|
174
|
-
PART_MIN_POINT = b"\xE7\x52" # part(1), abscoord(5), abscoord(5)
|
175
|
-
PART_MAX_POINT = b"\xE7\x53" # part(1), abscoord(5), abscoord(5)
|
176
|
-
PEN_OFFSET = b"\xE7\x54" # axis(1), coord(5)
|
177
|
-
LAYER_OFFSET = b"\xE7\x55" # axis(1), coord(5)
|
178
|
-
SET_CURRENT_ELEMENT_INDEX = b"\xE7\x55" # index(1)
|
179
|
-
PART_MIN_POINT_EX = b"\xE7\x61" # part(1), abscoord(5), abscoord(5)
|
180
|
-
PART_MAX_POINT_EX = b"\xE7\x62" # part(1), abscoord(5), abscoord(5)
|
181
|
-
ARRAY_START = b"\xEA" # index(1)
|
182
|
-
ARRAY_END = b"\xEB"
|
183
|
-
REF_POINT_SET = b"\xF0"
|
184
|
-
ELEMENT_MAX_INDEX = b"\xF1\x00" # index(1)
|
185
|
-
ELEMENT_NAME_MAX_INDEX = b"\xF1\x01" # index(1)
|
186
|
-
ENABLE_BLOCK_CUTTING = b"\xF1\x02" # enable(1)
|
187
|
-
DISPLAY_OFFSET = b"\xF1\x03" # abscoord(5), abscoord(5)
|
188
|
-
FEED_AUTO_CALC = b"\xF1\x04" # enable(1)
|
189
|
-
ELEMENT_INDEX = b"\xF2\x00" # index(1)
|
190
|
-
ELEMENT_NAME = b"\xF2\x02" # name(10)
|
191
|
-
ELEMENT_ARRAY_MIN_POINT = b"\xF2\x03" # abscoord(5), abscoord(5)
|
192
|
-
ELEMENT_ARRAY_MAX_POINT = b"\xF2\x04" # abscoord(5), abscoord(5)
|
193
|
-
ELEMENT_ARRAY = b"\xF2\x05" # v0(2), v1(2), v2(2), v3(2), v4(2), v5(2), v6(2)
|
194
|
-
ELEMENT_ARRAY_ADD = b"\xF2\x06" # abscoord(5), abscoord(5)
|
195
|
-
ELEMENT_ARRAY_MIRROR = b"\xF2\x07" # mirror(1)
|
196
|
-
|
197
|
-
|
198
|
-
def encode_part(part):
|
199
|
-
assert 0 <= part <= 255
|
200
|
-
return part
|
201
|
-
|
202
|
-
|
203
|
-
def encode_index(index):
|
204
|
-
assert 0 <= index <= 255
|
205
|
-
return index
|
206
|
-
|
207
|
-
|
208
|
-
def encode_coord(coord):
|
209
|
-
return encode32(coord)
|
210
|
-
|
211
|
-
|
212
|
-
def encode_color(color):
|
213
|
-
return encode32(int(color))
|
214
|
-
|
215
|
-
|
216
|
-
def encode_file_number(file_number):
|
217
|
-
return encode14(file_number)
|
218
|
-
|
219
|
-
|
220
|
-
def encode_mem(file_number):
|
221
|
-
return encode14(file_number)
|
222
|
-
|
223
|
-
|
224
|
-
def encode_value(value):
|
225
|
-
return encode32(value)
|
226
|
-
|
227
|
-
|
228
|
-
def encode_power(power):
|
229
|
-
return encode32(power)
|
230
|
-
|
231
|
-
|
232
|
-
def encode_speed(speed):
|
233
|
-
return encode32(speed)
|
234
|
-
|
235
|
-
|
236
|
-
class RuidaController:
|
237
|
-
"""
|
238
|
-
Ruida controller is tasked with sending queued data to the controller board and ensuring that the connection to the
|
239
|
-
controller board is established to perform these actions.
|
240
|
-
|
241
|
-
This also hides the underlying methods for ruida file types.
|
242
|
-
"""
|
243
|
-
|
244
|
-
def __init__(
|
245
|
-
self,
|
246
|
-
service,
|
247
|
-
force_mock=False,
|
248
|
-
):
|
249
|
-
self.service = service
|
250
|
-
self.is_shutdown = False # Shutdown finished.
|
251
|
-
self.force_mock = force_mock
|
252
|
-
|
253
|
-
name = self.service.label
|
254
|
-
self.usb_log = service.channel(f"{name}/usb", buffer_size=500)
|
255
|
-
self.usb_log.watch(lambda e: service.signal("pipe;usb_status", e))
|
256
|
-
|
257
|
-
self.connection = None
|
258
|
-
self.mode = "init"
|
259
|
-
self.paused = False
|
260
|
-
self._is_opening = False
|
261
|
-
self._abort_open = False
|
262
|
-
self._disable_connect = False
|
263
|
-
self._machine_index = 0
|
264
|
-
self._last_x = 0
|
265
|
-
self._last_y = 0
|
266
|
-
|
267
|
-
def __call__(self, *args, **kwargs):
|
268
|
-
pass
|
269
|
-
|
270
|
-
@property
|
271
|
-
def state(self):
|
272
|
-
return "idle", "idle"
|
273
|
-
|
274
|
-
def set_disable_connect(self, status):
|
275
|
-
self._disable_connect = status
|
276
|
-
|
277
|
-
def added(self):
|
278
|
-
pass
|
279
|
-
|
280
|
-
def service_detach(self):
|
281
|
-
pass
|
282
|
-
|
283
|
-
def shutdown(self, *args, **kwargs):
|
284
|
-
self.is_shutdown = True
|
285
|
-
|
286
|
-
@property
|
287
|
-
def connected(self):
|
288
|
-
if self.connection is None:
|
289
|
-
return False
|
290
|
-
return self.connection.is_open(self._machine_index)
|
291
|
-
|
292
|
-
@property
|
293
|
-
def is_connecting(self):
|
294
|
-
if self.connection is None:
|
295
|
-
return False
|
296
|
-
return self._is_opening
|
297
|
-
|
298
|
-
def abort_connect(self):
|
299
|
-
self._abort_open = True
|
300
|
-
self.usb_log("Connect Attempts Aborted")
|
301
|
-
|
302
|
-
def disconnect(self):
|
303
|
-
try:
|
304
|
-
self.connection.close(self._machine_index)
|
305
|
-
except (ConnectionError, ConnectionRefusedError, AttributeError):
|
306
|
-
pass
|
307
|
-
self.connection = None
|
308
|
-
# Reset error to allow another attempt
|
309
|
-
self.set_disable_connect(False)
|
310
|
-
|
311
|
-
def connect_if_needed(self):
|
312
|
-
if self._disable_connect:
|
313
|
-
# After many failures automatic connects are disabled. We require a manual connection.
|
314
|
-
self.abort_connect()
|
315
|
-
self.connection = None
|
316
|
-
raise ConnectionRefusedError(
|
317
|
-
"Ruida device was unreachable. Explicit connect required."
|
318
|
-
)
|
319
|
-
if self.connection is None:
|
320
|
-
self.connection = MockConnection(self.usb_log)
|
321
|
-
name = self.service.label
|
322
|
-
self.connection.send = self.service.channel(f"{name}/send")
|
323
|
-
self.connection.recv = self.service.channel(f"{name}/recv")
|
324
|
-
# TODO: Needs usbconnection and udp connection.
|
325
|
-
# self.connection = USBConnection(self.usb_log)
|
326
|
-
self._is_opening = True
|
327
|
-
self._abort_open = False
|
328
|
-
count = 0
|
329
|
-
while not self.connection.is_open(self._machine_index):
|
330
|
-
try:
|
331
|
-
if self.connection.open(self._machine_index) < 0:
|
332
|
-
raise ConnectionError
|
333
|
-
self.init_laser()
|
334
|
-
except (ConnectionError, ConnectionRefusedError):
|
335
|
-
time.sleep(0.3)
|
336
|
-
count += 1
|
337
|
-
# self.usb_log(f"Error-Routine pass #{count}")
|
338
|
-
if self.is_shutdown or self._abort_open:
|
339
|
-
self._is_opening = False
|
340
|
-
self._abort_open = False
|
341
|
-
return
|
342
|
-
if self.connection.is_open(self._machine_index):
|
343
|
-
self.connection.close(self._machine_index)
|
344
|
-
if count >= 10:
|
345
|
-
# We have failed too many times.
|
346
|
-
self._is_opening = False
|
347
|
-
self.set_disable_connect(True)
|
348
|
-
self.usb_log("Could not connect to the Ruida controller.")
|
349
|
-
self.usb_log("Automatic connections disabled.")
|
350
|
-
raise ConnectionRefusedError(
|
351
|
-
"Could not connect to the Ruida controller."
|
352
|
-
)
|
353
|
-
time.sleep(0.3)
|
354
|
-
continue
|
355
|
-
self._is_opening = False
|
356
|
-
self._abort_open = False
|
357
|
-
|
358
|
-
def send(self, data, read=True):
|
359
|
-
if self.is_shutdown:
|
360
|
-
return -1, -1, -1, -1
|
361
|
-
self.connect_if_needed()
|
362
|
-
try:
|
363
|
-
self.connection.write(self._machine_index, data)
|
364
|
-
except ConnectionError:
|
365
|
-
return -1, -1, -1, -1
|
366
|
-
if read:
|
367
|
-
try:
|
368
|
-
r = self.connection.read(self._machine_index)
|
369
|
-
return struct.unpack("<4H", r)
|
370
|
-
except ConnectionError:
|
371
|
-
return -1, -1, -1, -1
|
372
|
-
|
373
|
-
def status(self):
|
374
|
-
b0, b1, b2, b3 = self.get_version()
|
375
|
-
return b3
|
376
|
-
|
377
|
-
#######################
|
378
|
-
# MODE SHIFTS
|
379
|
-
#######################
|
380
|
-
|
381
|
-
def rapid_mode(self):
|
382
|
-
if self.mode == "rapid":
|
383
|
-
return
|
384
|
-
self.mode = "rapid"
|
385
|
-
|
386
|
-
def raster_mode(self):
|
387
|
-
self.program_mode()
|
388
|
-
|
389
|
-
def program_mode(self):
|
390
|
-
if self.mode == "rapid":
|
391
|
-
return
|
392
|
-
self.mode = "program"
|
393
|
-
|
394
|
-
#######################
|
395
|
-
# SETS FOR PLOTLIKES
|
396
|
-
#######################
|
397
|
-
|
398
|
-
def set_settings(self, settings):
|
399
|
-
"""
|
400
|
-
Sets the primary settings. Rapid, frequency, speed, and timings.
|
401
|
-
|
402
|
-
@param settings: The current settings dictionary
|
403
|
-
@return:
|
404
|
-
"""
|
405
|
-
pass
|
406
|
-
|
407
|
-
#######################
|
408
|
-
# PLOTLIKE SHORTCUTS
|
409
|
-
#######################
|
410
|
-
|
411
|
-
def mark(self, x, y):
|
412
|
-
if x == self._last_x and y == self._last_y:
|
413
|
-
return
|
414
|
-
self._last_x, self._last_y = x, y
|
415
|
-
|
416
|
-
def goto(self, x, y, long=None, short=None, distance_limit=None):
|
417
|
-
if x == self._last_x and y == self._last_y:
|
418
|
-
return
|
419
|
-
self._last_x, self._last_y = x, y
|
420
|
-
|
421
|
-
def set_xy(self, x, y):
|
422
|
-
pass
|
423
|
-
|
424
|
-
def get_last_xy(self):
|
425
|
-
return self._last_x, self._last_y
|
426
|
-
|
427
|
-
#######################
|
428
|
-
# Command Shortcuts
|
429
|
-
#######################
|
430
|
-
|
431
|
-
def wait_finished(self):
|
432
|
-
pass
|
433
|
-
|
434
|
-
def wait_ready(self):
|
435
|
-
pass
|
436
|
-
|
437
|
-
def wait_idle(self):
|
438
|
-
pass
|
439
|
-
|
440
|
-
def abort(self):
|
441
|
-
self.mode = "rapid"
|
442
|
-
|
443
|
-
def pause(self):
|
444
|
-
self.paused = True
|
445
|
-
|
446
|
-
def resume(self):
|
447
|
-
self.paused = False
|
448
|
-
|
449
|
-
def init_laser(self):
|
450
|
-
self.usb_log("Ready")
|
451
|
-
|
452
|
-
#######################
|
453
|
-
# Specific Commands
|
454
|
-
#######################
|
455
|
-
|
456
|
-
def axis_x_move(self, x):
|
457
|
-
self(AXIS_X_MOVE)
|
458
|
-
self(encode32(x))
|
459
|
-
|
460
|
-
def axis_z_move(self, z):
|
461
|
-
self(AXIS_Z_MOVE)
|
462
|
-
self(encode32(z))
|
463
|
-
|
464
|
-
def axis_a_move(self, a):
|
465
|
-
self(AXIS_A_MOVE)
|
466
|
-
self(encode32(a))
|
467
|
-
|
468
|
-
def axis_u_move(self, u):
|
469
|
-
self(AXIS_U_MOVE)
|
470
|
-
self(encode32(u))
|
471
|
-
|
472
|
-
def move_abs_xy(self, x, y):
|
473
|
-
self(MOVE_ABS_XY)
|
474
|
-
self(encode32(x))
|
475
|
-
self(encode32(y))
|
476
|
-
|
477
|
-
def move_rel_xy(self, dx, dy):
|
478
|
-
self(MOVE_REL_XY)
|
479
|
-
self(encode14(dx))
|
480
|
-
self(encode14(dy))
|
481
|
-
|
482
|
-
def move_rel_x(self, dx):
|
483
|
-
self(MOVE_REL_X)
|
484
|
-
self(encode14(dx))
|
485
|
-
|
486
|
-
def move_rel_y(self, dy):
|
487
|
-
self(MOVE_REL_Y)
|
488
|
-
self(encode14(dy))
|
489
|
-
|
490
|
-
def cut_abs_xy(self, x, y):
|
491
|
-
self(CUT_ABS_XY)
|
492
|
-
self(encode32(x))
|
493
|
-
self(encode32(y))
|
494
|
-
|
495
|
-
def cut_rel_xy(self, dx, dy):
|
496
|
-
self(CUT_REL_XY)
|
497
|
-
self(encode14(dx))
|
498
|
-
self(encode14(dy))
|
499
|
-
|
500
|
-
def cut_rel_x(self, dx):
|
501
|
-
self(CUT_REL_X)
|
502
|
-
self(encode14(dx))
|
503
|
-
|
504
|
-
def cut_rel_y(self, dy):
|
505
|
-
self(CUT_REL_Y)
|
506
|
-
self(encode14(dy))
|
507
|
-
|
508
|
-
def imd_power_1(self, power):
|
509
|
-
self(IMD_POWER_1)
|
510
|
-
self(encode14(power))
|
511
|
-
|
512
|
-
def imd_power_2(self, power):
|
513
|
-
self(IMD_POWER_2)
|
514
|
-
self(encode14(power))
|
515
|
-
|
516
|
-
def imd_power_3(self, power):
|
517
|
-
self(IMD_POWER_3)
|
518
|
-
self(encode14(power))
|
519
|
-
|
520
|
-
def imd_power_4(self, power):
|
521
|
-
self(IMD_POWER_4)
|
522
|
-
self(encode14(power))
|
523
|
-
|
524
|
-
def end_power_1(self, power):
|
525
|
-
self(END_POWER_1)
|
526
|
-
self(encode14(power))
|
527
|
-
|
528
|
-
def end_power_2(self, power):
|
529
|
-
self(END_POWER_2)
|
530
|
-
self(encode14(power))
|
531
|
-
|
532
|
-
def end_power_3(self, power):
|
533
|
-
self(END_POWER_3)
|
534
|
-
self(encode14(power))
|
535
|
-
|
536
|
-
def end_power_4(self, power):
|
537
|
-
self(END_POWER_4)
|
538
|
-
self(encode14(power))
|
539
|
-
|
540
|
-
def min_power_1(self, power):
|
541
|
-
self(MIN_POWER_1)
|
542
|
-
self(encode14(power))
|
543
|
-
|
544
|
-
def max_power_1(self, power):
|
545
|
-
self(MAX_POWER_1)
|
546
|
-
self(encode14(power))
|
547
|
-
|
548
|
-
def min_power_2(self, power):
|
549
|
-
self(MIN_POWER_2)
|
550
|
-
self(encode14(power))
|
551
|
-
|
552
|
-
def max_power_2(self, power):
|
553
|
-
self(MAX_POWER_2)
|
554
|
-
self(encode14(power))
|
555
|
-
|
556
|
-
def min_power_3(self, power):
|
557
|
-
self(MIN_POWER_3)
|
558
|
-
self(encode14(power))
|
559
|
-
|
560
|
-
def max_power_3(self, power):
|
561
|
-
self(MAX_POWER_3)
|
562
|
-
self(encode14(power))
|
563
|
-
|
564
|
-
def min_power_4(self, power):
|
565
|
-
self(MIN_POWER_4)
|
566
|
-
self(encode14(power))
|
567
|
-
|
568
|
-
def max_power_4(self, power):
|
569
|
-
self(MAX_POWER_4)
|
570
|
-
self(encode14(power))
|
571
|
-
|
572
|
-
def laser_interval(self, time):
|
573
|
-
self(LASER_INTERVAL)
|
574
|
-
self(encode32(time))
|
575
|
-
|
576
|
-
def add_delay(self, time):
|
577
|
-
self(ADD_DELAY)
|
578
|
-
self(encode32(time))
|
579
|
-
|
580
|
-
def laser_on_delay(self, time):
|
581
|
-
self(LASER_ON_DELAY)
|
582
|
-
self(encode32(time))
|
583
|
-
|
584
|
-
def laser_off_delay(self, time):
|
585
|
-
self(LASER_OFF_DELAY)
|
586
|
-
self(encode32(time))
|
587
|
-
|
588
|
-
def laser_on_delay_2(self, time):
|
589
|
-
self(LASER_ON_DELAY2)
|
590
|
-
self(encode32(time))
|
591
|
-
|
592
|
-
def laser_off_delay_2(self, time):
|
593
|
-
self(LASER_OFF_DELAY2)
|
594
|
-
self(encode32(time))
|
595
|
-
|
596
|
-
def min_power_1_part(self, part, power):
|
597
|
-
self(MIN_POWER_1_PART)
|
598
|
-
self(encode_part(part))
|
599
|
-
self(encode14(power))
|
600
|
-
|
601
|
-
def max_power_1_part(self, part, power):
|
602
|
-
self(MAX_POWER_1_PART)
|
603
|
-
self(encode_part(part))
|
604
|
-
self(encode14(power))
|
605
|
-
|
606
|
-
def min_power_2_part(self, part, power):
|
607
|
-
self(MIN_POWER_2_PART)
|
608
|
-
self(encode_part(part))
|
609
|
-
self(encode14(power))
|
610
|
-
|
611
|
-
def max_power_2_part(self, part, power):
|
612
|
-
self(MAX_POWER_2_PART)
|
613
|
-
self(encode_part(part))
|
614
|
-
self(encode14(power))
|
615
|
-
|
616
|
-
def min_power_3_part(self, part, power):
|
617
|
-
self(MIN_POWER_3_PART)
|
618
|
-
self(encode_part(part))
|
619
|
-
self(encode14(power))
|
620
|
-
|
621
|
-
def max_power_3_part(self, part, power):
|
622
|
-
self(MAX_POWER_3_PART)
|
623
|
-
self(encode_part(part))
|
624
|
-
self(encode14(power))
|
625
|
-
|
626
|
-
def min_power_4_part(self, part, power):
|
627
|
-
self(MIN_POWER_4_PART)
|
628
|
-
self(encode_part(part))
|
629
|
-
self(encode14(power))
|
630
|
-
|
631
|
-
def max_power_4_part(self, part, power):
|
632
|
-
self(MAX_POWER_4_PART)
|
633
|
-
self(encode_part(part))
|
634
|
-
self(encode14(power))
|
635
|
-
|
636
|
-
def through_power_1(self, power):
|
637
|
-
self(THROUGH_POWER_1)
|
638
|
-
self(encode14(power))
|
639
|
-
|
640
|
-
def through_power_2(self, power):
|
641
|
-
self(THROUGH_POWER_2)
|
642
|
-
self(encode14(power))
|
643
|
-
|
644
|
-
def through_power_3(self, power):
|
645
|
-
self(THROUGH_POWER_3)
|
646
|
-
self(encode14(power))
|
647
|
-
|
648
|
-
def through_power_4(self, power):
|
649
|
-
self(THROUGH_POWER_4)
|
650
|
-
self(encode14(power))
|
651
|
-
|
652
|
-
def frequency_part(self, laser, part, frequency):
|
653
|
-
self(FREQUENCY_PART)
|
654
|
-
self(encode_index(laser))
|
655
|
-
self(encode_part(part))
|
656
|
-
self(encode32(frequency))
|
657
|
-
|
658
|
-
def speed_laser_1(self, speed):
|
659
|
-
self(SPEED_LASER_1)
|
660
|
-
self(encode32(speed))
|
661
|
-
|
662
|
-
def speed_axis(self, speed):
|
663
|
-
self(SPEED_AXIS)
|
664
|
-
self(encode32(speed))
|
665
|
-
|
666
|
-
def speed_laser_1_part(self, part, speed):
|
667
|
-
self(SPEED_LASER_1_PART)
|
668
|
-
self(encode_part(part))
|
669
|
-
self(encode32(speed))
|
670
|
-
|
671
|
-
def force_eng_speed(self, speed):
|
672
|
-
self(FORCE_ENG_SPEED)
|
673
|
-
self(encode32(speed))
|
674
|
-
|
675
|
-
def speed_axis_move(self, speed):
|
676
|
-
self(SPEED_AXIS_MOVE)
|
677
|
-
self(encode32(speed))
|
678
|
-
|
679
|
-
def layer_end(self):
|
680
|
-
self(LAYER_END)
|
681
|
-
|
682
|
-
def work_mode_1(self):
|
683
|
-
self(WORK_MODE_1)
|
684
|
-
|
685
|
-
def work_mode_2(self):
|
686
|
-
self(WORK_MODE_2)
|
687
|
-
|
688
|
-
def work_mode_3(self):
|
689
|
-
self(WORK_MODE_3)
|
690
|
-
|
691
|
-
def work_mode_4(self):
|
692
|
-
self(WORK_MODE_4)
|
693
|
-
|
694
|
-
def work_mode_5(self):
|
695
|
-
self(WORK_MODE_5)
|
696
|
-
|
697
|
-
def work_mode_6(self):
|
698
|
-
self(WORK_MODE_6)
|
699
|
-
|
700
|
-
def laser_device_0(self):
|
701
|
-
self(LASER_DEVICE_0)
|
702
|
-
|
703
|
-
def laser_device_1(self):
|
704
|
-
self(LASER_DEVICE_1)
|
705
|
-
|
706
|
-
def air_assist_off(self):
|
707
|
-
self(AIR_ASSIST_OFF)
|
708
|
-
|
709
|
-
def air_assist_on(self):
|
710
|
-
self(AIR_ASSIST_ON)
|
711
|
-
|
712
|
-
def db_head(self):
|
713
|
-
self(DB_HEAD)
|
714
|
-
|
715
|
-
def en_laser_2_offset_0(self):
|
716
|
-
self(EN_LASER_2_OFFSET_0)
|
717
|
-
|
718
|
-
def en_laser_2_offset_1(self):
|
719
|
-
self(EN_LASER_2_OFFSET_1)
|
720
|
-
|
721
|
-
def layer_number_part(self, part):
|
722
|
-
self(LAYER_NUMBER_PART)
|
723
|
-
self(encode_part(part))
|
724
|
-
|
725
|
-
def en_laser_tube_start(self, part):
|
726
|
-
self(EN_LASER_TUBE_START)
|
727
|
-
self(encode_part(part))
|
728
|
-
|
729
|
-
def x_sign_map(self, value):
|
730
|
-
self(X_SIGN_MAP)
|
731
|
-
self(encode_index(value))
|
732
|
-
|
733
|
-
def layer_color(self, color):
|
734
|
-
self(LAYER_COLOR)
|
735
|
-
self(encode_color(color))
|
736
|
-
|
737
|
-
def layer_color_part(self, part, color):
|
738
|
-
self(LAYER_COLOR)
|
739
|
-
self(encode_part(part))
|
740
|
-
self(encode_color(color))
|
741
|
-
|
742
|
-
def en_ex_io(self, value):
|
743
|
-
"""
|
744
|
-
Enable External IO.
|
745
|
-
|
746
|
-
@param value:
|
747
|
-
@return:
|
748
|
-
"""
|
749
|
-
self(EN_EX_IO)
|
750
|
-
self(encode_index(value))
|
751
|
-
|
752
|
-
def max_layer_part(self, part):
|
753
|
-
self(MAX_LAYER_PART)
|
754
|
-
self(encode_part(part))
|
755
|
-
|
756
|
-
def u_file_id(self, file_number):
|
757
|
-
self(MAX_LAYER_PART)
|
758
|
-
self(encode_file_number(file_number))
|
759
|
-
|
760
|
-
def zu_map(self, value):
|
761
|
-
self(ZU_MAP)
|
762
|
-
self(encode_index(value))
|
763
|
-
|
764
|
-
def work_mode_part(self, part, mode):
|
765
|
-
self(WORK_MODE_PART)
|
766
|
-
self(encode_part(part))
|
767
|
-
self(encode_index(mode))
|
768
|
-
|
769
|
-
def ack(self):
|
770
|
-
self(ACK)
|
771
|
-
|
772
|
-
def err(self):
|
773
|
-
self(ERR)
|
774
|
-
|
775
|
-
def keep_alive(self):
|
776
|
-
self(KEEP_ALIVE)
|
777
|
-
|
778
|
-
def end_of_file(self):
|
779
|
-
self(END_OF_FILE)
|
780
|
-
|
781
|
-
def start_process(self):
|
782
|
-
self(START_PROCESS)
|
783
|
-
|
784
|
-
def stop_process(self):
|
785
|
-
self(STOP_PROCESS)
|
786
|
-
|
787
|
-
def pause_process(self):
|
788
|
-
self(PAUSE_PROCESS)
|
789
|
-
|
790
|
-
def restore_process(self):
|
791
|
-
self(RESTORE_PROCESS)
|
792
|
-
|
793
|
-
def ref_point_2(self):
|
794
|
-
"""
|
795
|
-
Machine zero. Absolute position.
|
796
|
-
@return:
|
797
|
-
"""
|
798
|
-
self(REF_POINT_2)
|
799
|
-
|
800
|
-
def ref_point_1(self):
|
801
|
-
"""
|
802
|
-
Anchor Point, Origin.
|
803
|
-
@return:
|
804
|
-
"""
|
805
|
-
self(REF_POINT_1)
|
806
|
-
|
807
|
-
def ref_point_0(self):
|
808
|
-
"""
|
809
|
-
Current position.
|
810
|
-
|
811
|
-
@return:
|
812
|
-
"""
|
813
|
-
self(REF_POINT_0)
|
814
|
-
|
815
|
-
def home_z(self):
|
816
|
-
self(HOME_Z)
|
817
|
-
|
818
|
-
def home_u(self):
|
819
|
-
self(HOME_U)
|
820
|
-
|
821
|
-
def home_xy(self):
|
822
|
-
self(HOME_XY)
|
823
|
-
|
824
|
-
def focus_z(self):
|
825
|
-
self(FOCUS_Z)
|
826
|
-
|
827
|
-
def _rapid_options(self, light=False, origin=False):
|
828
|
-
if light and origin:
|
829
|
-
return RAPID_OPTION_LIGHTORIGIN
|
830
|
-
if light and not origin:
|
831
|
-
return RAPID_OPTION_LIGHT
|
832
|
-
if origin:
|
833
|
-
return RAPID_OPTION_ORIGIN
|
834
|
-
return RAPID_OPTION_NONE
|
835
|
-
|
836
|
-
def rapid_move_x(self, x, light=False, origin=False):
|
837
|
-
self(RAPID_MOVE_X)
|
838
|
-
self(self._rapid_options(light=light, origin=origin))
|
839
|
-
self(encode_coord(x))
|
840
|
-
|
841
|
-
def rapid_move_y(self, y, light=False, origin=False):
|
842
|
-
self(RAPID_MOVE_Y)
|
843
|
-
self(self._rapid_options(light=light, origin=origin))
|
844
|
-
self(encode_coord(y))
|
845
|
-
|
846
|
-
def rapid_move_z(self, z, light=False, origin=False):
|
847
|
-
self(RAPID_MOVE_Z)
|
848
|
-
self(self._rapid_options(light=light, origin=origin))
|
849
|
-
self(encode_coord(z))
|
850
|
-
|
851
|
-
def rapid_move_u(self, u, light=False, origin=False):
|
852
|
-
self(RAPID_MOVE_U)
|
853
|
-
self(self._rapid_options(light=light, origin=origin))
|
854
|
-
self(encode_coord(u))
|
855
|
-
|
856
|
-
def rapid_move_xy(self, x, y, light=False, origin=False):
|
857
|
-
self(RAPID_MOVE_XY)
|
858
|
-
self(self._rapid_options(light=light, origin=origin))
|
859
|
-
self(encode_coord(x))
|
860
|
-
self(encode_coord(y))
|
861
|
-
|
862
|
-
def rapid_move_xyu(self, x, y, u, light=False, origin=False):
|
863
|
-
self(RAPID_MOVE_XYU)
|
864
|
-
self(self._rapid_options(light=light, origin=origin))
|
865
|
-
self(encode_coord(x))
|
866
|
-
self(encode_coord(y))
|
867
|
-
self(encode_coord(u))
|
868
|
-
|
869
|
-
def rapid_feed_axis(self, light=False, origin=False):
|
870
|
-
self(RAPID_FEED_AXIS_MOVE)
|
871
|
-
self(self._rapid_options(light=light, origin=origin))
|
872
|
-
|
873
|
-
def get_setting(self, mem):
|
874
|
-
self(GET_SETTING)
|
875
|
-
self(encode_mem(mem))
|
876
|
-
|
877
|
-
def set_setting(self, mem, value):
|
878
|
-
self(SET_SETTING)
|
879
|
-
self(encode_mem(mem))
|
880
|
-
self(encode_value(value))
|
881
|
-
self(encode_value(value))
|
882
|
-
|
883
|
-
def document_file_upload(self, file_number, value, value1):
|
884
|
-
self(DOCUMENT_FILE_UPLOAD)
|
885
|
-
self(encode_value(value))
|
886
|
-
self(encode_value(value1))
|
887
|
-
|
888
|
-
def document_file_end(self):
|
889
|
-
self(DOCUMENT_FILE_END)
|
890
|
-
|
891
|
-
def set_absolute(self):
|
892
|
-
self(SET_ABSOLUTE)
|
893
|
-
|
894
|
-
def block_end(self):
|
895
|
-
self(BLOCK_END)
|
896
|
-
|
897
|
-
def set_filename(self, filename):
|
898
|
-
self(SET_FILENAME)
|
899
|
-
self(bytes(filename[:9]), encoding="utf-8")
|
900
|
-
self(b"\x00")
|
901
|
-
|
902
|
-
def process_top_left(self, top, left):
|
903
|
-
self(PROCESS_TOP_LEFT)
|
904
|
-
self(encode_coord(top))
|
905
|
-
self(encode_coord(left))
|
906
|
-
|
907
|
-
def process_repeat(self, v0, v1, v2, v3, v4, v5, v6):
|
908
|
-
self(PROCESS_REPEAT)
|
909
|
-
self(encode14(v0))
|
910
|
-
self(encode14(v1))
|
911
|
-
self(encode14(v2))
|
912
|
-
self(encode14(v3))
|
913
|
-
self(encode14(v4))
|
914
|
-
self(encode14(v5))
|
915
|
-
self(encode14(v6))
|
916
|
-
|
917
|
-
def array_direction(self, direction):
|
918
|
-
self(ARRAY_DIRECTION)
|
919
|
-
self(encode_index(direction))
|
920
|
-
|
921
|
-
def feed_repeat(self, value, value1):
|
922
|
-
self(FEED_REPEAT)
|
923
|
-
self(encode32(value))
|
924
|
-
self(encode32(value1))
|
925
|
-
|
926
|
-
def process_bottom_right(self, bottom, right):
|
927
|
-
self(PROCESS_TOP_LEFT)
|
928
|
-
self(encode_coord(bottom))
|
929
|
-
self(encode_coord(right))
|
930
|
-
|
931
|
-
def array_repeat(self, v0, v1, v2, v3, v4, v5, v6):
|
932
|
-
self(ARRAY_REPEAT)
|
933
|
-
self(encode14(v0))
|
934
|
-
self(encode14(v1))
|
935
|
-
self(encode14(v2))
|
936
|
-
self(encode14(v3))
|
937
|
-
self(encode14(v4))
|
938
|
-
self(encode14(v5))
|
939
|
-
self(encode14(v6))
|
940
|
-
|
941
|
-
def feed_length(self, length):
|
942
|
-
self(FEED_LENGTH)
|
943
|
-
self(encode32(length))
|
944
|
-
|
945
|
-
def array_min_point(self, min_x, min_y):
|
946
|
-
self(ARRAY_MIN_POINT)
|
947
|
-
self(encode_coord(min_x))
|
948
|
-
self(encode_coord(min_y))
|
949
|
-
|
950
|
-
def array_max_point(self, max_x, max_y):
|
951
|
-
self(ARRAY_MAX_POINT)
|
952
|
-
self(encode_coord(max_x))
|
953
|
-
self(encode_coord(max_y))
|
954
|
-
|
955
|
-
def array_add(self, x, y):
|
956
|
-
self(ARRAY_ADD)
|
957
|
-
self(encode_coord(x))
|
958
|
-
self(encode_coord(y))
|
959
|
-
|
960
|
-
def array_mirror(self, mirror):
|
961
|
-
self(ARRAY_MIRROR)
|
962
|
-
self(encode_index(mirror))
|
963
|
-
|
964
|
-
def block_x_size(self, x0, x1):
|
965
|
-
self(BLOCK_X_SIZE)
|
966
|
-
self(encode_coord(x0))
|
967
|
-
self(encode_coord(x1))
|
968
|
-
|
969
|
-
def by_test(self):
|
970
|
-
self(BY_TEST)
|
971
|
-
self(encode32(0x11227766))
|
972
|
-
|
973
|
-
def document_min_point(self, min_x, min_y):
|
974
|
-
self(DOCUMENT_MIN_POINT)
|
975
|
-
self(encode_coord(min_x))
|
976
|
-
self(encode_coord(min_y))
|
977
|
-
|
978
|
-
def document_max_point(self, max_x, max_y):
|
979
|
-
self(DOCUMENT_MAX_POINT)
|
980
|
-
self(encode_coord(max_x))
|
981
|
-
self(encode_coord(max_y))
|
982
|
-
|
983
|
-
def part_min_point(self, part, min_x, min_y):
|
984
|
-
self(PART_MIN_POINT)
|
985
|
-
self(encode_part(part))
|
986
|
-
self(encode_coord(min_x))
|
987
|
-
self(encode_coord(min_y))
|
988
|
-
|
989
|
-
def part_max_point(self, part, max_x, max_y):
|
990
|
-
self(PART_MAX_POINT)
|
991
|
-
self(encode_part(part))
|
992
|
-
self(encode_coord(max_x))
|
993
|
-
self(encode_coord(max_y))
|
994
|
-
|
995
|
-
def pen_offset(self, axis, coord):
|
996
|
-
self(PEN_OFFSET)
|
997
|
-
self(encode_index(axis))
|
998
|
-
self(encode_coord(coord))
|
999
|
-
|
1000
|
-
def layer_offset(self, axis, coord):
|
1001
|
-
self(LAYER_OFFSET)
|
1002
|
-
self(encode_index(axis))
|
1003
|
-
self(encode_coord(coord))
|
1004
|
-
|
1005
|
-
def set_current_element_index(self, index):
|
1006
|
-
self(SET_CURRENT_ELEMENT_INDEX)
|
1007
|
-
self(encode_index(index))
|
1008
|
-
|
1009
|
-
def part_min_point_ex(self, part, min_x, min_y):
|
1010
|
-
self(PART_MIN_POINT_EX)
|
1011
|
-
self(encode_part(part))
|
1012
|
-
self(encode_coord(min_x))
|
1013
|
-
self(encode_coord(min_y))
|
1014
|
-
|
1015
|
-
def part_max_point_ex(self, part, max_x, max_y):
|
1016
|
-
self(PART_MAX_POINT_EX)
|
1017
|
-
self(encode_part(part))
|
1018
|
-
self(encode_coord(max_x))
|
1019
|
-
self(encode_coord(max_y))
|
1020
|
-
|
1021
|
-
def array_start(self, index):
|
1022
|
-
self(ARRAY_START)
|
1023
|
-
self(encode_index(index))
|
1024
|
-
|
1025
|
-
def array_end(self):
|
1026
|
-
self(ARRAY_END)
|
1027
|
-
|
1028
|
-
def ref_point_set(self):
|
1029
|
-
self(REF_POINT_SET)
|
1030
|
-
|
1031
|
-
def element_max_index(self, index):
|
1032
|
-
self(ELEMENT_MAX_INDEX)
|
1033
|
-
self(encode_index(index))
|
1034
|
-
|
1035
|
-
def element_name_max_index(self, index):
|
1036
|
-
self(ELEMENT_NAME_MAX_INDEX)
|
1037
|
-
self(encode_index(index))
|
1038
|
-
|
1039
|
-
def enable_block_cutting(self, enable):
|
1040
|
-
self(ENABLE_BLOCK_CUTTING)
|
1041
|
-
self(encode_index(enable))
|
1042
|
-
|
1043
|
-
def display_offset(self, dx, dy):
|
1044
|
-
self(DISPLAY_OFFSET)
|
1045
|
-
self(encode_coord(dx))
|
1046
|
-
self(encode_coord(dy))
|
1047
|
-
|
1048
|
-
def feed_auto_calc(self, enable):
|
1049
|
-
self(FEED_AUTO_CALC)
|
1050
|
-
self(encode_index(enable))
|
1051
|
-
|
1052
|
-
def element_index(self, index):
|
1053
|
-
self(ELEMENT_INDEX)
|
1054
|
-
self(encode_index(index))
|
1055
|
-
|
1056
|
-
def element_name(self, name):
|
1057
|
-
self(ELEMENT_NAME)
|
1058
|
-
self(bytes(name[:9]), encoding="utf-8")
|
1059
|
-
self(b"\x00")
|
1060
|
-
|
1061
|
-
def element_array_min_point(self, x, y):
|
1062
|
-
self(ELEMENT_ARRAY_MIN_POINT)
|
1063
|
-
self(encode_coord(x))
|
1064
|
-
self(encode_coord(y))
|
1065
|
-
|
1066
|
-
def element_array_max_point(self, x, y):
|
1067
|
-
self(ELEMENT_ARRAY_MAX_POINT)
|
1068
|
-
self(encode_coord(x))
|
1069
|
-
self(encode_coord(y))
|
1070
|
-
|
1071
|
-
def element_array(self, v0, v1, v2, v3, v4, v5, v6):
|
1072
|
-
self(ELEMENT_ARRAY)
|
1073
|
-
self(encode14(v0))
|
1074
|
-
self(encode14(v1))
|
1075
|
-
self(encode14(v2))
|
1076
|
-
self(encode14(v3))
|
1077
|
-
self(encode14(v4))
|
1078
|
-
self(encode14(v5))
|
1079
|
-
self(encode14(v6))
|
1080
|
-
|
1081
|
-
def element_array_add(self, x, y):
|
1082
|
-
self(ELEMENT_ARRAY_ADD)
|
1083
|
-
self(encode_coord(x))
|
1084
|
-
self(encode_coord(y))
|
1085
|
-
|
1086
|
-
def element_array_mirror(self, mirror):
|
1087
|
-
self(ELEMENT_ARRAY_MIRROR)
|
1088
|
-
self(encode_index(mirror))
|
1
|
+
"""
|
2
|
+
Ruida Encoder
|
3
|
+
|
4
|
+
The Ruida Encoder is responsible for turning function calls into binary ruida data.
|
5
|
+
"""
|
6
|
+
import threading
|
7
|
+
|
8
|
+
from meerk40t.ruida.rdjob import ACK, MEM_CARD_ID, RDJob
|
9
|
+
|
10
|
+
|
11
|
+
class RuidaController:
|
12
|
+
"""
|
13
|
+
Implements the Ruida protocol data sending.
|
14
|
+
"""
|
15
|
+
|
16
|
+
def __init__(self, service, pipe, magic=-1):
|
17
|
+
self.service = service
|
18
|
+
self.mode = "init"
|
19
|
+
self.paused = False
|
20
|
+
|
21
|
+
self.write = pipe
|
22
|
+
|
23
|
+
self.job = RDJob()
|
24
|
+
self._send_queue = []
|
25
|
+
self._send_lock = threading.Condition()
|
26
|
+
self._send_thread = None
|
27
|
+
self.events = service.channel(f"{service.safe_label}/events")
|
28
|
+
|
29
|
+
def start_sending(self):
|
30
|
+
self._send_thread = threading.Thread(target=self._data_sender, daemon=True)
|
31
|
+
self.events("Sending File...")
|
32
|
+
self.divide_data_into_queue()
|
33
|
+
self.events(f"File in {len(self._send_queue)} chunk(s)")
|
34
|
+
self._send_thread.start()
|
35
|
+
|
36
|
+
def divide_data_into_queue(self):
|
37
|
+
last = 0
|
38
|
+
total = 0
|
39
|
+
data = self.job.buffer
|
40
|
+
for i, command in enumerate(data):
|
41
|
+
total += len(command)
|
42
|
+
if total > 1000:
|
43
|
+
self._send_queue.append(self.job.get_contents(last, i))
|
44
|
+
last = i
|
45
|
+
total = 0
|
46
|
+
if last != len(data):
|
47
|
+
self._send_queue.append(self.job.get_contents(last))
|
48
|
+
|
49
|
+
def _data_sender(self):
|
50
|
+
while self._send_queue:
|
51
|
+
data = self._send_queue.pop(0)
|
52
|
+
self.write(data)
|
53
|
+
with self._send_lock:
|
54
|
+
if not self._send_lock.wait(5):
|
55
|
+
self.service.signal("warning", "Connection Problem.", "Timeout")
|
56
|
+
return
|
57
|
+
self._send_queue.clear()
|
58
|
+
self._send_thread = None
|
59
|
+
self.events("File Sent.")
|
60
|
+
|
61
|
+
def recv(self, reply):
|
62
|
+
e = self.job.unswizzle(reply)
|
63
|
+
if e == ACK:
|
64
|
+
with self._send_lock:
|
65
|
+
self._send_lock.notify()
|
66
|
+
self.events(f"-->: {e}")
|
67
|
+
|
68
|
+
def start_record(self):
|
69
|
+
self.job.get_setting(MEM_CARD_ID, output=self.write)
|
70
|
+
self.job.clear()
|
71
|
+
|
72
|
+
def stop_record(self):
|
73
|
+
self.start_sending()
|
74
|
+
|
75
|
+
@property
|
76
|
+
def state(self):
|
77
|
+
return "idle", "idle"
|
78
|
+
|
79
|
+
def added(self):
|
80
|
+
pass
|
81
|
+
|
82
|
+
def service_detach(self):
|
83
|
+
pass
|
84
|
+
|
85
|
+
#######################
|
86
|
+
# MODE SHIFTS
|
87
|
+
#######################
|
88
|
+
|
89
|
+
def rapid_mode(self):
|
90
|
+
if self.mode == "rapid":
|
91
|
+
return
|
92
|
+
self.mode = "rapid"
|
93
|
+
|
94
|
+
def raster_mode(self):
|
95
|
+
self.program_mode()
|
96
|
+
|
97
|
+
def program_mode(self):
|
98
|
+
if self.mode == "rapid":
|
99
|
+
return
|
100
|
+
self.mode = "program"
|
101
|
+
|
102
|
+
#######################
|
103
|
+
# SETS FOR PLOTLIKES
|
104
|
+
#######################
|
105
|
+
|
106
|
+
def set_settings(self, settings):
|
107
|
+
"""
|
108
|
+
Sets the primary settings. Rapid, frequency, speed, and timings.
|
109
|
+
|
110
|
+
@param settings: The current settings dictionary
|
111
|
+
@return:
|
112
|
+
"""
|
113
|
+
pass
|
114
|
+
|
115
|
+
#######################
|
116
|
+
# Command Shortcuts
|
117
|
+
#######################
|
118
|
+
|
119
|
+
def wait_finished(self):
|
120
|
+
pass
|
121
|
+
|
122
|
+
def wait_ready(self):
|
123
|
+
pass
|
124
|
+
|
125
|
+
def wait_idle(self):
|
126
|
+
pass
|
127
|
+
|
128
|
+
def abort(self):
|
129
|
+
self.mode = "rapid"
|
130
|
+
self.job.stop_process(output=self.write)
|
131
|
+
|
132
|
+
def pause(self):
|
133
|
+
self.paused = True
|
134
|
+
self.job.pause_process(output=self.write)
|
135
|
+
|
136
|
+
def resume(self):
|
137
|
+
self.paused = False
|
138
|
+
self.job.restore_process(output=self.write)
|