Skip to content

Commit

Permalink
Merge branch 'meerk40t:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Laserology authored Oct 23, 2024
2 parents 163cb86 + c233361 commit 4b92fe6
Show file tree
Hide file tree
Showing 19 changed files with 350 additions and 43 deletions.
50 changes: 50 additions & 0 deletions locale/de/LC_MESSAGES/meerk40t.po
Original file line number Diff line number Diff line change
Expand Up @@ -18840,3 +18840,53 @@ msgstr "Aktiv: Hatch-Linien werden untereinander optimiert."
#: meerk40t/core/planner.py:279
msgid "Inactive: hatch lines will be burnt sequentially."
msgstr "Inaktiv: Hatch-Linien werden nacheinander gebrannt."

#: meerk40t/newly/gui/operationproperties.py:29
msgid "Advanced Acceleration"
msgstr "Beschleunigung"

#: meerk40t/newly/gui/operationproperties.py:30
msgid "Set acceleration value for this operation"
msgstr "Setze Beschleunigungswerte für diesen Arbeitsablauf"

#: meerk40t/newly/gui/newlyconfig.py:41
msgid "Newly"
msgstr "Newly"

#: meerk40t/newly/gui/newlyconfig.py:43
msgid "Global"
msgstr "Global"

#: meerk40t/newly/gui/newlyconfig.py:60
msgid "Raster Chart"
msgstr "Raster-Chart"

#: meerk40t/gui/propertypanels/attributes.py:1412
msgid "Auto-Hide"
msgstr "Automatisches Verbergen"

#: meerk40t/gui/propertypanels/attributes.py:1413
msgid "Autohide children"
msgstr "Elemente verbergen"

#: meerk40t/gui/propertypanels/attributes.py:1416
msgid "Toggle the adoption behaviour of the effect."
msgstr "Schaltet das Verhalten des Effektes um."

#: meerk40t/gui/propertypanels/attributes.py:1418
msgid "Active: Added children will be automatically hidden, so only the result of the effect will be seen/burned"
msgstr "Aktiv: Enthaltene Elemente werden ausgeblendet, nur das Ergebnis des Effekts wird angezeigt/gebrannt"

#: meerk40t/gui/propertypanels/attributes.py:1420
msgid "Inactive: Added children remain unchanged, so both the child and the result of the effect will be seen/burned"
msgstr "Inaktiv: Enthaltene Elemente bleiben unverändert, sowohl das Element als auch das Ergebnis des Elements werden angezeigt/gebrannt"

#: meerk40t/gui/propertypanels/warpproperty.py:66
msgid "Instructions:"
msgstr "Hilfe:"

#: meerk40t/gui/propertypanels/warpproperty.py:68
msgid "Use the finger tool to modify the containing shape of the warped children"
msgstr ""
"Benutze das Finger-Werkzeug, um die umgebende Form\n"
"um die enthaltenen Elemente zu verändern."
43 changes: 21 additions & 22 deletions meerk40t/core/elements/element_treeops.py
Original file line number Diff line number Diff line change
Expand Up @@ -2508,28 +2508,6 @@ def append_element_effect_line_45(node, pos=None, **kwargs):
pos=pos,
)

@tree_conditional(lambda node: is_developer_mode())
@tree_submenu(_("Apply special effect"))
@tree_operation(
_("Append Warp").format(),
node_type=hatchable_elems,
help=_("Apply a warp effect"),
grouping="50_ELEM_MODIFY_ZMISC_WARP",
)
def append_element_effect_warp(node, pos=None, **kwargs):
# Language hint _("Apply warp")
with self.undoscope("Apply warp"):
group_node = node.parent.add(
type="effect warp",
pos=pos,
)
for e in list(self.elems(emphasized=True)):
group_node.append_child(e)
if self.classify_new:
self.classify([group_node])

self.signal("updateelem_tree")

def wobble_me(node, wobble_type, wobble_radius, wobble_interval, pos):
# Language hint _("Apply wobble")
with self.undoscope("Apply wobble"):
Expand Down Expand Up @@ -2619,6 +2597,27 @@ def append_element_effect_wobble_m1(node, pos=None, **kwargs):
pos=pos,
)

@tree_submenu(_("Apply special effect"))
@tree_operation(
_("Append Warp").format(),
node_type=hatchable_elems,
help=_("Apply a warp effect"),
grouping="51_ELEM_MODIFY_ZMISC_WARP",
)
def append_element_effect_warp(node, pos=None, **kwargs):
# Language hint _("Apply warp")
with self.undoscope("Apply warp"):
group_node = node.parent.add(
type="effect warp",
pos=pos,
)
for e in list(self.elems(emphasized=True)):
group_node.append_child(e)
if self.classify_new:
self.classify([group_node])

self.signal("updateelem_tree")

@tree_operation(
_("Duplicate operation(s)"),
node_type=op_nodes,
Expand Down
2 changes: 1 addition & 1 deletion meerk40t/core/node/effect_hatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, *args, id=None, label=None, lock=False, **kwargs):
kwargs["hidden"] = False
self.hidden = kwargs["hidden"]

self._formatter = "{element_type} - {distance} {angle} ({children})"
self._formatter = "{element_type} {id} - {distance} {angle} ({children})"

if label is None:
self.label = "Hatch"
Expand Down
12 changes: 11 additions & 1 deletion meerk40t/core/node/effect_warp.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def __init__(self, *args, id=None, label=None, lock=False, **kwargs):
self.stroke_scale = False
self._stroke_zero = None
self.output = True
self.autohide = True
self.p1 = complex(0, 0)
self.p2 = complex(0, 0)
self.p3 = complex(0, 0)
Expand All @@ -31,7 +32,7 @@ def __init__(self, *args, id=None, label=None, lock=False, **kwargs):
self._interim = False

Node.__init__(self, type="effect warp", id=id, label=label, lock=lock, **kwargs)
self._formatter = "{element_type} - ({children})"
self._formatter = "{element_type} {id} - ({children})"

if label is None:
self.label = "Warp"
Expand Down Expand Up @@ -93,13 +94,17 @@ def notify_attached(self, node=None, **kwargs):
Node.notify_attached(self, node=node, **kwargs)
if node is self:
return
if self.autohide and hasattr(node, "hidden"):
node.hidden = True
self.altered()
self.set_bounds_parameters()

def notify_detached(self, node=None, **kwargs):
Node.notify_detached(self, node=node, **kwargs)
if node is self:
return
if self.autohide and hasattr(node, "hidden"):
node.hidden = False
self.altered()
self.set_bounds_parameters()

Expand Down Expand Up @@ -127,6 +132,11 @@ def notify_scaled(self, node=None, sx=1, sy=1, ox=0, oy=0, interim=False, **kwar
self.altered()
self.set_bounds_parameters()

def append_child(self, new_child):
if self.autohide and hasattr(new_child, "hidden"):
new_child.hidden = True
return super().append_child(new_child)

def notify_translated(self, node=None, dx=0, dy=0, interim=False, **kwargs):
Node.notify_translated(self, node, dx, dy, interim=interim, **kwargs)
if node is self:
Expand Down
12 changes: 11 additions & 1 deletion meerk40t/core/node/effect_wobble.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def __init__(self, *args, id=None, label=None, lock=False, **kwargs):
self.stroke_scale = False
self._stroke_zero = None
self.output = True
self.autohide = True
self.wobble_radius = "1.5mm"
self.wobble_interval = "0.1mm"
self.wobble_speed = 50
Expand All @@ -37,7 +38,7 @@ def __init__(self, *args, id=None, label=None, lock=False, **kwargs):
else:
kwargs["hidden"] = False
self.hidden = kwargs["hidden"]
self._formatter = "{element_type} - {type} {radius} ({children})"
self._formatter = "{element_type} {id} - {type} {radius} ({children})"

if label is None:
self.label = "Wobble"
Expand Down Expand Up @@ -72,12 +73,16 @@ def notify_attached(self, node=None, **kwargs):
Node.notify_attached(self, node=node, **kwargs)
if node is self:
return
if self.autohide and hasattr(node, "hidden"):
node.hidden = True
self.altered()

def notify_detached(self, node=None, **kwargs):
Node.notify_detached(self, node=node, **kwargs)
if node is self:
return
if self.autohide and hasattr(node, "hidden"):
node.hidden = False
self.altered()

def notify_modified(self, node=None, **kwargs):
Expand Down Expand Up @@ -110,6 +115,11 @@ def notify_translated(self, node=None, dx=0, dy=0, interim=False, **kwargs):
else:
self.altered()

def append_child(self, new_child):
if self.autohide and hasattr(new_child, "hidden"):
new_child.hidden = True
return super().append_child(new_child)

@property
def radius(self):
return self.wobble_radius
Expand Down
3 changes: 2 additions & 1 deletion meerk40t/device/gui/formatterpanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from meerk40t.gui.icons import (
EmptyIcon,
icon_console,
icon_distort,
icon_effect_hatch,
icon_effect_wobble,
icon_external,
Expand Down Expand Up @@ -61,7 +62,7 @@ def __init__(self, *args, context=None, **kwds):
"op dots": icon_points,
"effect hatch": icon_effect_hatch,
"effect wobble": icon_effect_wobble,
"effect warp": icon_effect_wobble,
"effect warp": icon_distort,
"file": icons8_file,
"group": icons8_group_objects,
"elem point": icon_points,
Expand Down
4 changes: 2 additions & 2 deletions meerk40t/gui/guicolors.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ def set_random_colors(self):
for key in default_color:
setattr(self, key, random_color())

def set_default_colors(self):
def set_default_colors(self, brighter=False):
"""
Reset all colors to default values...
"""
for key, value in default_color.items():
setattr(self, key, value)
if self._kernel.root.themes.dark:
if self._kernel.root.themes.dark and not brighter:
for key, value in default_colors_dark.items():
setattr(self, key, value)
13 changes: 13 additions & 0 deletions meerk40t/gui/icons.py
Original file line number Diff line number Diff line change
Expand Up @@ -3502,3 +3502,16 @@ def splitted(org):
),
strokewidth=1,
)

icon_distort = VectorIcon(
fill=(
"M464.149,343.637l-52.693-158.08C432.981,175.253,448,153.429,448,128c0-35.307-28.715-64-64-64"
"c-18.219,0-34.603,7.744-46.272,20.011l-169.877-37.76C160.107,19.627,135.765,0,106.667,0c-35.285,0-64,28.693-64,64"
"c0,26.816,16.619,49.749,40.085,59.264L45.056,387.179C19.051,395.328,0,419.349,0,448c0,35.285,28.715,64,64,64"
"c28.651,0,52.672-19.051,60.821-45.056l263.915-37.696c9.493,23.445,32.448,40.085,59.264,40.085c35.285,0,64-28.715,64-64"
"C512,375.637,491.605,350.848,464.149,343.637z M387.2,386.368l-263.936,37.717c-6.507-16.064-19.285-28.864-35.349-35.349"
"L125.632,124.8c17.792-5.568,32.363-18.453,39.723-35.392l155.072,34.453C320.32,125.248,320,126.571,320,128"
"c0,29.675,20.395,54.464,47.851,61.675l52.693,158.08C404.629,355.392,392.533,369.323,387.2,386.368z",
),
stroke=()
)
14 changes: 8 additions & 6 deletions meerk40t/gui/laserpanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
icon_closed_door,
icon_open_door,
icon_update_plan,
icons8_computer_support,
icons8_delete,
icons8_emergency_stop_button,
icons8_gas_industry,
Expand All @@ -26,6 +27,7 @@
disable_window,
wxButton,
wxCheckBox,
wxStaticBitmap,
wxStaticText,
)
from meerk40t.kernel import lookup_listener, signal_listener
Expand Down Expand Up @@ -146,7 +148,9 @@ def __init__(self, *args, context=None, **kwds):
self.combo_devices.SetToolTip(
_("Select device from list of configured devices")
)
self.btn_config_laser = wxButton(self, wx.ID_ANY, "*")
ss = dip_size(self, 23, 23)
self.btn_config_laser = wxButton(self, wx.ID_ANY, size=ss)
self.btn_config_laser.SetBitmap(icons8_computer_support.GetBitmap(resize=ss[0]))
self.btn_config_laser.SetToolTip(
_("Opens device-specific configuration window")
)
Expand All @@ -157,10 +161,7 @@ def __init__(self, *args, context=None, **kwds):
):
self.btn_config_laser.Enable(False)
self.sizer_devices.Add(self.combo_devices, 1, wx.EXPAND, 0)
if platform.system() == "Windows":
minsize = 20
else:
minsize = 30
minsize = 32
self.btn_config_laser.SetMinSize(dip_size(self, minsize, -1))
self.sizer_devices.Add(self.btn_config_laser, 0, wx.EXPAND, 0)

Expand Down Expand Up @@ -343,7 +344,8 @@ def __init__(self, *args, context=None, **kwds):
self.Bind(wx.EVT_SLIDER, self.on_slider_speed, self.slider_speed)
self.Bind(wx.EVT_SLIDER, self.on_slider_power, self.slider_power)
self.Bind(wx.EVT_CHECKBOX, self.on_optimize, self.checkbox_optimize)
self.Bind(wx.EVT_BUTTON, self.on_config_button, self.btn_config_laser)
# self.btn_config_laser.Bind(wx.EVT_LEFT_DOWN, self.on_config_button)
self.btn_config_laser.Bind(wx.EVT_BUTTON, self.on_config_button)
# end wxGlade
self.checkbox_adjust.SetValue(False)
self.on_check_adjust(None)
Expand Down
7 changes: 4 additions & 3 deletions meerk40t/gui/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,13 @@ def message_dialog(*args):
image = None
from ..main import APPLICATION_VERSION
from platform import system
kernel.busyinfo.start(msg=_("Start MeerK40t|V. {version}".format(version=APPLICATION_VERSION)), image=image)
kernel.busyinfo.change(msg=_("Load main module"), keep=1)
if system() != "Linux":
kernel.busyinfo.start(msg=_("Start MeerK40t|V. {version}".format(version=APPLICATION_VERSION)), image=image)
kernel.busyinfo.change(msg=_("Load main module"), keep=1)
meerk40tgui = kernel_root.open("module/wxMeerK40t")

@kernel.console_command(
("quit", "shutdown"), help=_("shuts down the gui and exits")
("quit", "shutdown", "exit"), help=_("shuts down the gui and exits")
)
def shutdown(**kwargs):
try:
Expand Down
26 changes: 26 additions & 0 deletions meerk40t/gui/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,17 @@ def __init__(self, *args, **kwds):
"section": "_ZZ_",
}
)
if self.window_context.themes.dark:
color_choices.append(
{
"attr": "color_reset_brighter",
"object": self,
"type": bool,
"style": "button",
"label": _("Reset Colors to brighter defaults"),
"section": "_ZZ_",
}
)

self.panel_color = ChoicePropertyPanel(
self,
Expand Down Expand Up @@ -798,6 +809,21 @@ def color_reset(self, value):
self.panel_color.reload()
self.context.signal("restart")

@property
def color_reset_brighter(self):
# Not relevant
return False

@color_reset.setter
def color_reset_brighter(self, value):
if value:
# We are resetting all GUI.colors
self.context("scene color unsetbright\n")
self.context.root.label_display_color = "#ff0000ff"
self.context.signal("theme", True)
self.panel_color.reload()
self.context.signal("restart")

@property
def preset_classify_manual(self):
# Not relevant
Expand Down
Loading

0 comments on commit 4b92fe6

Please sign in to comment.