meerk40t 0.9.3001__py2.py3-none-any.whl → 0.9.7010__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- meerk40t/__init__.py +1 -1
- meerk40t/balormk/balor_params.py +167 -167
- meerk40t/balormk/clone_loader.py +457 -457
- meerk40t/balormk/controller.py +1566 -1512
- meerk40t/balormk/cylindermod.py +64 -0
- meerk40t/balormk/device.py +966 -1959
- meerk40t/balormk/driver.py +778 -591
- meerk40t/balormk/galvo_commands.py +1195 -0
- meerk40t/balormk/gui/balorconfig.py +237 -111
- meerk40t/balormk/gui/balorcontroller.py +191 -184
- meerk40t/balormk/gui/baloroperationproperties.py +116 -115
- meerk40t/balormk/gui/corscene.py +845 -0
- meerk40t/balormk/gui/gui.py +179 -147
- meerk40t/balormk/livelightjob.py +466 -382
- meerk40t/balormk/mock_connection.py +131 -109
- meerk40t/balormk/plugin.py +133 -135
- meerk40t/balormk/usb_connection.py +306 -301
- meerk40t/camera/__init__.py +1 -1
- meerk40t/camera/camera.py +514 -397
- meerk40t/camera/gui/camerapanel.py +1241 -1095
- meerk40t/camera/gui/gui.py +58 -58
- meerk40t/camera/plugin.py +441 -399
- meerk40t/ch341/__init__.py +27 -27
- meerk40t/ch341/ch341device.py +628 -628
- meerk40t/ch341/libusb.py +595 -589
- meerk40t/ch341/mock.py +171 -171
- meerk40t/ch341/windriver.py +157 -157
- meerk40t/constants.py +13 -0
- meerk40t/core/__init__.py +1 -1
- meerk40t/core/bindalias.py +550 -539
- meerk40t/core/core.py +47 -47
- meerk40t/core/cutcode/cubiccut.py +73 -73
- meerk40t/core/cutcode/cutcode.py +315 -312
- meerk40t/core/cutcode/cutgroup.py +141 -137
- meerk40t/core/cutcode/cutobject.py +192 -185
- meerk40t/core/cutcode/dwellcut.py +37 -37
- meerk40t/core/cutcode/gotocut.py +29 -29
- meerk40t/core/cutcode/homecut.py +29 -29
- meerk40t/core/cutcode/inputcut.py +34 -34
- meerk40t/core/cutcode/linecut.py +33 -33
- meerk40t/core/cutcode/outputcut.py +34 -34
- meerk40t/core/cutcode/plotcut.py +335 -335
- meerk40t/core/cutcode/quadcut.py +61 -61
- meerk40t/core/cutcode/rastercut.py +168 -148
- meerk40t/core/cutcode/waitcut.py +34 -34
- meerk40t/core/cutplan.py +1843 -1316
- meerk40t/core/drivers.py +330 -329
- meerk40t/core/elements/align.py +801 -669
- meerk40t/core/elements/branches.py +1844 -1507
- meerk40t/core/elements/clipboard.py +229 -219
- meerk40t/core/elements/element_treeops.py +4561 -2837
- meerk40t/core/elements/element_types.py +125 -105
- meerk40t/core/elements/elements.py +4329 -3617
- meerk40t/core/elements/files.py +117 -64
- meerk40t/core/elements/geometry.py +473 -224
- meerk40t/core/elements/grid.py +467 -316
- meerk40t/core/elements/materials.py +158 -94
- meerk40t/core/elements/notes.py +50 -38
- meerk40t/core/elements/offset_clpr.py +933 -912
- meerk40t/core/elements/offset_mk.py +963 -955
- meerk40t/core/elements/penbox.py +339 -267
- meerk40t/core/elements/placements.py +300 -83
- meerk40t/core/elements/render.py +785 -687
- meerk40t/core/elements/shapes.py +2618 -2092
- meerk40t/core/elements/trace.py +651 -563
- meerk40t/core/elements/tree_commands.py +415 -409
- meerk40t/core/elements/undo_redo.py +116 -58
- meerk40t/core/elements/wordlist.py +319 -200
- meerk40t/core/exceptions.py +9 -9
- meerk40t/core/laserjob.py +220 -220
- meerk40t/core/logging.py +63 -63
- meerk40t/core/node/blobnode.py +83 -86
- meerk40t/core/node/bootstrap.py +105 -103
- meerk40t/core/node/branch_elems.py +40 -31
- meerk40t/core/node/branch_ops.py +45 -38
- meerk40t/core/node/branch_regmark.py +48 -41
- meerk40t/core/node/cutnode.py +29 -32
- meerk40t/core/node/effect_hatch.py +375 -257
- meerk40t/core/node/effect_warp.py +398 -0
- meerk40t/core/node/effect_wobble.py +441 -309
- meerk40t/core/node/elem_ellipse.py +404 -309
- meerk40t/core/node/elem_image.py +1082 -801
- meerk40t/core/node/elem_line.py +358 -292
- meerk40t/core/node/elem_path.py +259 -201
- meerk40t/core/node/elem_point.py +129 -102
- meerk40t/core/node/elem_polyline.py +310 -246
- meerk40t/core/node/elem_rect.py +376 -286
- meerk40t/core/node/elem_text.py +445 -418
- meerk40t/core/node/filenode.py +59 -40
- meerk40t/core/node/groupnode.py +138 -74
- meerk40t/core/node/image_processed.py +777 -766
- meerk40t/core/node/image_raster.py +156 -113
- meerk40t/core/node/layernode.py +31 -31
- meerk40t/core/node/mixins.py +135 -107
- meerk40t/core/node/node.py +1427 -1304
- meerk40t/core/node/nutils.py +117 -114
- meerk40t/core/node/op_cut.py +462 -335
- meerk40t/core/node/op_dots.py +296 -251
- meerk40t/core/node/op_engrave.py +414 -311
- meerk40t/core/node/op_image.py +755 -369
- meerk40t/core/node/op_raster.py +787 -522
- meerk40t/core/node/place_current.py +37 -40
- meerk40t/core/node/place_point.py +329 -126
- meerk40t/core/node/refnode.py +58 -47
- meerk40t/core/node/rootnode.py +225 -219
- meerk40t/core/node/util_console.py +48 -48
- meerk40t/core/node/util_goto.py +84 -65
- meerk40t/core/node/util_home.py +61 -61
- meerk40t/core/node/util_input.py +102 -102
- meerk40t/core/node/util_output.py +102 -102
- meerk40t/core/node/util_wait.py +65 -65
- meerk40t/core/parameters.py +709 -707
- meerk40t/core/planner.py +875 -785
- meerk40t/core/plotplanner.py +656 -652
- meerk40t/core/space.py +120 -113
- meerk40t/core/spoolers.py +706 -705
- meerk40t/core/svg_io.py +1836 -1549
- meerk40t/core/treeop.py +534 -445
- meerk40t/core/undos.py +278 -124
- meerk40t/core/units.py +784 -680
- meerk40t/core/view.py +393 -322
- meerk40t/core/webhelp.py +62 -62
- meerk40t/core/wordlist.py +513 -504
- meerk40t/cylinder/cylinder.py +247 -0
- meerk40t/cylinder/gui/cylindersettings.py +41 -0
- meerk40t/cylinder/gui/gui.py +24 -0
- meerk40t/device/__init__.py +1 -1
- meerk40t/device/basedevice.py +322 -123
- meerk40t/device/devicechoices.py +50 -0
- meerk40t/device/dummydevice.py +163 -128
- meerk40t/device/gui/defaultactions.py +618 -602
- meerk40t/device/gui/effectspanel.py +114 -0
- meerk40t/device/gui/formatterpanel.py +253 -290
- meerk40t/device/gui/warningpanel.py +337 -260
- meerk40t/device/mixins.py +13 -13
- meerk40t/dxf/__init__.py +1 -1
- meerk40t/dxf/dxf_io.py +766 -554
- meerk40t/dxf/plugin.py +47 -35
- meerk40t/external_plugins.py +79 -79
- meerk40t/external_plugins_build.py +28 -28
- meerk40t/extra/cag.py +112 -116
- meerk40t/extra/coolant.py +403 -0
- meerk40t/extra/encode_detect.py +198 -0
- meerk40t/extra/ezd.py +1165 -1165
- meerk40t/extra/hershey.py +835 -340
- meerk40t/extra/imageactions.py +322 -316
- meerk40t/extra/inkscape.py +630 -622
- meerk40t/extra/lbrn.py +424 -424
- meerk40t/extra/outerworld.py +284 -0
- meerk40t/extra/param_functions.py +1542 -1556
- meerk40t/extra/potrace.py +257 -253
- meerk40t/extra/serial_exchange.py +118 -0
- meerk40t/extra/updater.py +602 -453
- meerk40t/extra/vectrace.py +147 -146
- meerk40t/extra/winsleep.py +83 -83
- meerk40t/extra/xcs_reader.py +597 -0
- meerk40t/fill/fills.py +781 -335
- meerk40t/fill/patternfill.py +1061 -1061
- meerk40t/fill/patterns.py +614 -567
- meerk40t/grbl/control.py +87 -87
- meerk40t/grbl/controller.py +990 -903
- meerk40t/grbl/device.py +1081 -768
- meerk40t/grbl/driver.py +989 -771
- meerk40t/grbl/emulator.py +532 -497
- meerk40t/grbl/gcodejob.py +783 -767
- meerk40t/grbl/gui/grblconfiguration.py +373 -298
- meerk40t/grbl/gui/grblcontroller.py +485 -271
- meerk40t/grbl/gui/grblhardwareconfig.py +269 -153
- meerk40t/grbl/gui/grbloperationconfig.py +105 -0
- meerk40t/grbl/gui/gui.py +147 -116
- meerk40t/grbl/interpreter.py +44 -44
- meerk40t/grbl/loader.py +22 -22
- meerk40t/grbl/mock_connection.py +56 -56
- meerk40t/grbl/plugin.py +294 -264
- meerk40t/grbl/serial_connection.py +93 -88
- meerk40t/grbl/tcp_connection.py +81 -79
- meerk40t/grbl/ws_connection.py +112 -0
- meerk40t/gui/__init__.py +1 -1
- meerk40t/gui/about.py +2042 -296
- meerk40t/gui/alignment.py +1644 -1608
- meerk40t/gui/autoexec.py +199 -0
- meerk40t/gui/basicops.py +791 -670
- meerk40t/gui/bufferview.py +77 -71
- meerk40t/gui/busy.py +170 -133
- meerk40t/gui/choicepropertypanel.py +1673 -1469
- meerk40t/gui/consolepanel.py +706 -542
- meerk40t/gui/devicepanel.py +687 -581
- meerk40t/gui/dialogoptions.py +110 -107
- meerk40t/gui/executejob.py +316 -306
- meerk40t/gui/fonts.py +90 -90
- meerk40t/gui/functionwrapper.py +252 -0
- meerk40t/gui/gui_mixins.py +729 -0
- meerk40t/gui/guicolors.py +205 -182
- meerk40t/gui/help_assets/help_assets.py +218 -201
- meerk40t/gui/helper.py +154 -0
- meerk40t/gui/hersheymanager.py +1430 -846
- meerk40t/gui/icons.py +3422 -2747
- meerk40t/gui/imagesplitter.py +555 -508
- meerk40t/gui/keymap.py +354 -344
- meerk40t/gui/laserpanel.py +892 -806
- meerk40t/gui/laserrender.py +1470 -1232
- meerk40t/gui/lasertoolpanel.py +805 -793
- meerk40t/gui/magnetoptions.py +436 -0
- meerk40t/gui/materialmanager.py +2917 -0
- meerk40t/gui/materialtest.py +1722 -1694
- meerk40t/gui/mkdebug.py +646 -359
- meerk40t/gui/mwindow.py +163 -140
- meerk40t/gui/navigationpanels.py +2605 -2467
- meerk40t/gui/notes.py +143 -142
- meerk40t/gui/opassignment.py +414 -410
- meerk40t/gui/operation_info.py +310 -299
- meerk40t/gui/plugin.py +494 -328
- meerk40t/gui/position.py +714 -669
- meerk40t/gui/preferences.py +901 -650
- meerk40t/gui/propertypanels/attributes.py +1461 -1131
- meerk40t/gui/propertypanels/blobproperty.py +117 -114
- meerk40t/gui/propertypanels/consoleproperty.py +83 -80
- meerk40t/gui/propertypanels/gotoproperty.py +77 -0
- meerk40t/gui/propertypanels/groupproperties.py +223 -217
- meerk40t/gui/propertypanels/hatchproperty.py +489 -469
- meerk40t/gui/propertypanels/imageproperty.py +2244 -1384
- meerk40t/gui/propertypanels/inputproperty.py +59 -58
- meerk40t/gui/propertypanels/opbranchproperties.py +82 -80
- meerk40t/gui/propertypanels/operationpropertymain.py +1890 -1638
- meerk40t/gui/propertypanels/outputproperty.py +59 -58
- meerk40t/gui/propertypanels/pathproperty.py +389 -380
- meerk40t/gui/propertypanels/placementproperty.py +1214 -383
- meerk40t/gui/propertypanels/pointproperty.py +140 -136
- meerk40t/gui/propertypanels/propertywindow.py +313 -181
- meerk40t/gui/propertypanels/rasterwizardpanels.py +996 -912
- meerk40t/gui/propertypanels/regbranchproperties.py +76 -0
- meerk40t/gui/propertypanels/textproperty.py +770 -755
- meerk40t/gui/propertypanels/waitproperty.py +56 -55
- meerk40t/gui/propertypanels/warpproperty.py +121 -0
- meerk40t/gui/propertypanels/wobbleproperty.py +255 -204
- meerk40t/gui/ribbon.py +2468 -2210
- meerk40t/gui/scene/scene.py +1100 -1051
- meerk40t/gui/scene/sceneconst.py +22 -22
- meerk40t/gui/scene/scenepanel.py +439 -349
- meerk40t/gui/scene/scenespacewidget.py +365 -365
- meerk40t/gui/scene/widget.py +518 -505
- meerk40t/gui/scenewidgets/affinemover.py +215 -215
- meerk40t/gui/scenewidgets/attractionwidget.py +315 -309
- meerk40t/gui/scenewidgets/bedwidget.py +120 -97
- meerk40t/gui/scenewidgets/elementswidget.py +137 -107
- meerk40t/gui/scenewidgets/gridwidget.py +785 -745
- meerk40t/gui/scenewidgets/guidewidget.py +765 -765
- meerk40t/gui/scenewidgets/laserpathwidget.py +66 -66
- meerk40t/gui/scenewidgets/machineoriginwidget.py +86 -86
- meerk40t/gui/scenewidgets/nodeselector.py +28 -28
- meerk40t/gui/scenewidgets/rectselectwidget.py +589 -346
- meerk40t/gui/scenewidgets/relocatewidget.py +33 -33
- meerk40t/gui/scenewidgets/reticlewidget.py +83 -83
- meerk40t/gui/scenewidgets/selectionwidget.py +2952 -2756
- meerk40t/gui/simpleui.py +357 -333
- meerk40t/gui/simulation.py +2431 -2094
- meerk40t/gui/snapoptions.py +208 -203
- meerk40t/gui/spoolerpanel.py +1227 -1180
- meerk40t/gui/statusbarwidgets/defaultoperations.py +480 -353
- meerk40t/gui/statusbarwidgets/infowidget.py +520 -483
- meerk40t/gui/statusbarwidgets/opassignwidget.py +356 -355
- meerk40t/gui/statusbarwidgets/selectionwidget.py +172 -171
- meerk40t/gui/statusbarwidgets/shapepropwidget.py +754 -236
- meerk40t/gui/statusbarwidgets/statusbar.py +272 -260
- meerk40t/gui/statusbarwidgets/statusbarwidget.py +268 -270
- meerk40t/gui/statusbarwidgets/strokewidget.py +267 -251
- meerk40t/gui/themes.py +200 -78
- meerk40t/gui/tips.py +591 -0
- meerk40t/gui/toolwidgets/circlebrush.py +35 -35
- meerk40t/gui/toolwidgets/toolcircle.py +248 -242
- meerk40t/gui/toolwidgets/toolcontainer.py +82 -77
- meerk40t/gui/toolwidgets/tooldraw.py +97 -90
- meerk40t/gui/toolwidgets/toolellipse.py +219 -212
- meerk40t/gui/toolwidgets/toolimagecut.py +25 -132
- meerk40t/gui/toolwidgets/toolline.py +39 -144
- meerk40t/gui/toolwidgets/toollinetext.py +79 -236
- meerk40t/gui/toolwidgets/toollinetext_inline.py +296 -0
- meerk40t/gui/toolwidgets/toolmeasure.py +160 -216
- meerk40t/gui/toolwidgets/toolnodeedit.py +2088 -2074
- meerk40t/gui/toolwidgets/toolnodemove.py +92 -94
- meerk40t/gui/toolwidgets/toolparameter.py +754 -668
- meerk40t/gui/toolwidgets/toolplacement.py +108 -108
- meerk40t/gui/toolwidgets/toolpoint.py +68 -59
- meerk40t/gui/toolwidgets/toolpointlistbuilder.py +294 -0
- meerk40t/gui/toolwidgets/toolpointmove.py +183 -0
- meerk40t/gui/toolwidgets/toolpolygon.py +288 -403
- meerk40t/gui/toolwidgets/toolpolyline.py +38 -196
- meerk40t/gui/toolwidgets/toolrect.py +211 -207
- meerk40t/gui/toolwidgets/toolrelocate.py +72 -72
- meerk40t/gui/toolwidgets/toolribbon.py +598 -113
- meerk40t/gui/toolwidgets/tooltabedit.py +546 -0
- meerk40t/gui/toolwidgets/tooltext.py +98 -89
- meerk40t/gui/toolwidgets/toolvector.py +213 -204
- meerk40t/gui/toolwidgets/toolwidget.py +39 -39
- meerk40t/gui/usbconnect.py +98 -91
- meerk40t/gui/utilitywidgets/buttonwidget.py +18 -18
- meerk40t/gui/utilitywidgets/checkboxwidget.py +90 -90
- meerk40t/gui/utilitywidgets/controlwidget.py +14 -14
- meerk40t/gui/utilitywidgets/cyclocycloidwidget.py +343 -340
- meerk40t/gui/utilitywidgets/debugwidgets.py +148 -0
- meerk40t/gui/utilitywidgets/handlewidget.py +27 -27
- meerk40t/gui/utilitywidgets/harmonograph.py +450 -447
- meerk40t/gui/utilitywidgets/openclosewidget.py +40 -40
- meerk40t/gui/utilitywidgets/rotationwidget.py +54 -54
- meerk40t/gui/utilitywidgets/scalewidget.py +75 -75
- meerk40t/gui/utilitywidgets/seekbarwidget.py +183 -183
- meerk40t/gui/utilitywidgets/togglewidget.py +142 -142
- meerk40t/gui/utilitywidgets/toolbarwidget.py +8 -8
- meerk40t/gui/wordlisteditor.py +985 -931
- meerk40t/gui/wxmeerk40t.py +1444 -1169
- meerk40t/gui/wxmmain.py +5578 -4112
- meerk40t/gui/wxmribbon.py +1591 -1076
- meerk40t/gui/wxmscene.py +1635 -1453
- meerk40t/gui/wxmtree.py +2410 -2089
- meerk40t/gui/wxutils.py +1769 -1099
- meerk40t/gui/zmatrix.py +102 -102
- meerk40t/image/__init__.py +1 -1
- meerk40t/image/dither.py +429 -0
- meerk40t/image/imagetools.py +2778 -2269
- meerk40t/internal_plugins.py +150 -130
- meerk40t/kernel/__init__.py +63 -12
- meerk40t/kernel/channel.py +259 -212
- meerk40t/kernel/context.py +538 -538
- meerk40t/kernel/exceptions.py +41 -41
- meerk40t/kernel/functions.py +463 -414
- meerk40t/kernel/jobs.py +100 -100
- meerk40t/kernel/kernel.py +3809 -3571
- meerk40t/kernel/lifecycles.py +71 -71
- meerk40t/kernel/module.py +49 -49
- meerk40t/kernel/service.py +147 -147
- meerk40t/kernel/settings.py +383 -343
- meerk40t/lihuiyu/controller.py +883 -876
- meerk40t/lihuiyu/device.py +1181 -1069
- meerk40t/lihuiyu/driver.py +1466 -1372
- meerk40t/lihuiyu/gui/gui.py +127 -106
- meerk40t/lihuiyu/gui/lhyaccelgui.py +377 -363
- meerk40t/lihuiyu/gui/lhycontrollergui.py +741 -651
- meerk40t/lihuiyu/gui/lhydrivergui.py +470 -446
- meerk40t/lihuiyu/gui/lhyoperationproperties.py +238 -237
- meerk40t/lihuiyu/gui/tcpcontroller.py +226 -190
- meerk40t/lihuiyu/interpreter.py +53 -53
- meerk40t/lihuiyu/laserspeed.py +450 -450
- meerk40t/lihuiyu/loader.py +90 -90
- meerk40t/lihuiyu/parser.py +404 -404
- meerk40t/lihuiyu/plugin.py +101 -102
- meerk40t/lihuiyu/tcp_connection.py +111 -109
- meerk40t/main.py +231 -165
- meerk40t/moshi/builder.py +788 -781
- meerk40t/moshi/controller.py +505 -499
- meerk40t/moshi/device.py +495 -442
- meerk40t/moshi/driver.py +862 -696
- meerk40t/moshi/gui/gui.py +78 -76
- meerk40t/moshi/gui/moshicontrollergui.py +538 -522
- meerk40t/moshi/gui/moshidrivergui.py +87 -75
- meerk40t/moshi/plugin.py +43 -43
- meerk40t/network/console_server.py +102 -57
- meerk40t/network/kernelserver.py +10 -9
- meerk40t/network/tcp_server.py +142 -140
- meerk40t/network/udp_server.py +103 -77
- meerk40t/network/web_server.py +390 -0
- meerk40t/newly/controller.py +1158 -1144
- meerk40t/newly/device.py +874 -732
- meerk40t/newly/driver.py +540 -412
- meerk40t/newly/gui/gui.py +219 -188
- meerk40t/newly/gui/newlyconfig.py +116 -101
- meerk40t/newly/gui/newlycontroller.py +193 -186
- meerk40t/newly/gui/operationproperties.py +51 -51
- meerk40t/newly/mock_connection.py +82 -82
- meerk40t/newly/newly_params.py +56 -56
- meerk40t/newly/plugin.py +1214 -1246
- meerk40t/newly/usb_connection.py +322 -322
- meerk40t/rotary/gui/gui.py +52 -46
- meerk40t/rotary/gui/rotarysettings.py +240 -232
- meerk40t/rotary/rotary.py +202 -98
- meerk40t/ruida/control.py +291 -91
- meerk40t/ruida/controller.py +138 -1088
- meerk40t/ruida/device.py +672 -231
- meerk40t/ruida/driver.py +534 -472
- meerk40t/ruida/emulator.py +1494 -1491
- meerk40t/ruida/exceptions.py +4 -4
- meerk40t/ruida/gui/gui.py +71 -76
- meerk40t/ruida/gui/ruidaconfig.py +239 -72
- meerk40t/ruida/gui/ruidacontroller.py +187 -184
- meerk40t/ruida/gui/ruidaoperationproperties.py +48 -47
- meerk40t/ruida/loader.py +54 -52
- meerk40t/ruida/mock_connection.py +57 -109
- meerk40t/ruida/plugin.py +124 -87
- meerk40t/ruida/rdjob.py +2084 -945
- meerk40t/ruida/serial_connection.py +116 -0
- meerk40t/ruida/tcp_connection.py +146 -0
- meerk40t/ruida/udp_connection.py +73 -0
- meerk40t/svgelements.py +9671 -9669
- meerk40t/tools/driver_to_path.py +584 -579
- meerk40t/tools/geomstr.py +5583 -4680
- meerk40t/tools/jhfparser.py +357 -292
- meerk40t/tools/kerftest.py +904 -890
- meerk40t/tools/livinghinges.py +1168 -1033
- meerk40t/tools/pathtools.py +987 -949
- meerk40t/tools/pmatrix.py +234 -0
- meerk40t/tools/pointfinder.py +942 -942
- meerk40t/tools/polybool.py +940 -940
- meerk40t/tools/rasterplotter.py +1660 -547
- meerk40t/tools/shxparser.py +989 -901
- meerk40t/tools/ttfparser.py +726 -446
- meerk40t/tools/zinglplotter.py +595 -593
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/LICENSE +21 -21
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/METADATA +150 -139
- meerk40t-0.9.7010.dist-info/RECORD +445 -0
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/WHEEL +1 -1
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/top_level.txt +0 -1
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/zip-safe +1 -1
- meerk40t/balormk/elementlightjob.py +0 -159
- meerk40t-0.9.3001.dist-info/RECORD +0 -437
- test/bootstrap.py +0 -63
- test/test_cli.py +0 -12
- test/test_core_cutcode.py +0 -418
- test/test_core_elements.py +0 -144
- test/test_core_plotplanner.py +0 -397
- test/test_core_viewports.py +0 -312
- test/test_drivers_grbl.py +0 -108
- test/test_drivers_lihuiyu.py +0 -443
- test/test_drivers_newly.py +0 -113
- test/test_element_degenerate_points.py +0 -43
- test/test_elements_classify.py +0 -97
- test/test_elements_penbox.py +0 -22
- test/test_file_svg.py +0 -176
- test/test_fill.py +0 -155
- test/test_geomstr.py +0 -1523
- test/test_geomstr_nodes.py +0 -18
- test/test_imagetools_actualize.py +0 -306
- test/test_imagetools_wizard.py +0 -258
- test/test_kernel.py +0 -200
- test/test_laser_speeds.py +0 -3303
- test/test_length.py +0 -57
- test/test_lifecycle.py +0 -66
- test/test_operations.py +0 -251
- test/test_operations_hatch.py +0 -57
- test/test_ruida.py +0 -19
- test/test_spooler.py +0 -22
- test/test_tools_rasterplotter.py +0 -29
- test/test_wobble.py +0 -133
- test/test_zingl.py +0 -124
- {test → meerk40t/cylinder}/__init__.py +0 -0
- /meerk40t/{core/element_commands.py → cylinder/gui/__init__.py} +0 -0
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/entry_points.txt +0 -0
meerk40t/gui/spoolerpanel.py
CHANGED
@@ -1,1180 +1,1227 @@
|
|
1
|
-
import threading
|
2
|
-
import time
|
3
|
-
from math import isinf, isnan
|
4
|
-
from pathlib import Path
|
5
|
-
|
6
|
-
import wx
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
get_default_icon_size,
|
13
|
-
icons8_emergency_stop_button,
|
14
|
-
icons8_pause,
|
15
|
-
icons8_route,
|
16
|
-
)
|
17
|
-
from meerk40t.gui.mwindow import MWindow
|
18
|
-
from meerk40t.gui.wxutils import
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
.
|
59
|
-
.
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
self.context
|
94
|
-
self.context.
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
self.
|
100
|
-
|
101
|
-
|
102
|
-
self.
|
103
|
-
self.
|
104
|
-
self.
|
105
|
-
|
106
|
-
|
107
|
-
self.
|
108
|
-
|
109
|
-
|
110
|
-
self.
|
111
|
-
|
112
|
-
)
|
113
|
-
self.
|
114
|
-
self.
|
115
|
-
self.
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
)
|
125
|
-
self.button_stop.
|
126
|
-
self.button_stop.
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
)
|
138
|
-
self.
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
wx.
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
self.
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
self.list_job_history
|
155
|
-
|
156
|
-
wx.
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
self.
|
163
|
-
|
164
|
-
self.
|
165
|
-
self.
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
self.Bind(
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
self.
|
174
|
-
self.
|
175
|
-
self.
|
176
|
-
self.
|
177
|
-
self.
|
178
|
-
|
179
|
-
self.
|
180
|
-
self.
|
181
|
-
|
182
|
-
self.
|
183
|
-
self.
|
184
|
-
self.
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
self.
|
192
|
-
self.
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
self.
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
self.
|
208
|
-
self.
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
)
|
219
|
-
self.
|
220
|
-
_("
|
221
|
-
)
|
222
|
-
self.list_job_spool.AppendColumn(
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
)
|
228
|
-
self.list_job_spool.AppendColumn(
|
229
|
-
_("
|
230
|
-
)
|
231
|
-
self.list_job_spool.AppendColumn(
|
232
|
-
_("
|
233
|
-
)
|
234
|
-
self.list_job_spool.AppendColumn(
|
235
|
-
_("
|
236
|
-
)
|
237
|
-
self.list_job_spool.AppendColumn(
|
238
|
-
_("
|
239
|
-
)
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
self.
|
244
|
-
_("
|
245
|
-
)
|
246
|
-
self.
|
247
|
-
_("
|
248
|
-
)
|
249
|
-
self.
|
250
|
-
_("
|
251
|
-
)
|
252
|
-
self.
|
253
|
-
_("
|
254
|
-
)
|
255
|
-
self.
|
256
|
-
|
257
|
-
)
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
self.
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
self.
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
line_items
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
line_items.append(str(info.get("
|
352
|
-
line_items.append(
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
def
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
)
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
)
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
if element.
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
self.refresh_spooler_list()
|
643
|
-
|
644
|
-
return routine
|
645
|
-
|
646
|
-
def
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
def
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
def
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
self.
|
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
|
-
if
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
)
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
self.list_job_spool.SetItem(
|
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
|
-
if
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
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
|
-
self.list_job_history.
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
)
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
self.list_job_history.SetItem(
|
955
|
-
list_id,
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
)
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
self.list_job_history.
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
self.list_job_history.
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
self.
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
self.set_pause_color()
|
1034
|
-
|
1035
|
-
@signal_listener("
|
1036
|
-
def
|
1037
|
-
self.
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
self.
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
if
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
except AttributeError:
|
1111
|
-
if list_id < self.list_job_spool.GetItemCount():
|
1112
|
-
self.list_job_spool.SetItem(list_id,
|
1113
|
-
else:
|
1114
|
-
refresh_needed = True
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
except
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1
|
+
import threading
|
2
|
+
import time
|
3
|
+
from math import isinf, isnan
|
4
|
+
from pathlib import Path
|
5
|
+
|
6
|
+
import wx
|
7
|
+
|
8
|
+
# import wx.lib.mixins.listctrl as listmix
|
9
|
+
from wx import aui
|
10
|
+
|
11
|
+
from meerk40t.gui.icons import (
|
12
|
+
get_default_icon_size,
|
13
|
+
icons8_emergency_stop_button,
|
14
|
+
icons8_pause,
|
15
|
+
icons8_route,
|
16
|
+
)
|
17
|
+
from meerk40t.gui.mwindow import MWindow
|
18
|
+
from meerk40t.gui.wxutils import (
|
19
|
+
EditableListCtrl,
|
20
|
+
HoverButton,
|
21
|
+
wxButton,
|
22
|
+
wxComboBox,
|
23
|
+
wxListCtrl,
|
24
|
+
wxStaticText,
|
25
|
+
)
|
26
|
+
from meerk40t.kernel import Job, get_safe_path, signal_listener
|
27
|
+
|
28
|
+
_ = wx.GetTranslation
|
29
|
+
|
30
|
+
JC_INDEX = 0
|
31
|
+
JC_DEVICE = 1
|
32
|
+
JC_JOBNAME = 2
|
33
|
+
JC_ENTRIES = 3
|
34
|
+
JC_STATUS = 4
|
35
|
+
JC_TYPE = 5
|
36
|
+
JC_STEPS = 6
|
37
|
+
JC_PASSES = 7
|
38
|
+
JC_PRIORITY = 8
|
39
|
+
JC_RUNTIME = 9
|
40
|
+
JC_ESTIMATE = 10
|
41
|
+
|
42
|
+
HC_INDEX = 0
|
43
|
+
HC_DEVICE = 1
|
44
|
+
HC_JOBNAME = 2
|
45
|
+
HC_START = 3
|
46
|
+
HC_END = 4
|
47
|
+
HC_RUNTIME = 5
|
48
|
+
HC_ESTIMATE = 6
|
49
|
+
HC_STEPS = 7
|
50
|
+
HC_PASSES = 8
|
51
|
+
HC_STATUS = 9
|
52
|
+
HC_JOBINFO = 10
|
53
|
+
|
54
|
+
|
55
|
+
def register_panel_spooler(window, context):
|
56
|
+
panel = SpoolerPanel(window, wx.ID_ANY, context=context)
|
57
|
+
pane = (
|
58
|
+
aui.AuiPaneInfo()
|
59
|
+
.Bottom()
|
60
|
+
.Layer(1)
|
61
|
+
.MinSize(600, 100)
|
62
|
+
.FloatingSize(600, 230)
|
63
|
+
.Caption(_("Spooler"))
|
64
|
+
.Name("spooler")
|
65
|
+
.CaptionVisible(not context.pane_lock)
|
66
|
+
.Hide()
|
67
|
+
)
|
68
|
+
pane.dock_proportion = 600
|
69
|
+
pane.control = panel
|
70
|
+
pane.helptext = _("Opens the spooler window with all job information")
|
71
|
+
|
72
|
+
window.on_pane_create(pane)
|
73
|
+
context.register("pane/spooler", pane)
|
74
|
+
|
75
|
+
|
76
|
+
# class EditableListCtrl(wx.ListCtrl, listmix.TextEditMixin):
|
77
|
+
# """TextEditMixin allows any column to be edited."""
|
78
|
+
|
79
|
+
# # ----------------------------------------------------------------------
|
80
|
+
# def __init__(
|
81
|
+
# self, parent, ID=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0
|
82
|
+
# ):
|
83
|
+
# """Constructor"""
|
84
|
+
# wx.ListCtrl.__init__(self, parent, ID, pos, size, style)
|
85
|
+
# listmix.TextEditMixin.__init__(self)
|
86
|
+
|
87
|
+
|
88
|
+
class SpoolerPanel(wx.Panel):
|
89
|
+
def __init__(self, *args, context=None, selected_device=None, **kwds):
|
90
|
+
# begin wxGlade: SpoolerPanel.__init__
|
91
|
+
kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
|
92
|
+
wx.Panel.__init__(self, *args, **kwds)
|
93
|
+
self.context = context
|
94
|
+
self.context.themes.set_window_colors(self)
|
95
|
+
self.SetHelpText("spooler")
|
96
|
+
|
97
|
+
self.selected_device = selected_device
|
98
|
+
self.available_devices = context.kernel.services("device")
|
99
|
+
self.filter_device = None
|
100
|
+
spools = [s.label for s in self.available_devices]
|
101
|
+
spools.insert(0, _("-- All available devices --"))
|
102
|
+
self.queue_entries = []
|
103
|
+
self.context.setting(int, "spooler_sash_position", 0)
|
104
|
+
self.context.setting(bool, "spool_history_clear_on_start", False)
|
105
|
+
self.context.setting(bool, "spool_ignore_helper_jobs", True)
|
106
|
+
|
107
|
+
self.splitter = wx.SplitterWindow(self, id=wx.ID_ANY, style=wx.SP_LIVE_UPDATE)
|
108
|
+
sty = wx.BORDER_SUNKEN
|
109
|
+
|
110
|
+
self.win_top = wx.Window(self.splitter, style=sty)
|
111
|
+
self.win_bottom = wx.Window(self.splitter, style=sty)
|
112
|
+
self.splitter.SetMinimumPaneSize(50)
|
113
|
+
self.splitter.SplitHorizontally(self.win_top, self.win_bottom, -100)
|
114
|
+
self.splitter.SetSashPosition(self.context.spooler_sash_position)
|
115
|
+
self.combo_device = wxComboBox(
|
116
|
+
self.win_top, wx.ID_ANY, choices=spools, style=wx.CB_DROPDOWN
|
117
|
+
)
|
118
|
+
self.combo_device.SetSelection(0) # All by default...
|
119
|
+
self.button_pause = wxButton(self.win_top, wx.ID_ANY, _("Pause"))
|
120
|
+
self.button_pause.SetToolTip(_("Pause/Resume the laser"))
|
121
|
+
self.button_pause.SetBitmap(
|
122
|
+
icons8_pause.GetBitmap(resize=0.5 * get_default_icon_size(self.context))
|
123
|
+
)
|
124
|
+
self.button_stop = HoverButton(self.win_top, wx.ID_ANY, _("Abort"))
|
125
|
+
self.button_stop.SetToolTip(_("Stop the laser"))
|
126
|
+
self.button_stop.SetBitmap(
|
127
|
+
icons8_emergency_stop_button.GetBitmap(
|
128
|
+
resize=0.5 * get_default_icon_size(self.context),
|
129
|
+
color=self.context.themes.get("stop_fg"),
|
130
|
+
keepalpha=True,
|
131
|
+
)
|
132
|
+
)
|
133
|
+
self.button_stop.SetBitmapFocus(
|
134
|
+
icons8_emergency_stop_button.GetBitmap(resize=0.5 * get_default_icon_size(self.context))
|
135
|
+
)
|
136
|
+
self.button_stop.SetBackgroundColour(self.context.themes.get("stop_bg"))
|
137
|
+
self.button_stop.SetForegroundColour(self.context.themes.get("stop_fg"))
|
138
|
+
self.button_stop.SetFocusColour(self.context.themes.get("stop_fg_focus"))
|
139
|
+
|
140
|
+
self.list_job_spool = wxListCtrl(
|
141
|
+
self.win_top,
|
142
|
+
wx.ID_ANY,
|
143
|
+
style=wx.LC_HRULES | wx.LC_REPORT | wx.LC_VRULES | wx.LC_SINGLE_SEL,
|
144
|
+
context=self.context,
|
145
|
+
list_name="list_spoolerjobs",
|
146
|
+
)
|
147
|
+
|
148
|
+
self.info_label = wxStaticText(
|
149
|
+
self.win_bottom, wx.ID_ANY, _("Completed jobs:")
|
150
|
+
)
|
151
|
+
self.button_clear_history = wxButton(
|
152
|
+
self.win_bottom, wx.ID_ANY, _("Clear History")
|
153
|
+
)
|
154
|
+
self.list_job_history = EditableListCtrl(
|
155
|
+
self.win_bottom,
|
156
|
+
wx.ID_ANY,
|
157
|
+
style=wx.LC_HRULES | wx.LC_REPORT | wx.LC_VRULES | wx.LC_SINGLE_SEL,
|
158
|
+
context=self.context,
|
159
|
+
list_name="list_spoolerhistory",
|
160
|
+
)
|
161
|
+
|
162
|
+
self.__set_properties()
|
163
|
+
self.__do_layout()
|
164
|
+
self.current_item = None
|
165
|
+
self.Bind(
|
166
|
+
wx.EVT_BUTTON, self.on_button_clear_history, self.button_clear_history
|
167
|
+
)
|
168
|
+
self.button_clear_history.Bind(wx.EVT_RIGHT_DOWN, self.on_right_mouse_history)
|
169
|
+
self.list_job_history.Bind(wx.EVT_RIGHT_DOWN, self.on_right_mouse_history)
|
170
|
+
self.list_job_history.Bind(
|
171
|
+
wx.EVT_LIST_BEGIN_LABEL_EDIT, self.before_history_update
|
172
|
+
)
|
173
|
+
self.list_job_history.Bind(wx.EVT_LIST_END_LABEL_EDIT, self.on_history_update)
|
174
|
+
self.Bind(wx.EVT_BUTTON, self.on_button_pause, self.button_pause)
|
175
|
+
self.Bind(wx.EVT_BUTTON, self.on_button_stop, self.button_stop)
|
176
|
+
self.Bind(wx.EVT_COMBOBOX, self.on_combo_device, self.combo_device)
|
177
|
+
self.Bind(wx.EVT_LIST_BEGIN_DRAG, self.on_list_drag, self.list_job_spool)
|
178
|
+
|
179
|
+
self.splitter.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED, self.on_sash_changed)
|
180
|
+
self.splitter.Bind(wx.EVT_SPLITTER_DOUBLECLICKED, self.on_sash_double)
|
181
|
+
|
182
|
+
self.list_job_spool.Bind(wx.EVT_LIST_ITEM_SELECTED, self.on_item_selected)
|
183
|
+
# self.list_job_spool.Bind(wx.EVT_LEFT_DCLICK, self.on_item_doubleclick)
|
184
|
+
self.Bind(
|
185
|
+
wx.EVT_LIST_ITEM_RIGHT_CLICK, self.on_item_rightclick, self.list_job_spool
|
186
|
+
)
|
187
|
+
# end wxGlade
|
188
|
+
self._last_invokation = 0
|
189
|
+
self.dirty = False
|
190
|
+
self.update_buffer_size = False
|
191
|
+
self.update_spooler_state = False
|
192
|
+
self.update_spooler = True
|
193
|
+
|
194
|
+
self.elements_progress = 0
|
195
|
+
self.elements_progress_total = 0
|
196
|
+
self.command_index = 0
|
197
|
+
self.listener_list = None
|
198
|
+
self.list_lookup = {}
|
199
|
+
self.map_item_key = {}
|
200
|
+
self.refresh_history()
|
201
|
+
self.set_pause_color()
|
202
|
+
if self.context.spool_history_clear_on_start:
|
203
|
+
self.clear_history()
|
204
|
+
# We set a timer job that will periodically check the spooler queue
|
205
|
+
# in case no signal was received
|
206
|
+
self.shown = False
|
207
|
+
self.update_lock = threading.Lock()
|
208
|
+
self.timerjob = Job(
|
209
|
+
process=self.update_queue,
|
210
|
+
job_name="spooler-update",
|
211
|
+
interval=5,
|
212
|
+
run_main=True,
|
213
|
+
)
|
214
|
+
|
215
|
+
def __set_properties(self):
|
216
|
+
# begin wxGlade: SpoolerPanel.__set_properties
|
217
|
+
self.combo_device.SetToolTip(_("Select the device"))
|
218
|
+
self.list_job_spool.SetToolTip(_("List and modify the queued operations"))
|
219
|
+
self.button_clear_history.SetToolTip(
|
220
|
+
_("Clear spooler history (right click for more options)")
|
221
|
+
)
|
222
|
+
self.list_job_spool.AppendColumn(_("#"), format=wx.LIST_FORMAT_LEFT, width=58)
|
223
|
+
self.list_job_spool.AppendColumn(
|
224
|
+
_("Device"),
|
225
|
+
format=wx.LIST_FORMAT_LEFT,
|
226
|
+
width=95,
|
227
|
+
)
|
228
|
+
self.list_job_spool.AppendColumn(
|
229
|
+
_("Name"), format=wx.LIST_FORMAT_LEFT, width=95
|
230
|
+
)
|
231
|
+
self.list_job_spool.AppendColumn(
|
232
|
+
_("Items"), format=wx.LIST_FORMAT_LEFT, width=45
|
233
|
+
)
|
234
|
+
self.list_job_spool.AppendColumn(
|
235
|
+
_("Status"), format=wx.LIST_FORMAT_LEFT, width=73
|
236
|
+
)
|
237
|
+
self.list_job_spool.AppendColumn(
|
238
|
+
_("Type"), format=wx.LIST_FORMAT_LEFT, width=60
|
239
|
+
)
|
240
|
+
self.list_job_spool.AppendColumn(
|
241
|
+
_("Steps"), format=wx.LIST_FORMAT_LEFT, width=73
|
242
|
+
)
|
243
|
+
self.list_job_spool.AppendColumn(
|
244
|
+
_("Passes"), format=wx.LIST_FORMAT_LEFT, width=73
|
245
|
+
)
|
246
|
+
self.list_job_spool.AppendColumn(
|
247
|
+
_("Priority"), format=wx.LIST_FORMAT_LEFT, width=73
|
248
|
+
)
|
249
|
+
self.list_job_spool.AppendColumn(
|
250
|
+
_("Runtime"), format=wx.LIST_FORMAT_LEFT, width=73
|
251
|
+
)
|
252
|
+
self.list_job_spool.AppendColumn(
|
253
|
+
_("Estimate"), format=wx.LIST_FORMAT_LEFT, width=73
|
254
|
+
)
|
255
|
+
self.list_job_spool.resize_columns()
|
256
|
+
|
257
|
+
self.list_job_history.AppendColumn(_("#"), format=wx.LIST_FORMAT_LEFT, width=48)
|
258
|
+
|
259
|
+
self.list_job_history.AppendColumn(
|
260
|
+
_("Device"), format=wx.LIST_FORMAT_LEFT, width=73
|
261
|
+
)
|
262
|
+
self.list_job_history.AppendColumn(
|
263
|
+
_("Name"), format=wx.LIST_FORMAT_LEFT, width=95
|
264
|
+
)
|
265
|
+
self.list_job_history.AppendColumn(
|
266
|
+
_("Start"), format=wx.LIST_FORMAT_LEFT, width=113
|
267
|
+
)
|
268
|
+
self.list_job_history.AppendColumn(
|
269
|
+
_("End"), format=wx.LIST_FORMAT_LEFT, width=73
|
270
|
+
)
|
271
|
+
self.list_job_history.AppendColumn(
|
272
|
+
_("Runtime"), format=wx.LIST_FORMAT_LEFT, width=73
|
273
|
+
)
|
274
|
+
self.list_job_history.AppendColumn(
|
275
|
+
_("Estimate"), format=wx.LIST_FORMAT_LEFT, width=73
|
276
|
+
)
|
277
|
+
self.list_job_history.AppendColumn(
|
278
|
+
_("Steps"), format=wx.LIST_FORMAT_LEFT, width=73
|
279
|
+
)
|
280
|
+
self.list_job_history.AppendColumn(
|
281
|
+
_("Passes"), format=wx.LIST_FORMAT_LEFT, width=73
|
282
|
+
)
|
283
|
+
self.list_job_history.AppendColumn(
|
284
|
+
_("Status"), format=wx.LIST_FORMAT_LEFT, width=73
|
285
|
+
)
|
286
|
+
self.list_job_history.AppendColumn(
|
287
|
+
_("Jobinfo"), format=wx.LIST_FORMAT_LEFT, width=wx.LIST_AUTOSIZE_USEHEADER
|
288
|
+
)
|
289
|
+
self.list_job_history.resize_columns()
|
290
|
+
# end wxGlade
|
291
|
+
|
292
|
+
def __do_layout(self):
|
293
|
+
sizer_main = wx.BoxSizer(wx.VERTICAL)
|
294
|
+
|
295
|
+
sizer_top = wx.BoxSizer(wx.VERTICAL)
|
296
|
+
sizer_bottom = wx.BoxSizer(wx.VERTICAL)
|
297
|
+
sizer_combo_cmds = wx.BoxSizer(wx.HORIZONTAL)
|
298
|
+
sizer_combo_cmds.Add(self.combo_device, 1, wx.ALIGN_CENTER_VERTICAL, 0)
|
299
|
+
sizer_combo_cmds.Add(self.button_pause, 0, wx.EXPAND, 0)
|
300
|
+
sizer_combo_cmds.Add(self.button_stop, 0, wx.EXPAND, 0)
|
301
|
+
|
302
|
+
sizer_top.Add(sizer_combo_cmds, 0, wx.EXPAND, 0)
|
303
|
+
sizer_top.Add(self.list_job_spool, 4, wx.EXPAND, 0)
|
304
|
+
self.win_top.SetSizer(sizer_top)
|
305
|
+
sizer_top.Fit(self.win_top)
|
306
|
+
|
307
|
+
hsizer = wx.BoxSizer(wx.HORIZONTAL)
|
308
|
+
hsizer.Add(self.info_label, 1, wx.ALIGN_CENTER_VERTICAL, 0)
|
309
|
+
hsizer.Add(self.button_clear_history, 0, wx.EXPAND, 0)
|
310
|
+
sizer_bottom.Add(hsizer, 0, wx.EXPAND, 0)
|
311
|
+
sizer_bottom.Add(self.list_job_history, 2, wx.EXPAND, 0)
|
312
|
+
self.win_bottom.SetSizer(sizer_bottom)
|
313
|
+
sizer_bottom.Fit(self.win_bottom)
|
314
|
+
|
315
|
+
sizer_main.Add(self.splitter, 1, wx.EXPAND, 0)
|
316
|
+
self.SetSizer(sizer_main)
|
317
|
+
sizer_main.Fit(self)
|
318
|
+
self.Layout()
|
319
|
+
# end wxGlade
|
320
|
+
|
321
|
+
def on_sash_changed(self, event):
|
322
|
+
position = self.splitter.GetSashPosition()
|
323
|
+
self.context.spooler_sash_position = position
|
324
|
+
|
325
|
+
def on_sash_double(self, event):
|
326
|
+
self.splitter.SetSashPosition(0, True)
|
327
|
+
self.context.spooler_sash_position = 0
|
328
|
+
|
329
|
+
def on_item_selected(self, event):
|
330
|
+
self.current_item = event.Index
|
331
|
+
|
332
|
+
def write_csv(self):
|
333
|
+
filename = Path(get_safe_path(self.context.kernel.name, create=True)).joinpath(
|
334
|
+
"history.csv"
|
335
|
+
)
|
336
|
+
if self.filter_device:
|
337
|
+
events = self.context.logging.matching_events(
|
338
|
+
"job", device=self.filter_device
|
339
|
+
)
|
340
|
+
else:
|
341
|
+
events = self.context.logging.matching_events("job")
|
342
|
+
try:
|
343
|
+
with open(filename, "w", encoding="utf-8") as f:
|
344
|
+
simpleline = "device;jobname;start;end;duration;estimate;steps;total;loops;passes;status;info"
|
345
|
+
f.write(simpleline + "\n")
|
346
|
+
for key, info in events:
|
347
|
+
line_items = []
|
348
|
+
if info["start_time"] is None:
|
349
|
+
continue
|
350
|
+
line_items.append(str(info.get("device", "''")))
|
351
|
+
line_items.append(str(info.get("label", "''")))
|
352
|
+
line_items.append(
|
353
|
+
f"{self.datestr(info.get('start_time',0))} {self.timestr(info.get('start_time',0), True)}"
|
354
|
+
)
|
355
|
+
|
356
|
+
line_items.append(
|
357
|
+
self.timestr(
|
358
|
+
info.get("start_time", 0) + info.get("duration", 0), True
|
359
|
+
)
|
360
|
+
)
|
361
|
+
line_items.append(self.timestr(info.get("duration", 0), False))
|
362
|
+
line_items.append(self.timestr(info.get("estimate", 0), False))
|
363
|
+
line_items.append(str(info.get("steps_done", 0)))
|
364
|
+
line_items.append(str(info.get("steps_total", 0)))
|
365
|
+
line_items.append(str(info.get("loop", 0)))
|
366
|
+
# First passes then device
|
367
|
+
line_items.append(str(info.get("passes", "''")))
|
368
|
+
line_items.append(str(info.get("status", "''")))
|
369
|
+
line_items.append(str(info.get("info", "''")))
|
370
|
+
f.write(f'{";".join(line_items)}\n')
|
371
|
+
|
372
|
+
except (PermissionError, OSError, FileNotFoundError):
|
373
|
+
pass
|
374
|
+
|
375
|
+
def clear_history(self, older_than=None, job_type=None):
|
376
|
+
if self.filter_device:
|
377
|
+
to_remove = list(
|
378
|
+
self.context.logging.matching_events("job", device=self.filter_device)
|
379
|
+
)
|
380
|
+
else:
|
381
|
+
to_remove = list(self.context.logging.matching_events("job"))
|
382
|
+
for key, event in to_remove:
|
383
|
+
if event is not None and older_than is not None:
|
384
|
+
if not "start_time" in event:
|
385
|
+
continue
|
386
|
+
if (
|
387
|
+
event["start_time"] is not None
|
388
|
+
and event["start_time"] >= older_than
|
389
|
+
):
|
390
|
+
continue
|
391
|
+
if event is not None and job_type is not None:
|
392
|
+
if not "status" in event:
|
393
|
+
continue
|
394
|
+
if event["status"] is not None and event["status"] != job_type:
|
395
|
+
continue
|
396
|
+
del self.context.logging.logs[key]
|
397
|
+
self.refresh_history()
|
398
|
+
|
399
|
+
def on_button_clear_history(self, event):
|
400
|
+
self.clear_history(older_than=None, job_type=None)
|
401
|
+
|
402
|
+
def on_right_mouse_history(self, event):
|
403
|
+
listid = self.list_job_history.GetFirstSelected()
|
404
|
+
if listid >= 0:
|
405
|
+
idx = self.list_job_history.GetItemData(listid)
|
406
|
+
key = self.map_item_key[listid]
|
407
|
+
else:
|
408
|
+
# Bad selection.
|
409
|
+
idx = -1
|
410
|
+
key = None
|
411
|
+
|
412
|
+
def on_menu_index(idx_to_delete):
|
413
|
+
def check(event_c):
|
414
|
+
del self.context.logging.logs[key]
|
415
|
+
self.refresh_history()
|
416
|
+
|
417
|
+
return check
|
418
|
+
|
419
|
+
def on_menu_time(cutoff, jobtype):
|
420
|
+
def check(event):
|
421
|
+
self.clear_history(older_than=dcutoff, job_type=djobtype)
|
422
|
+
|
423
|
+
# Store value locally
|
424
|
+
dcutoff = cutoff
|
425
|
+
djobtype = jobtype
|
426
|
+
return check
|
427
|
+
|
428
|
+
def toggle_1(event):
|
429
|
+
self.context.spool_history_clear_on_start = (
|
430
|
+
not self.context.spool_history_clear_on_start
|
431
|
+
)
|
432
|
+
|
433
|
+
def toggle_2(event):
|
434
|
+
self.context.spool_ignore_helper_jobs = (
|
435
|
+
not self.context.spool_ignore_helper_jobs
|
436
|
+
)
|
437
|
+
self.refresh_history()
|
438
|
+
|
439
|
+
now = time.time()
|
440
|
+
week_seconds = 60 * 60 * 24 * 7
|
441
|
+
options = [(_("All entries"), None, None)]
|
442
|
+
for week in range(1, 5):
|
443
|
+
cutoff_time = now - week * week_seconds
|
444
|
+
options.append(
|
445
|
+
(_("Older than {week} week").format(week=week), cutoff_time, None)
|
446
|
+
)
|
447
|
+
options.append((_("All incomplete jobs"), None, "stopped"))
|
448
|
+
menu = wx.Menu()
|
449
|
+
if idx >= 0:
|
450
|
+
menuitem = menu.Append(wx.ID_ANY, _("Delete this entry"), "")
|
451
|
+
self.Bind(
|
452
|
+
wx.EVT_MENU,
|
453
|
+
on_menu_index(idx),
|
454
|
+
id=menuitem.GetId(),
|
455
|
+
)
|
456
|
+
menu.AppendSeparator()
|
457
|
+
|
458
|
+
menuitem = menu.Append(wx.ID_ANY, _("Delete..."))
|
459
|
+
menu.Enable(menuitem.GetId(), False)
|
460
|
+
|
461
|
+
for item in options:
|
462
|
+
menuitem = menu.Append(wx.ID_ANY, item[0], "")
|
463
|
+
self.Bind(
|
464
|
+
wx.EVT_MENU,
|
465
|
+
on_menu_time(item[1], item[2]),
|
466
|
+
id=menuitem.GetId(),
|
467
|
+
)
|
468
|
+
|
469
|
+
menu.AppendSeparator()
|
470
|
+
menuitem = menu.Append(
|
471
|
+
wx.ID_ANY, _("Clear history on startup"), "", wx.ITEM_CHECK
|
472
|
+
)
|
473
|
+
menuitem.Check(self.context.spool_history_clear_on_start)
|
474
|
+
self.Bind(
|
475
|
+
wx.EVT_MENU,
|
476
|
+
toggle_1,
|
477
|
+
id=menuitem.GetId(),
|
478
|
+
)
|
479
|
+
menuitem = menu.Append(wx.ID_ANY, _("Ignore helper jobs"), "", wx.ITEM_CHECK)
|
480
|
+
menuitem.Check(self.context.spool_ignore_helper_jobs)
|
481
|
+
self.Bind(
|
482
|
+
wx.EVT_MENU,
|
483
|
+
toggle_2,
|
484
|
+
id=menuitem.GetId(),
|
485
|
+
)
|
486
|
+
|
487
|
+
item = menu.Append(wx.ID_ANY, _("Write CSV"), "", wx.ITEM_NORMAL)
|
488
|
+
self.Bind(wx.EVT_MENU, lambda e: self.write_csv(), item)
|
489
|
+
|
490
|
+
if menu.MenuItemCount != 0:
|
491
|
+
self.PopupMenu(menu)
|
492
|
+
menu.Destroy()
|
493
|
+
|
494
|
+
def on_button_pause(self, event): # wxGlade: LaserPanel.<event_handler>
|
495
|
+
self.context("pause\n")
|
496
|
+
|
497
|
+
def on_button_stop(self, event): # wxGlade: LaserPanel.<event_handler>
|
498
|
+
self.context("estop\n")
|
499
|
+
|
500
|
+
def on_combo_device(self, event=None): # wxGlade: Spooler.<event_handler>
|
501
|
+
index = self.combo_device.GetSelection()
|
502
|
+
if index == 0:
|
503
|
+
self.filter_device = None
|
504
|
+
else:
|
505
|
+
self.filter_device = self.available_devices[index - 1].label
|
506
|
+
self.update_spooler = True
|
507
|
+
self.refresh_spooler_list()
|
508
|
+
self.refresh_history()
|
509
|
+
self.set_pause_color()
|
510
|
+
|
511
|
+
def on_list_drag(self, event): # wxGlade: JobSpooler.<event_handler>
|
512
|
+
# Todo: Drag to reprioritise jobs
|
513
|
+
event.Skip()
|
514
|
+
|
515
|
+
def on_item_rightclick(self, event): # wxGlade: JobSpooler.<event_handler>
|
516
|
+
listindex = event.Index
|
517
|
+
try:
|
518
|
+
index = self.list_job_spool.GetItemData(listindex)
|
519
|
+
except AssertionError:
|
520
|
+
# Size of list_job_spool changed or is updating.
|
521
|
+
return
|
522
|
+
try:
|
523
|
+
spooler = self.queue_entries[index][0]
|
524
|
+
qindex = self.queue_entries[index][1]
|
525
|
+
element = spooler.queue[qindex]
|
526
|
+
except IndexError:
|
527
|
+
return
|
528
|
+
|
529
|
+
menu = wx.Menu()
|
530
|
+
item = menu.Append(
|
531
|
+
wx.ID_ANY,
|
532
|
+
f"{str(element)[:30]} [{spooler.context.label}]",
|
533
|
+
"",
|
534
|
+
wx.ITEM_NORMAL,
|
535
|
+
)
|
536
|
+
item.Enable(False)
|
537
|
+
can_enable = False
|
538
|
+
action = _("Remove")
|
539
|
+
remove_mode = "remove"
|
540
|
+
if element.status == "Running":
|
541
|
+
action = _("Stop")
|
542
|
+
remove_mode = "stop"
|
543
|
+
elif hasattr(element, "enabled"):
|
544
|
+
remove_mode = "remove"
|
545
|
+
if element.enabled:
|
546
|
+
action2 = _("Disable")
|
547
|
+
else:
|
548
|
+
action2 = _("Enable")
|
549
|
+
can_enable = True
|
550
|
+
|
551
|
+
item = menu.Append(
|
552
|
+
wx.ID_ANY,
|
553
|
+
f"{action}",
|
554
|
+
"",
|
555
|
+
wx.ITEM_NORMAL,
|
556
|
+
)
|
557
|
+
info_tuple = [spooler, element, remove_mode]
|
558
|
+
self.Bind(wx.EVT_MENU, self.on_menu_popup_delete(info_tuple), item)
|
559
|
+
# Are there more loops than just one?
|
560
|
+
if hasattr(element, "loops"):
|
561
|
+
# Still something to go?
|
562
|
+
if element.loops > 1 and element.loops_executed < element.loops:
|
563
|
+
item = menu.Append(
|
564
|
+
wx.ID_ANY,
|
565
|
+
_("Finish after this loop"),
|
566
|
+
_(
|
567
|
+
"Stop the current execution after the succesful execution of this loop"
|
568
|
+
),
|
569
|
+
wx.ITEM_NORMAL,
|
570
|
+
)
|
571
|
+
info_tuple = [spooler, element]
|
572
|
+
self.Bind(wx.EVT_MENU, self.on_menu_popup_stop_loop(info_tuple), item)
|
573
|
+
if not isinf(element.loops):
|
574
|
+
item = menu.Append(
|
575
|
+
wx.ID_ANY,
|
576
|
+
_("add another loop"),
|
577
|
+
_("add another loop to this job"),
|
578
|
+
wx.ITEM_NORMAL,
|
579
|
+
)
|
580
|
+
info_tuple = [spooler, element]
|
581
|
+
self.Bind(wx.EVT_MENU, self.on_menu_popup_add_loop(info_tuple), item)
|
582
|
+
|
583
|
+
if can_enable:
|
584
|
+
item = menu.Append(
|
585
|
+
wx.ID_ANY,
|
586
|
+
f"{action2}",
|
587
|
+
"",
|
588
|
+
wx.ITEM_NORMAL,
|
589
|
+
)
|
590
|
+
info_tuple = [spooler, element]
|
591
|
+
self.Bind(wx.EVT_MENU, self.on_menu_popup_toggle_enable(info_tuple), item)
|
592
|
+
menu.AppendSeparator()
|
593
|
+
item = menu.Append(wx.ID_ANY, _("Clear All"), "", wx.ITEM_NORMAL)
|
594
|
+
self.Bind(wx.EVT_MENU, self.on_menu_popup_clear(element), item)
|
595
|
+
|
596
|
+
self.PopupMenu(menu)
|
597
|
+
menu.Destroy()
|
598
|
+
|
599
|
+
def on_menu_popup_clear(self, element=None):
|
600
|
+
def clear(event=None):
|
601
|
+
if self.context.kernel.yesno(
|
602
|
+
_("Do you really want to delete all entries?"), caption=_("Spooler")
|
603
|
+
):
|
604
|
+
spoolers = []
|
605
|
+
for device in self.available_devices:
|
606
|
+
addit = True
|
607
|
+
if (
|
608
|
+
self.filter_device is not None
|
609
|
+
and device.label != self.filter_device
|
610
|
+
):
|
611
|
+
addit = False
|
612
|
+
if addit:
|
613
|
+
spoolers.append(device.spooler)
|
614
|
+
for spooler in spoolers:
|
615
|
+
spooler.clear_queue()
|
616
|
+
self.refresh_spooler_list()
|
617
|
+
|
618
|
+
return clear
|
619
|
+
|
620
|
+
def on_menu_popup_delete(self, element):
|
621
|
+
def delete(event=None):
|
622
|
+
spooler = element[0]
|
623
|
+
mode = element[2]
|
624
|
+
job = element[1]
|
625
|
+
spooler.remove(job)
|
626
|
+
# That will remove the job but create a log entry if needed.
|
627
|
+
if mode == "stop":
|
628
|
+
if hasattr(job, "stop"):
|
629
|
+
job.stop()
|
630
|
+
else:
|
631
|
+
# Force stop of laser.
|
632
|
+
self.context("estop\n")
|
633
|
+
self.refresh_spooler_list()
|
634
|
+
|
635
|
+
return delete
|
636
|
+
|
637
|
+
def on_menu_popup_toggle_enable(self, element):
|
638
|
+
def routine(event=None):
|
639
|
+
spooler = element[0]
|
640
|
+
job = element[1]
|
641
|
+
job.enabled = not job.enabled
|
642
|
+
self.refresh_spooler_list()
|
643
|
+
|
644
|
+
return routine
|
645
|
+
|
646
|
+
# def on_menu_popup_next_placement(self, element):
|
647
|
+
# def routine(event=None):
|
648
|
+
# spooler = element[0]
|
649
|
+
# job = element[1]
|
650
|
+
# if hasattr(job, "jump_to_next"):
|
651
|
+
# job.jump_to_next()
|
652
|
+
# self.refresh_spooler_list()
|
653
|
+
|
654
|
+
# return routine
|
655
|
+
|
656
|
+
def on_menu_popup_stop_loop(self, element):
|
657
|
+
def routine(event=None):
|
658
|
+
spooler = element[0]
|
659
|
+
job = element[1]
|
660
|
+
if hasattr(job, "stop_after_loop"):
|
661
|
+
job.stop_after_loop()
|
662
|
+
self.refresh_spooler_list()
|
663
|
+
|
664
|
+
return routine
|
665
|
+
|
666
|
+
def on_menu_popup_add_loop(self, element):
|
667
|
+
def routine(event=None):
|
668
|
+
spooler = element[0]
|
669
|
+
job = element[1]
|
670
|
+
if hasattr(job, "add_another_loop"):
|
671
|
+
job.add_another_loop()
|
672
|
+
self.refresh_spooler_list()
|
673
|
+
|
674
|
+
return routine
|
675
|
+
|
676
|
+
def pane_show(self, *args):
|
677
|
+
self.shown = True
|
678
|
+
self.context.schedule(self.timerjob)
|
679
|
+
self.refresh_spooler_list()
|
680
|
+
|
681
|
+
def pane_hide(self, *args):
|
682
|
+
self.context.unschedule(self.timerjob)
|
683
|
+
self.shown = False
|
684
|
+
|
685
|
+
@staticmethod
|
686
|
+
def _name_str(named_obj):
|
687
|
+
try:
|
688
|
+
return named_obj.__name__
|
689
|
+
except AttributeError:
|
690
|
+
return str(named_obj)
|
691
|
+
|
692
|
+
def refresh_spooler_list(self):
|
693
|
+
if not self.update_spooler:
|
694
|
+
return
|
695
|
+
try:
|
696
|
+
self.list_job_spool.DeleteAllItems()
|
697
|
+
except RuntimeError:
|
698
|
+
return
|
699
|
+
self.queue_entries = []
|
700
|
+
queue_idx = -1
|
701
|
+
for device in self.available_devices:
|
702
|
+
spooler = device.spooler
|
703
|
+
if spooler is None:
|
704
|
+
continue
|
705
|
+
if self.filter_device is not None and self.filter_device != device.label:
|
706
|
+
continue
|
707
|
+
for idx, e in enumerate(spooler.queue):
|
708
|
+
self.queue_entries.append([spooler, idx])
|
709
|
+
queue_idx += 1
|
710
|
+
# Idx, Status, Type, Passes, Priority, Runtime, Estimate
|
711
|
+
m = self.list_job_spool.InsertItem(idx, f"#{idx}")
|
712
|
+
list_id = m
|
713
|
+
spool_obj = e
|
714
|
+
|
715
|
+
if list_id != -1:
|
716
|
+
self.list_job_spool.SetItemData(list_id, queue_idx)
|
717
|
+
# DEVICE
|
718
|
+
self.list_job_spool.SetItem(list_id, JC_DEVICE, device.label)
|
719
|
+
# Jobname
|
720
|
+
to_display = ""
|
721
|
+
if hasattr(spool_obj, "label"):
|
722
|
+
to_display = spool_obj.label
|
723
|
+
if to_display is None:
|
724
|
+
to_display = ""
|
725
|
+
if to_display == "":
|
726
|
+
to_display = SpoolerPanel._name_str(spool_obj)
|
727
|
+
if to_display.endswith(" items"):
|
728
|
+
# Look for last ':' and remove everything from there
|
729
|
+
cpos = -1
|
730
|
+
lpos = -1
|
731
|
+
while True:
|
732
|
+
lpos = to_display.find(":", lpos + 1)
|
733
|
+
if lpos == -1:
|
734
|
+
break
|
735
|
+
cpos = lpos
|
736
|
+
if cpos > 0:
|
737
|
+
to_display = to_display[:cpos]
|
738
|
+
|
739
|
+
self.list_job_spool.SetItem(list_id, JC_JOBNAME, to_display)
|
740
|
+
# Entries
|
741
|
+
joblen = 1
|
742
|
+
try:
|
743
|
+
if hasattr(spool_obj, "items"):
|
744
|
+
joblen = len(spool_obj.items)
|
745
|
+
elif hasattr(spool_obj, "elements"):
|
746
|
+
joblen = len(spool_obj.elements)
|
747
|
+
except AttributeError:
|
748
|
+
joblen = 1
|
749
|
+
self.list_job_spool.SetItem(list_id, JC_ENTRIES, str(joblen))
|
750
|
+
# STATUS
|
751
|
+
self.list_job_spool.SetItem(
|
752
|
+
list_id, JC_STATUS, str(spool_obj.status)
|
753
|
+
)
|
754
|
+
|
755
|
+
# TYPE
|
756
|
+
try:
|
757
|
+
self.list_job_spool.SetItem(
|
758
|
+
list_id,
|
759
|
+
JC_TYPE,
|
760
|
+
str(spool_obj.__class__.__name__),
|
761
|
+
)
|
762
|
+
except AttributeError:
|
763
|
+
pass
|
764
|
+
|
765
|
+
# STEPS
|
766
|
+
try:
|
767
|
+
if spool_obj.steps_total == 0:
|
768
|
+
spool_obj.calc_steps()
|
769
|
+
info_s = f"{spool_obj.steps_done}/{spool_obj.steps_total}"
|
770
|
+
if hasattr(spooler, "driver"):
|
771
|
+
if hasattr(spooler.driver, "get_internal_queue_status"):
|
772
|
+
internal_current, internal_total = spooler.driver.get_internal_queue_status()
|
773
|
+
if internal_current != 0:
|
774
|
+
info_s += f" ({internal_current}/{internal_total})"
|
775
|
+
except AttributeError:
|
776
|
+
info_s = "-"
|
777
|
+
self.list_job_spool.SetItem(list_id, JC_STEPS, info_s)
|
778
|
+
# PASSES
|
779
|
+
try:
|
780
|
+
loop = spool_obj.loops_executed
|
781
|
+
total = spool_obj.loops
|
782
|
+
# No invalid values please
|
783
|
+
if loop is None:
|
784
|
+
loop = 0
|
785
|
+
if total is None:
|
786
|
+
total = 1
|
787
|
+
|
788
|
+
if isinf(total):
|
789
|
+
total = "∞"
|
790
|
+
self.list_job_spool.SetItem(
|
791
|
+
list_id, JC_PASSES, f"{loop}/{total}"
|
792
|
+
)
|
793
|
+
except AttributeError:
|
794
|
+
self.list_job_spool.SetItem(list_id, JC_PASSES, "-")
|
795
|
+
|
796
|
+
# Priority
|
797
|
+
try:
|
798
|
+
self.list_job_spool.SetItem(
|
799
|
+
list_id,
|
800
|
+
JC_PRIORITY,
|
801
|
+
str(spool_obj.priority),
|
802
|
+
)
|
803
|
+
except AttributeError:
|
804
|
+
self.list_job_spool.SetItem(list_id, JC_PRIORITY, "-")
|
805
|
+
|
806
|
+
# Runtime
|
807
|
+
try:
|
808
|
+
t = spool_obj.elapsed_time()
|
809
|
+
hours, remainder = divmod(t, 3600)
|
810
|
+
minutes, seconds = divmod(remainder, 60)
|
811
|
+
runtime = f"{int(hours)}:{str(int(minutes)).zfill(2)}:{str(int(seconds)).zfill(2)}"
|
812
|
+
self.list_job_spool.SetItem(list_id, JC_RUNTIME, runtime)
|
813
|
+
except AttributeError:
|
814
|
+
self.list_job_spool.SetItem(list_id, JC_RUNTIME, "-")
|
815
|
+
|
816
|
+
# Estimate Time
|
817
|
+
try:
|
818
|
+
t = spool_obj.estimate_time()
|
819
|
+
if isinf(t):
|
820
|
+
runtime = "∞"
|
821
|
+
else:
|
822
|
+
hours, remainder = divmod(t, 3600)
|
823
|
+
minutes, seconds = divmod(remainder, 60)
|
824
|
+
runtime = f"{int(hours)}:{str(int(minutes)).zfill(2)}:{str(int(seconds)).zfill(2)}"
|
825
|
+
self.list_job_spool.SetItem(list_id, JC_ESTIMATE, runtime)
|
826
|
+
except AttributeError:
|
827
|
+
self.list_job_spool.SetItem(list_id, JC_ESTIMATE, "-")
|
828
|
+
self._last_invokation = time.time()
|
829
|
+
|
830
|
+
@staticmethod
|
831
|
+
def timestr(t, oneday):
|
832
|
+
if t is None:
|
833
|
+
return ""
|
834
|
+
if isinstance(t, str):
|
835
|
+
return t
|
836
|
+
if isinf(t) or isnan(t) or t < 0:
|
837
|
+
return "∞"
|
838
|
+
|
839
|
+
if oneday:
|
840
|
+
localt = time.localtime(t)
|
841
|
+
hours = localt[3]
|
842
|
+
minutes = localt[4]
|
843
|
+
seconds = localt[5]
|
844
|
+
else:
|
845
|
+
hours, remainder = divmod(t, 3600)
|
846
|
+
minutes, seconds = divmod(remainder, 60)
|
847
|
+
# Military time display
|
848
|
+
result = (
|
849
|
+
f"{int(hours)}:{str(int(minutes)).zfill(2)}:{str(int(seconds)).zfill(2)}"
|
850
|
+
)
|
851
|
+
return result
|
852
|
+
|
853
|
+
@staticmethod
|
854
|
+
def datestr(t):
|
855
|
+
if t is None:
|
856
|
+
return ""
|
857
|
+
if isinstance(t, str):
|
858
|
+
return t
|
859
|
+
localt = time.localtime(t)
|
860
|
+
lyear = localt[0]
|
861
|
+
syear = lyear % 100
|
862
|
+
lmonth = int(localt[1])
|
863
|
+
lday = localt[2]
|
864
|
+
lhour = localt[3]
|
865
|
+
lminute = localt[4]
|
866
|
+
lsecond = localt[5]
|
867
|
+
# wx.DateTime has a bug: it does always provide the dateformat
|
868
|
+
# string with a month representation one number too high, so
|
869
|
+
# wx.DateTime(31,01,1999)
|
870
|
+
# Arbitrary but with different figures
|
871
|
+
# Alas this is the only simple method to get locale relevant dateformat...
|
872
|
+
pattern = None
|
873
|
+
try:
|
874
|
+
loc = wx.Locale()
|
875
|
+
pattern = loc.GetOSInfo(wx.LOCALE_SHORT_DATE_FMT, wx.LOCALE_CAT_DEFAULT)
|
876
|
+
except AttributeError:
|
877
|
+
# That's not available, so we use the other algorithm instead...
|
878
|
+
pass
|
879
|
+
if pattern is not None:
|
880
|
+
pattern = pattern.replace("%d", "{dd}")
|
881
|
+
pattern = pattern.replace("%m", "{mm}")
|
882
|
+
pattern = pattern.replace("%y", "{y}")
|
883
|
+
pattern = pattern.replace("%Y", "{yy}")
|
884
|
+
if pattern is None:
|
885
|
+
wxdt = wx.DateTime(31, 7, 2022)
|
886
|
+
pattern = wxdt.FormatDate()
|
887
|
+
pattern = pattern.replace("2022", "{yy}")
|
888
|
+
pattern = pattern.replace("22", "{y}")
|
889
|
+
pattern = pattern.replace("31", "{dd}")
|
890
|
+
# That would be the right thing, so if the bug is ever fixed, that will work
|
891
|
+
pattern = pattern.replace("07", "{mm}")
|
892
|
+
pattern = pattern.replace("7", "{mm}")
|
893
|
+
# And this is needed to deal with the bug...
|
894
|
+
pattern = pattern.replace("08", "{mm}")
|
895
|
+
pattern = pattern.replace("8", "{mm}")
|
896
|
+
# Deal with years seperately
|
897
|
+
pattern = pattern.replace("{y}", str(syear).zfill(2))
|
898
|
+
pattern = pattern.replace("{yy}", str(lyear).zfill(2))
|
899
|
+
result = pattern.format(
|
900
|
+
dd=str(lday).zfill(2),
|
901
|
+
mm=str(lmonth).zfill(2),
|
902
|
+
)
|
903
|
+
# Just to show the bug...
|
904
|
+
# result1 = f"{int(lday)}.{str(int(lmonth)).zfill(2)}.{str(int(lyear)).zfill(2)}"
|
905
|
+
# wxdt = wx.DateTime(lday, lmonth, lyear, lhour, lminute, lsecond)
|
906
|
+
# result2 = wxdt.FormatDate()
|
907
|
+
# print(f"res={result}, wxd={result2}, manual={result1}, pattern={pattern}")
|
908
|
+
return result
|
909
|
+
|
910
|
+
def refresh_history(self):
|
911
|
+
self.list_job_history.DeleteAllItems()
|
912
|
+
self.map_item_key.clear()
|
913
|
+
if self.filter_device:
|
914
|
+
if self.context.spool_ignore_helper_jobs:
|
915
|
+
events = self.context.logging.matching_events(
|
916
|
+
"job", device=self.filter_device, important=True
|
917
|
+
)
|
918
|
+
else:
|
919
|
+
events = self.context.logging.matching_events(
|
920
|
+
"job", device=self.filter_device
|
921
|
+
)
|
922
|
+
|
923
|
+
else:
|
924
|
+
if self.context.spool_ignore_helper_jobs:
|
925
|
+
events = self.context.logging.matching_events("job", important=True)
|
926
|
+
else:
|
927
|
+
events = self.context.logging.matching_events("job")
|
928
|
+
has_data = False
|
929
|
+
for idx, event_and_key in enumerate(reversed(list(events))):
|
930
|
+
has_data = True
|
931
|
+
key, info = event_and_key
|
932
|
+
list_id = self.list_job_history.InsertItem(
|
933
|
+
self.list_job_history.GetItemCount(), f"#{idx}"
|
934
|
+
)
|
935
|
+
self.map_item_key[list_id] = key
|
936
|
+
start_time = info.get("start_time", 0)
|
937
|
+
if start_time is None:
|
938
|
+
start_time = 0
|
939
|
+
duration = info.get("duration", 0)
|
940
|
+
if duration is None:
|
941
|
+
duration = 0
|
942
|
+
self.list_job_history.SetItem(list_id, HC_JOBNAME, str(info.get("label")))
|
943
|
+
self.list_job_history.SetItem(
|
944
|
+
list_id,
|
945
|
+
HC_START,
|
946
|
+
f"{self.datestr(start_time)} {self.timestr(start_time, True)}",
|
947
|
+
)
|
948
|
+
|
949
|
+
self.list_job_history.SetItem(
|
950
|
+
list_id,
|
951
|
+
HC_END,
|
952
|
+
self.timestr(start_time + duration, True),
|
953
|
+
)
|
954
|
+
self.list_job_history.SetItem(
|
955
|
+
list_id,
|
956
|
+
HC_RUNTIME,
|
957
|
+
self.timestr(duration, False),
|
958
|
+
)
|
959
|
+
nr_loop = info.get("loop")
|
960
|
+
nr_total = info.get("total")
|
961
|
+
if nr_total is None:
|
962
|
+
if nr_loop is None:
|
963
|
+
passes_str = "n/a"
|
964
|
+
else:
|
965
|
+
passes_str = f"{nr_loop}"
|
966
|
+
elif isinf(float(nr_total)):
|
967
|
+
passes_str = f"{nr_loop}/∞"
|
968
|
+
else:
|
969
|
+
passes_str = f"{nr_loop}/{nr_total}"
|
970
|
+
self.list_job_history.SetItem(
|
971
|
+
list_id,
|
972
|
+
HC_PASSES,
|
973
|
+
passes_str,
|
974
|
+
)
|
975
|
+
self.list_job_history.SetItem(list_id, HC_DEVICE, str(info.get("device")))
|
976
|
+
self.list_job_history.SetItem(
|
977
|
+
list_id, HC_STATUS, str(info.get("status", ""))
|
978
|
+
)
|
979
|
+
self.list_job_history.SetItem(
|
980
|
+
list_id, HC_JOBINFO, str(info.get("info", ""))
|
981
|
+
)
|
982
|
+
self.list_job_history.SetItem(
|
983
|
+
list_id,
|
984
|
+
HC_ESTIMATE,
|
985
|
+
self.timestr(info.get("estimate", 0), False),
|
986
|
+
)
|
987
|
+
self.list_job_history.SetItem(
|
988
|
+
list_id,
|
989
|
+
HC_STEPS,
|
990
|
+
f"{info.get('steps_done',0)}/{info.get('steps_total',0)}",
|
991
|
+
)
|
992
|
+
self.list_job_history.SetItemData(list_id, idx)
|
993
|
+
if has_data:
|
994
|
+
self.list_job_history.Select(0)
|
995
|
+
|
996
|
+
def before_history_update(self, event):
|
997
|
+
list_id = event.GetIndex() # Get the current row
|
998
|
+
col_id = event.GetColumn() # Get the current column
|
999
|
+
if col_id == HC_JOBINFO:
|
1000
|
+
event.Allow()
|
1001
|
+
else:
|
1002
|
+
event.Veto()
|
1003
|
+
|
1004
|
+
def on_history_update(self, event):
|
1005
|
+
list_id = event.GetIndex() # Get the current row
|
1006
|
+
col_id = event.GetColumn() # Get the current column
|
1007
|
+
new_data = event.GetLabel() # Get the changed data
|
1008
|
+
if list_id >= 0 and col_id == HC_JOBINFO:
|
1009
|
+
idx = self.list_job_history.GetItemData(list_id)
|
1010
|
+
key = self.map_item_key[idx]
|
1011
|
+
self.context.logging.logs[key]["info"] = new_data
|
1012
|
+
|
1013
|
+
# Set the new data in the listctrl
|
1014
|
+
self.list_job_history.SetItem(list_id, col_id, new_data)
|
1015
|
+
|
1016
|
+
def set_pause_color(self):
|
1017
|
+
new_bg_color = None
|
1018
|
+
new_fg_color = None
|
1019
|
+
new_caption = _("Pause")
|
1020
|
+
try:
|
1021
|
+
if self.context.device.driver.paused:
|
1022
|
+
new_bg_color = self.context.themes.get("pause_bg")
|
1023
|
+
new_fg_color = self.context.themes.get("pause_fg")
|
1024
|
+
new_caption = _("Resume")
|
1025
|
+
except AttributeError:
|
1026
|
+
pass
|
1027
|
+
self.button_pause.SetBackgroundColour(new_bg_color)
|
1028
|
+
self.button_pause.SetForegroundColour(new_fg_color)
|
1029
|
+
self.button_pause.SetLabelText(new_caption)
|
1030
|
+
|
1031
|
+
@signal_listener("pause")
|
1032
|
+
def on_device_pause_toggle(self, origin, *args):
|
1033
|
+
self.set_pause_color()
|
1034
|
+
|
1035
|
+
@signal_listener("activate;device")
|
1036
|
+
def on_activate_device(self, origin, device):
|
1037
|
+
self.available_devices = self.context.kernel.services("device")
|
1038
|
+
self.selected_device = self.context.device
|
1039
|
+
index = -1
|
1040
|
+
for i, s in enumerate(self.available_devices):
|
1041
|
+
if s is self.selected_device:
|
1042
|
+
index = i + 1
|
1043
|
+
break
|
1044
|
+
spools = [s.label for s in self.available_devices]
|
1045
|
+
spools.insert(0, _("-- All available devices --"))
|
1046
|
+
# This might not be relevant if you have a stable device set, but there might always be
|
1047
|
+
# changes to add / rename devices etc.
|
1048
|
+
if self.combo_device.GetSelection() == 0:
|
1049
|
+
# all-devices is a superset of any device, so we can leave it...
|
1050
|
+
index = 0
|
1051
|
+
self.combo_device.Clear()
|
1052
|
+
self.combo_device.SetItems(spools)
|
1053
|
+
self.combo_device.SetSelection(index)
|
1054
|
+
self.on_combo_device(None)
|
1055
|
+
self.set_pause_color()
|
1056
|
+
|
1057
|
+
@signal_listener("spooler;completed")
|
1058
|
+
def on_spooler_completed(self, origin, *args):
|
1059
|
+
self.refresh_history()
|
1060
|
+
|
1061
|
+
@signal_listener("spooler;queue")
|
1062
|
+
@signal_listener("spooler;idle")
|
1063
|
+
@signal_listener("spooler;realtime")
|
1064
|
+
def on_spooler_update(self, origin, value, *args, **kwargs):
|
1065
|
+
self.update_spooler = True
|
1066
|
+
self.refresh_spooler_list()
|
1067
|
+
|
1068
|
+
@signal_listener("driver;position")
|
1069
|
+
@signal_listener("emulator;position")
|
1070
|
+
@signal_listener("pipe;usb_status")
|
1071
|
+
def on_device_update(self, origin, *args):
|
1072
|
+
doit = True
|
1073
|
+
with self.update_lock:
|
1074
|
+
# Only update every 2 seconds or so
|
1075
|
+
dtime = time.time()
|
1076
|
+
if dtime - self._last_invokation < 2:
|
1077
|
+
doit = False
|
1078
|
+
else:
|
1079
|
+
self._last_invokation = dtime
|
1080
|
+
if not doit:
|
1081
|
+
return
|
1082
|
+
|
1083
|
+
# Two things (at least) could go wrong:
|
1084
|
+
# 1) You are in the wrong queue, i.e. there's a job running in the background a
|
1085
|
+
# that provides an update but the user has changed the device so a different
|
1086
|
+
# queue is selected
|
1087
|
+
# 2) As this is a signal it may come later, i.e. the job has already finished
|
1088
|
+
#
|
1089
|
+
# The checks here are rather basic and need to be revisited
|
1090
|
+
refresh_needed = False
|
1091
|
+
try:
|
1092
|
+
listctrl = self.list_job_spool
|
1093
|
+
except RuntimeError:
|
1094
|
+
return
|
1095
|
+
for list_id, entry in enumerate(self.queue_entries):
|
1096
|
+
spooler = entry[0]
|
1097
|
+
qindex = entry[1]
|
1098
|
+
if qindex >= len(spooler.queue):
|
1099
|
+
# This item is nowhere to be found
|
1100
|
+
refresh_needed = True
|
1101
|
+
continue
|
1102
|
+
spool_obj = spooler.queue[qindex]
|
1103
|
+
try:
|
1104
|
+
t = spool_obj.elapsed_time()
|
1105
|
+
hours, remainder = divmod(t, 3600)
|
1106
|
+
minutes, seconds = divmod(remainder, 60)
|
1107
|
+
runtime = f"{int(hours)}:{str(int(minutes)).zfill(2)}:{str(int(seconds)).zfill(2)}"
|
1108
|
+
if list_id < self.list_job_spool.GetItemCount():
|
1109
|
+
self.list_job_spool.SetItem(list_id, JC_RUNTIME, runtime)
|
1110
|
+
except (AttributeError, AssertionError):
|
1111
|
+
if list_id < self.list_job_spool.GetItemCount():
|
1112
|
+
self.list_job_spool.SetItem(list_id, JC_RUNTIME, "-")
|
1113
|
+
else:
|
1114
|
+
refresh_needed = True
|
1115
|
+
except RuntimeError:
|
1116
|
+
# Form no longer valid
|
1117
|
+
return
|
1118
|
+
|
1119
|
+
try:
|
1120
|
+
if spool_obj.steps_total == 0:
|
1121
|
+
spool_obj.calc_steps()
|
1122
|
+
info_s = f"{spool_obj.steps_done}/{spool_obj.steps_total}"
|
1123
|
+
if hasattr(spooler, "driver"):
|
1124
|
+
if hasattr(spooler.driver, "get_internal_queue_status"):
|
1125
|
+
internal_current, internal_total = spooler.driver.get_internal_queue_status()
|
1126
|
+
if internal_current != 0:
|
1127
|
+
info_s += f" ({internal_current}/{internal_total})"
|
1128
|
+
except AttributeError:
|
1129
|
+
info_s = "-"
|
1130
|
+
if list_id >= self.list_job_spool.GetItemCount():
|
1131
|
+
refresh_needed = True
|
1132
|
+
|
1133
|
+
self.list_job_spool.SetItem(list_id, JC_STEPS, info_s)
|
1134
|
+
try:
|
1135
|
+
loop = spool_obj.loops_executed
|
1136
|
+
total = spool_obj.loops
|
1137
|
+
|
1138
|
+
if isinf(total):
|
1139
|
+
total = "∞"
|
1140
|
+
pass_str = f"{loop}/{total}"
|
1141
|
+
self.list_job_spool.SetItem(list_id, JC_PASSES, pass_str)
|
1142
|
+
except AttributeError:
|
1143
|
+
if list_id < self.list_job_spool.GetItemCount():
|
1144
|
+
self.list_job_spool.SetItem(list_id, JC_PASSES, "-")
|
1145
|
+
else:
|
1146
|
+
refresh_needed = True
|
1147
|
+
|
1148
|
+
# Estimate Time
|
1149
|
+
try:
|
1150
|
+
t = spool_obj.estimate_time()
|
1151
|
+
if isinf(t):
|
1152
|
+
runtime = "∞"
|
1153
|
+
else:
|
1154
|
+
hours, remainder = divmod(t, 3600)
|
1155
|
+
minutes, seconds = divmod(remainder, 60)
|
1156
|
+
runtime = f"{int(hours)}:{str(int(minutes)).zfill(2)}:{str(int(seconds)).zfill(2)}"
|
1157
|
+
|
1158
|
+
if list_id < self.list_job_spool.GetItemCount():
|
1159
|
+
self.list_job_spool.SetItem(list_id, JC_ESTIMATE, runtime)
|
1160
|
+
except (AttributeError, AssertionError):
|
1161
|
+
if list_id < self.list_job_spool.GetItemCount():
|
1162
|
+
self.list_job_spool.SetItem(list_id, JC_ESTIMATE, "-")
|
1163
|
+
else:
|
1164
|
+
refresh_needed = True
|
1165
|
+
if refresh_needed:
|
1166
|
+
self.refresh_spooler_list()
|
1167
|
+
self.refresh_history()
|
1168
|
+
|
1169
|
+
def update_queue(self):
|
1170
|
+
if self.shown:
|
1171
|
+
self.on_device_update(None)
|
1172
|
+
|
1173
|
+
def pane_show(self):
|
1174
|
+
self.list_job_history.load_column_widths()
|
1175
|
+
self.list_job_spool.load_column_widths()
|
1176
|
+
|
1177
|
+
def pane_hide(self):
|
1178
|
+
self.list_job_history.save_column_widths()
|
1179
|
+
self.list_job_spool.save_column_widths()
|
1180
|
+
|
1181
|
+
|
1182
|
+
class JobSpooler(MWindow):
|
1183
|
+
def __init__(self, *args, **kwds):
|
1184
|
+
super().__init__(600, 400, *args, **kwds)
|
1185
|
+
selected_device = None
|
1186
|
+
if len(args) >= 4 and args[3]:
|
1187
|
+
selected_device = args[3]
|
1188
|
+
self.panel = SpoolerPanel(
|
1189
|
+
self, wx.ID_ANY, context=self.context, selected_device=selected_device
|
1190
|
+
)
|
1191
|
+
self.sizer.Add(self.panel, 1, wx.EXPAND, 0)
|
1192
|
+
self.add_module_delegate(self.panel)
|
1193
|
+
_icon = wx.NullIcon
|
1194
|
+
_icon.CopyFromBitmap(icons8_route.GetBitmap())
|
1195
|
+
self.SetIcon(_icon)
|
1196
|
+
self.SetTitle(_("Job Spooler"))
|
1197
|
+
self.Layout()
|
1198
|
+
self.restore_aspect(honor_initial_values=True)
|
1199
|
+
|
1200
|
+
@staticmethod
|
1201
|
+
def sub_register(kernel):
|
1202
|
+
kernel.register("wxpane/JobSpooler", register_panel_spooler)
|
1203
|
+
kernel.register(
|
1204
|
+
"button/control/Spooler",
|
1205
|
+
{
|
1206
|
+
"label": _("Spooler"),
|
1207
|
+
"icon": icons8_route,
|
1208
|
+
"tip": _("Opens Spooler Window"),
|
1209
|
+
"help": "spooler",
|
1210
|
+
"action": lambda v: kernel.console("window toggle JobSpooler\n"),
|
1211
|
+
"priority": -1,
|
1212
|
+
},
|
1213
|
+
)
|
1214
|
+
|
1215
|
+
def window_open(self):
|
1216
|
+
self.panel.pane_show()
|
1217
|
+
|
1218
|
+
def window_close(self):
|
1219
|
+
self.panel.pane_hide()
|
1220
|
+
|
1221
|
+
@staticmethod
|
1222
|
+
def submenu():
|
1223
|
+
return "Burning", "Spooler"
|
1224
|
+
|
1225
|
+
@staticmethod
|
1226
|
+
def helptext():
|
1227
|
+
return _("Opens the spooler window with all job information")
|