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/gui/preferences.py
CHANGED
@@ -1,650 +1,901 @@
|
|
1
|
-
#
|
2
|
-
# generated by wxGlade 0.9.3 on Thu Jun 27 21:45:40 2019
|
3
|
-
#
|
4
|
-
import platform
|
5
|
-
|
6
|
-
import wx
|
7
|
-
|
8
|
-
from meerk40t.kernel.kernel import signal_listener
|
9
|
-
|
10
|
-
from .choicepropertypanel import ChoicePropertyPanel
|
11
|
-
from .icons import icons8_administrative_tools
|
12
|
-
from .mwindow import MWindow
|
13
|
-
from .wxmribbon import RibbonEditor
|
14
|
-
from .wxutils import
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
self.radio_units
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
self.radio_units.
|
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
|
-
p
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
p
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
self.
|
109
|
-
|
110
|
-
)
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
self.
|
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
|
-
self.
|
151
|
-
self.
|
152
|
-
|
153
|
-
self
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
self.
|
161
|
-
self.
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
self.
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
)
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
_(
|
184
|
-
"
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
self
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
self.
|
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
|
-
self.Bind(wx.
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
wx.
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
)
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
#
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
)
|
384
|
-
self.
|
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
|
-
|
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
|
-
self.
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
self.
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
)
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
self
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
)
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
1
|
+
#
|
2
|
+
# generated by wxGlade 0.9.3 on Thu Jun 27 21:45:40 2019
|
3
|
+
#
|
4
|
+
import platform
|
5
|
+
|
6
|
+
import wx
|
7
|
+
|
8
|
+
from meerk40t.kernel.kernel import signal_listener
|
9
|
+
|
10
|
+
from .choicepropertypanel import ChoicePropertyPanel
|
11
|
+
from .icons import icons8_administrative_tools
|
12
|
+
from .mwindow import MWindow
|
13
|
+
from .wxmribbon import RibbonEditor
|
14
|
+
from .wxutils import (
|
15
|
+
StaticBoxSizer,
|
16
|
+
TextCtrl,
|
17
|
+
dip_size,
|
18
|
+
wxButton,
|
19
|
+
wxComboBox,
|
20
|
+
wxRadioBox,
|
21
|
+
)
|
22
|
+
|
23
|
+
_ = wx.GetTranslation
|
24
|
+
|
25
|
+
|
26
|
+
class PreferencesUnitsPanel(wx.Panel):
|
27
|
+
def __init__(self, *args, context=None, **kwds):
|
28
|
+
# begin wxGlade: PreferencesUnitsPanel.__init__
|
29
|
+
kwds["style"] = kwds.get("style", 0)
|
30
|
+
wx.Panel.__init__(self, *args, **kwds)
|
31
|
+
self.context = context
|
32
|
+
self.context.themes.set_window_colors(self)
|
33
|
+
|
34
|
+
sizer_1 = wx.BoxSizer(wx.HORIZONTAL)
|
35
|
+
|
36
|
+
self.radio_units = wxRadioBox(
|
37
|
+
self,
|
38
|
+
wx.ID_ANY,
|
39
|
+
_("Units"),
|
40
|
+
choices=["mm", "cm", "inch", "mils"],
|
41
|
+
majorDimension=1,
|
42
|
+
style=wx.RA_SPECIFY_ROWS,
|
43
|
+
)
|
44
|
+
self.radio_units.SetToolTip(_("Set default units for guides"))
|
45
|
+
sizer_1.Add(self.radio_units, 0, wx.EXPAND, 0)
|
46
|
+
|
47
|
+
self.SetSizer(sizer_1)
|
48
|
+
|
49
|
+
self.Layout()
|
50
|
+
|
51
|
+
self.Bind(wx.EVT_RADIOBOX, self.on_radio_units, self.radio_units)
|
52
|
+
|
53
|
+
self.radio_units.SetSelection(self._get_units_index())
|
54
|
+
|
55
|
+
def on_radio_units(self, event):
|
56
|
+
if event.Int == 0:
|
57
|
+
self.set_mm()
|
58
|
+
elif event.Int == 1:
|
59
|
+
self.set_cm()
|
60
|
+
elif event.Int == 2:
|
61
|
+
self.set_inch()
|
62
|
+
elif event.Int == 3:
|
63
|
+
self.set_mil()
|
64
|
+
|
65
|
+
def _get_units_index(self):
|
66
|
+
p = self.context.root
|
67
|
+
units = p.units_name
|
68
|
+
if units == "mm":
|
69
|
+
return 0
|
70
|
+
if units == "cm":
|
71
|
+
return 1
|
72
|
+
if units in ("in", "inch", "inches"):
|
73
|
+
return 2
|
74
|
+
if units == "mil":
|
75
|
+
return 3
|
76
|
+
return 0
|
77
|
+
|
78
|
+
def set_inch(self):
|
79
|
+
p = self.context.root
|
80
|
+
p.units_name = "inch"
|
81
|
+
p.signal("units", p.units_name)
|
82
|
+
|
83
|
+
def set_mil(self):
|
84
|
+
p = self.context.root
|
85
|
+
p.units_name = "mil"
|
86
|
+
p.signal("units", p.units_name)
|
87
|
+
|
88
|
+
def set_cm(self):
|
89
|
+
p = self.context.root
|
90
|
+
p.units_name = "cm"
|
91
|
+
p.signal("units", p.units_name)
|
92
|
+
|
93
|
+
def set_mm(self):
|
94
|
+
p = self.context.root
|
95
|
+
p.units_name = "mm"
|
96
|
+
p.signal("units", p.units_name)
|
97
|
+
|
98
|
+
|
99
|
+
# end of class PreferencesUnitsPanel
|
100
|
+
|
101
|
+
|
102
|
+
class PreferencesLanguagePanel(wx.Panel):
|
103
|
+
def __init__(self, *args, context=None, **kwds):
|
104
|
+
# begin wxGlade: PreferencesLanguagePanel.__init__
|
105
|
+
kwds["style"] = kwds.get("style", 0)
|
106
|
+
wx.Panel.__init__(self, *args, **kwds)
|
107
|
+
self.context = context
|
108
|
+
self.context.themes.set_window_colors(self)
|
109
|
+
|
110
|
+
sizer_2 = StaticBoxSizer(self, wx.ID_ANY, _("Language"), wx.HORIZONTAL)
|
111
|
+
from .wxmeerk40t import supported_languages
|
112
|
+
|
113
|
+
choices = [
|
114
|
+
language_name
|
115
|
+
for language_code, language_name, language_index in supported_languages
|
116
|
+
]
|
117
|
+
self.combo_language = wxComboBox(
|
118
|
+
self, wx.ID_ANY, choices=choices, style=wx.CB_READONLY
|
119
|
+
)
|
120
|
+
self.combo_language.SetToolTip(
|
121
|
+
_("Select the desired language to use (requires a restart to take effect).")
|
122
|
+
)
|
123
|
+
sizer_2.Add(self.combo_language, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
124
|
+
|
125
|
+
self.SetSizer(sizer_2)
|
126
|
+
|
127
|
+
self.Layout()
|
128
|
+
|
129
|
+
self.context.setting(int, "language", 0)
|
130
|
+
|
131
|
+
self.Bind(wx.EVT_COMBOBOX, self.on_combo_language, self.combo_language)
|
132
|
+
# end wxGlade
|
133
|
+
self.combo_language.SetSelection(self.context.language)
|
134
|
+
|
135
|
+
def on_combo_language(self, event=None):
|
136
|
+
lang = self.combo_language.GetSelection()
|
137
|
+
if lang != -1 and self.context.app is not None:
|
138
|
+
self.context.app.update_language(lang)
|
139
|
+
self.context.signal("restart")
|
140
|
+
|
141
|
+
|
142
|
+
# end of class PreferencesLanguagePanel
|
143
|
+
|
144
|
+
|
145
|
+
class PreferencesSavingPanel(wx.Panel):
|
146
|
+
def __init__(self, *args, context=None, **kwds):
|
147
|
+
# begin wxGlade: PreferencesLanguagePanel.__init__
|
148
|
+
kwds["style"] = kwds.get("style", 0)
|
149
|
+
wx.Panel.__init__(self, *args, **kwds)
|
150
|
+
self.context = context
|
151
|
+
self.context.themes.set_window_colors(self)
|
152
|
+
|
153
|
+
main_sizer = StaticBoxSizer(self, wx.ID_ANY, _("Management"), wx.HORIZONTAL)
|
154
|
+
self.button_save = wxButton(self, wx.ID_ANY, _("Save"))
|
155
|
+
self.button_save.SetToolTip(_("Immediately save the settings to disk"))
|
156
|
+
self.button_export = wxButton(self, wx.ID_ANY, _("Export"))
|
157
|
+
self.button_export.SetToolTip(
|
158
|
+
_("Export the current settings to a different location")
|
159
|
+
)
|
160
|
+
self.button_import = wxButton(self, wx.ID_ANY, _("Import"))
|
161
|
+
self.button_import.SetToolTip(_("Import a previously saved setting file"))
|
162
|
+
main_sizer.Add(self.button_save, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
163
|
+
self.Bind(wx.EVT_BUTTON, self.on_button_save, self.button_save)
|
164
|
+
main_sizer.AddStretchSpacer(1)
|
165
|
+
main_sizer.Add(self.button_export, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
166
|
+
main_sizer.Add(self.button_import, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
167
|
+
|
168
|
+
self.SetSizer(main_sizer)
|
169
|
+
self.Layout()
|
170
|
+
self.Bind(wx.EVT_BUTTON, self.on_button_save, self.button_save)
|
171
|
+
self.Bind(wx.EVT_BUTTON, self.on_button_import, self.button_import)
|
172
|
+
self.Bind(wx.EVT_BUTTON, self.on_button_export, self.button_export)
|
173
|
+
|
174
|
+
self.Bind(wx.EVT_RIGHT_DOWN, self.pane_right_click, self)
|
175
|
+
self.Bind(wx.EVT_RIGHT_DOWN, self.pane_right_click, self.button_save)
|
176
|
+
|
177
|
+
def save_config_and_prevent_further_writing(self):
|
178
|
+
self.context.kernel.prevent_persisting = False
|
179
|
+
self.context.kernel.write_configuration()
|
180
|
+
self.context.kernel.prevent_persisting = True
|
181
|
+
self.context.signal("restart")
|
182
|
+
wx.MessageBox(
|
183
|
+
message=_(
|
184
|
+
"The modified configuration has been saved.\n"
|
185
|
+
+ "Please note further changes to your configuration will not be saved until the end of the program.\n"
|
186
|
+
+ "So please exit MeerK40t as soon as possible."
|
187
|
+
),
|
188
|
+
caption=_("Warning"),
|
189
|
+
style=wx.OK | wx.ICON_EXCLAMATION,
|
190
|
+
)
|
191
|
+
|
192
|
+
def delete_persistent_starting_with(self, section: str, startpattern: str):
|
193
|
+
to_be_deleted = list()
|
194
|
+
for key in self.context.kernel.keylist(section):
|
195
|
+
if key.startswith(startpattern):
|
196
|
+
to_be_deleted.append(key)
|
197
|
+
for key in to_be_deleted:
|
198
|
+
# print (f"Will delete {section}.{key}")
|
199
|
+
self.context.kernel.delete_persistent(section, key)
|
200
|
+
if len(to_be_deleted):
|
201
|
+
# d = list(self.context.kernel.keylist(section))
|
202
|
+
# d.sort()
|
203
|
+
# print (d)
|
204
|
+
self.save_config_and_prevent_further_writing()
|
205
|
+
|
206
|
+
def clear_persistent_starting_with(self, startpattern):
|
207
|
+
to_be_deleted = list()
|
208
|
+
for key in self.context.kernel.section_set():
|
209
|
+
if key.startswith(startpattern):
|
210
|
+
to_be_deleted.append(key)
|
211
|
+
for key in to_be_deleted:
|
212
|
+
# print (f"Will delete section {key}")
|
213
|
+
self.context.kernel.clear_persistent(key)
|
214
|
+
if len(to_be_deleted):
|
215
|
+
self.save_config_and_prevent_further_writing()
|
216
|
+
|
217
|
+
def on_clear_all(self, event):
|
218
|
+
self.context.kernel.clear_persistent("/")
|
219
|
+
self.save_config_and_prevent_further_writing()
|
220
|
+
|
221
|
+
def on_clear_camera_settings(self, event):
|
222
|
+
self.clear_persistent_starting_with("camera/")
|
223
|
+
|
224
|
+
def on_clear_planner(self, event):
|
225
|
+
self.context.kernel.clear_persistent("planner")
|
226
|
+
self.save_config_and_prevent_further_writing()
|
227
|
+
|
228
|
+
def on_clear_positions(self, event):
|
229
|
+
self.context.kernel.delete_persistent("/", "aui")
|
230
|
+
self.context.kernel.delete_persistent("/", "perspective")
|
231
|
+
self.clear_persistent_starting_with("window/")
|
232
|
+
# print ([l for l in self.context.kernel._config_dict])
|
233
|
+
|
234
|
+
def on_clear_colors(self, event):
|
235
|
+
self.context.kernel.clear_persistent("colors")
|
236
|
+
self.delete_persistent_starting_with("/", "color_")
|
237
|
+
|
238
|
+
def on_clear_files(self, event):
|
239
|
+
self.delete_persistent_starting_with("/", "file")
|
240
|
+
|
241
|
+
def on_clear_hinges(self, event):
|
242
|
+
self.delete_persistent_starting_with("/", "hinge_")
|
243
|
+
|
244
|
+
def pane_right_click(self, event):
|
245
|
+
menu = wx.Menu()
|
246
|
+
item = menu.Append(
|
247
|
+
wx.ID_ANY,
|
248
|
+
_("Clear..."),
|
249
|
+
"",
|
250
|
+
wx.ITEM_NORMAL,
|
251
|
+
)
|
252
|
+
item.Enable(False)
|
253
|
+
item = menu.Append(
|
254
|
+
wx.ID_ANY,
|
255
|
+
_("...Pane + Windows-Positions"),
|
256
|
+
"",
|
257
|
+
wx.ITEM_NORMAL,
|
258
|
+
)
|
259
|
+
self.Bind(wx.EVT_MENU, self.on_clear_positions, item)
|
260
|
+
item = menu.Append(
|
261
|
+
wx.ID_ANY,
|
262
|
+
_("...color settings"),
|
263
|
+
"",
|
264
|
+
wx.ITEM_NORMAL,
|
265
|
+
)
|
266
|
+
self.Bind(wx.EVT_MENU, self.on_clear_colors, item)
|
267
|
+
item = menu.Append(
|
268
|
+
wx.ID_ANY,
|
269
|
+
_("...recent file names"),
|
270
|
+
"",
|
271
|
+
wx.ITEM_NORMAL,
|
272
|
+
)
|
273
|
+
self.Bind(wx.EVT_MENU, self.on_clear_files, item)
|
274
|
+
menu.AppendSeparator()
|
275
|
+
item = menu.Append(
|
276
|
+
wx.ID_ANY,
|
277
|
+
_("...living hinge settings"),
|
278
|
+
"",
|
279
|
+
wx.ITEM_NORMAL,
|
280
|
+
)
|
281
|
+
self.Bind(wx.EVT_MENU, self.on_clear_hinges, item)
|
282
|
+
# item = menu.Append(wx.ID_ANY, _("...material test settings"), "", wx.ITEM_NORMAL, )
|
283
|
+
# self.Bind(wx.EVT_MENU, self.on_clear_templates, item)
|
284
|
+
menu.AppendSeparator()
|
285
|
+
item = menu.Append(
|
286
|
+
wx.ID_ANY,
|
287
|
+
_("...camera settings"),
|
288
|
+
"",
|
289
|
+
wx.ITEM_NORMAL,
|
290
|
+
)
|
291
|
+
self.Bind(wx.EVT_MENU, self.on_clear_camera_settings, item)
|
292
|
+
if self.context.root.setting(bool, "developer_mode", False):
|
293
|
+
menu.AppendSeparator()
|
294
|
+
item = menu.Append(
|
295
|
+
wx.ID_ANY,
|
296
|
+
_("...all user settings"),
|
297
|
+
"",
|
298
|
+
wx.ITEM_NORMAL,
|
299
|
+
)
|
300
|
+
self.Bind(wx.EVT_MENU, self.on_clear_all, item)
|
301
|
+
self.PopupMenu(menu)
|
302
|
+
menu.Destroy()
|
303
|
+
|
304
|
+
def on_button_save(self, event=None):
|
305
|
+
self.context("flush\n")
|
306
|
+
|
307
|
+
def on_button_export(self, event=None):
|
308
|
+
dlg = wx.DirDialog(
|
309
|
+
self,
|
310
|
+
_("Choose target directory:"),
|
311
|
+
style=wx.DD_DEFAULT_STYLE | wx.DD_DIR_MUST_EXIST,
|
312
|
+
)
|
313
|
+
|
314
|
+
if dlg.ShowModal() == wx.ID_OK:
|
315
|
+
self.context(f"setting_export {dlg.GetPath()}\n")
|
316
|
+
wx.MessageBox(_("Export completed"), _("Info"), wx.OK | wx.ICON_INFORMATION)
|
317
|
+
|
318
|
+
dlg.Destroy()
|
319
|
+
|
320
|
+
def on_button_import(self, event=None):
|
321
|
+
message = _("This will import a previously saved configuration file!") + "\n"
|
322
|
+
message += (
|
323
|
+
_(
|
324
|
+
"This may make MeerK40t unworkable if the file does not have the right format!"
|
325
|
+
)
|
326
|
+
+ "\n"
|
327
|
+
)
|
328
|
+
message += _("You do this at you own risk - are you really sure?")
|
329
|
+
caption = _("Warning")
|
330
|
+
dlg = wx.MessageDialog(
|
331
|
+
self,
|
332
|
+
message,
|
333
|
+
caption,
|
334
|
+
wx.YES_NO | wx.ICON_WARNING,
|
335
|
+
)
|
336
|
+
dlgresult = dlg.ShowModal()
|
337
|
+
dlg.Destroy()
|
338
|
+
if dlgresult != wx.ID_YES:
|
339
|
+
return
|
340
|
+
dlg = wx.FileDialog(
|
341
|
+
self,
|
342
|
+
message=_("Choose a previously saved configuration-file"),
|
343
|
+
wildcard="Meerk40t-Config-Files (*.cfg)|*.cfg|All files (*.*)|*.*",
|
344
|
+
style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST | wx.FD_PREVIEW,
|
345
|
+
)
|
346
|
+
dlgresult = dlg.ShowModal()
|
347
|
+
if dlgresult == wx.ID_YES:
|
348
|
+
myfile = dlg.GetPath()
|
349
|
+
dlg.Destroy()
|
350
|
+
else:
|
351
|
+
dlg.Destroy()
|
352
|
+
return
|
353
|
+
|
354
|
+
self.context(f"setting_import {myfile}\n")
|
355
|
+
wx.MessageBox(_("Import completed"), _("Info"), wx.OK | wx.ICON_INFORMATION)
|
356
|
+
|
357
|
+
|
358
|
+
class PreferencesPixelsPerInchPanel(wx.Panel):
|
359
|
+
def __init__(self, *args, context=None, **kwds):
|
360
|
+
# begin wxGlade: PreferencesPixelsPerInchPanel.__init__
|
361
|
+
kwds["style"] = kwds.get("style", 0)
|
362
|
+
wx.Panel.__init__(self, *args, **kwds)
|
363
|
+
self.context = context
|
364
|
+
self.context.themes.set_window_colors(self)
|
365
|
+
|
366
|
+
sizer_3 = StaticBoxSizer(
|
367
|
+
self, wx.ID_ANY, _("SVG Pixel Per Inch"), wx.HORIZONTAL
|
368
|
+
)
|
369
|
+
|
370
|
+
self.combo_svg_ppi = wxComboBox(
|
371
|
+
self,
|
372
|
+
wx.ID_ANY,
|
373
|
+
choices=[
|
374
|
+
_("96 px/in Inkscape"),
|
375
|
+
_("72 px/in Illustrator"),
|
376
|
+
_("90 px/in Old Inkscape"),
|
377
|
+
_("Custom"),
|
378
|
+
],
|
379
|
+
style=wx.CB_READONLY,
|
380
|
+
)
|
381
|
+
self.combo_svg_ppi.SetToolTip(
|
382
|
+
_("Select the Pixels Per Inch to use when loading an SVG file")
|
383
|
+
)
|
384
|
+
sizer_3.Add(self.combo_svg_ppi, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
385
|
+
|
386
|
+
sizer_3.Add((20, 20), 0, 0, 0)
|
387
|
+
|
388
|
+
self.text_svg_ppi = TextCtrl(
|
389
|
+
self, wx.ID_ANY, "", check="float", style=wx.TE_PROCESS_ENTER, limited=True
|
390
|
+
)
|
391
|
+
self.text_svg_ppi.SetToolTip(
|
392
|
+
_("Custom Pixels Per Inch to use when loading an SVG file")
|
393
|
+
)
|
394
|
+
sizer_3.Add(self.text_svg_ppi, 1, wx.EXPAND, 0)
|
395
|
+
|
396
|
+
self.SetSizer(sizer_3)
|
397
|
+
|
398
|
+
self.Layout()
|
399
|
+
|
400
|
+
self.Bind(wx.EVT_COMBOBOX, self.on_combo_svg_ppi, self.combo_svg_ppi)
|
401
|
+
self.text_svg_ppi.SetActionRoutine(self.on_text_svg_ppi)
|
402
|
+
# end wxGlade
|
403
|
+
|
404
|
+
context.elements.setting(float, "svg_ppi", 96.0)
|
405
|
+
self.text_svg_ppi.SetValue(str(context.elements.svg_ppi))
|
406
|
+
self.on_text_svg_ppi()
|
407
|
+
|
408
|
+
def on_combo_svg_ppi(self, event=None):
|
409
|
+
elements = self.context.elements
|
410
|
+
ppi = self.combo_svg_ppi.GetSelection()
|
411
|
+
if ppi == 0:
|
412
|
+
elements.svg_ppi = 96.0
|
413
|
+
elif ppi == 1:
|
414
|
+
elements.svg_ppi = 72.0
|
415
|
+
elif ppi == 2:
|
416
|
+
elements.svg_ppi = 90.0
|
417
|
+
else:
|
418
|
+
elements.svg_ppi = 96.0
|
419
|
+
self.text_svg_ppi.SetValue(str(elements.svg_ppi))
|
420
|
+
|
421
|
+
def on_text_svg_ppi(self):
|
422
|
+
elements = self.context.elements
|
423
|
+
try:
|
424
|
+
svg_ppi = float(self.text_svg_ppi.GetValue())
|
425
|
+
except ValueError:
|
426
|
+
return
|
427
|
+
if svg_ppi == 96:
|
428
|
+
if self.combo_svg_ppi.GetSelection() != 0:
|
429
|
+
self.combo_svg_ppi.SetSelection(0)
|
430
|
+
elif svg_ppi == 72:
|
431
|
+
if self.combo_svg_ppi.GetSelection() != 1:
|
432
|
+
self.combo_svg_ppi.SetSelection(1)
|
433
|
+
elif svg_ppi == 90:
|
434
|
+
if self.combo_svg_ppi.GetSelection() != 2:
|
435
|
+
self.combo_svg_ppi.SetSelection(2)
|
436
|
+
else:
|
437
|
+
if self.combo_svg_ppi.GetSelection() != 3:
|
438
|
+
self.combo_svg_ppi.SetSelection(3)
|
439
|
+
elements.svg_ppi = svg_ppi
|
440
|
+
|
441
|
+
# end of class PreferencesPixelsPerInchPanel
|
442
|
+
|
443
|
+
|
444
|
+
class PreferencesMain(wx.Panel):
|
445
|
+
def __init__(self, *args, context=None, **kwds):
|
446
|
+
# begin wxGlade: PreferencesMain.__init__
|
447
|
+
kwds["style"] = kwds.get("style", 0)
|
448
|
+
wx.Panel.__init__(self, *args, **kwds)
|
449
|
+
self.context = context
|
450
|
+
self.context.themes.set_window_colors(self)
|
451
|
+
self.SetHelpText("preferences")
|
452
|
+
sizer_main = wx.BoxSizer(wx.VERTICAL)
|
453
|
+
|
454
|
+
self.panel_units = PreferencesUnitsPanel(self, wx.ID_ANY, context=context)
|
455
|
+
sizer_main.Add(self.panel_units, 0, wx.EXPAND, 0)
|
456
|
+
|
457
|
+
self.panel_language = PreferencesLanguagePanel(self, wx.ID_ANY, context=context)
|
458
|
+
sizer_main.Add(self.panel_language, 0, wx.EXPAND, 0)
|
459
|
+
|
460
|
+
self.panel_pref1 = ChoicePropertyPanel(
|
461
|
+
self,
|
462
|
+
id=wx.ID_ANY,
|
463
|
+
context=context,
|
464
|
+
choices="preferences",
|
465
|
+
constraint=("-Input/Output", "-Classification", "-Gui", "-Scene", "-Operations"),
|
466
|
+
)
|
467
|
+
sizer_main.Add(self.panel_pref1, 1, wx.EXPAND, 0)
|
468
|
+
|
469
|
+
self.panel_management = PreferencesSavingPanel(self, wx.ID_ANY, context=context)
|
470
|
+
sizer_main.Add(self.panel_management, 0, wx.EXPAND, 0)
|
471
|
+
|
472
|
+
self.SetSizer(sizer_main)
|
473
|
+
|
474
|
+
self.Layout()
|
475
|
+
# end wxGlade
|
476
|
+
|
477
|
+
def delegates(self):
|
478
|
+
yield self.panel_language
|
479
|
+
yield self.panel_units
|
480
|
+
yield self.panel_pref1
|
481
|
+
yield self.panel_management
|
482
|
+
|
483
|
+
|
484
|
+
class PreferencesInputOutput(wx.Panel):
|
485
|
+
def __init__(self, *args, context=None, **kwds):
|
486
|
+
# begin wxGlade: PreferencesMain.__init__
|
487
|
+
kwds["style"] = kwds.get("style", 0)
|
488
|
+
wx.Panel.__init__(self, *args, **kwds)
|
489
|
+
self.context = context
|
490
|
+
self.context.themes.set_window_colors(self)
|
491
|
+
self.SetHelpText("preferences")
|
492
|
+
sizer_main = wx.BoxSizer(wx.VERTICAL)
|
493
|
+
|
494
|
+
self.panel_ppi = PreferencesPixelsPerInchPanel(self, wx.ID_ANY, context=context)
|
495
|
+
sizer_main.Add(self.panel_ppi, 0, wx.EXPAND, 0)
|
496
|
+
|
497
|
+
self.panel_input_output = ChoicePropertyPanel(
|
498
|
+
self,
|
499
|
+
id=wx.ID_ANY,
|
500
|
+
context=self.context,
|
501
|
+
choices="preferences",
|
502
|
+
constraint="Input/Output",
|
503
|
+
)
|
504
|
+
self.panel_input_output.SetupScrolling()
|
505
|
+
sizer_main.Add(self.panel_input_output, 1, wx.EXPAND, 0)
|
506
|
+
|
507
|
+
self.SetSizer(sizer_main)
|
508
|
+
|
509
|
+
self.Layout()
|
510
|
+
# end wxGlade
|
511
|
+
|
512
|
+
def delegates(self):
|
513
|
+
yield self.panel_ppi
|
514
|
+
yield self.panel_input_output
|
515
|
+
|
516
|
+
# end of class PreferencesMain
|
517
|
+
|
518
|
+
#
|
519
|
+
# class PreferencesPanel(wx.Panel):
|
520
|
+
# def __init__(self, *args, context=None, **kwds):
|
521
|
+
# # begin wxGlade: PreferencesPanel.__init__
|
522
|
+
# kwds["style"] = kwds.get("style", 0)
|
523
|
+
# wx.Panel.__init__(self, *args, **kwds)
|
524
|
+
# self.context = context
|
525
|
+
#
|
526
|
+
# sizer_settings = wx.BoxSizer(wx.VERTICAL)
|
527
|
+
#
|
528
|
+
# self.panel_main = PreferencesMain(self, wx.ID_ANY, context=context)
|
529
|
+
# sizer_settings.Add(self.panel_main, 1, wx.EXPAND, 0)
|
530
|
+
#
|
531
|
+
# self.SetSizer(sizer_settings)
|
532
|
+
#
|
533
|
+
# self.Layout()
|
534
|
+
# # end wxGlade
|
535
|
+
#
|
536
|
+
# def delegates(self):
|
537
|
+
# yield self.panel_main
|
538
|
+
|
539
|
+
|
540
|
+
class Preferences(MWindow):
|
541
|
+
def __init__(self, *args, **kwds):
|
542
|
+
super().__init__(
|
543
|
+
525,
|
544
|
+
750,
|
545
|
+
*args,
|
546
|
+
style=wx.CAPTION
|
547
|
+
| wx.CLOSE_BOX
|
548
|
+
| wx.FRAME_FLOAT_ON_PARENT
|
549
|
+
| wx.TAB_TRAVERSAL
|
550
|
+
| (wx.RESIZE_BORDER if platform.system() != "Darwin" else 0),
|
551
|
+
**kwds,
|
552
|
+
)
|
553
|
+
self.notebook_main = wx.aui.AuiNotebook(
|
554
|
+
self,
|
555
|
+
-1,
|
556
|
+
style=wx.aui.AUI_NB_TAB_EXTERNAL_MOVE
|
557
|
+
| wx.aui.AUI_NB_SCROLL_BUTTONS
|
558
|
+
| wx.aui.AUI_NB_TAB_SPLIT
|
559
|
+
| wx.aui.AUI_NB_TAB_MOVE,
|
560
|
+
)
|
561
|
+
# ARGGH, the color setting via the ArtProvider does only work
|
562
|
+
# if you set the tabs to the bottom! wx.aui.AUI_NB_BOTTOM
|
563
|
+
self.window_context.themes.set_window_colors(self.notebook_main)
|
564
|
+
bg_std = self.window_context.themes.get("win_bg")
|
565
|
+
bg_active = self.window_context.themes.get("highlight")
|
566
|
+
self.notebook_main.GetArtProvider().SetColour(bg_std)
|
567
|
+
self.notebook_main.GetArtProvider().SetActiveColour(bg_active)
|
568
|
+
|
569
|
+
self.sizer.Add(self.notebook_main, 1, wx.EXPAND, 0)
|
570
|
+
|
571
|
+
# self.panel_main = PreferencesPanel(self, wx.ID_ANY, context=self.context)
|
572
|
+
self.panel_main = PreferencesMain(self, wx.ID_ANY, context=self.context)
|
573
|
+
|
574
|
+
self.panel_input_output = PreferencesInputOutput(self, wx.ID_ANY, context=self.context)
|
575
|
+
|
576
|
+
inject_choices = [
|
577
|
+
{
|
578
|
+
"attr": "preset_classify_automatic",
|
579
|
+
"object": self,
|
580
|
+
"default": False,
|
581
|
+
"type": bool,
|
582
|
+
"style": "button",
|
583
|
+
"label": _("Automatic"),
|
584
|
+
"tip": _("Set options for a good automatic experience"),
|
585
|
+
"help": "classification",
|
586
|
+
"page": "Classification",
|
587
|
+
"section": "_AA_Presets",
|
588
|
+
"subsection": "_0_",
|
589
|
+
},
|
590
|
+
{
|
591
|
+
"attr": "preset_classify_manual",
|
592
|
+
"object": self,
|
593
|
+
"default": False,
|
594
|
+
"type": bool,
|
595
|
+
"style": "button",
|
596
|
+
"label": _("Manual"),
|
597
|
+
"tip": _("Set options for complete manual control"),
|
598
|
+
"help": "classification",
|
599
|
+
"page": "Classification",
|
600
|
+
"section": "_AA_Presets",
|
601
|
+
"subsection": "_0_",
|
602
|
+
},
|
603
|
+
{
|
604
|
+
"attr": "dummy",
|
605
|
+
"default": "dummy",
|
606
|
+
"object": self,
|
607
|
+
"type": str,
|
608
|
+
"style": "info",
|
609
|
+
"label": _(
|
610
|
+
"Classification is the (automatic) process of assigning an element to an operation."
|
611
|
+
)
|
612
|
+
+ "\n"
|
613
|
+
+ _("That link between element and operation is called an assignment."),
|
614
|
+
"help": "classification",
|
615
|
+
"page": "Classification",
|
616
|
+
# "section": "_000_Information",
|
617
|
+
},
|
618
|
+
]
|
619
|
+
self.presets = [
|
620
|
+
# object, property, automatic, manual
|
621
|
+
(self.context.elements, "operation_default_empty", False, True),
|
622
|
+
(self.context.elements, "classify_reverse", False, False),
|
623
|
+
(self.context.elements, "classify_new", True, False),
|
624
|
+
(self.context.elements, "classify_fuzzy", True, True),
|
625
|
+
(self.context.elements, "classify_fuzzydistance", 100, 100),
|
626
|
+
(self.context.elements, "classify_black_as_raster", True, True),
|
627
|
+
(self.context.elements, "classify_default", True, False),
|
628
|
+
(self.context.elements, "classify_autogenerate", True, False),
|
629
|
+
# (self.context.elements, "classify_auto_inherit", False, True),
|
630
|
+
(self.context.elements, "classify_on_color", True, False),
|
631
|
+
(self.context.elements, "classify_autogenerate_both", True, True),
|
632
|
+
]
|
633
|
+
self.panel_classification = ChoicePropertyPanel(
|
634
|
+
self,
|
635
|
+
id=wx.ID_ANY,
|
636
|
+
context=self.context,
|
637
|
+
choices="preferences",
|
638
|
+
constraint="Classification",
|
639
|
+
injector=inject_choices,
|
640
|
+
)
|
641
|
+
self.panel_classification.SetupScrolling()
|
642
|
+
|
643
|
+
self.panel_ops = ChoicePropertyPanel(
|
644
|
+
self,
|
645
|
+
id=wx.ID_ANY,
|
646
|
+
context=self.context,
|
647
|
+
choices="preferences",
|
648
|
+
constraint="Operations",
|
649
|
+
)
|
650
|
+
self.panel_ops.SetupScrolling()
|
651
|
+
|
652
|
+
self.panel_gui = ChoicePropertyPanel(
|
653
|
+
self,
|
654
|
+
id=wx.ID_ANY,
|
655
|
+
context=self.context,
|
656
|
+
choices="preferences",
|
657
|
+
constraint="Gui",
|
658
|
+
)
|
659
|
+
self.panel_gui.SetupScrolling()
|
660
|
+
|
661
|
+
self.panel_scene = ChoicePropertyPanel(
|
662
|
+
self,
|
663
|
+
id=wx.ID_ANY,
|
664
|
+
context=self.context,
|
665
|
+
choices="preferences",
|
666
|
+
constraint="Scene",
|
667
|
+
)
|
668
|
+
self.panel_scene.SetupScrolling()
|
669
|
+
|
670
|
+
main_scene = getattr(self.context.root, "mainscene", None)
|
671
|
+
color_choices = []
|
672
|
+
local_default_color = []
|
673
|
+
for key, value in main_scene.colors.__dict__.items():
|
674
|
+
if not key.startswith("_") and isinstance(value, str):
|
675
|
+
local_default_color.append(key)
|
676
|
+
local_default_color.sort()
|
677
|
+
section = ""
|
678
|
+
for key in local_default_color:
|
679
|
+
# Try to make a sensible name out of it
|
680
|
+
keyname = key.replace("_", " ")
|
681
|
+
idx = 1 # Intentionally
|
682
|
+
while idx < len(keyname):
|
683
|
+
if keyname[idx] in "0123456789" and keyname[idx - 1] != " ":
|
684
|
+
keyname = keyname[:idx] + " " + keyname[idx:]
|
685
|
+
idx += 1
|
686
|
+
keyname = keyname[0].upper() + keyname[1:]
|
687
|
+
words = keyname.split()
|
688
|
+
possible_section = words[0]
|
689
|
+
if possible_section[0:2] != section[0:2]:
|
690
|
+
section = possible_section
|
691
|
+
color_choices.append(
|
692
|
+
{
|
693
|
+
"attr": f"color_{key}",
|
694
|
+
"object": main_scene.colors,
|
695
|
+
"default": main_scene.colors[key],
|
696
|
+
"type": str,
|
697
|
+
"style": "color", # hexa representation
|
698
|
+
"label": keyname,
|
699
|
+
"section": section,
|
700
|
+
"signals": ("refresh_scene", "theme"),
|
701
|
+
}
|
702
|
+
)
|
703
|
+
col = self.context.root.setting(str, "label_display_color", "#ff0000ff")
|
704
|
+
color_choices.append(
|
705
|
+
{
|
706
|
+
"attr": "color_label",
|
707
|
+
"object": self,
|
708
|
+
"default": self.color_label,
|
709
|
+
"type": str,
|
710
|
+
"style": "color", # hexa representation
|
711
|
+
"label": _("Object-Label"),
|
712
|
+
"section": "Scene",
|
713
|
+
"signals": ("refresh_scene", "theme"),
|
714
|
+
}
|
715
|
+
)
|
716
|
+
color_choices.append(
|
717
|
+
{
|
718
|
+
"attr": "color_reset",
|
719
|
+
"object": self,
|
720
|
+
"type": bool,
|
721
|
+
"style": "button",
|
722
|
+
"label": _("Reset Colors to Default"),
|
723
|
+
"section": "_ZZ_",
|
724
|
+
}
|
725
|
+
)
|
726
|
+
if self.window_context.themes.dark:
|
727
|
+
color_choices.append(
|
728
|
+
{
|
729
|
+
"attr": "color_reset_brighter",
|
730
|
+
"object": self,
|
731
|
+
"type": bool,
|
732
|
+
"style": "button",
|
733
|
+
"label": _("Reset Colors to brighter defaults"),
|
734
|
+
"section": "_ZZ_",
|
735
|
+
}
|
736
|
+
)
|
737
|
+
|
738
|
+
self.panel_color = ChoicePropertyPanel(
|
739
|
+
self,
|
740
|
+
id=wx.ID_ANY,
|
741
|
+
context=self.context,
|
742
|
+
choices=color_choices,
|
743
|
+
entries_per_column=12,
|
744
|
+
)
|
745
|
+
self.panel_color.SetupScrolling()
|
746
|
+
|
747
|
+
self.panel_ribbon = RibbonEditor(self, wx.ID_ANY, context=self.context)
|
748
|
+
|
749
|
+
self.notebook_main.AddPage(self.panel_main, _("General"))
|
750
|
+
self.notebook_main.AddPage(self.panel_input_output, _("Input/Output"))
|
751
|
+
self.notebook_main.AddPage(self.panel_classification, _("Classification"))
|
752
|
+
self.notebook_main.AddPage(self.panel_ops, _("Operations"))
|
753
|
+
self.notebook_main.AddPage(self.panel_gui, _("GUI"))
|
754
|
+
self.notebook_main.AddPage(self.panel_scene, _("Scene"))
|
755
|
+
self.notebook_main.AddPage(self.panel_color, _("Colors"))
|
756
|
+
self.notebook_main.AddPage(self.panel_ribbon, _("Ribbon"))
|
757
|
+
|
758
|
+
self.panels = [
|
759
|
+
self.panel_main,
|
760
|
+
self.panel_input_output,
|
761
|
+
self.panel_classification,
|
762
|
+
self.panel_ops,
|
763
|
+
self.panel_gui,
|
764
|
+
self.panel_scene,
|
765
|
+
self.panel_color,
|
766
|
+
self.panel_ribbon,
|
767
|
+
]
|
768
|
+
self.panel_ids = ["main", "classification", "ops", "gui", "scene", "color", "ribbon"]
|
769
|
+
self.context.setting(bool, "developer_mode", False)
|
770
|
+
if self.context.developer_mode:
|
771
|
+
panel_space = ChoicePropertyPanel(
|
772
|
+
self, wx.ID_ANY, context=self.context, choices="space"
|
773
|
+
)
|
774
|
+
self.notebook_main.AddPage(panel_space, _("Coordinate Space"))
|
775
|
+
self.panels.append(panel_space)
|
776
|
+
self.panel_ids.append("space")
|
777
|
+
self.Layout()
|
778
|
+
self.restore_aspect(honor_initial_values=True)
|
779
|
+
|
780
|
+
_icon = wx.NullIcon
|
781
|
+
_icon.CopyFromBitmap(icons8_administrative_tools.GetBitmap())
|
782
|
+
self.SetIcon(_icon)
|
783
|
+
self.SetTitle(_("Preferences"))
|
784
|
+
|
785
|
+
@signal_listener("preferences")
|
786
|
+
def on_pref_signal(self, origin, *args):
|
787
|
+
if not args:
|
788
|
+
return
|
789
|
+
panel = args[0]
|
790
|
+
if panel and panel in self.panel_ids:
|
791
|
+
self.Show()
|
792
|
+
self.notebook_main.SetSelection(self.panel_ids.index(panel))
|
793
|
+
|
794
|
+
@property
|
795
|
+
def color_label(self):
|
796
|
+
col = self.context.root.setting(str, "label_display_color", "#ff0000ff")
|
797
|
+
return col
|
798
|
+
|
799
|
+
@color_label.setter
|
800
|
+
def color_label(self, value):
|
801
|
+
if value:
|
802
|
+
self.context.root.label_display_color = value
|
803
|
+
|
804
|
+
@property
|
805
|
+
def color_reset(self):
|
806
|
+
# Not relevant
|
807
|
+
return False
|
808
|
+
|
809
|
+
@color_reset.setter
|
810
|
+
def color_reset(self, value):
|
811
|
+
if value:
|
812
|
+
# We are resetting all GUI.colors
|
813
|
+
self.context("scene color unset\n")
|
814
|
+
self.context.root.label_display_color = "#ff0000ff"
|
815
|
+
self.context.signal("theme", True)
|
816
|
+
self.panel_color.reload()
|
817
|
+
|
818
|
+
@property
|
819
|
+
def color_reset_brighter(self):
|
820
|
+
# Not relevant
|
821
|
+
return False
|
822
|
+
|
823
|
+
@color_reset.setter
|
824
|
+
def color_reset_brighter(self, value):
|
825
|
+
if value:
|
826
|
+
# We are resetting all GUI.colors
|
827
|
+
self.context("scene color unsetbright\n")
|
828
|
+
self.context.root.label_display_color = "#ff0000ff"
|
829
|
+
self.context.signal("theme", True)
|
830
|
+
self.panel_color.reload()
|
831
|
+
|
832
|
+
@property
|
833
|
+
def preset_classify_manual(self):
|
834
|
+
# Not relevant
|
835
|
+
return False
|
836
|
+
|
837
|
+
@preset_classify_manual.setter
|
838
|
+
def preset_classify_manual(self, value):
|
839
|
+
if value:
|
840
|
+
# We are setting presets for a couple of parameters
|
841
|
+
for preset in self.presets:
|
842
|
+
setattr(preset[0], preset[1], preset[3])
|
843
|
+
self.context.signal(preset[1], preset[3], preset[0])
|
844
|
+
|
845
|
+
@property
|
846
|
+
def preset_classify_automatic(self):
|
847
|
+
# Not relevant
|
848
|
+
return False
|
849
|
+
|
850
|
+
@preset_classify_automatic.setter
|
851
|
+
def preset_classify_automatic(self, value):
|
852
|
+
if value:
|
853
|
+
# We are setting presets for a couple of parameters
|
854
|
+
for preset in self.presets:
|
855
|
+
setattr(preset[0], preset[1], preset[2])
|
856
|
+
self.context.signal(preset[1], preset[2], preset[0])
|
857
|
+
|
858
|
+
def delegates(self):
|
859
|
+
yield from self.panels
|
860
|
+
|
861
|
+
@staticmethod
|
862
|
+
def sub_register(kernel):
|
863
|
+
import platform
|
864
|
+
|
865
|
+
if platform.system() != "Darwin":
|
866
|
+
kernel.register(
|
867
|
+
"button/config/Preferences",
|
868
|
+
{
|
869
|
+
"label": _("Preferences"),
|
870
|
+
"icon": icons8_administrative_tools,
|
871
|
+
"tip": _("Opens Preferences Window"),
|
872
|
+
"action": lambda v: kernel.console("window toggle Preferences\n"),
|
873
|
+
},
|
874
|
+
)
|
875
|
+
|
876
|
+
def window_open(self):
|
877
|
+
pass
|
878
|
+
|
879
|
+
def window_close(self):
|
880
|
+
pass
|
881
|
+
|
882
|
+
@staticmethod
|
883
|
+
def menu_label():
|
884
|
+
return _("Pr&eferences...\tCtrl-,")
|
885
|
+
|
886
|
+
@staticmethod
|
887
|
+
def menu_tip():
|
888
|
+
return _("Show/Hide the Preferences window")
|
889
|
+
|
890
|
+
@staticmethod
|
891
|
+
def menu_id():
|
892
|
+
return wx.ID_PREFERENCES
|
893
|
+
|
894
|
+
@staticmethod
|
895
|
+
def submenu():
|
896
|
+
# suppress in tool-menu
|
897
|
+
return "", "Preferences", True
|
898
|
+
|
899
|
+
@staticmethod
|
900
|
+
def helptext():
|
901
|
+
return _("Configure MeerK40ts behaviour")
|