meerk40t 0.9.2000__py2.py3-none-any.whl → 0.9.3001__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/balormk/balor_params.py +1 -43
- meerk40t/balormk/controller.py +1 -41
- meerk40t/balormk/device.py +16 -22
- meerk40t/balormk/driver.py +4 -4
- meerk40t/balormk/gui/balorconfig.py +2 -2
- meerk40t/balormk/gui/balorcontroller.py +13 -5
- meerk40t/balormk/gui/baloroperationproperties.py +0 -46
- meerk40t/balormk/gui/gui.py +17 -17
- meerk40t/camera/gui/camerapanel.py +18 -11
- meerk40t/core/cutcode/rastercut.py +3 -1
- meerk40t/core/cutplan.py +145 -14
- meerk40t/core/elements/clipboard.py +18 -9
- meerk40t/core/elements/element_treeops.py +320 -180
- meerk40t/core/elements/element_types.py +7 -2
- meerk40t/core/elements/elements.py +53 -27
- meerk40t/core/elements/geometry.py +8 -0
- meerk40t/core/elements/offset_clpr.py +129 -4
- meerk40t/core/elements/offset_mk.py +3 -1
- meerk40t/core/elements/shapes.py +28 -25
- meerk40t/core/laserjob.py +7 -0
- meerk40t/core/node/bootstrap.py +4 -0
- meerk40t/core/node/effect_hatch.py +85 -96
- meerk40t/core/node/effect_wobble.py +309 -0
- meerk40t/core/node/elem_image.py +49 -19
- meerk40t/core/node/elem_line.py +60 -0
- meerk40t/core/node/elem_rect.py +5 -3
- meerk40t/core/node/image_processed.py +766 -0
- meerk40t/core/node/image_raster.py +113 -0
- meerk40t/core/node/node.py +120 -1
- meerk40t/core/node/op_cut.py +2 -8
- meerk40t/core/node/op_dots.py +0 -8
- meerk40t/core/node/op_engrave.py +2 -18
- meerk40t/core/node/op_image.py +22 -35
- meerk40t/core/node/op_raster.py +0 -9
- meerk40t/core/planner.py +32 -2
- meerk40t/core/svg_io.py +699 -461
- meerk40t/core/treeop.py +191 -0
- meerk40t/core/undos.py +15 -1
- meerk40t/core/units.py +14 -4
- meerk40t/device/dummydevice.py +3 -2
- meerk40t/device/gui/defaultactions.py +43 -55
- meerk40t/device/gui/formatterpanel.py +58 -49
- meerk40t/device/gui/warningpanel.py +12 -12
- meerk40t/device/mixins.py +13 -0
- meerk40t/dxf/dxf_io.py +9 -5
- meerk40t/extra/ezd.py +28 -26
- meerk40t/extra/imageactions.py +300 -308
- meerk40t/extra/lbrn.py +19 -2
- meerk40t/fill/fills.py +6 -6
- meerk40t/fill/patternfill.py +1061 -1061
- meerk40t/fill/patterns.py +2 -6
- meerk40t/grbl/controller.py +168 -52
- meerk40t/grbl/device.py +23 -18
- meerk40t/grbl/driver.py +39 -0
- meerk40t/grbl/emulator.py +79 -19
- meerk40t/grbl/gcodejob.py +10 -0
- meerk40t/grbl/gui/grblconfiguration.py +2 -2
- meerk40t/grbl/gui/grblcontroller.py +24 -8
- meerk40t/grbl/gui/grblhardwareconfig.py +153 -0
- meerk40t/grbl/gui/gui.py +17 -14
- meerk40t/grbl/mock_connection.py +15 -34
- meerk40t/grbl/plugin.py +0 -4
- meerk40t/grbl/serial_connection.py +2 -1
- meerk40t/gui/about.py +8 -5
- meerk40t/gui/alignment.py +10 -6
- meerk40t/gui/basicops.py +27 -17
- meerk40t/gui/bufferview.py +2 -2
- meerk40t/gui/choicepropertypanel.py +101 -13
- meerk40t/gui/consolepanel.py +12 -9
- meerk40t/gui/devicepanel.py +38 -25
- meerk40t/gui/executejob.py +6 -4
- meerk40t/gui/help_assets/help_assets.py +13 -10
- meerk40t/gui/hersheymanager.py +8 -6
- meerk40t/gui/icons.py +1951 -3065
- meerk40t/gui/imagesplitter.py +14 -7
- meerk40t/gui/keymap.py +3 -3
- meerk40t/gui/laserpanel.py +151 -84
- meerk40t/gui/laserrender.py +61 -70
- meerk40t/gui/lasertoolpanel.py +8 -7
- meerk40t/gui/materialtest.py +3 -3
- meerk40t/gui/mkdebug.py +254 -1
- meerk40t/gui/navigationpanels.py +321 -180
- meerk40t/gui/notes.py +3 -3
- meerk40t/gui/opassignment.py +12 -12
- meerk40t/gui/operation_info.py +13 -13
- meerk40t/gui/plugin.py +5 -0
- meerk40t/gui/position.py +20 -18
- meerk40t/gui/preferences.py +21 -6
- meerk40t/gui/propertypanels/attributes.py +70 -22
- meerk40t/gui/propertypanels/blobproperty.py +2 -2
- meerk40t/gui/propertypanels/consoleproperty.py +2 -2
- meerk40t/gui/propertypanels/groupproperties.py +3 -3
- meerk40t/gui/propertypanels/hatchproperty.py +11 -18
- meerk40t/gui/propertypanels/imageproperty.py +4 -3
- meerk40t/gui/propertypanels/opbranchproperties.py +1 -1
- meerk40t/gui/propertypanels/pathproperty.py +2 -2
- meerk40t/gui/propertypanels/pointproperty.py +2 -2
- meerk40t/gui/propertypanels/propertywindow.py +4 -4
- meerk40t/gui/propertypanels/textproperty.py +3 -3
- meerk40t/gui/propertypanels/wobbleproperty.py +204 -0
- meerk40t/gui/ribbon.py +367 -259
- meerk40t/gui/scene/scene.py +31 -5
- meerk40t/gui/scenewidgets/elementswidget.py +12 -4
- meerk40t/gui/scenewidgets/gridwidget.py +2 -2
- meerk40t/gui/scenewidgets/laserpathwidget.py +7 -2
- meerk40t/gui/scenewidgets/machineoriginwidget.py +6 -2
- meerk40t/gui/scenewidgets/relocatewidget.py +1 -1
- meerk40t/gui/scenewidgets/reticlewidget.py +9 -0
- meerk40t/gui/scenewidgets/selectionwidget.py +12 -7
- meerk40t/gui/simpleui.py +95 -8
- meerk40t/gui/simulation.py +44 -36
- meerk40t/gui/spoolerpanel.py +124 -26
- meerk40t/gui/statusbarwidgets/defaultoperations.py +18 -6
- meerk40t/gui/statusbarwidgets/infowidget.py +2 -2
- meerk40t/gui/statusbarwidgets/opassignwidget.py +12 -12
- meerk40t/gui/statusbarwidgets/shapepropwidget.py +45 -18
- meerk40t/gui/statusbarwidgets/statusbar.py +11 -4
- meerk40t/gui/themes.py +78 -0
- meerk40t/gui/toolwidgets/toolcircle.py +2 -1
- meerk40t/gui/toolwidgets/toolellipse.py +2 -1
- meerk40t/gui/toolwidgets/toolimagecut.py +132 -0
- meerk40t/gui/toolwidgets/toolline.py +144 -0
- meerk40t/gui/toolwidgets/toolnodeedit.py +72 -145
- meerk40t/gui/toolwidgets/toolpoint.py +1 -1
- meerk40t/gui/toolwidgets/toolpolygon.py +8 -55
- meerk40t/gui/toolwidgets/toolrect.py +2 -1
- meerk40t/gui/usbconnect.py +2 -2
- meerk40t/gui/utilitywidgets/cyclocycloidwidget.py +2 -2
- meerk40t/gui/utilitywidgets/harmonograph.py +7 -7
- meerk40t/gui/utilitywidgets/scalewidget.py +1 -1
- meerk40t/gui/wordlisteditor.py +33 -18
- meerk40t/gui/wxmeerk40t.py +166 -66
- meerk40t/gui/wxmmain.py +236 -157
- meerk40t/gui/wxmribbon.py +49 -25
- meerk40t/gui/wxmscene.py +49 -38
- meerk40t/gui/wxmtree.py +216 -85
- meerk40t/gui/wxutils.py +62 -4
- meerk40t/image/imagetools.py +443 -15
- meerk40t/internal_plugins.py +2 -10
- meerk40t/kernel/kernel.py +12 -4
- meerk40t/lihuiyu/controller.py +7 -7
- meerk40t/lihuiyu/device.py +3 -1
- meerk40t/lihuiyu/driver.py +3 -0
- meerk40t/lihuiyu/gui/gui.py +8 -8
- meerk40t/lihuiyu/gui/lhyaccelgui.py +2 -2
- meerk40t/lihuiyu/gui/lhycontrollergui.py +73 -27
- meerk40t/lihuiyu/gui/lhydrivergui.py +2 -2
- meerk40t/lihuiyu/gui/tcpcontroller.py +22 -9
- meerk40t/main.py +6 -1
- meerk40t/moshi/controller.py +5 -5
- meerk40t/moshi/device.py +5 -2
- meerk40t/moshi/driver.py +4 -0
- meerk40t/moshi/gui/gui.py +8 -8
- meerk40t/moshi/gui/moshicontrollergui.py +24 -8
- meerk40t/moshi/gui/moshidrivergui.py +2 -2
- meerk40t/newly/controller.py +2 -0
- meerk40t/newly/device.py +9 -2
- meerk40t/newly/driver.py +4 -0
- meerk40t/newly/gui/gui.py +16 -17
- meerk40t/newly/gui/newlyconfig.py +2 -2
- meerk40t/newly/gui/newlycontroller.py +13 -5
- meerk40t/rotary/gui/gui.py +2 -2
- meerk40t/rotary/gui/rotarysettings.py +2 -2
- meerk40t/ruida/device.py +3 -0
- meerk40t/ruida/driver.py +4 -0
- meerk40t/ruida/gui/gui.py +6 -6
- meerk40t/ruida/gui/ruidaconfig.py +2 -2
- meerk40t/ruida/gui/ruidacontroller.py +13 -5
- meerk40t/svgelements.py +9 -9
- meerk40t/tools/geomstr.py +849 -153
- meerk40t/tools/kerftest.py +8 -4
- meerk40t/tools/livinghinges.py +15 -8
- {meerk40t-0.9.2000.dist-info → meerk40t-0.9.3001.dist-info}/METADATA +21 -16
- {meerk40t-0.9.2000.dist-info → meerk40t-0.9.3001.dist-info}/RECORD +185 -177
- {meerk40t-0.9.2000.dist-info → meerk40t-0.9.3001.dist-info}/entry_points.txt +0 -1
- test/test_core_elements.py +8 -24
- test/test_file_svg.py +88 -0
- test/test_fill.py +9 -9
- test/test_geomstr.py +258 -8
- test/test_kernel.py +4 -0
- test/test_tools_rasterplotter.py +29 -0
- meerk40t/extra/embroider.py +0 -56
- meerk40t/extra/pathoptimize.py +0 -249
- {meerk40t-0.9.2000.dist-info → meerk40t-0.9.3001.dist-info}/LICENSE +0 -0
- {meerk40t-0.9.2000.dist-info → meerk40t-0.9.3001.dist-info}/WHEEL +0 -0
- {meerk40t-0.9.2000.dist-info → meerk40t-0.9.3001.dist-info}/top_level.txt +0 -0
- {meerk40t-0.9.2000.dist-info → meerk40t-0.9.3001.dist-info}/zip-safe +0 -0
meerk40t/gui/laserrender.py
CHANGED
@@ -37,7 +37,7 @@ from ..tools.geomstr import ( # , TYPE_RAMP
|
|
37
37
|
Geomstr,
|
38
38
|
)
|
39
39
|
from .fonts import wxfont_to_svg
|
40
|
-
from .icons import
|
40
|
+
from .icons import icons8_image
|
41
41
|
from .zmatrix import ZMatrix
|
42
42
|
|
43
43
|
DRAW_MODE_FILLS = 0x000001
|
@@ -215,10 +215,11 @@ class LaserRender:
|
|
215
215
|
"elem rect",
|
216
216
|
"elem line",
|
217
217
|
"effect hatch",
|
218
|
+
"effect wobble",
|
218
219
|
)
|
219
220
|
nodes = [e for e in nodes if e.type not in path_elements]
|
220
221
|
if draw_mode & DRAW_MODE_IMAGE: # Do not draw images.
|
221
|
-
nodes = [e for e in nodes if e
|
222
|
+
nodes = [e for e in nodes if hasattr(e, "as_image")]
|
222
223
|
if draw_mode & DRAW_MODE_TEXT: # Do not draw text.
|
223
224
|
nodes = [e for e in nodes if e.type != "elem text"]
|
224
225
|
if draw_mode & DRAW_MODE_REGMARKS: # Do not draw regmarked items.
|
@@ -270,6 +271,7 @@ class LaserRender:
|
|
270
271
|
"elem line",
|
271
272
|
"elem polyline",
|
272
273
|
"effect hatch",
|
274
|
+
"effect wobble",
|
273
275
|
):
|
274
276
|
node.draw = self.draw_vector
|
275
277
|
node._make_cache = self.cache_geomstr
|
@@ -277,7 +279,7 @@ class LaserRender:
|
|
277
279
|
node.draw = self.draw_point_node
|
278
280
|
elif node.type in place_nodes:
|
279
281
|
node.draw = self.draw_placement_node
|
280
|
-
elif node
|
282
|
+
elif hasattr(node, "as_image"):
|
281
283
|
node.draw = self.draw_image_node
|
282
284
|
elif node.type == "elem text":
|
283
285
|
node.draw = self.draw_text_node
|
@@ -599,7 +601,7 @@ class LaserRender:
|
|
599
601
|
gc.SetBrush(wx.RED_BRUSH)
|
600
602
|
gc.DrawRectangle(0, 0, cut._cache_width, cut._cache_height)
|
601
603
|
gc.DrawBitmap(
|
602
|
-
|
604
|
+
icons8_image.GetBitmap(),
|
603
605
|
0,
|
604
606
|
0,
|
605
607
|
cut._cache_width,
|
@@ -630,25 +632,12 @@ class LaserRender:
|
|
630
632
|
gc.StrokePath(p)
|
631
633
|
del p
|
632
634
|
|
633
|
-
def cache_shape(self, node, gc):
|
634
|
-
matrix = node.matrix
|
635
|
-
node._cache_matrix = copy(matrix)
|
636
|
-
# Ensure Sync.
|
637
|
-
node.shape.transform = matrix
|
638
|
-
cache = self.make_path(gc, node.shape)
|
639
|
-
node._cache = cache
|
640
|
-
|
641
|
-
def cache_path(self, node, gc):
|
642
|
-
matrix = node.matrix
|
643
|
-
node._cache_matrix = copy(matrix)
|
644
|
-
# Ensure Sync.
|
645
|
-
node.path.transform = matrix
|
646
|
-
cache = self.make_path(gc, node.path)
|
647
|
-
node._cache = cache
|
648
|
-
|
649
635
|
def cache_geomstr(self, node, gc):
|
650
|
-
|
651
|
-
|
636
|
+
try:
|
637
|
+
matrix = node.matrix
|
638
|
+
node._cache_matrix = copy(matrix)
|
639
|
+
except AttributeError:
|
640
|
+
node._cache_matrix = Matrix()
|
652
641
|
geom = node.as_geometry()
|
653
642
|
cache = self.make_geomstr(gc, geom, node=node)
|
654
643
|
node._cache = cache
|
@@ -672,7 +661,10 @@ class LaserRender:
|
|
672
661
|
property_op(kernel.root, node)
|
673
662
|
if hasattr(node, "_cache"):
|
674
663
|
node._cache = None
|
675
|
-
|
664
|
+
try:
|
665
|
+
matrix = node.matrix
|
666
|
+
except AttributeError:
|
667
|
+
matrix = Matrix()
|
676
668
|
gc.PushState()
|
677
669
|
try:
|
678
670
|
cache = node._cache
|
@@ -891,55 +883,54 @@ class LaserRender:
|
|
891
883
|
gc.PopState()
|
892
884
|
|
893
885
|
def draw_image_node(self, node, gc, draw_mode, zoomscale=1.0, alpha=255):
|
894
|
-
image = node.
|
895
|
-
matrix = node.active_matrix
|
886
|
+
image, bounds = node.as_image()
|
896
887
|
gc.PushState()
|
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
|
-
pass
|
888
|
+
|
889
|
+
try:
|
890
|
+
image = node.active_image
|
891
|
+
matrix = node.active_matrix
|
892
|
+
bounds = 0, 0, image.width, image.height
|
893
|
+
if matrix is not None and not matrix.is_identity():
|
894
|
+
gc.ConcatTransform(wx.GraphicsContext.CreateMatrix(gc, ZMatrix(matrix)))
|
895
|
+
except AttributeError:
|
896
|
+
pass
|
897
|
+
|
898
|
+
cache = None
|
899
|
+
try:
|
900
|
+
cache = node._cache
|
901
|
+
except AttributeError:
|
902
|
+
pass
|
903
|
+
if cache is None:
|
904
|
+
try:
|
905
|
+
max_allowed = node.max_allowed
|
906
|
+
except AttributeError:
|
907
|
+
max_allowed = 2048
|
908
|
+
node._cache_width, node._cache_height = image.size
|
909
|
+
node._cache = self.make_thumbnail(
|
910
|
+
image,
|
911
|
+
maximum=max_allowed,
|
912
|
+
alphablack=draw_mode & DRAW_MODE_ALPHABLACK == 0,
|
913
|
+
)
|
914
|
+
node._cache_width, node._cache_height = image.size
|
915
|
+
try:
|
916
|
+
cache = self.make_thumbnail(
|
917
|
+
image, alphablack=draw_mode & DRAW_MODE_ALPHABLACK == 0
|
918
|
+
)
|
919
|
+
min_x, min_y, max_x, max_y = bounds
|
920
|
+
gc.DrawBitmap(cache, min_x, min_y, max_x - min_x, max_y - min_y)
|
921
|
+
except MemoryError:
|
922
|
+
pass
|
933
923
|
gc.PopState()
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
924
|
+
if hasattr(node, "message"):
|
925
|
+
txt = node.message
|
926
|
+
if txt is not None:
|
927
|
+
gc.PushState()
|
928
|
+
gc.SetTransform(wx.GraphicsContext.CreateMatrix(gc, ZMatrix(None)))
|
929
|
+
font = wx.Font()
|
930
|
+
font.SetPointSize(20)
|
931
|
+
gc.SetFont(font, wx.BLACK)
|
932
|
+
gc.DrawText(txt, 30, 30)
|
933
|
+
gc.PopState()
|
943
934
|
|
944
935
|
def measure_text(self, node):
|
945
936
|
"""
|
meerk40t/gui/lasertoolpanel.py
CHANGED
@@ -4,9 +4,9 @@ import wx
|
|
4
4
|
|
5
5
|
from meerk40t.core.units import Length
|
6
6
|
from meerk40t.gui.icons import (
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
icon_instruct_circle,
|
8
|
+
icon_instruct_rect,
|
9
|
+
icon_instruct_square,
|
10
10
|
)
|
11
11
|
from meerk40t.gui.mwindow import MWindow
|
12
12
|
from meerk40t.gui.wxutils import dip_size
|
@@ -98,7 +98,7 @@ class LaserToolPanel(wx.Panel):
|
|
98
98
|
img_instruction_1 = wx.StaticBitmap(
|
99
99
|
self.nb_circle,
|
100
100
|
wx.ID_ANY,
|
101
|
-
self.fitted_bitmap(
|
101
|
+
self.fitted_bitmap(icon_instruct_circle, desired_height),
|
102
102
|
)
|
103
103
|
instructions = _(
|
104
104
|
"Instruction: place the laser on three points on the circumference of the circle on the bed and confirm the position by clicking on the buttons below.\nMK will find the center for you and place the laser above it or will recreate the circle for further processing."
|
@@ -174,7 +174,7 @@ class LaserToolPanel(wx.Panel):
|
|
174
174
|
self.img_instruction_2 = wx.StaticBitmap(
|
175
175
|
self.nb_rectangle,
|
176
176
|
wx.ID_ANY,
|
177
|
-
self.fitted_bitmap(
|
177
|
+
self.fitted_bitmap(icon_instruct_rect, desired_height),
|
178
178
|
)
|
179
179
|
instructions = _(
|
180
180
|
"Instruction: place the laser on one corner of the encompassing rectangle and confirm the position by clicking on the buttons below. Then choose the opposing corner.\nMK will create a rectangle for you for further processing."
|
@@ -272,7 +272,7 @@ class LaserToolPanel(wx.Panel):
|
|
272
272
|
self.img_instruction_3 = wx.StaticBitmap(
|
273
273
|
self.nb_square,
|
274
274
|
wx.ID_ANY,
|
275
|
-
self.fitted_bitmap(
|
275
|
+
self.fitted_bitmap(icon_instruct_square, desired_height),
|
276
276
|
)
|
277
277
|
instructions = _(
|
278
278
|
"Instruction: place the laser on two points of one side of a square on the bed and confirm the position by clicking on the buttons below. Then choose one point on the other side of the corner.\nMK will create a square for you for further processing."
|
@@ -765,6 +765,7 @@ class LaserToolPanel(wx.Panel):
|
|
765
765
|
|
766
766
|
@signal_listener("driver;position")
|
767
767
|
@signal_listener("emulator;position")
|
768
|
+
@signal_listener("status;position")
|
768
769
|
def on_update_laser(self, origin, pos):
|
769
770
|
self.laserposition = (pos[2], pos[3])
|
770
771
|
|
@@ -774,7 +775,7 @@ class LaserTool(MWindow):
|
|
774
775
|
super().__init__(551, 234, submenu="Operations", *args, **kwds)
|
775
776
|
self.panel = LaserToolPanel(self, wx.ID_ANY, context=self.context)
|
776
777
|
_icon = wx.NullIcon
|
777
|
-
# _icon.CopyFromBitmap(
|
778
|
+
# _icon.CopyFromBitmap(icons8_computer_support.GetBitmap())
|
778
779
|
self.SetIcon(_icon)
|
779
780
|
self.SetTitle(_("Place Template"))
|
780
781
|
|
meerk40t/gui/materialtest.py
CHANGED
@@ -10,7 +10,7 @@ from meerk40t.core.node.op_engrave import EngraveOpNode
|
|
10
10
|
from meerk40t.core.node.op_image import ImageOpNode
|
11
11
|
from meerk40t.core.node.op_raster import RasterOpNode
|
12
12
|
from meerk40t.core.units import UNITS_PER_PIXEL, Angle, Length
|
13
|
-
from meerk40t.gui.icons import STD_ICON_SIZE,
|
13
|
+
from meerk40t.gui.icons import STD_ICON_SIZE, get_default_icon_size, icons8_detective
|
14
14
|
from meerk40t.gui.mwindow import MWindow
|
15
15
|
from meerk40t.gui.wxutils import StaticBoxSizer, TextCtrl, dip_size
|
16
16
|
from meerk40t.kernel import Settings, lookup_listener, signal_listener
|
@@ -284,7 +284,7 @@ class TemplatePanel(wx.Panel):
|
|
284
284
|
|
285
285
|
self.button_create = wx.Button(self, wx.ID_ANY, _("Create Pattern"))
|
286
286
|
self.button_create.SetBitmap(
|
287
|
-
|
287
|
+
icons8_detective.GetBitmap(resize=0.5 * get_default_icon_size())
|
288
288
|
)
|
289
289
|
|
290
290
|
sizer_main = wx.BoxSizer(wx.VERTICAL)
|
@@ -1563,7 +1563,7 @@ class TemplateTool(MWindow):
|
|
1563
1563
|
self.add_module_delegate(self.panel_saveload)
|
1564
1564
|
|
1565
1565
|
_icon = wx.NullIcon
|
1566
|
-
_icon.CopyFromBitmap(
|
1566
|
+
_icon.CopyFromBitmap(icons8_detective.GetBitmap())
|
1567
1567
|
self.SetIcon(_icon)
|
1568
1568
|
self.SetTitle(_("Parameter-Test"))
|
1569
1569
|
|
meerk40t/gui/mkdebug.py
CHANGED
@@ -1,9 +1,15 @@
|
|
1
|
+
"""
|
2
|
+
This module contains panels that display internal developer information.
|
3
|
+
They will become visible if you type 'set debug_mode True' in the
|
4
|
+
console and restart the program.
|
5
|
+
"""
|
1
6
|
import time
|
2
7
|
|
3
8
|
import wx
|
4
9
|
from wx import aui
|
5
10
|
|
6
|
-
|
11
|
+
import meerk40t.gui.icons as mkicons
|
12
|
+
from meerk40t.gui.wxutils import ScrolledPanel, StaticBoxSizer
|
7
13
|
|
8
14
|
_ = wx.GetTranslation
|
9
15
|
|
@@ -26,7 +32,47 @@ def register_panel_debugger(window, context):
|
|
26
32
|
context.register("pane/debug_tree", pane)
|
27
33
|
|
28
34
|
|
35
|
+
def register_panel_color(window, context):
|
36
|
+
pane = (
|
37
|
+
aui.AuiPaneInfo()
|
38
|
+
.Left()
|
39
|
+
.MinSize(225, 110)
|
40
|
+
.FloatingSize(225, 110)
|
41
|
+
.Caption(_("System-Colors"))
|
42
|
+
.CaptionVisible(not context.pane_lock)
|
43
|
+
.Name("debug_color")
|
44
|
+
.Hide()
|
45
|
+
)
|
46
|
+
pane.dock_proportion = 225
|
47
|
+
pane.control = DebugColorPanel(window, wx.ID_ANY, context=context)
|
48
|
+
pane.submenu = "_ZZ_" + _("Debug")
|
49
|
+
window.on_pane_create(pane)
|
50
|
+
context.register("pane/debug_color", pane)
|
51
|
+
|
52
|
+
|
53
|
+
def register_panel_icon(window, context):
|
54
|
+
pane = (
|
55
|
+
aui.AuiPaneInfo()
|
56
|
+
.Left()
|
57
|
+
.MinSize(225, 110)
|
58
|
+
.FloatingSize(225, 110)
|
59
|
+
.Caption(_("Icons"))
|
60
|
+
.CaptionVisible(not context.pane_lock)
|
61
|
+
.Name("debug_icons")
|
62
|
+
.Hide()
|
63
|
+
)
|
64
|
+
pane.dock_proportion = 225
|
65
|
+
pane.control = DebugIconPanel(window, wx.ID_ANY, context=context)
|
66
|
+
pane.submenu = "_ZZ_" + _("Debug")
|
67
|
+
window.on_pane_create(pane)
|
68
|
+
context.register("pane/debug_icons", pane)
|
69
|
+
|
70
|
+
|
29
71
|
class DebugTreePanel(wx.Panel):
|
72
|
+
"""
|
73
|
+
Displays information about selected elements
|
74
|
+
"""
|
75
|
+
|
30
76
|
def __init__(self, *args, context=None, **kwds):
|
31
77
|
# begin wxGlade: PositionPanel.__init__
|
32
78
|
kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
|
@@ -104,3 +150,210 @@ class DebugTreePanel(wx.Panel):
|
|
104
150
|
self.lb_emphasized.SetValue(txt2)
|
105
151
|
|
106
152
|
self.txt_first.SetValue(txt3)
|
153
|
+
|
154
|
+
|
155
|
+
class DebugColorPanel(ScrolledPanel):
|
156
|
+
"""
|
157
|
+
Displays system defined (OS and wxpython) colors to simplify identifying / choosing them
|
158
|
+
"""
|
159
|
+
|
160
|
+
def __init__(self, *args, context=None, **kwds):
|
161
|
+
# begin wxGlade: PositionPanel.__init__
|
162
|
+
kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
|
163
|
+
ScrolledPanel.__init__(self, *args, **kwds)
|
164
|
+
from copy import copy
|
165
|
+
|
166
|
+
self.context = context
|
167
|
+
|
168
|
+
sizer_main = wx.BoxSizer(wx.VERTICAL)
|
169
|
+
count = 1000
|
170
|
+
font = wx.Font(
|
171
|
+
6, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL
|
172
|
+
)
|
173
|
+
pattern = "SYS_COLOUR_"
|
174
|
+
for prop in dir(wx):
|
175
|
+
if prop.startswith(pattern):
|
176
|
+
# print (prop)
|
177
|
+
count += 1
|
178
|
+
if count >= 5:
|
179
|
+
sizer_line = wx.BoxSizer(wx.HORIZONTAL)
|
180
|
+
sizer_main.Add(sizer_line, 0, wx.EXPAND, 0)
|
181
|
+
count = 0
|
182
|
+
|
183
|
+
col = wx.SystemSettings().GetColour(getattr(wx, prop))
|
184
|
+
infosizer = wx.BoxSizer(wx.VERTICAL)
|
185
|
+
box = wx.StaticBitmap(
|
186
|
+
self, wx.ID_ANY, size=wx.Size(32, 32), style=wx.SB_RAISED
|
187
|
+
)
|
188
|
+
box.SetBackgroundColour(col)
|
189
|
+
box.SetToolTip(prop)
|
190
|
+
lbl = wx.StaticText(self, wx.ID_ANY, prop[len(pattern) :])
|
191
|
+
lbl.SetFont(font)
|
192
|
+
lbl.SetMinSize(wx.Size(75, -1))
|
193
|
+
infosizer.Add(box, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
|
194
|
+
infosizer.Add(lbl, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
|
195
|
+
|
196
|
+
sizer_line.Add(infosizer, 1, wx.EXPAND, 0)
|
197
|
+
count = 1000 # New line
|
198
|
+
coldb = (
|
199
|
+
"AQUAMARINE",
|
200
|
+
"FIREBRICK",
|
201
|
+
"MEDIUM FOREST GREEN",
|
202
|
+
"RED",
|
203
|
+
"BLACK",
|
204
|
+
"FOREST GREEN",
|
205
|
+
"MEDIUM GOLDENROD",
|
206
|
+
"SALMON",
|
207
|
+
"BLUE",
|
208
|
+
"GOLD",
|
209
|
+
"MEDIUM ORCHID",
|
210
|
+
"SEA GREEN",
|
211
|
+
"BLUE VIOLET",
|
212
|
+
"GOLDENROD",
|
213
|
+
"MEDIUM SEA GREEN",
|
214
|
+
"SIENNA",
|
215
|
+
"BROWN",
|
216
|
+
"GREY",
|
217
|
+
"MEDIUM SLATE BLUE",
|
218
|
+
"SKY BLUE",
|
219
|
+
"CADET BLUE",
|
220
|
+
"GREEN",
|
221
|
+
"MEDIUM SPRING GREEN",
|
222
|
+
"SLATE BLUE",
|
223
|
+
"CORAL",
|
224
|
+
"GREEN YELLOW",
|
225
|
+
"MEDIUM TURQUOISE",
|
226
|
+
"SPRING GREEN",
|
227
|
+
"CORNFLOWER BLUE",
|
228
|
+
"INDIAN RED",
|
229
|
+
"MEDIUM VIOLET RED",
|
230
|
+
"STEEL BLUE",
|
231
|
+
"CYAN",
|
232
|
+
"KHAKI",
|
233
|
+
"MIDNIGHT BLUE",
|
234
|
+
"TAN",
|
235
|
+
"DARK GREY",
|
236
|
+
"LIGHT BLUE",
|
237
|
+
"NAVY",
|
238
|
+
"THISTLE",
|
239
|
+
"DARK GREEN",
|
240
|
+
"LIGHT GREY",
|
241
|
+
"ORANGE",
|
242
|
+
"TURQUOISE",
|
243
|
+
"DARK OLIVE GREEN",
|
244
|
+
"LIGHT STEEL BLUE",
|
245
|
+
"ORANGE RED",
|
246
|
+
"VIOLET",
|
247
|
+
"DARK ORCHID",
|
248
|
+
"LIME GREEN",
|
249
|
+
"ORCHID",
|
250
|
+
"VIOLET RED",
|
251
|
+
"DARK SLATE BLUE",
|
252
|
+
"MAGENTA",
|
253
|
+
"PALE GREEN",
|
254
|
+
"WHEAT",
|
255
|
+
"DARK SLATE GREY",
|
256
|
+
"MAROON",
|
257
|
+
"PINK",
|
258
|
+
"WHITE",
|
259
|
+
"DARK TURQUOISE",
|
260
|
+
"MEDIUM AQUAMARINE",
|
261
|
+
"PLUM",
|
262
|
+
"YELLOW",
|
263
|
+
"DIM GREY",
|
264
|
+
"MEDIUM BLUE",
|
265
|
+
"PURPLE",
|
266
|
+
"YELLOW GREEN",
|
267
|
+
)
|
268
|
+
for entry in coldb:
|
269
|
+
count += 1
|
270
|
+
if count >= 5:
|
271
|
+
sizer_line = wx.BoxSizer(wx.HORIZONTAL)
|
272
|
+
sizer_main.Add(sizer_line, 0, wx.EXPAND, 0)
|
273
|
+
count = 0
|
274
|
+
|
275
|
+
col = wx.Colour(entry)
|
276
|
+
infosizer = wx.BoxSizer(wx.VERTICAL)
|
277
|
+
box = wx.StaticBitmap(
|
278
|
+
self, wx.ID_ANY, size=wx.Size(32, 32), style=wx.SB_RAISED
|
279
|
+
)
|
280
|
+
box.SetBackgroundColour(col)
|
281
|
+
box.SetToolTip(entry)
|
282
|
+
lbl = wx.StaticText(self, wx.ID_ANY, entry)
|
283
|
+
lbl.SetFont(font)
|
284
|
+
lbl.SetMinSize(wx.Size(75, -1))
|
285
|
+
infosizer.Add(box, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
|
286
|
+
infosizer.Add(lbl, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
|
287
|
+
|
288
|
+
sizer_line.Add(infosizer, 1, wx.EXPAND, 0)
|
289
|
+
|
290
|
+
self.SetSizer(sizer_main)
|
291
|
+
sizer_main.Fit(self)
|
292
|
+
self.Layout()
|
293
|
+
self.SetupScrolling()
|
294
|
+
|
295
|
+
def pane_show(self, *args):
|
296
|
+
return
|
297
|
+
|
298
|
+
def pane_hide(self, *args):
|
299
|
+
return
|
300
|
+
|
301
|
+
|
302
|
+
class DebugIconPanel(wx.Panel):
|
303
|
+
"""
|
304
|
+
Displays defined icons in a bigger size to facilitate debugging / changing them
|
305
|
+
"""
|
306
|
+
|
307
|
+
def __init__(self, *args, context=None, **kwds):
|
308
|
+
# begin wxGlade: PositionPanel.__init__
|
309
|
+
kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
|
310
|
+
wx.Panel.__init__(self, *args, **kwds)
|
311
|
+
|
312
|
+
self.context = context
|
313
|
+
self.icon = None
|
314
|
+
|
315
|
+
sizer_main = wx.BoxSizer(wx.VERTICAL)
|
316
|
+
choose_sizer = wx.BoxSizer(wx.HORIZONTAL)
|
317
|
+
|
318
|
+
lbl = wx.StaticText(self, wx.ID_ANY, "Pick icon")
|
319
|
+
|
320
|
+
self.icon_list = list()
|
321
|
+
for entry in dir(mkicons):
|
322
|
+
# print (entry)
|
323
|
+
if entry.startswith("icon"):
|
324
|
+
self.icon_list.append(entry)
|
325
|
+
self.combo_icons = wx.ComboBox(
|
326
|
+
self,
|
327
|
+
wx.ID_ANY,
|
328
|
+
choices=self.icon_list,
|
329
|
+
style=wx.CB_SORT | wx.CB_READONLY | wx.CB_DROPDOWN,
|
330
|
+
)
|
331
|
+
choose_sizer.Add(lbl, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
332
|
+
choose_sizer.Add(self.combo_icons, 0, wx.ALIGN_CENTER_VERTICAL, 0)
|
333
|
+
sizer_main.Add(choose_sizer, 0, wx.EXPAND, 0)
|
334
|
+
self.SetSizer(sizer_main)
|
335
|
+
self.icon_show = wx.StaticBitmap(self, wx.ID_ANY)
|
336
|
+
sizer_main.Add(self.icon_show, 1, wx.EXPAND, 0)
|
337
|
+
sizer_main.Fit(self)
|
338
|
+
self.combo_icons.Bind(wx.EVT_COMBOBOX, self.on_combo)
|
339
|
+
self.Layout()
|
340
|
+
|
341
|
+
def on_combo(self, event):
|
342
|
+
idx = self.combo_icons.GetSelection()
|
343
|
+
if idx < 0:
|
344
|
+
return
|
345
|
+
s = self.combo_icons.GetString(idx)
|
346
|
+
if s:
|
347
|
+
obj = getattr(mkicons, s, None)
|
348
|
+
if obj is not None:
|
349
|
+
if isinstance(obj, (mkicons.VectorIcon, mkicons.PyEmbeddedImage)):
|
350
|
+
imgs = self.icon_show.Size
|
351
|
+
ms = min(imgs[0], imgs[1])
|
352
|
+
bmp = obj.GetBitmap(resize=ms)
|
353
|
+
self.icon_show.SetBitmap(bmp)
|
354
|
+
|
355
|
+
def pane_show(self, *args):
|
356
|
+
return
|
357
|
+
|
358
|
+
def pane_hide(self, *args):
|
359
|
+
return
|