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/balormk/device.py
CHANGED
@@ -1,1959 +1,966 @@
|
|
1
|
-
"""
|
2
|
-
Galvo Device
|
3
|
-
|
4
|
-
Defines how the balor device interacts with the scene, and accepts data via the spooler.
|
5
|
-
"""
|
6
|
-
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
10
|
-
|
11
|
-
from meerk40t.
|
12
|
-
from meerk40t.
|
13
|
-
from meerk40t.
|
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
|
-
self.register(
|
47
|
-
"format/op
|
48
|
-
"{danger}{defop}{enabled}{pass}{element_type} {speed}mm/s @{power} {frequency}kHz {colcode} {opstop}",
|
49
|
-
)
|
50
|
-
self.register(
|
51
|
-
"format/op
|
52
|
-
"{danger}{defop}{enabled}{pass}{element_type}
|
53
|
-
)
|
54
|
-
self.register(
|
55
|
-
"format/op
|
56
|
-
"{danger}{defop}{enabled}{
|
57
|
-
)
|
58
|
-
self.register(
|
59
|
-
"format/op
|
60
|
-
"{danger}{defop}{enabled}{pass}{element_type}
|
61
|
-
)
|
62
|
-
self.register(
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
self.
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
self.setting(
|
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
|
-
"label": _("
|
112
|
-
"tip": _("
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
"
|
118
|
-
"
|
119
|
-
"
|
120
|
-
"
|
121
|
-
"
|
122
|
-
"
|
123
|
-
|
124
|
-
|
125
|
-
"
|
126
|
-
"
|
127
|
-
"
|
128
|
-
"
|
129
|
-
|
130
|
-
|
131
|
-
"
|
132
|
-
"
|
133
|
-
"
|
134
|
-
"
|
135
|
-
"
|
136
|
-
"
|
137
|
-
|
138
|
-
|
139
|
-
"
|
140
|
-
"
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
"
|
145
|
-
"
|
146
|
-
"
|
147
|
-
"
|
148
|
-
"
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
"
|
153
|
-
"
|
154
|
-
|
155
|
-
|
156
|
-
"
|
157
|
-
"
|
158
|
-
"
|
159
|
-
"
|
160
|
-
|
161
|
-
|
162
|
-
"
|
163
|
-
"
|
164
|
-
|
165
|
-
|
166
|
-
"
|
167
|
-
"
|
168
|
-
"
|
169
|
-
"
|
170
|
-
|
171
|
-
|
172
|
-
"
|
173
|
-
"
|
174
|
-
|
175
|
-
|
176
|
-
"
|
177
|
-
"
|
178
|
-
"
|
179
|
-
"
|
180
|
-
"
|
181
|
-
|
182
|
-
|
183
|
-
"
|
184
|
-
|
185
|
-
|
186
|
-
"
|
187
|
-
"
|
188
|
-
"
|
189
|
-
"
|
190
|
-
"
|
191
|
-
"
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
"label": _("
|
199
|
-
"tip": _("
|
200
|
-
"section": "_10_Parameters",
|
201
|
-
"subsection": "_10_Axis corrections",
|
202
|
-
},
|
203
|
-
{
|
204
|
-
"attr": "
|
205
|
-
"object": self,
|
206
|
-
"default":
|
207
|
-
"type":
|
208
|
-
"label": _("
|
209
|
-
"
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
"
|
214
|
-
"
|
215
|
-
|
216
|
-
|
217
|
-
"
|
218
|
-
"
|
219
|
-
|
220
|
-
|
221
|
-
"
|
222
|
-
"
|
223
|
-
|
224
|
-
|
225
|
-
"
|
226
|
-
"
|
227
|
-
|
228
|
-
|
229
|
-
"
|
230
|
-
"
|
231
|
-
|
232
|
-
|
233
|
-
"
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
"
|
239
|
-
"
|
240
|
-
"
|
241
|
-
"
|
242
|
-
"
|
243
|
-
"
|
244
|
-
|
245
|
-
|
246
|
-
"
|
247
|
-
"
|
248
|
-
|
249
|
-
|
250
|
-
"
|
251
|
-
"
|
252
|
-
"
|
253
|
-
"
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
"
|
263
|
-
"
|
264
|
-
"
|
265
|
-
"
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
"
|
270
|
-
"
|
271
|
-
|
272
|
-
|
273
|
-
"
|
274
|
-
"
|
275
|
-
|
276
|
-
|
277
|
-
"
|
278
|
-
|
279
|
-
|
280
|
-
"
|
281
|
-
"
|
282
|
-
"
|
283
|
-
"
|
284
|
-
},
|
285
|
-
{
|
286
|
-
"attr": "
|
287
|
-
"object": self,
|
288
|
-
"default":
|
289
|
-
"type":
|
290
|
-
"label": _("
|
291
|
-
"tip": _(
|
292
|
-
|
293
|
-
|
294
|
-
"
|
295
|
-
},
|
296
|
-
{
|
297
|
-
"attr": "
|
298
|
-
"object": self,
|
299
|
-
"default":
|
300
|
-
"type":
|
301
|
-
"label": _("
|
302
|
-
"tip": _(
|
303
|
-
|
304
|
-
|
305
|
-
"
|
306
|
-
},
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
"
|
313
|
-
"
|
314
|
-
|
315
|
-
|
316
|
-
"
|
317
|
-
"
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
"
|
322
|
-
"
|
323
|
-
"
|
324
|
-
"
|
325
|
-
"
|
326
|
-
"
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
"
|
331
|
-
"
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
"
|
341
|
-
"
|
342
|
-
"
|
343
|
-
"
|
344
|
-
"label": _("
|
345
|
-
"
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
"
|
350
|
-
"
|
351
|
-
"
|
352
|
-
"
|
353
|
-
"
|
354
|
-
"
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
"
|
359
|
-
"
|
360
|
-
"
|
361
|
-
"
|
362
|
-
"
|
363
|
-
"
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
"
|
369
|
-
"
|
370
|
-
"
|
371
|
-
"
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
"
|
393
|
-
"
|
394
|
-
"
|
395
|
-
"
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
"
|
403
|
-
"
|
404
|
-
"
|
405
|
-
"
|
406
|
-
"label": _("
|
407
|
-
"
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
"
|
412
|
-
"
|
413
|
-
"
|
414
|
-
|
415
|
-
|
416
|
-
"
|
417
|
-
|
418
|
-
|
419
|
-
"
|
420
|
-
"
|
421
|
-
"
|
422
|
-
"
|
423
|
-
|
424
|
-
),
|
425
|
-
"
|
426
|
-
"
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
"
|
431
|
-
"
|
432
|
-
"
|
433
|
-
"
|
434
|
-
"
|
435
|
-
"
|
436
|
-
|
437
|
-
|
438
|
-
"
|
439
|
-
"
|
440
|
-
|
441
|
-
|
442
|
-
"
|
443
|
-
"
|
444
|
-
"
|
445
|
-
"
|
446
|
-
|
447
|
-
|
448
|
-
"
|
449
|
-
"
|
450
|
-
"
|
451
|
-
"
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
"
|
472
|
-
"
|
473
|
-
"
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
"
|
483
|
-
"
|
484
|
-
|
485
|
-
|
486
|
-
"
|
487
|
-
"
|
488
|
-
"
|
489
|
-
|
490
|
-
|
491
|
-
"
|
492
|
-
"
|
493
|
-
"
|
494
|
-
},
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
"
|
501
|
-
"
|
502
|
-
"
|
503
|
-
|
504
|
-
|
505
|
-
"
|
506
|
-
"
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
"
|
513
|
-
"
|
514
|
-
"
|
515
|
-
"
|
516
|
-
"
|
517
|
-
"
|
518
|
-
"subsection": "
|
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
|
-
"subsection": "
|
564
|
-
},
|
565
|
-
{
|
566
|
-
"attr": "
|
567
|
-
"object": self,
|
568
|
-
"default":
|
569
|
-
"type":
|
570
|
-
"label": _("
|
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
|
-
"subsection": "
|
626
|
-
},
|
627
|
-
{
|
628
|
-
"attr": "
|
629
|
-
"object": self,
|
630
|
-
"default":
|
631
|
-
"type": int,
|
632
|
-
"label": _("
|
633
|
-
# "tip": _(""),
|
634
|
-
"subsection": "
|
635
|
-
},
|
636
|
-
{
|
637
|
-
"attr": "
|
638
|
-
"object": self,
|
639
|
-
"default":
|
640
|
-
"type": int,
|
641
|
-
"label": _("
|
642
|
-
# "tip": _(""),
|
643
|
-
"subsection": "
|
644
|
-
},
|
645
|
-
{
|
646
|
-
"attr": "
|
647
|
-
"object": self,
|
648
|
-
"default":
|
649
|
-
"type": int,
|
650
|
-
"label": _("
|
651
|
-
# "tip": _(""),
|
652
|
-
"subsection": "
|
653
|
-
},
|
654
|
-
{
|
655
|
-
"attr": "
|
656
|
-
"object": self,
|
657
|
-
"default":
|
658
|
-
"type": int,
|
659
|
-
"label": _("
|
660
|
-
# "tip": _(""),
|
661
|
-
"subsection": "
|
662
|
-
},
|
663
|
-
{
|
664
|
-
"attr": "
|
665
|
-
"object": self,
|
666
|
-
"default":
|
667
|
-
"type": int,
|
668
|
-
"label": _("
|
669
|
-
"tip": _(
|
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
|
-
self.
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
self.
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
)
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
self
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
self.spooler.command("abort_retry", priority=1)
|
968
|
-
|
969
|
-
@self.console_argument("filename", type=str)
|
970
|
-
@self.console_command("save_job", help=_("save job export"), input_type="plan")
|
971
|
-
def galvo_save(channel, _, filename, data=None, **kwargs):
|
972
|
-
if filename is None:
|
973
|
-
raise CommandSyntaxError
|
974
|
-
try:
|
975
|
-
with open(filename, "w") as f:
|
976
|
-
driver = BalorDriver(self, force_mock=True)
|
977
|
-
job = LaserJob(filename, list(data.plan), driver=driver)
|
978
|
-
from meerk40t.balormk.controller import list_command_lookup
|
979
|
-
|
980
|
-
def write(index, cmd):
|
981
|
-
cmds = [
|
982
|
-
struct.unpack("<6H", cmd[i : i + 12])
|
983
|
-
for i in range(0, len(cmd), 12)
|
984
|
-
]
|
985
|
-
for v in cmds:
|
986
|
-
if v[0] >= 0x8000:
|
987
|
-
f.write(
|
988
|
-
f"{list_command_lookup.get(v[0], f'{v[0]:04x}').ljust(20)} "
|
989
|
-
f"{v[1]:04x} {v[2]:04x} {v[3]:04x} {v[4]:04x} {v[5]:04x}\n"
|
990
|
-
)
|
991
|
-
if v[0] == 0x8002:
|
992
|
-
break
|
993
|
-
|
994
|
-
driver.connection.connect_if_needed()
|
995
|
-
driver.connection.connection.write = write
|
996
|
-
job.execute()
|
997
|
-
|
998
|
-
except (PermissionError, OSError):
|
999
|
-
channel(_("Could not save: {filename}").format(filename=filename))
|
1000
|
-
|
1001
|
-
@self.console_option(
|
1002
|
-
"default",
|
1003
|
-
"d",
|
1004
|
-
help=_("Allow default list commands to persist within the raw command"),
|
1005
|
-
type=bool,
|
1006
|
-
action="store_true",
|
1007
|
-
)
|
1008
|
-
@self.console_option(
|
1009
|
-
"raw",
|
1010
|
-
"r",
|
1011
|
-
help=_("Data is explicitly little-ended hex from a data capture"),
|
1012
|
-
type=bool,
|
1013
|
-
action="store_true",
|
1014
|
-
)
|
1015
|
-
@self.console_option(
|
1016
|
-
"binary_in",
|
1017
|
-
"b",
|
1018
|
-
help=_("Read data is explicitly in binary"),
|
1019
|
-
type=bool,
|
1020
|
-
action="store_true",
|
1021
|
-
)
|
1022
|
-
@self.console_option(
|
1023
|
-
"binary_out",
|
1024
|
-
"B",
|
1025
|
-
help=_("Write data should be explicitly in binary"),
|
1026
|
-
type=bool,
|
1027
|
-
action="store_true",
|
1028
|
-
)
|
1029
|
-
@self.console_option(
|
1030
|
-
"short",
|
1031
|
-
"s",
|
1032
|
-
help=_("Export data is assumed short command only"),
|
1033
|
-
type=bool,
|
1034
|
-
action="store_true",
|
1035
|
-
)
|
1036
|
-
@self.console_option(
|
1037
|
-
"hard",
|
1038
|
-
"h",
|
1039
|
-
help=_("Do not send regular list protocol commands"),
|
1040
|
-
type=bool,
|
1041
|
-
action="store_true",
|
1042
|
-
)
|
1043
|
-
@self.console_option(
|
1044
|
-
"trim",
|
1045
|
-
"t",
|
1046
|
-
help=_("Trim the first number of characters"),
|
1047
|
-
type=int,
|
1048
|
-
)
|
1049
|
-
@self.console_option(
|
1050
|
-
"input", "i", type=str, default=None, help="input data for given file"
|
1051
|
-
)
|
1052
|
-
@self.console_option(
|
1053
|
-
"output", "o", type=str, default=None, help="output data to given file"
|
1054
|
-
)
|
1055
|
-
@self.console_command(
|
1056
|
-
"raw",
|
1057
|
-
help=_("sends raw galvo list command exactly as composed"),
|
1058
|
-
)
|
1059
|
-
def galvo_raw(
|
1060
|
-
channel,
|
1061
|
-
_,
|
1062
|
-
default=False,
|
1063
|
-
raw=False,
|
1064
|
-
binary_in=False,
|
1065
|
-
binary_out=False,
|
1066
|
-
short=False,
|
1067
|
-
hard=False,
|
1068
|
-
trim=0,
|
1069
|
-
input=None,
|
1070
|
-
output=None,
|
1071
|
-
remainder=None,
|
1072
|
-
**kwgs,
|
1073
|
-
):
|
1074
|
-
"""
|
1075
|
-
Raw for galvo performs raw actions and sends these commands directly to the laser.
|
1076
|
-
There are methods for reading and writing raw info from files in order to send that
|
1077
|
-
data. You can also use shorthand commands.
|
1078
|
-
"""
|
1079
|
-
from meerk40t.balormk.controller import (
|
1080
|
-
list_command_lookup,
|
1081
|
-
single_command_lookup,
|
1082
|
-
)
|
1083
|
-
|
1084
|
-
# Establish reverse lookup for string commands to binary command.
|
1085
|
-
reverse_lookup = {}
|
1086
|
-
for k in list_command_lookup:
|
1087
|
-
command_string = list_command_lookup[k]
|
1088
|
-
reverse_lookup[command_string] = k
|
1089
|
-
reverse_lookup[command_string.lower()[4:]] = k
|
1090
|
-
|
1091
|
-
for k in single_command_lookup:
|
1092
|
-
command_string = single_command_lookup[k]
|
1093
|
-
reverse_lookup[command_string] = k
|
1094
|
-
reverse_lookup[command_string.lower()] = k
|
1095
|
-
|
1096
|
-
if remainder is None and input is None:
|
1097
|
-
# "raw" was typed without any data or input file, so we list the permitted commands
|
1098
|
-
channel("Permitted List Commands:")
|
1099
|
-
for k in list_command_lookup:
|
1100
|
-
command_string = list_command_lookup[k]
|
1101
|
-
channel(f"{command_string.lower()[4:]} aka {k:04x}")
|
1102
|
-
channel("----------------------------")
|
1103
|
-
|
1104
|
-
channel("Permitted Short Commands:")
|
1105
|
-
for k in single_command_lookup:
|
1106
|
-
command_string = single_command_lookup[k]
|
1107
|
-
channel(f"{command_string.lower()} aka {k:04x}")
|
1108
|
-
return
|
1109
|
-
|
1110
|
-
if input is not None:
|
1111
|
-
# We were given an input file. We load that data, in either binary plain text.
|
1112
|
-
from os.path import exists
|
1113
|
-
|
1114
|
-
if exists(input):
|
1115
|
-
channel(f"Loading data from: {input}")
|
1116
|
-
try:
|
1117
|
-
if binary_in:
|
1118
|
-
with open(input, "br") as f:
|
1119
|
-
remainder = f.read().hex()
|
1120
|
-
else:
|
1121
|
-
with open(input) as f:
|
1122
|
-
remainder = f.read()
|
1123
|
-
except OSError:
|
1124
|
-
channel("File could not be read.")
|
1125
|
-
else:
|
1126
|
-
channel(f"The file at {os.path.realpath(input)} does not exist.")
|
1127
|
-
return
|
1128
|
-
|
1129
|
-
cmds = None
|
1130
|
-
if raw or binary_in:
|
1131
|
-
# Our data is 6 values int16le
|
1132
|
-
if trim:
|
1133
|
-
# Used to cut off raw header data
|
1134
|
-
remainder = remainder[trim:]
|
1135
|
-
try:
|
1136
|
-
cmds = [
|
1137
|
-
struct.unpack("<6H", bytearray.fromhex(remainder[i : i + 24]))
|
1138
|
-
for i in range(0, len(remainder), 24)
|
1139
|
-
]
|
1140
|
-
cmds = [
|
1141
|
-
f"{v[0]:04x} {v[1]:04x} {v[2]:04x} {v[3]:04x} {v[4]:04x} {v[5]:04x}"
|
1142
|
-
for v in cmds
|
1143
|
-
]
|
1144
|
-
except (struct.error, ValueError) as e:
|
1145
|
-
channel(f"Data was declared raw but could not parse because '{e}'")
|
1146
|
-
|
1147
|
-
if cmds is None:
|
1148
|
-
cmds = list(re.split(r"[,\n\r]", remainder))
|
1149
|
-
|
1150
|
-
raw_commands = list()
|
1151
|
-
|
1152
|
-
# Compile commands.
|
1153
|
-
for cmd_i, cmd in enumerate(cmds):
|
1154
|
-
cmd = cmd.strip()
|
1155
|
-
if not cmd:
|
1156
|
-
continue
|
1157
|
-
|
1158
|
-
values = [0] * 6
|
1159
|
-
byte_i = 0
|
1160
|
-
split_bytes = [b for b in cmd.split(" ") if b.strip()]
|
1161
|
-
if len(split_bytes) > 6:
|
1162
|
-
channel(
|
1163
|
-
f"Invalid command line {cmd_i}: {split_bytes} has more than six entries."
|
1164
|
-
)
|
1165
|
-
return
|
1166
|
-
for b in split_bytes:
|
1167
|
-
v = None
|
1168
|
-
convert = reverse_lookup.get(b)
|
1169
|
-
if convert is not None:
|
1170
|
-
v = int(convert)
|
1171
|
-
else:
|
1172
|
-
try:
|
1173
|
-
p = struct.unpack(">H", bytearray.fromhex(b))
|
1174
|
-
v = p[0]
|
1175
|
-
except (ValueError, struct.error):
|
1176
|
-
pass
|
1177
|
-
if not isinstance(v, int):
|
1178
|
-
channel(f'Compile error. Line #{cmd_i+1} value "{b}"')
|
1179
|
-
return
|
1180
|
-
values[byte_i] = v
|
1181
|
-
byte_i += 1
|
1182
|
-
raw_commands.append(values)
|
1183
|
-
|
1184
|
-
if output is not None:
|
1185
|
-
# Output to file
|
1186
|
-
channel(f"Writing data to: {output}")
|
1187
|
-
try:
|
1188
|
-
if binary_out:
|
1189
|
-
with open(output, "wb") as f:
|
1190
|
-
for v in raw_commands:
|
1191
|
-
b_data = struct.pack("<6H", *v)
|
1192
|
-
f.write(b_data)
|
1193
|
-
else:
|
1194
|
-
lines = []
|
1195
|
-
for v in raw_commands:
|
1196
|
-
lines.append(
|
1197
|
-
f"{list_command_lookup.get(v[0], f'{v[0]:04x}').ljust(20)} "
|
1198
|
-
f"{v[1]:04x} {v[2]:04x} {v[3]:04x} {v[4]:04x} {v[5]:04x}\n"
|
1199
|
-
)
|
1200
|
-
with open(output, "w") as f:
|
1201
|
-
f.writelines(lines)
|
1202
|
-
except OSError:
|
1203
|
-
channel("File could not be written.")
|
1204
|
-
return # If we output to file, we do not output to device.
|
1205
|
-
|
1206
|
-
# OUTPUT TO DEVICE
|
1207
|
-
if hard:
|
1208
|
-
# Hard raw mode, disable any control values being sent.
|
1209
|
-
self.driver.connection.raw_mode()
|
1210
|
-
if not default:
|
1211
|
-
self.driver.connection.raw_clear()
|
1212
|
-
for v in raw_commands:
|
1213
|
-
command = v[0]
|
1214
|
-
if command >= 0x8000:
|
1215
|
-
self.driver.connection._list_write(*v)
|
1216
|
-
else:
|
1217
|
-
self.driver.connection._list_end()
|
1218
|
-
self.driver.connection._command(*v)
|
1219
|
-
return
|
1220
|
-
|
1221
|
-
if short:
|
1222
|
-
# Short mode only sending pure shorts.
|
1223
|
-
for v in raw_commands:
|
1224
|
-
self.driver.connection.raw_write(*v)
|
1225
|
-
return
|
1226
|
-
|
1227
|
-
# Hybrid mode. Sending list and short commands using the right mode changes.
|
1228
|
-
self.driver.connection.rapid_mode()
|
1229
|
-
self.driver.connection.program_mode()
|
1230
|
-
if not default:
|
1231
|
-
self.driver.connection.raw_clear()
|
1232
|
-
for v in raw_commands:
|
1233
|
-
command = v[0]
|
1234
|
-
if command >= 0x8000:
|
1235
|
-
self.driver.connection.program_mode()
|
1236
|
-
self.driver.connection._list_write(*v)
|
1237
|
-
else:
|
1238
|
-
self.driver.connection.rapid_mode()
|
1239
|
-
self.driver.connection._command(*v)
|
1240
|
-
self.driver.connection.rapid_mode()
|
1241
|
-
|
1242
|
-
@self.console_argument("x", type=float, default=0.0)
|
1243
|
-
@self.console_argument("y", type=float, default=0.0)
|
1244
|
-
@self.console_command(
|
1245
|
-
"goto",
|
1246
|
-
help=_("send laser a goto command"),
|
1247
|
-
)
|
1248
|
-
def galvo_goto(command, channel, _, x=None, y=None, remainder=None, **kwgs):
|
1249
|
-
if x is not None and y is not None:
|
1250
|
-
rx = int(0x8000 + x) & 0xFFFF
|
1251
|
-
ry = int(0x8000 + y) & 0xFFFF
|
1252
|
-
self.driver.connection.set_xy(rx, ry)
|
1253
|
-
|
1254
|
-
@self.console_option("minspeed", "n", type=int, default=100)
|
1255
|
-
@self.console_option("maxspeed", "x", type=int, default=5000)
|
1256
|
-
@self.console_option("acc_time", "a", type=int, default=100)
|
1257
|
-
@self.console_argument("position", type=int, default=0)
|
1258
|
-
@self.console_command(
|
1259
|
-
"rotary_to",
|
1260
|
-
help=_("Send laser rotary command info."),
|
1261
|
-
all_arguments_required=True,
|
1262
|
-
)
|
1263
|
-
def galvo_rotary(
|
1264
|
-
command, channel, _, position, minspeed, maxspeed, acc_time, **kwgs
|
1265
|
-
):
|
1266
|
-
self.driver.connection.set_axis_motion_param(
|
1267
|
-
minspeed & 0xFFFF, maxspeed & 0xFFFF
|
1268
|
-
)
|
1269
|
-
self.driver.connection.set_axis_origin_param(acc_time) # Unsure why 100.
|
1270
|
-
pos = position if position >= 0 else -position + 0x80000000
|
1271
|
-
p1 = (pos >> 16) & 0xFFFF
|
1272
|
-
p0 = pos & 0xFFFF
|
1273
|
-
self.driver.connection.move_axis_to(p0, p1)
|
1274
|
-
self.driver.connection.wait_axis()
|
1275
|
-
|
1276
|
-
@self.console_option("minspeed", "n", type=int, default=100)
|
1277
|
-
@self.console_option("maxspeed", "x", type=int, default=5000)
|
1278
|
-
@self.console_option("acc_time", "a", type=int, default=100)
|
1279
|
-
@self.console_argument(
|
1280
|
-
"delta_rotary", type=int, default=0, help="relative amount"
|
1281
|
-
)
|
1282
|
-
@self.console_command(
|
1283
|
-
"rotary_relative",
|
1284
|
-
help=_("Advance the rotary by the given amount"),
|
1285
|
-
all_arguments_required=True,
|
1286
|
-
)
|
1287
|
-
def galvo_rotary_advance(
|
1288
|
-
command, channel, _, delta_rotary, minspeed, maxspeed, acc_time, **kwgs
|
1289
|
-
):
|
1290
|
-
pos_args = self.driver.connection.get_axis_pos()
|
1291
|
-
current = pos_args[1] | pos_args[2] << 16
|
1292
|
-
if current > 0x80000000:
|
1293
|
-
current = -current + 0x80000000
|
1294
|
-
position = current + delta_rotary
|
1295
|
-
|
1296
|
-
self.driver.connection.set_axis_motion_param(
|
1297
|
-
minspeed & 0xFFFF, maxspeed & 0xFFFF
|
1298
|
-
)
|
1299
|
-
self.driver.connection.set_axis_origin_param(acc_time) # Unsure why 100.
|
1300
|
-
pos = position if position >= 0 else -position + 0x80000000
|
1301
|
-
p1 = (pos >> 16) & 0xFFFF
|
1302
|
-
p0 = pos & 0xFFFF
|
1303
|
-
self.driver.connection.move_axis_to(p0, p1)
|
1304
|
-
self.driver.connection.wait_axis()
|
1305
|
-
|
1306
|
-
@self.console_option("axis_index", "i", type=int, default=0)
|
1307
|
-
@self.console_command(
|
1308
|
-
"rotary_pos",
|
1309
|
-
help=_("Check the rotary position"),
|
1310
|
-
)
|
1311
|
-
def galvo_rotary_pos(command, channel, _, axis_index=0, **kwgs):
|
1312
|
-
pos_args = self.driver.connection.get_axis_pos(axis_index)
|
1313
|
-
if pos_args is None:
|
1314
|
-
channel("Not connected, cannot get axis pos.")
|
1315
|
-
return
|
1316
|
-
current = pos_args[1] | pos_args[2] << 16
|
1317
|
-
if current > 0x80000000:
|
1318
|
-
current = -current + 0x80000000
|
1319
|
-
channel(f"Rotary Position: {current}")
|
1320
|
-
|
1321
|
-
@self.console_argument("off", type=str)
|
1322
|
-
@self.console_command(
|
1323
|
-
"red",
|
1324
|
-
help=_("Turns redlight on/off"),
|
1325
|
-
)
|
1326
|
-
def galvo_on(command, channel, _, off=None, remainder=None, **kwgs):
|
1327
|
-
try:
|
1328
|
-
if off == "off":
|
1329
|
-
reply = self.driver.connection.light_off()
|
1330
|
-
self.driver.connection.write_port()
|
1331
|
-
self.redlight_preferred = False
|
1332
|
-
channel("Turning off redlight.")
|
1333
|
-
else:
|
1334
|
-
reply = self.driver.connection.light_on()
|
1335
|
-
self.driver.connection.write_port()
|
1336
|
-
channel("Turning on redlight.")
|
1337
|
-
self.redlight_preferred = True
|
1338
|
-
except ConnectionRefusedError:
|
1339
|
-
self.signal(
|
1340
|
-
"warning",
|
1341
|
-
_("Connection was aborted. Manual connection required."),
|
1342
|
-
_("Not Connected"),
|
1343
|
-
)
|
1344
|
-
channel("Could not alter redlight. Connection is aborted.")
|
1345
|
-
|
1346
|
-
@self.console_argument(
|
1347
|
-
"filename", type=str, default=None, help="filename or none"
|
1348
|
-
)
|
1349
|
-
@self.console_option(
|
1350
|
-
"default", "d", type=bool, action="store_true", help="restore to default"
|
1351
|
-
)
|
1352
|
-
@self.console_command(
|
1353
|
-
"force_correction",
|
1354
|
-
help=_("Resets the galvo laser"),
|
1355
|
-
)
|
1356
|
-
def force_correction(
|
1357
|
-
command, channel, _, filename=None, default=False, remainder=None, **kwgs
|
1358
|
-
):
|
1359
|
-
if default:
|
1360
|
-
filename = self.corfile
|
1361
|
-
channel(f"Using default corfile: {filename}")
|
1362
|
-
if filename is None:
|
1363
|
-
self.driver.connection.write_correction_file(None)
|
1364
|
-
channel(f"Force set corrections to blank.")
|
1365
|
-
else:
|
1366
|
-
from os.path import exists
|
1367
|
-
|
1368
|
-
if exists(filename):
|
1369
|
-
channel(f"Force set corrections: {filename}")
|
1370
|
-
self.driver.connection.write_correction_file(filename)
|
1371
|
-
else:
|
1372
|
-
channel(f"The file at {os.path.realpath(filename)} does not exist.")
|
1373
|
-
|
1374
|
-
@self.console_command(
|
1375
|
-
"softreboot",
|
1376
|
-
help=_("Resets the galvo laser"),
|
1377
|
-
)
|
1378
|
-
def galvo_reset(command, channel, _, remainder=None, **kwgs):
|
1379
|
-
self.driver.connection.init_laser()
|
1380
|
-
channel(f"Soft reboot: {self.label}")
|
1381
|
-
|
1382
|
-
@self.console_option(
|
1383
|
-
"duration", "d", type=float, help=_("time to set/unset the port")
|
1384
|
-
)
|
1385
|
-
@self.console_argument("off", type=str)
|
1386
|
-
@self.console_argument("bit", type=int)
|
1387
|
-
@self.console_command(
|
1388
|
-
"port",
|
1389
|
-
help=_("Turns port on or off, eg. port off 8"),
|
1390
|
-
all_arguments_required=True,
|
1391
|
-
)
|
1392
|
-
def galvo_port(command, channel, _, off, bit=None, duration=None, **kwgs):
|
1393
|
-
off = off == "off"
|
1394
|
-
if off:
|
1395
|
-
self.driver.connection.port_off(bit)
|
1396
|
-
self.driver.connection.write_port()
|
1397
|
-
channel(f"Turning off bit {bit}")
|
1398
|
-
else:
|
1399
|
-
self.driver.connection.port_on(bit)
|
1400
|
-
self.driver.connection.write_port()
|
1401
|
-
channel(f"Turning on bit {bit}")
|
1402
|
-
if duration is not None:
|
1403
|
-
if off:
|
1404
|
-
self(f".timer 1 {duration} port on {bit}")
|
1405
|
-
else:
|
1406
|
-
self(f".timer 1 {duration} port off {bit}")
|
1407
|
-
|
1408
|
-
@self.console_command(
|
1409
|
-
"status",
|
1410
|
-
help=_("Sends status check"),
|
1411
|
-
)
|
1412
|
-
def galvo_status(command, channel, _, remainder=None, **kwgs):
|
1413
|
-
reply = self.driver.connection.get_version()
|
1414
|
-
if reply is None:
|
1415
|
-
channel("Not connected, cannot get serial number.")
|
1416
|
-
return
|
1417
|
-
channel(f"Command replied: {reply}")
|
1418
|
-
for index, b in enumerate(reply):
|
1419
|
-
channel(f"Bit {index}: 0x{b:04x} 0b{b:016b}")
|
1420
|
-
|
1421
|
-
@self.console_command(
|
1422
|
-
"lstatus",
|
1423
|
-
help=_("Checks the list status."),
|
1424
|
-
)
|
1425
|
-
def galvo_liststatus(command, channel, _, remainder=None, **kwgs):
|
1426
|
-
reply = self.driver.connection.get_list_status()
|
1427
|
-
if reply is None:
|
1428
|
-
channel("Not connected, cannot get serial number.")
|
1429
|
-
return
|
1430
|
-
channel(f"Command replied: {reply}")
|
1431
|
-
for index, b in enumerate(reply):
|
1432
|
-
channel(f"Bit {index}: 0x{b:04x} 0b{b:016b}")
|
1433
|
-
|
1434
|
-
@self.console_command(
|
1435
|
-
"mark_time",
|
1436
|
-
help=_("Checks the Mark Time."),
|
1437
|
-
)
|
1438
|
-
def galvo_mark_time(command, channel, _, remainder=None, **kwgs):
|
1439
|
-
reply = self.driver.connection.get_mark_time()
|
1440
|
-
if reply is None:
|
1441
|
-
channel("Not connected, cannot get mark time.")
|
1442
|
-
return
|
1443
|
-
channel(f"Command replied: {reply}")
|
1444
|
-
for index, b in enumerate(reply):
|
1445
|
-
channel(f"Bit {index}: 0x{b:04x} 0b{b:016b}")
|
1446
|
-
|
1447
|
-
@self.console_command(
|
1448
|
-
"mark_count",
|
1449
|
-
help=_("Checks the Mark Count."),
|
1450
|
-
)
|
1451
|
-
def galvo_mark_count(command, channel, _, remainder=None, **kwgs):
|
1452
|
-
reply = self.driver.connection.get_mark_count()
|
1453
|
-
if reply is None:
|
1454
|
-
channel("Not connected, cannot get mark count.")
|
1455
|
-
return
|
1456
|
-
channel(f"Command replied: {reply}")
|
1457
|
-
for index, b in enumerate(reply):
|
1458
|
-
channel(f"Bit {index}: 0x{b:04x} 0b{b:016b}")
|
1459
|
-
|
1460
|
-
@self.console_command(
|
1461
|
-
"axis_pos",
|
1462
|
-
help=_("Checks the Axis Position."),
|
1463
|
-
)
|
1464
|
-
def galvo_axis_pos(command, channel, _, remainder=None, **kwgs):
|
1465
|
-
reply = self.driver.connection.get_axis_pos()
|
1466
|
-
if reply is None:
|
1467
|
-
channel("Not connected, cannot get axis position.")
|
1468
|
-
return
|
1469
|
-
channel(f"Command replied: {reply}")
|
1470
|
-
for index, b in enumerate(reply):
|
1471
|
-
channel(f"Bit {index}: 0x{b:04x} 0b{b:016b}")
|
1472
|
-
|
1473
|
-
@self.console_command(
|
1474
|
-
"user_data",
|
1475
|
-
help=_("Checks the User Data."),
|
1476
|
-
)
|
1477
|
-
def galvo_user_data(command, channel, _, remainder=None, **kwgs):
|
1478
|
-
reply = self.driver.connection.get_user_data()
|
1479
|
-
if reply is None:
|
1480
|
-
channel("Not connected, cannot get user data.")
|
1481
|
-
return
|
1482
|
-
channel(f"Command replied: {reply}")
|
1483
|
-
for index, b in enumerate(reply):
|
1484
|
-
channel(f"Bit {index}: 0x{b:04x} 0b{b:016b}")
|
1485
|
-
|
1486
|
-
@self.console_command(
|
1487
|
-
"position_xy",
|
1488
|
-
help=_("Checks the Position XY"),
|
1489
|
-
)
|
1490
|
-
def galvo_position_xy(command, channel, _, remainder=None, **kwgs):
|
1491
|
-
reply = self.driver.connection.get_position_xy()
|
1492
|
-
if reply is None:
|
1493
|
-
channel("Not connected, cannot get position xy.")
|
1494
|
-
return
|
1495
|
-
channel(f"Command replied: {reply}")
|
1496
|
-
for index, b in enumerate(reply):
|
1497
|
-
channel(f"Bit {index}: 0x{b:04x} 0b{b:016b}")
|
1498
|
-
|
1499
|
-
@self.console_command(
|
1500
|
-
"fly_speed",
|
1501
|
-
help=_("Checks the Fly Speed."),
|
1502
|
-
)
|
1503
|
-
def galvo_fly_speed(command, channel, _, remainder=None, **kwgs):
|
1504
|
-
reply = self.driver.connection.get_fly_speed()
|
1505
|
-
if reply is None:
|
1506
|
-
channel("Not connected, cannot get fly speed.")
|
1507
|
-
return
|
1508
|
-
channel(f"Command replied: {reply}")
|
1509
|
-
for index, b in enumerate(reply):
|
1510
|
-
channel(f"Bit {index}: 0x{b:04x} 0b{b:016b}")
|
1511
|
-
|
1512
|
-
@self.console_command(
|
1513
|
-
"fly_wait_count",
|
1514
|
-
help=_("Checks the fiber config extend"),
|
1515
|
-
)
|
1516
|
-
def galvo_fly_wait_count(command, channel, _, remainder=None, **kwgs):
|
1517
|
-
reply = self.driver.connection.get_fly_wait_count()
|
1518
|
-
if reply is None:
|
1519
|
-
channel("Not connected, cannot get fly weight count.")
|
1520
|
-
return
|
1521
|
-
channel(f"Command replied: {reply}")
|
1522
|
-
for index, b in enumerate(reply):
|
1523
|
-
channel(f"Bit {index}: 0x{b:04x} 0b{b:016b}")
|
1524
|
-
|
1525
|
-
@self.console_command(
|
1526
|
-
"fiber_st_mo_ap",
|
1527
|
-
help=_("Checks the fiber st mo ap"),
|
1528
|
-
)
|
1529
|
-
def galvo_fiber_st_mo_ap(command, channel, _, remainder=None, **kwgs):
|
1530
|
-
reply = self.driver.connection.get_fiber_st_mo_ap()
|
1531
|
-
if reply is None:
|
1532
|
-
channel("Not connected, cannot get fiber_st_mo_ap.")
|
1533
|
-
return
|
1534
|
-
channel(f"Command replied: {reply}")
|
1535
|
-
for index, b in enumerate(reply):
|
1536
|
-
channel(f"Bit {index}: 0x{b:04x} 0b{b:016b}")
|
1537
|
-
|
1538
|
-
def from_binary(p: str):
|
1539
|
-
if p.startswith("0b"):
|
1540
|
-
p = p[2:]
|
1541
|
-
for c in p:
|
1542
|
-
if c not in ("0", "1", "x", "X"):
|
1543
|
-
raise ValueError("Not valid binary")
|
1544
|
-
return p.lower()
|
1545
|
-
|
1546
|
-
@self.console_argument(
|
1547
|
-
"input",
|
1548
|
-
help=_("input binary to wait for. Use 'x' for any bit."),
|
1549
|
-
type=from_binary,
|
1550
|
-
nargs="*",
|
1551
|
-
)
|
1552
|
-
@self.console_option(
|
1553
|
-
"debug", "d", action="store_true", type=bool, help="debug output"
|
1554
|
-
)
|
1555
|
-
@self.console_command(
|
1556
|
-
"wait_for_input", all_arguments_required=True, hidden=True
|
1557
|
-
)
|
1558
|
-
def wait_for_input(channel, input, debug=False, **kwargs):
|
1559
|
-
"""
|
1560
|
-
Wait for input is intended as a spooler command. It will halt the calling thread (spooler thread) until the
|
1561
|
-
matching input is matched. Unimportant bits or bytes can be denoted with `x` for example:
|
1562
|
-
`wait_for_input x x x 1xxxx` would wait for a 1 on the 5th bit of the 4th word.
|
1563
|
-
|
1564
|
-
Omitted values are assumed to be unimportant.
|
1565
|
-
"""
|
1566
|
-
input_unmatched = True
|
1567
|
-
while input_unmatched:
|
1568
|
-
reply = self.driver.connection.read_port()
|
1569
|
-
input_unmatched = False
|
1570
|
-
word = 0
|
1571
|
-
for a, b in zip(reply, input):
|
1572
|
-
a = bin(a)
|
1573
|
-
if debug:
|
1574
|
-
channel(f"input check: {a} match {b} in word #{word}")
|
1575
|
-
word += 1
|
1576
|
-
for i in range(-1, -len(a), -1):
|
1577
|
-
try:
|
1578
|
-
ac = a[i]
|
1579
|
-
bc = b[i]
|
1580
|
-
except IndexError:
|
1581
|
-
# Assume remaining bits are no-care.
|
1582
|
-
break
|
1583
|
-
if bc in "x":
|
1584
|
-
# This is a no-care bit.
|
1585
|
-
continue
|
1586
|
-
if ac != bc:
|
1587
|
-
if debug:
|
1588
|
-
channel(f"Fail at {~i} because {ac} != {bc}")
|
1589
|
-
# We care, and they weren't equal
|
1590
|
-
time.sleep(0.1)
|
1591
|
-
input_unmatched = True
|
1592
|
-
break
|
1593
|
-
if not input_unmatched:
|
1594
|
-
if debug:
|
1595
|
-
channel("Input matched.")
|
1596
|
-
return # We exited
|
1597
|
-
|
1598
|
-
@self.console_command(
|
1599
|
-
"read_port",
|
1600
|
-
help=_("Checks the read_port"),
|
1601
|
-
)
|
1602
|
-
def galvo_read_port(command, channel, _, remainder=None, **kwgs):
|
1603
|
-
reply = self.driver.connection.read_port()
|
1604
|
-
if reply is None:
|
1605
|
-
channel("Not connected, cannot get read port.")
|
1606
|
-
return
|
1607
|
-
channel(f"Command replied: {reply}")
|
1608
|
-
for index, b in enumerate(reply):
|
1609
|
-
channel(f"Bit {index}: 0x{b:04x} 0b{b:016b}")
|
1610
|
-
|
1611
|
-
@self.console_command(
|
1612
|
-
"input_port",
|
1613
|
-
help=_("Checks the input_port"),
|
1614
|
-
)
|
1615
|
-
def galvo_input_port(command, channel, _, remainder=None, **kwgs):
|
1616
|
-
reply = self.driver.connection.get_input_port()
|
1617
|
-
if reply is None:
|
1618
|
-
channel("Not connected, cannot get input port.")
|
1619
|
-
return
|
1620
|
-
channel(f"Command replied: {reply}")
|
1621
|
-
for index, b in enumerate(reply):
|
1622
|
-
channel(f"Bit {index}: 0x{b:04x} 0b{b:016b}")
|
1623
|
-
|
1624
|
-
@self.console_command(
|
1625
|
-
"clear_lock_input_port",
|
1626
|
-
help=_("clear the input_port"),
|
1627
|
-
)
|
1628
|
-
def galvo_clear_input_port(command, channel, _, remainder=None, **kwgs):
|
1629
|
-
reply = self.driver.connection.clear_lock_input_port()
|
1630
|
-
if reply is None:
|
1631
|
-
channel("Not connected, cannot get input port.")
|
1632
|
-
return
|
1633
|
-
channel(f"Command replied: {reply}")
|
1634
|
-
for index, b in enumerate(reply):
|
1635
|
-
channel(f"Bit {index}: 0x{b:04x} 0b{b:016b}")
|
1636
|
-
|
1637
|
-
@self.console_command(
|
1638
|
-
"enable_lock_input_port",
|
1639
|
-
help=_("clear the input_port"),
|
1640
|
-
)
|
1641
|
-
def galvo_enable_lock_input_port(command, channel, _, remainder=None, **kwgs):
|
1642
|
-
reply = self.driver.connection.enable_lock_input_port()
|
1643
|
-
if reply is None:
|
1644
|
-
channel("Not connected, cannot get input port.")
|
1645
|
-
return
|
1646
|
-
channel(f"Command replied: {reply}")
|
1647
|
-
for index, b in enumerate(reply):
|
1648
|
-
channel(f"Bit {index}: 0x{b:04x} 0b{b:016b}")
|
1649
|
-
|
1650
|
-
@self.console_command(
|
1651
|
-
"disable_lock_input_port",
|
1652
|
-
help=_("clear the input_port"),
|
1653
|
-
)
|
1654
|
-
def galvo_disable_lock_input_port(command, channel, _, remainder=None, **kwgs):
|
1655
|
-
reply = self.driver.connection.disable_lock_input_port()
|
1656
|
-
if reply is None:
|
1657
|
-
channel("Not connected, cannot get input port.")
|
1658
|
-
return
|
1659
|
-
channel(f"Command replied: {reply}")
|
1660
|
-
for index, b in enumerate(reply):
|
1661
|
-
channel(f"Bit {index}: 0x{b:04x} 0b{b:016b}")
|
1662
|
-
|
1663
|
-
@self.console_command(
|
1664
|
-
"fiber_config_extend",
|
1665
|
-
help=_("Checks the fiber config extend"),
|
1666
|
-
)
|
1667
|
-
def galvo_fiber_config_extend(command, channel, _, remainder=None, **kwgs):
|
1668
|
-
reply = self.driver.connection.get_fiber_config_extend()
|
1669
|
-
if reply is None:
|
1670
|
-
channel("Not connected, cannot get fiber config extend.")
|
1671
|
-
return
|
1672
|
-
channel(f"Command replied: {reply}")
|
1673
|
-
for index, b in enumerate(reply):
|
1674
|
-
channel(f"Bit {index}: 0x{b:04x} 0b{b:016b}")
|
1675
|
-
|
1676
|
-
@self.console_command(
|
1677
|
-
"serial_number",
|
1678
|
-
help=_("Checks the serial number."),
|
1679
|
-
)
|
1680
|
-
def galvo_serial(command, channel, _, remainder=None, **kwgs):
|
1681
|
-
reply = self.driver.connection.get_serial_number()
|
1682
|
-
if reply is None:
|
1683
|
-
channel("Not connected, cannot get serial number.")
|
1684
|
-
return
|
1685
|
-
|
1686
|
-
channel(f"Command replied: {reply}")
|
1687
|
-
for index, b in enumerate(reply):
|
1688
|
-
channel(f"Bit {index}: 0x{b:04x} 0b{b:016b}")
|
1689
|
-
|
1690
|
-
@self.console_argument("filename", type=str, default=None)
|
1691
|
-
@self.console_command(
|
1692
|
-
"correction",
|
1693
|
-
help=_("set the correction file"),
|
1694
|
-
)
|
1695
|
-
def set_corfile(command, channel, _, filename=None, remainder=None, **kwgs):
|
1696
|
-
if filename is None:
|
1697
|
-
file = self.corfile
|
1698
|
-
if file is None:
|
1699
|
-
channel("No correction file set.")
|
1700
|
-
else:
|
1701
|
-
channel(f"Correction file is set to: {self.corfile}")
|
1702
|
-
from os.path import exists
|
1703
|
-
|
1704
|
-
if exists(file):
|
1705
|
-
channel("Correction file exists!")
|
1706
|
-
else:
|
1707
|
-
channel("WARNING: Correction file does not exist.")
|
1708
|
-
else:
|
1709
|
-
from os.path import exists
|
1710
|
-
|
1711
|
-
if exists(filename):
|
1712
|
-
self.corfile = filename
|
1713
|
-
self.signal("corfile", filename)
|
1714
|
-
else:
|
1715
|
-
channel(f"The file at {os.path.realpath(filename)} does not exist.")
|
1716
|
-
channel("Correction file was not set.")
|
1717
|
-
|
1718
|
-
@self.console_command(
|
1719
|
-
"position",
|
1720
|
-
help=_("give the position of the selection box in galvos"),
|
1721
|
-
)
|
1722
|
-
def galvo_pos(command, channel, _, data=None, args=tuple(), **kwargs):
|
1723
|
-
"""
|
1724
|
-
Draws an outline of the current shape.
|
1725
|
-
"""
|
1726
|
-
bounds = self.elements.selected_area()
|
1727
|
-
if bounds is None:
|
1728
|
-
channel(_("Nothing Selected"))
|
1729
|
-
return
|
1730
|
-
x0, y0 = self.view.position(bounds[0], bounds[1])
|
1731
|
-
x1, y1 = self.view.position(bounds[2], bounds[3])
|
1732
|
-
channel(
|
1733
|
-
f"Top,Right: ({x0:.02f}, {y0:.02f}). Lower, Left: ({x1:.02f},{y1:.02f})"
|
1734
|
-
)
|
1735
|
-
|
1736
|
-
@self.console_argument("lens_size", type=str, default=None)
|
1737
|
-
@self.console_command(
|
1738
|
-
"lens",
|
1739
|
-
help=_("set the lens size"),
|
1740
|
-
)
|
1741
|
-
def galvo_lens(
|
1742
|
-
command, channel, _, data=None, lens_size=None, args=tuple(), **kwargs
|
1743
|
-
):
|
1744
|
-
"""
|
1745
|
-
Sets lens size.
|
1746
|
-
"""
|
1747
|
-
if lens_size is None:
|
1748
|
-
raise SyntaxError
|
1749
|
-
self.lens_size = lens_size
|
1750
|
-
self.width = lens_size
|
1751
|
-
self.height = lens_size
|
1752
|
-
self.signal("bedsize", (self.lens_size, self.lens_size))
|
1753
|
-
channel(f"Set Bed Size : ({self.lens_size}, {self.lens_size}).")
|
1754
|
-
|
1755
|
-
@self.console_option(
|
1756
|
-
"count",
|
1757
|
-
"c",
|
1758
|
-
default=256,
|
1759
|
-
type=int,
|
1760
|
-
help="Number of instances of boxes to draw.",
|
1761
|
-
)
|
1762
|
-
@self.console_command(
|
1763
|
-
"box",
|
1764
|
-
help=_("outline the current selected elements"),
|
1765
|
-
output_type="geometry",
|
1766
|
-
)
|
1767
|
-
def shapes_selected(
|
1768
|
-
command, channel, _, count=256, data=None, args=tuple(), **kwargs
|
1769
|
-
):
|
1770
|
-
"""
|
1771
|
-
Draws an outline of the current shape.
|
1772
|
-
"""
|
1773
|
-
bounds = self.elements.selected_area()
|
1774
|
-
if bounds is None:
|
1775
|
-
channel(_("Nothing Selected"))
|
1776
|
-
return
|
1777
|
-
xmin, ymin, xmax, ymax = bounds
|
1778
|
-
channel(_("Element bounds: {bounds}").format(bounds=str(bounds)))
|
1779
|
-
geometry = Geomstr.rect(xmin, ymin, xmax - xmin, ymin - ymax)
|
1780
|
-
if count > 1:
|
1781
|
-
geometry.copies(count)
|
1782
|
-
return "geometry", geometry
|
1783
|
-
|
1784
|
-
@self.console_command(
|
1785
|
-
"hull",
|
1786
|
-
help=_("convex hull of the current selected elements"),
|
1787
|
-
input_type=(None, "elements"),
|
1788
|
-
output_type="geometry",
|
1789
|
-
)
|
1790
|
-
def shapes_hull(channel, _, data=None, **kwargs):
|
1791
|
-
"""
|
1792
|
-
Draws an outline of the current shape.
|
1793
|
-
"""
|
1794
|
-
if data is None:
|
1795
|
-
data = list(self.elements.elems(emphasized=True))
|
1796
|
-
g = Geomstr()
|
1797
|
-
for e in data:
|
1798
|
-
if hasattr(e, "as_image"):
|
1799
|
-
bounds = e.bounds
|
1800
|
-
g.append(
|
1801
|
-
Geomstr.rect(
|
1802
|
-
bounds[0],
|
1803
|
-
bounds[1],
|
1804
|
-
bounds[2] - bounds[0],
|
1805
|
-
bounds[3] - bounds[1],
|
1806
|
-
)
|
1807
|
-
)
|
1808
|
-
elif e.type == "elem text":
|
1809
|
-
continue # We can't outline text.
|
1810
|
-
else:
|
1811
|
-
g.append(e.as_geometry())
|
1812
|
-
hull = Geomstr.hull(g)
|
1813
|
-
if len(hull) == 0:
|
1814
|
-
channel(_("No elements bounds to trace."))
|
1815
|
-
return
|
1816
|
-
return "geometry", hull
|
1817
|
-
|
1818
|
-
def ant_points(points, steps):
|
1819
|
-
points = list(points)
|
1820
|
-
movement = 1 + int(steps / 10)
|
1821
|
-
forward_steps = steps + movement
|
1822
|
-
pos = 0
|
1823
|
-
size = len(points)
|
1824
|
-
cycles = int(size / movement) + 1
|
1825
|
-
for cycle in range(cycles):
|
1826
|
-
for f in range(pos, pos + forward_steps, 1):
|
1827
|
-
index = f % size
|
1828
|
-
point = points[index]
|
1829
|
-
yield point
|
1830
|
-
pos += forward_steps
|
1831
|
-
for f in range(pos, pos - steps, -1):
|
1832
|
-
index = f % size
|
1833
|
-
point = points[index]
|
1834
|
-
yield point
|
1835
|
-
pos -= steps
|
1836
|
-
|
1837
|
-
@self.console_option(
|
1838
|
-
"quantization",
|
1839
|
-
"q",
|
1840
|
-
default=50,
|
1841
|
-
type=int,
|
1842
|
-
help="Number of segments to break each path into.",
|
1843
|
-
)
|
1844
|
-
@self.console_command(
|
1845
|
-
"ants",
|
1846
|
-
help=_("Marching ants of the given element path."),
|
1847
|
-
input_type=(None, "elements"),
|
1848
|
-
output_type="geometry",
|
1849
|
-
)
|
1850
|
-
def element_ants(command, channel, _, data=None, quantization=50, **kwargs):
|
1851
|
-
"""
|
1852
|
-
Draws an outline of the current shape.
|
1853
|
-
"""
|
1854
|
-
if data is None:
|
1855
|
-
data = list(self.elements.elems(emphasized=True))
|
1856
|
-
geom = Geomstr()
|
1857
|
-
for e in data:
|
1858
|
-
try:
|
1859
|
-
path = e.as_geometry()
|
1860
|
-
except AttributeError:
|
1861
|
-
continue
|
1862
|
-
ants = list(
|
1863
|
-
ant_points(
|
1864
|
-
path.as_interpolated_points(interpolate=quantization),
|
1865
|
-
int(quantization / 2),
|
1866
|
-
)
|
1867
|
-
)
|
1868
|
-
geom.polyline(ants)
|
1869
|
-
geom.end()
|
1870
|
-
return "geometry", geom
|
1871
|
-
|
1872
|
-
@self.console_argument("filename", type=str)
|
1873
|
-
@self.console_command(
|
1874
|
-
"clone_init",
|
1875
|
-
help=_("Initializes a galvo clone board from specified file."),
|
1876
|
-
)
|
1877
|
-
def codes_update(channel, filename, **kwargs):
|
1878
|
-
import platform
|
1879
|
-
|
1880
|
-
from meerk40t.balormk.clone_loader import load_sys
|
1881
|
-
from meerk40t.kernel import get_safe_path
|
1882
|
-
|
1883
|
-
self.setting(str, "clone_sys", "chunks")
|
1884
|
-
if filename is not None:
|
1885
|
-
self.clone_sys = filename
|
1886
|
-
if self.clone_sys == "chunks":
|
1887
|
-
from meerk40t.balormk.clone_loader import load_chunks
|
1888
|
-
|
1889
|
-
load_chunks(channel=channel)
|
1890
|
-
return
|
1891
|
-
|
1892
|
-
# Check for file in local directory
|
1893
|
-
p = self.clone_sys
|
1894
|
-
if os.path.exists(p):
|
1895
|
-
load_sys(p, channel=channel)
|
1896
|
-
return
|
1897
|
-
|
1898
|
-
# Check for file in the meerk40t directory (safe_path)
|
1899
|
-
directory = get_safe_path(kernel.name, create=True)
|
1900
|
-
p = os.path.join(directory, self.clone_sys)
|
1901
|
-
if os.path.exists(p):
|
1902
|
-
load_sys(p, channel=channel)
|
1903
|
-
return
|
1904
|
-
|
1905
|
-
if platform.system() != "Windows":
|
1906
|
-
return
|
1907
|
-
|
1908
|
-
# In windows, check the system32/drivers directory.
|
1909
|
-
system32 = os.path.join(
|
1910
|
-
os.environ["SystemRoot"],
|
1911
|
-
"SysNative" if platform.architecture()[0] == "32bit" else "System32",
|
1912
|
-
)
|
1913
|
-
p = os.path.join(system32, "drivers", self.clone_sys)
|
1914
|
-
if os.path.exists(p):
|
1915
|
-
load_sys(p, channel=channel)
|
1916
|
-
return
|
1917
|
-
|
1918
|
-
channel(f"{self.clone_sys} file was not found.")
|
1919
|
-
|
1920
|
-
@self.console_command(
|
1921
|
-
"viewport_update",
|
1922
|
-
hidden=True,
|
1923
|
-
help=_("Update galvo flips for movement"),
|
1924
|
-
)
|
1925
|
-
def codes_update(**kwargs):
|
1926
|
-
self.realize()
|
1927
|
-
|
1928
|
-
def service_attach(self, *args, **kwargs):
|
1929
|
-
self.realize()
|
1930
|
-
|
1931
|
-
@signal_listener("flip_x")
|
1932
|
-
@signal_listener("flip_y")
|
1933
|
-
@signal_listener("swap_xy")
|
1934
|
-
def realize(self, origin=None, *args):
|
1935
|
-
self.view.set_dims(self.lens_size, self.lens_size)
|
1936
|
-
self.view.transform(
|
1937
|
-
flip_x=self.flip_x,
|
1938
|
-
flip_y=self.flip_y,
|
1939
|
-
swap_xy=self.swap_xy,
|
1940
|
-
)
|
1941
|
-
self.space.update_bounds(0, 0, self.lens_size, self.lens_size)
|
1942
|
-
|
1943
|
-
@property
|
1944
|
-
def current(self):
|
1945
|
-
"""
|
1946
|
-
@return: the location in units for the current known position.
|
1947
|
-
"""
|
1948
|
-
return self.view.iposition(self.driver.native_x, self.driver.native_y)
|
1949
|
-
|
1950
|
-
@property
|
1951
|
-
def native(self):
|
1952
|
-
"""
|
1953
|
-
@return: the location in device native units for the current known position.
|
1954
|
-
"""
|
1955
|
-
return self.driver.native_x, self.driver.native_y
|
1956
|
-
|
1957
|
-
@property
|
1958
|
-
def calibration_file(self):
|
1959
|
-
return None
|
1
|
+
"""
|
2
|
+
Galvo Device
|
3
|
+
|
4
|
+
Defines how the balor device interacts with the scene, and accepts data via the spooler.
|
5
|
+
"""
|
6
|
+
|
7
|
+
from meerk40t.balormk.driver import BalorDriver
|
8
|
+
from meerk40t.core.spoolers import Spooler
|
9
|
+
from meerk40t.core.units import Angle, Length
|
10
|
+
from meerk40t.core.view import View
|
11
|
+
from meerk40t.device.mixins import Status
|
12
|
+
from meerk40t.kernel import Service, signal_listener
|
13
|
+
from meerk40t.device.devicechoices import get_effect_choices
|
14
|
+
|
15
|
+
|
16
|
+
class BalorDevice(Service, Status):
|
17
|
+
"""
|
18
|
+
The BalorDevice is a MeerK40t service for the device type. It should be the main method of interacting with
|
19
|
+
the rest of meerk40t. It defines how the scene should look and contains a spooler which meerk40t will give jobs
|
20
|
+
to. This class additionally defines commands which exist as console commands while this service is activated.
|
21
|
+
"""
|
22
|
+
|
23
|
+
def __init__(self, kernel, path, *args, choices=None, **kwargs):
|
24
|
+
Service.__init__(self, kernel, path)
|
25
|
+
Status.__init__(self)
|
26
|
+
self.name = "balor"
|
27
|
+
self.extension = "lmc"
|
28
|
+
self.job = None
|
29
|
+
if choices is not None:
|
30
|
+
for c in choices:
|
31
|
+
attr = c.get("attr")
|
32
|
+
default = c.get("default")
|
33
|
+
if attr is not None and default is not None:
|
34
|
+
setattr(self, attr, default)
|
35
|
+
|
36
|
+
_ = kernel.translation
|
37
|
+
self.register("frequency", (0, 1000))
|
38
|
+
self.register(
|
39
|
+
"format/op cut",
|
40
|
+
"{danger}{defop}{enabled}{pass}{element_type} {speed}mm/s @{power} {frequency}kHz {colcode} {opstop}",
|
41
|
+
)
|
42
|
+
self.register(
|
43
|
+
"format/op engrave",
|
44
|
+
"{danger}{defop}{enabled}{pass}{element_type} {speed}mm/s @{power} {frequency}kHz {colcode} {opstop}",
|
45
|
+
)
|
46
|
+
self.register(
|
47
|
+
"format/op hatch",
|
48
|
+
"{danger}{defop}{enabled}{penpass}{pass}{element_type} {speed}mm/s @{power} {frequency}kHz {colcode} {opstop}",
|
49
|
+
)
|
50
|
+
self.register(
|
51
|
+
"format/op raster",
|
52
|
+
"{danger}{defop}{enabled}{pass}{element_type}{direction}{speed}mm/s @{power} {frequency}kHz {colcode} {opstop}",
|
53
|
+
)
|
54
|
+
self.register(
|
55
|
+
"format/op image",
|
56
|
+
"{danger}{defop}{enabled}{penvalue}{pass}{element_type}{direction}{speed}mm/s @{power} {frequency}kHz {colcode}",
|
57
|
+
)
|
58
|
+
self.register(
|
59
|
+
"format/op dots",
|
60
|
+
"{danger}{defop}{enabled}{pass}{element_type} {dwell_time}ms dwell {frequency}kHz {colcode} {opstop}",
|
61
|
+
)
|
62
|
+
self.register("format/util console", "{enabled}{command}")
|
63
|
+
# This device prefers to display power level in percent
|
64
|
+
self.setting(bool, "use_percent_for_power_display", True)
|
65
|
+
# Tuple contains 4 value pairs: Speed Low, Speed High, Power Low, Power High, each with enabled, value
|
66
|
+
self.setting(
|
67
|
+
list, "dangerlevel_op_cut", (False, 0, False, 0, False, 0, False, 0)
|
68
|
+
)
|
69
|
+
self.setting(
|
70
|
+
list, "dangerlevel_op_engrave", (False, 0, False, 0, False, 0, False, 0)
|
71
|
+
)
|
72
|
+
self.setting(
|
73
|
+
list, "dangerlevel_op_hatch", (False, 0, False, 0, False, 0, False, 0)
|
74
|
+
)
|
75
|
+
self.setting(
|
76
|
+
list, "dangerlevel_op_raster", (False, 0, False, 0, False, 0, False, 0)
|
77
|
+
)
|
78
|
+
self.setting(
|
79
|
+
list, "dangerlevel_op_image", (False, 0, False, 0, False, 0, False, 0)
|
80
|
+
)
|
81
|
+
self.setting(
|
82
|
+
list, "dangerlevel_op_dots", (False, 0, False, 0, False, 0, False, 0)
|
83
|
+
)
|
84
|
+
choices = [
|
85
|
+
{
|
86
|
+
"attr": "label",
|
87
|
+
"object": self,
|
88
|
+
"default": "balor-device",
|
89
|
+
"type": str,
|
90
|
+
"label": _("Label"),
|
91
|
+
"tip": _("What is this device called."),
|
92
|
+
"section": "_00_General",
|
93
|
+
"priority": "10",
|
94
|
+
"signals": "device;renamed",
|
95
|
+
},
|
96
|
+
{
|
97
|
+
"attr": "source",
|
98
|
+
"object": self,
|
99
|
+
"default": "fiber",
|
100
|
+
"type": str,
|
101
|
+
"style": "combo",
|
102
|
+
"choices": ["fiber", "co2", "uv"],
|
103
|
+
"label": _("Laser Source"),
|
104
|
+
"tip": _("What type of laser is this?"),
|
105
|
+
},
|
106
|
+
{
|
107
|
+
"attr": "corfile_enabled",
|
108
|
+
"object": self,
|
109
|
+
"default": False,
|
110
|
+
"type": bool,
|
111
|
+
"label": _("Enable"),
|
112
|
+
"tip": _("Use correction file?"),
|
113
|
+
"section": "_00_General",
|
114
|
+
"subsection": "Correction File",
|
115
|
+
},
|
116
|
+
{
|
117
|
+
"attr": "corfile",
|
118
|
+
"object": self,
|
119
|
+
"default": None,
|
120
|
+
"type": str,
|
121
|
+
"style": "file",
|
122
|
+
"wildcard": "*.cor",
|
123
|
+
"conditional": (self, "corfile_enabled"),
|
124
|
+
"label": _("File"),
|
125
|
+
"tip": _("Provide a correction file for the machine"),
|
126
|
+
"weight": 3,
|
127
|
+
"section": "_00_General",
|
128
|
+
"subsection": "Correction File",
|
129
|
+
},
|
130
|
+
{
|
131
|
+
"attr": "lens_size",
|
132
|
+
"object": self,
|
133
|
+
"default": "110mm",
|
134
|
+
"type": Length,
|
135
|
+
"label": _("Width"),
|
136
|
+
"tip": _("Lens Size"),
|
137
|
+
"section": "_00_General",
|
138
|
+
"subsection": "_00_",
|
139
|
+
"priority": "20",
|
140
|
+
"nonzero": True,
|
141
|
+
# intentionally not bed_size
|
142
|
+
},
|
143
|
+
{
|
144
|
+
"attr": "laserspot",
|
145
|
+
"object": self,
|
146
|
+
"default": "0.3mm",
|
147
|
+
"type": Length,
|
148
|
+
"label": _("Laserspot"),
|
149
|
+
"tip": _("Laser spot size"),
|
150
|
+
"section": "_00_General",
|
151
|
+
"subsection": "_00_",
|
152
|
+
"priority": "20",
|
153
|
+
"nonzero": True,
|
154
|
+
},
|
155
|
+
{
|
156
|
+
"attr": "flip_x",
|
157
|
+
"object": self,
|
158
|
+
"default": False,
|
159
|
+
"type": bool,
|
160
|
+
"label": _("Flip X"),
|
161
|
+
"tip": _("Flip the X axis for the device"),
|
162
|
+
"section": "_10_Parameters",
|
163
|
+
"subsection": "_10_Axis corrections",
|
164
|
+
},
|
165
|
+
{
|
166
|
+
"attr": "flip_y",
|
167
|
+
"object": self,
|
168
|
+
"default": True,
|
169
|
+
"type": bool,
|
170
|
+
"label": _("Flip Y"),
|
171
|
+
"tip": _("Flip the Y axis for the device"),
|
172
|
+
"section": "_10_Parameters",
|
173
|
+
"subsection": "_10_Axis corrections",
|
174
|
+
},
|
175
|
+
{
|
176
|
+
"attr": "swap_xy",
|
177
|
+
"object": self,
|
178
|
+
"default": True,
|
179
|
+
"type": bool,
|
180
|
+
"label": _("Swap XY"),
|
181
|
+
"tip": _("Swap the X and Y axis for the device"),
|
182
|
+
"section": "_10_Parameters",
|
183
|
+
"subsection": "_10_Axis corrections",
|
184
|
+
},
|
185
|
+
{
|
186
|
+
"attr": "rotate",
|
187
|
+
"object": self,
|
188
|
+
"default": 0,
|
189
|
+
"type": int,
|
190
|
+
"style": "combo",
|
191
|
+
"trailer": "°",
|
192
|
+
"choices": [
|
193
|
+
0,
|
194
|
+
90,
|
195
|
+
180,
|
196
|
+
270,
|
197
|
+
],
|
198
|
+
"label": _("Rotate View"),
|
199
|
+
"tip": _("Rotate the device field"),
|
200
|
+
"section": "_10_Parameters",
|
201
|
+
"subsection": "_10_Axis corrections",
|
202
|
+
},
|
203
|
+
{
|
204
|
+
"attr": "user_margin_x",
|
205
|
+
"object": self,
|
206
|
+
"default": "0",
|
207
|
+
"type": str,
|
208
|
+
"label": _("X-Margin"),
|
209
|
+
"tip": _(
|
210
|
+
"Margin for the X-axis. This will be a kind of unused space at the left side."
|
211
|
+
),
|
212
|
+
"section": "_10_Parameters",
|
213
|
+
# _("User Offset")
|
214
|
+
"subsection": "_30_User Offset",
|
215
|
+
},
|
216
|
+
{
|
217
|
+
"attr": "user_margin_y",
|
218
|
+
"object": self,
|
219
|
+
"default": "0",
|
220
|
+
"type": str,
|
221
|
+
"label": _("Y-Margin"),
|
222
|
+
"tip": _(
|
223
|
+
"Margin for the Y-axis. This will be a kind of unused space at the top."
|
224
|
+
),
|
225
|
+
"section": "_10_Parameters",
|
226
|
+
"subsection": "_30_User Offset",
|
227
|
+
},
|
228
|
+
{
|
229
|
+
"attr": "interp",
|
230
|
+
"object": self,
|
231
|
+
"default": 5,
|
232
|
+
"type": int,
|
233
|
+
"label": _("Curve Interpolation"),
|
234
|
+
"section": "_10_Parameters",
|
235
|
+
"tip": _("Number of curve interpolation points"),
|
236
|
+
},
|
237
|
+
{
|
238
|
+
"attr": "mock",
|
239
|
+
"object": self,
|
240
|
+
"default": False,
|
241
|
+
"type": bool,
|
242
|
+
"label": _("Run mock-usb backend"),
|
243
|
+
"tip": _(
|
244
|
+
"This starts connects to fake software laser rather than real one for debugging."
|
245
|
+
),
|
246
|
+
"section": "_00_General",
|
247
|
+
"priority": "30",
|
248
|
+
},
|
249
|
+
{
|
250
|
+
"attr": "machine_index",
|
251
|
+
"object": self,
|
252
|
+
"default": 0,
|
253
|
+
"type": int,
|
254
|
+
"label": _("Machine index to select"),
|
255
|
+
"tip": _(
|
256
|
+
"Which machine should we connect to? -- Leave at 0 if you have 1 machine."
|
257
|
+
),
|
258
|
+
"section": "_00_General",
|
259
|
+
"subsection": "_10_Device Selection",
|
260
|
+
},
|
261
|
+
{ "attr": "serial_enable",
|
262
|
+
"object": self,
|
263
|
+
"default": False,
|
264
|
+
"type": bool,
|
265
|
+
"label": _("Check serial no"),
|
266
|
+
"tip": _(
|
267
|
+
"Does the machine need to have a specific serial number?"
|
268
|
+
),
|
269
|
+
"section": "_00_General",
|
270
|
+
"subsection": "_10_Device Selection",
|
271
|
+
},
|
272
|
+
{
|
273
|
+
"attr": "serial",
|
274
|
+
"object": self,
|
275
|
+
"default": "",
|
276
|
+
"type": str,
|
277
|
+
"tip": _(
|
278
|
+
"Does the machine need to have a specific serial number?"
|
279
|
+
),
|
280
|
+
"label": "",
|
281
|
+
"section": "_00_General",
|
282
|
+
"subsection": "_10_Device Selection",
|
283
|
+
"conditional": (self, "serial_enable")
|
284
|
+
},
|
285
|
+
{
|
286
|
+
"attr": "footpedal_pin",
|
287
|
+
"object": self,
|
288
|
+
"default": 15,
|
289
|
+
"type": int,
|
290
|
+
"label": _("Footpedal"),
|
291
|
+
"tip": _("What pin is your foot pedal hooked to on the GPIO"),
|
292
|
+
"section": "_10_Parameters",
|
293
|
+
"subsection": "_30_Pin-Index",
|
294
|
+
"signals": "balorpin",
|
295
|
+
},
|
296
|
+
{
|
297
|
+
"attr": "light_pin",
|
298
|
+
"object": self,
|
299
|
+
"default": 8,
|
300
|
+
"type": int,
|
301
|
+
"label": _("Redlight laser"),
|
302
|
+
"tip": _("What pin is your redlight hooked to on the GPIO"),
|
303
|
+
"section": "_10_Parameters",
|
304
|
+
"subsection": "_30_Pin-Index",
|
305
|
+
"signals": "balorpin",
|
306
|
+
},
|
307
|
+
{
|
308
|
+
"attr": "signal_updates",
|
309
|
+
"object": self,
|
310
|
+
"default": True,
|
311
|
+
"type": bool,
|
312
|
+
"label": _("Device Position"),
|
313
|
+
"tip": _(
|
314
|
+
"Do you want to see some indicator about the current device position?"
|
315
|
+
),
|
316
|
+
"section": "_95_" + _("Screen updates"),
|
317
|
+
"signals": "restart",
|
318
|
+
},
|
319
|
+
{
|
320
|
+
"attr": "device_coolant",
|
321
|
+
"object": self,
|
322
|
+
"default": "",
|
323
|
+
"type": str,
|
324
|
+
"style": "option",
|
325
|
+
"label": _("Coolant"),
|
326
|
+
"tip": _(
|
327
|
+
"Does this device has a method to turn on / off a coolant associated to it?"
|
328
|
+
),
|
329
|
+
"section": "_99_" + _("Coolant Support"),
|
330
|
+
"dynamic": self.cool_helper,
|
331
|
+
"signals": "coolant_changed",
|
332
|
+
},
|
333
|
+
]
|
334
|
+
self.register_choices("balor", choices)
|
335
|
+
|
336
|
+
self.register_choices("balor-effects", get_effect_choices(self))
|
337
|
+
|
338
|
+
choices = [
|
339
|
+
{
|
340
|
+
"attr": "redlight_speed",
|
341
|
+
"object": self,
|
342
|
+
"default": "3000",
|
343
|
+
"type": int,
|
344
|
+
"label": _("Redlight travel speed"),
|
345
|
+
"tip": _("Speed of the galvo when using the red laser."),
|
346
|
+
},
|
347
|
+
{
|
348
|
+
"attr": "redlight_offset_x",
|
349
|
+
"object": self,
|
350
|
+
"default": "0mm",
|
351
|
+
"type": Length,
|
352
|
+
"label": _("X-Offset"),
|
353
|
+
"tip": _("Offset the redlight positions by this amount in x"),
|
354
|
+
"subsection": "Redlight-Offset",
|
355
|
+
},
|
356
|
+
{
|
357
|
+
"attr": "redlight_offset_y",
|
358
|
+
"object": self,
|
359
|
+
"default": "0mm",
|
360
|
+
"type": Length,
|
361
|
+
"label": _("Y-Offset"),
|
362
|
+
"tip": _("Offset the redlight positions by this amount in y"),
|
363
|
+
"subsection": "Redlight-Offset",
|
364
|
+
},
|
365
|
+
{
|
366
|
+
"attr": "redlight_angle",
|
367
|
+
"object": self,
|
368
|
+
"default": "0deg",
|
369
|
+
"type": Angle,
|
370
|
+
"label": _("Angle Offset"),
|
371
|
+
"tip": _(
|
372
|
+
"Offset the redlight positions by this angle, curving around center"
|
373
|
+
),
|
374
|
+
"subsection": "Redlight-Offset",
|
375
|
+
},
|
376
|
+
{
|
377
|
+
"attr": "redlight_preferred",
|
378
|
+
"object": self,
|
379
|
+
"default": False,
|
380
|
+
"type": bool,
|
381
|
+
"label": _("Prefer redlight on"),
|
382
|
+
"tip": _(
|
383
|
+
"Redlight preference will turn toggleable redlights on after a job completes."
|
384
|
+
),
|
385
|
+
"priority": "0",
|
386
|
+
},
|
387
|
+
]
|
388
|
+
self.register_choices("balor-redlight", choices)
|
389
|
+
|
390
|
+
choices = [
|
391
|
+
{
|
392
|
+
"attr": "default_power",
|
393
|
+
"object": self,
|
394
|
+
"default": 50.0,
|
395
|
+
"type": float,
|
396
|
+
"label": _("Laser Power"),
|
397
|
+
"trailer": "%",
|
398
|
+
"tip": _("What power level do we cut at?"),
|
399
|
+
},
|
400
|
+
{
|
401
|
+
"attr": "default_speed",
|
402
|
+
"object": self,
|
403
|
+
"default": 100.0,
|
404
|
+
"type": float,
|
405
|
+
"trailer": "mm/s",
|
406
|
+
"label": _("Cut Speed"),
|
407
|
+
"tip": _("How fast do we cut?"),
|
408
|
+
},
|
409
|
+
{
|
410
|
+
"attr": "default_frequency",
|
411
|
+
"object": self,
|
412
|
+
"default": 30.0,
|
413
|
+
"type": float,
|
414
|
+
"trailer": "kHz",
|
415
|
+
"label": _("Q Switch Frequency"),
|
416
|
+
"tip": _("QSwitch Frequency value"),
|
417
|
+
},
|
418
|
+
{
|
419
|
+
"attr": "default_fpk",
|
420
|
+
"object": self,
|
421
|
+
"default": 10.0,
|
422
|
+
"type": float,
|
423
|
+
"trailer": "%",
|
424
|
+
"label": _("First Pulse Killer"),
|
425
|
+
"conditional": (self, "source", "co2"),
|
426
|
+
"tip": _("Percent of First Pulse Killer for co2 source"),
|
427
|
+
},
|
428
|
+
{
|
429
|
+
"attr": "default_rapid_speed",
|
430
|
+
"object": self,
|
431
|
+
"default": 2000.0,
|
432
|
+
"type": float,
|
433
|
+
"label": _("Travel Speed"),
|
434
|
+
"trailer": "mm/s",
|
435
|
+
"tip": _("How fast do we travel when not cutting?"),
|
436
|
+
},
|
437
|
+
{
|
438
|
+
"attr": "pulse_width_enabled",
|
439
|
+
"object": self,
|
440
|
+
"default": False,
|
441
|
+
"type": bool,
|
442
|
+
"label": _("Enable"),
|
443
|
+
"tip": _("Enable using Pulse Width (MOPA)"),
|
444
|
+
# "conditional": (self, "source", "fiber"),
|
445
|
+
"subsection": "Pulse Width",
|
446
|
+
},
|
447
|
+
{
|
448
|
+
"attr": "default_pulse_width",
|
449
|
+
"object": self,
|
450
|
+
"default": 4,
|
451
|
+
"type": int,
|
452
|
+
"style": "combo",
|
453
|
+
"choices": [
|
454
|
+
1,
|
455
|
+
2,
|
456
|
+
4,
|
457
|
+
6,
|
458
|
+
9,
|
459
|
+
13,
|
460
|
+
20,
|
461
|
+
30,
|
462
|
+
45,
|
463
|
+
55,
|
464
|
+
60,
|
465
|
+
80,
|
466
|
+
100,
|
467
|
+
150,
|
468
|
+
200,
|
469
|
+
250,
|
470
|
+
],
|
471
|
+
"conditional": (self, "pulse_width_enabled"),
|
472
|
+
"label": _("Set Pulse Width (ns)"),
|
473
|
+
"trailer": "ns",
|
474
|
+
"tip": _("Set the MOPA pulse width setting"),
|
475
|
+
"subsection": "Pulse Width",
|
476
|
+
},
|
477
|
+
]
|
478
|
+
self.register_choices("balor-global", choices)
|
479
|
+
|
480
|
+
choices = [
|
481
|
+
{
|
482
|
+
"attr": "delay_laser_on",
|
483
|
+
"object": self,
|
484
|
+
"default": 100.0,
|
485
|
+
"type": float,
|
486
|
+
"label": _("Laser On"),
|
487
|
+
"trailer": "µs",
|
488
|
+
"tip": _(
|
489
|
+
"Start delay (Start TC) at the beginning of each mark command"
|
490
|
+
),
|
491
|
+
"section": "_10_General",
|
492
|
+
"subsection": "Delays",
|
493
|
+
"priority": "00",
|
494
|
+
},
|
495
|
+
{
|
496
|
+
"attr": "delay_laser_off",
|
497
|
+
"object": self,
|
498
|
+
"default": 100.0,
|
499
|
+
"type": float,
|
500
|
+
"label": _("Laser Off"),
|
501
|
+
"trailer": "µs",
|
502
|
+
"tip": _(
|
503
|
+
"The delay time of the laser shutting down after marking finished"
|
504
|
+
),
|
505
|
+
"section": "_10_General",
|
506
|
+
"subsection": "Delays",
|
507
|
+
"priority": "10",
|
508
|
+
},
|
509
|
+
{
|
510
|
+
"attr": "delay_polygon",
|
511
|
+
"object": self,
|
512
|
+
"default": 100.0,
|
513
|
+
"type": float,
|
514
|
+
"label": _("Polygon Delay"),
|
515
|
+
"trailer": "µs",
|
516
|
+
"tip": _("Delay amount between different points in the path travel."),
|
517
|
+
"section": "_10_General",
|
518
|
+
"subsection": "Delays",
|
519
|
+
"priority": "30",
|
520
|
+
},
|
521
|
+
{
|
522
|
+
"attr": "delay_end",
|
523
|
+
"object": self,
|
524
|
+
"default": 300.0,
|
525
|
+
"type": float,
|
526
|
+
"label": _("End Delay"),
|
527
|
+
"trailer": "µs",
|
528
|
+
"tip": _("Delay amount for the end TC"),
|
529
|
+
"section": "_10_General",
|
530
|
+
"subsection": "Delays",
|
531
|
+
"priority": "20",
|
532
|
+
},
|
533
|
+
{
|
534
|
+
"attr": "delay_jump_long",
|
535
|
+
"object": self,
|
536
|
+
"default": 200.0,
|
537
|
+
"type": float,
|
538
|
+
"label": _("Long jump delay"),
|
539
|
+
"trailer": "µs",
|
540
|
+
"tip": _("Delay for a long jump distance"),
|
541
|
+
"section": "_10_General",
|
542
|
+
"subsection": "Jump-Settings",
|
543
|
+
},
|
544
|
+
{
|
545
|
+
"attr": "delay_jump_short",
|
546
|
+
"object": self,
|
547
|
+
"default": 8,
|
548
|
+
"type": float,
|
549
|
+
"label": _("Short jump delay"),
|
550
|
+
"trailer": "µs",
|
551
|
+
"tip": _("Delay for a short jump distance"),
|
552
|
+
"section": "_10_General",
|
553
|
+
"subsection": "Jump-Settings",
|
554
|
+
},
|
555
|
+
{
|
556
|
+
"attr": "delay_distance_long",
|
557
|
+
"object": self,
|
558
|
+
"default": "10mm",
|
559
|
+
"type": Length,
|
560
|
+
"label": _("Long jump distance"),
|
561
|
+
"tip": _("Distance divide between long and short jump distances"),
|
562
|
+
"section": "_10_General",
|
563
|
+
"subsection": "Jump-Settings",
|
564
|
+
},
|
565
|
+
{
|
566
|
+
"attr": "delay_openmo",
|
567
|
+
"object": self,
|
568
|
+
"default": 8.0,
|
569
|
+
"type": float,
|
570
|
+
"label": _("Open MO delay"),
|
571
|
+
"trailer": "ms",
|
572
|
+
"tip": _("OpenMO delay in ms"),
|
573
|
+
"section": "_90_Other",
|
574
|
+
},
|
575
|
+
]
|
576
|
+
self.register_choices("balor-global-timing", choices)
|
577
|
+
|
578
|
+
choices = [
|
579
|
+
{
|
580
|
+
"attr": "first_pulse_killer",
|
581
|
+
"object": self,
|
582
|
+
"default": 200,
|
583
|
+
"type": int,
|
584
|
+
"label": _("First Pulse Killer"),
|
585
|
+
"trailer": "µs",
|
586
|
+
"tip": _(
|
587
|
+
"First Pulse Killer (F.P.K): the lasting time for the first pulse suppress"
|
588
|
+
),
|
589
|
+
"section": "First Pulse Killer",
|
590
|
+
},
|
591
|
+
{
|
592
|
+
"attr": "pwm_half_period",
|
593
|
+
"object": self,
|
594
|
+
"default": 125,
|
595
|
+
"type": int,
|
596
|
+
"label": _("PWM Half Period"),
|
597
|
+
"tip": _("Pulse Period: the frequency of the preionization signal"),
|
598
|
+
"subsection": "Pulse-Width-Modulation",
|
599
|
+
},
|
600
|
+
{
|
601
|
+
"attr": "pwm_pulse_width",
|
602
|
+
"object": self,
|
603
|
+
"default": 125,
|
604
|
+
"type": int,
|
605
|
+
"label": _("PWM Pulse Width"),
|
606
|
+
"tip": _("Pulse Width: the pulse width of the preionization signal"),
|
607
|
+
"subsection": "Pulse-Width-Modulation",
|
608
|
+
},
|
609
|
+
{
|
610
|
+
"attr": "standby_param_1",
|
611
|
+
"object": self,
|
612
|
+
"default": 2000,
|
613
|
+
"type": int,
|
614
|
+
"label": _("Parameter 1"),
|
615
|
+
# "tip": _(""),
|
616
|
+
"subsection": "Standby-Parameter",
|
617
|
+
},
|
618
|
+
{
|
619
|
+
"attr": "standby_param_2",
|
620
|
+
"object": self,
|
621
|
+
"default": 20,
|
622
|
+
"type": int,
|
623
|
+
"label": _("Parameter 2"),
|
624
|
+
# "tip": _(""),
|
625
|
+
"subsection": "Standby-Parameter",
|
626
|
+
},
|
627
|
+
{
|
628
|
+
"attr": "timing_mode",
|
629
|
+
"object": self,
|
630
|
+
"default": 1,
|
631
|
+
"type": int,
|
632
|
+
"label": _("Timing Mode"),
|
633
|
+
# "tip": _(""),
|
634
|
+
"subsection": "Modes",
|
635
|
+
},
|
636
|
+
{
|
637
|
+
"attr": "delay_mode",
|
638
|
+
"object": self,
|
639
|
+
"default": 1,
|
640
|
+
"type": int,
|
641
|
+
"label": _("Delay Mode"),
|
642
|
+
# "tip": _(""),
|
643
|
+
"subsection": "Modes",
|
644
|
+
},
|
645
|
+
{
|
646
|
+
"attr": "laser_mode",
|
647
|
+
"object": self,
|
648
|
+
"default": 1,
|
649
|
+
"type": int,
|
650
|
+
"label": _("Laser Mode"),
|
651
|
+
# "tip": _(""),
|
652
|
+
"subsection": "Modes",
|
653
|
+
},
|
654
|
+
{
|
655
|
+
"attr": "control_mode",
|
656
|
+
"object": self,
|
657
|
+
"default": 0,
|
658
|
+
"type": int,
|
659
|
+
"label": _("Control Mode"),
|
660
|
+
# "tip": _(""),
|
661
|
+
"subsection": "Modes",
|
662
|
+
},
|
663
|
+
{
|
664
|
+
"attr": "fpk2_p1",
|
665
|
+
"object": self,
|
666
|
+
"default": 0xFFB,
|
667
|
+
"type": int,
|
668
|
+
"label": _("Max Voltage"),
|
669
|
+
# "tip": _(""),
|
670
|
+
"trailer": "V",
|
671
|
+
"section": "First Pulse Killer",
|
672
|
+
"subsection": "Parameters",
|
673
|
+
},
|
674
|
+
{
|
675
|
+
"attr": "fpk2_p2",
|
676
|
+
"object": self,
|
677
|
+
"default": 1,
|
678
|
+
"type": int,
|
679
|
+
"label": _("Min Voltage"),
|
680
|
+
"trailer": "V",
|
681
|
+
# "tip": _(""),
|
682
|
+
"section": "First Pulse Killer",
|
683
|
+
"subsection": "Parameters",
|
684
|
+
},
|
685
|
+
{
|
686
|
+
"attr": "fpk2_p3",
|
687
|
+
"object": self,
|
688
|
+
"default": 409,
|
689
|
+
"type": int,
|
690
|
+
"label": _("T1"),
|
691
|
+
"trailer": "µs",
|
692
|
+
# "tip": _(""),
|
693
|
+
"section": "First Pulse Killer",
|
694
|
+
"subsection": "Parameters",
|
695
|
+
},
|
696
|
+
{
|
697
|
+
"attr": "fpk2_p4",
|
698
|
+
"object": self,
|
699
|
+
"default": 100,
|
700
|
+
"type": int,
|
701
|
+
"label": _("T2"),
|
702
|
+
"trailer": "µs",
|
703
|
+
# "tip": _(""),
|
704
|
+
"section": "First Pulse Killer",
|
705
|
+
"subsection": "Parameters",
|
706
|
+
},
|
707
|
+
{
|
708
|
+
"attr": "fly_res_p1",
|
709
|
+
"object": self,
|
710
|
+
"default": 0,
|
711
|
+
"type": int,
|
712
|
+
"label": _("Param 1"),
|
713
|
+
# "tip": _(""),
|
714
|
+
"subsection": "Fly Resolution",
|
715
|
+
},
|
716
|
+
{
|
717
|
+
"attr": "fly_res_p2",
|
718
|
+
"object": self,
|
719
|
+
"default": 99,
|
720
|
+
"type": int,
|
721
|
+
"label": _("Param 2"),
|
722
|
+
# "tip": _(""),
|
723
|
+
"subsection": "Fly Resolution",
|
724
|
+
},
|
725
|
+
{
|
726
|
+
"attr": "fly_res_p3",
|
727
|
+
"object": self,
|
728
|
+
"default": 1000,
|
729
|
+
"type": int,
|
730
|
+
"label": _("Param 3"),
|
731
|
+
# "tip": _(""),
|
732
|
+
"subsection": "Fly Resolution",
|
733
|
+
},
|
734
|
+
{
|
735
|
+
"attr": "fly_res_p4",
|
736
|
+
"object": self,
|
737
|
+
"default": 25,
|
738
|
+
"type": int,
|
739
|
+
"label": _("Param 4"),
|
740
|
+
# "tip": _(""),
|
741
|
+
"subsection": "Fly Resolution",
|
742
|
+
},
|
743
|
+
{
|
744
|
+
"attr": "input_passes_required",
|
745
|
+
"object": self,
|
746
|
+
"default": 3,
|
747
|
+
"type": int,
|
748
|
+
"label": _("Input Signal Hold"),
|
749
|
+
"tip": _(
|
750
|
+
"How long does the input operation need to hold for to count as a pass"
|
751
|
+
),
|
752
|
+
},
|
753
|
+
{
|
754
|
+
"attr": "input_operation_hardware",
|
755
|
+
"object": self,
|
756
|
+
"default": False,
|
757
|
+
"type": bool,
|
758
|
+
"label": _("Input Operation Hardware"),
|
759
|
+
"tip": _("Use hardware based input operation command"),
|
760
|
+
},
|
761
|
+
]
|
762
|
+
self.register_choices("balor-extra", choices)
|
763
|
+
|
764
|
+
choices = [
|
765
|
+
{
|
766
|
+
"attr": "cf_1",
|
767
|
+
"object": self,
|
768
|
+
"default": "50",
|
769
|
+
"type": float,
|
770
|
+
"label": _("Corfile distance {index}").format(index=1),
|
771
|
+
"section": _("Correction-Values"),
|
772
|
+
},
|
773
|
+
{
|
774
|
+
"attr": "cf_2",
|
775
|
+
"object": self,
|
776
|
+
"default": "50",
|
777
|
+
"type": float,
|
778
|
+
"label": _("Corfile distance {index}").format(index=2),
|
779
|
+
"section": _("Correction-Values"),
|
780
|
+
},
|
781
|
+
{
|
782
|
+
"attr": "cf_3",
|
783
|
+
"object": self,
|
784
|
+
"default": "50",
|
785
|
+
"type": float,
|
786
|
+
"label": _("Corfile distance {index}").format(index=3),
|
787
|
+
"section": _("Correction-Values"),
|
788
|
+
},
|
789
|
+
{
|
790
|
+
"attr": "cf_4",
|
791
|
+
"object": self,
|
792
|
+
"default": "50",
|
793
|
+
"type": float,
|
794
|
+
"label": _("Corfile distance {index}").format(index=4),
|
795
|
+
"section": _("Correction-Values"),
|
796
|
+
},
|
797
|
+
{
|
798
|
+
"attr": "cf_5",
|
799
|
+
"object": self,
|
800
|
+
"default": "50",
|
801
|
+
"type": float,
|
802
|
+
"label": _("Corfile distance {index}").format(index=5),
|
803
|
+
"section": _("Correction-Values"),
|
804
|
+
},
|
805
|
+
{
|
806
|
+
"attr": "cf_6",
|
807
|
+
"object": self,
|
808
|
+
"default": "50",
|
809
|
+
"type": float,
|
810
|
+
"label": _("Corfile distance {index}").format(index=6),
|
811
|
+
"section": _("Correction-Values"),
|
812
|
+
},
|
813
|
+
{
|
814
|
+
"attr": "cf_7",
|
815
|
+
"object": self,
|
816
|
+
"default": "50",
|
817
|
+
"type": float,
|
818
|
+
"label": _("Corfile distance {index}").format(index=7),
|
819
|
+
"section": _("Correction-Values"),
|
820
|
+
},
|
821
|
+
{
|
822
|
+
"attr": "cf_8",
|
823
|
+
"object": self,
|
824
|
+
"default": "50",
|
825
|
+
"type": float,
|
826
|
+
"label": _("Corfile distance {index}").format(index=8),
|
827
|
+
"section": _("Correction-Values"),
|
828
|
+
},
|
829
|
+
{
|
830
|
+
"attr": "cf_9",
|
831
|
+
"object": self,
|
832
|
+
"default": "50",
|
833
|
+
"type": float,
|
834
|
+
"label": _("Corfile distance {index}").format(index=9),
|
835
|
+
"section": _("Correction-Values"),
|
836
|
+
},
|
837
|
+
{
|
838
|
+
"attr": "cf_10",
|
839
|
+
"object": self,
|
840
|
+
"default": "50",
|
841
|
+
"type": float,
|
842
|
+
"label": _("Corfile distance {index}").format(index=10),
|
843
|
+
"section": _("Correction-Values"),
|
844
|
+
},
|
845
|
+
{
|
846
|
+
"attr": "cf_11",
|
847
|
+
"object": self,
|
848
|
+
"default": "50",
|
849
|
+
"type": float,
|
850
|
+
"label": _("Corfile distance {index}").format(index=11),
|
851
|
+
"section": _("Correction-Values"),
|
852
|
+
},
|
853
|
+
{
|
854
|
+
"attr": "cf_12",
|
855
|
+
"object": self,
|
856
|
+
"default": "50",
|
857
|
+
"type": float,
|
858
|
+
"label": _("Corfile distance {index}").format(index=12),
|
859
|
+
"section": _("Correction-Values"),
|
860
|
+
},
|
861
|
+
]
|
862
|
+
self.register_choices("balor-corfile", choices)
|
863
|
+
self.kernel.root.coolant.claim_coolant(self, self.device_coolant)
|
864
|
+
|
865
|
+
self.state = 0
|
866
|
+
|
867
|
+
unit_size = float(Length(self.lens_size))
|
868
|
+
galvo_range = 0xFFFF
|
869
|
+
units_per_galvo = unit_size / galvo_range
|
870
|
+
self.view = View(
|
871
|
+
self.lens_size,
|
872
|
+
self.lens_size,
|
873
|
+
native_scale_x=units_per_galvo,
|
874
|
+
native_scale_y=units_per_galvo,
|
875
|
+
)
|
876
|
+
self.realize()
|
877
|
+
|
878
|
+
self.spooler = Spooler(self)
|
879
|
+
self.driver = BalorDriver(self)
|
880
|
+
self.spooler.driver = self.driver
|
881
|
+
|
882
|
+
self.add_service_delegate(self.spooler)
|
883
|
+
|
884
|
+
self.viewbuffer = ""
|
885
|
+
self._simulate = False
|
886
|
+
self.laser_status = "idle"
|
887
|
+
|
888
|
+
@property
|
889
|
+
def safe_label(self):
|
890
|
+
"""
|
891
|
+
Provides a safe label without spaces or / which could cause issues when used in timer or other names.
|
892
|
+
@return:
|
893
|
+
"""
|
894
|
+
if not hasattr(self, "label"):
|
895
|
+
return self.name
|
896
|
+
name = self.label.replace(" ", "-")
|
897
|
+
return name.replace("/", "-")
|
898
|
+
|
899
|
+
def service_attach(self, *args, **kwargs):
|
900
|
+
self.realize()
|
901
|
+
|
902
|
+
@signal_listener("lens_size")
|
903
|
+
@signal_listener("rotate")
|
904
|
+
@signal_listener("flip_x")
|
905
|
+
@signal_listener("flip_y")
|
906
|
+
@signal_listener("swap_xy")
|
907
|
+
@signal_listener("user_margin_x")
|
908
|
+
@signal_listener("user_margin_y")
|
909
|
+
def realize(self, origin=None, *args):
|
910
|
+
if origin is not None and origin != self.path:
|
911
|
+
return
|
912
|
+
try:
|
913
|
+
unit_size = float(Length(self.lens_size))
|
914
|
+
except ValueError:
|
915
|
+
return
|
916
|
+
galvo_range = 0xFFFF
|
917
|
+
units_per_galvo = unit_size / galvo_range
|
918
|
+
|
919
|
+
self.view.set_dims(self.lens_size, self.lens_size)
|
920
|
+
self.view.set_margins(self.user_margin_x, self.user_margin_y)
|
921
|
+
self.view.set_native_scale(units_per_galvo, units_per_galvo)
|
922
|
+
self.view.transform(
|
923
|
+
flip_x=self.flip_x,
|
924
|
+
flip_y=self.flip_y,
|
925
|
+
swap_xy=self.swap_xy,
|
926
|
+
)
|
927
|
+
if self.rotate >= 90:
|
928
|
+
self.view.rotate_cw()
|
929
|
+
if self.rotate >= 180:
|
930
|
+
self.view.rotate_cw()
|
931
|
+
if self.rotate >= 270:
|
932
|
+
self.view.rotate_cw()
|
933
|
+
self.signal("view;realized")
|
934
|
+
|
935
|
+
@property
|
936
|
+
def current(self):
|
937
|
+
"""
|
938
|
+
@return: the location in units for the current known position.
|
939
|
+
"""
|
940
|
+
return self.view.iposition(self.driver.native_x, self.driver.native_y)
|
941
|
+
|
942
|
+
@property
|
943
|
+
def native(self):
|
944
|
+
"""
|
945
|
+
@return: the location in device native units for the current known position.
|
946
|
+
"""
|
947
|
+
return self.driver.native_x, self.driver.native_y
|
948
|
+
|
949
|
+
@property
|
950
|
+
def calibration_file(self):
|
951
|
+
return None
|
952
|
+
|
953
|
+
@signal_listener("light_simulate")
|
954
|
+
def simulate_state(self, origin, v=True):
|
955
|
+
self._simulate = False
|
956
|
+
|
957
|
+
def outline(self):
|
958
|
+
if not self._simulate:
|
959
|
+
self._simulate = True
|
960
|
+
self("full-light\n")
|
961
|
+
else:
|
962
|
+
self._simulate = False
|
963
|
+
self("stop\n")
|
964
|
+
|
965
|
+
def cool_helper(self, choice_dict):
|
966
|
+
self.kernel.root.coolant.coolant_choice_helper(self)(choice_dict)
|