From 8de7145313372ec134d9c2f73ea81e593b541c88 Mon Sep 17 00:00:00 2001 From: Laserology Date: Mon, 21 Oct 2024 23:53:42 -0700 Subject: [PATCH 1/3] Simplify device listings and add longer ray5 --- meerk40t/balormk/plugin.py | 12 ++--- meerk40t/grbl/plugin.py | 47 +++++++++++++----- meerk40t/gui/devicepanel.py | 3 +- meerk40t/lihuiyu/plugin.py | 6 +-- meerk40t/moshi/plugin.py | 3 +- meerk40t/newly/plugin.py | 99 +++++++++++++------------------------ meerk40t/ruida/plugin.py | 3 +- 7 files changed, 78 insertions(+), 95 deletions(-) diff --git a/meerk40t/balormk/plugin.py b/meerk40t/balormk/plugin.py index 0bca42c305..cf1df8df1b 100644 --- a/meerk40t/balormk/plugin.py +++ b/meerk40t/balormk/plugin.py @@ -33,8 +33,7 @@ def plugin(kernel, lifecycle): "The JCZ Controller is a type of Galvo Laser Controller for several different sources compatible with the EZCad2™ software." ), "priority": 9, - "family": _("Fibre-Laser"), - "family_priority": 30, + "family": _("Generic Fibre-Laser"), "choices": [ { "attr": "label", @@ -58,8 +57,7 @@ def plugin(kernel, lifecycle): + "\n" + _("With this driver we specifically enable the MOPA feature."), "priority": 8, - "family": _("Fibre-Laser"), - "family_priority": 30, + "family": _("Generic Fibre-Laser"), "choices": [ { "attr": "label", @@ -89,8 +87,7 @@ def plugin(kernel, lifecycle): "With specific settings for the CO2 source. (No specific settings are known)." ), "priority": 7, - "family": _("CO2-Laser"), - "family_priority": 99, + "family": _("Generic CO2-Laser"), "choices": [ { "attr": "label", @@ -116,8 +113,7 @@ def plugin(kernel, lifecycle): "With specific settings for the UV source. (No specific settings are known)." ), "priority": 6, - "family": _("UV-Laser"), - "family_priority": 10, + "family": _("Generic UV-Laser"), "choices": [ { "attr": "label", diff --git a/meerk40t/grbl/plugin.py b/meerk40t/grbl/plugin.py index e7ed5d3437..112a7d9b8d 100644 --- a/meerk40t/grbl/plugin.py +++ b/meerk40t/grbl/plugin.py @@ -35,8 +35,7 @@ def plugin(kernel, lifecycle=None): "friendly_name": _("Generic (GRBL-Controller)"), "extended_info": _("Generic GRBL Laser Device."), "priority": 17, - "family": _("Generic"), - "family_priority": 20, + "family": _("Generic Diode-Laser"), "choices": [ { "attr": "label", @@ -59,7 +58,6 @@ def plugin(kernel, lifecycle=None): ), "priority": 20, "family": _("Generic"), - "family_priority": 20, "choices": [ { "attr": "label", @@ -84,15 +82,14 @@ def plugin(kernel, lifecycle=None): "dev_info/grbl-k40", { "provider": "provider/device/grbl", - "friendly_name": _("K40 (GRBL-Controller)"), + "friendly_name": _("K40 CO2 (GRBL-Controller)"), "extended_info": _("K40 laser with a modified GRBL laser controller."), "priority": 18, - "family": _("CO2-Laser"), - "family_priority": 99, + "family": _("K-Series CO2-Laser"), "choices": [ { "attr": "label", - "default": "GRBL-K40", + "default": "GRBL-K40-CO2", }, { "attr": "has_endstops", @@ -126,8 +123,7 @@ def plugin(kernel, lifecycle=None): "Any of a variety of inexpensive GRBL based diode lasers." ), "priority": 19, - "family": _("Diode-Laser"), - "family_priority": 50, + "family": _("Generic"), "choices": [ { "attr": "label", @@ -151,8 +147,7 @@ def plugin(kernel, lifecycle=None): "friendly_name": _("Ortur Laser Master 2 (GRBL)"), "extended_info": _("Ortur-branded self-assembled grbl diode lasers"), "priority": 21, - "family": _("Diode-Laser"), - "family_priority": 50, + "family": _("Ortur Diode-Laser"), "choices": [ { "attr": "label", @@ -175,6 +170,36 @@ def plugin(kernel, lifecycle=None): ], }, ) + kernel.register( + "dev_info/grbl-longer-ray5", + { + "provider": "provider/device/grbl", + "friendly_name": _("Longer Ray5 (GRBL)"), + "extended_info": _("Longer-branded 10w/20w grbl diode laser."), + "priority": 21, + "family": _("Longer Diode-Laser"), + "choices": [ + { + "attr": "label", + "default": "Longer-Ray5", + }, + { + "attr": "has_endstops", + "default": False, + }, + { + "attr": "source", + "default": "diode", + }, + { + "attr": "require_validator", + "default": False, + }, + {"attr": "bedheight", "default": "450mm"}, + {"attr": "bedwidth", "default": "450mm"}, + ], + }, + ) kernel.register("driver/grbl", GRBLDriver) kernel.register("spoolerjob/grbl", GcodeJob) kernel.register("interpreter/grbl", GRBLInterpreter) diff --git a/meerk40t/gui/devicepanel.py b/meerk40t/gui/devicepanel.py index 71b4aa963d..412c69d80a 100644 --- a/meerk40t/gui/devicepanel.py +++ b/meerk40t/gui/devicepanel.py @@ -117,7 +117,7 @@ def populate_tree(self): tree_root = tree.AddRoot(_("Devices")) self.dev_infos = list(self.context.find("dev_info")) self.dev_infos.sort( - key=lambda e: str(e[0].get("family_priority", 0)) + key=lambda e: str(e[0].get("family", 0)) + "_" + str(e[0].get("priority", 0)), reverse=True, @@ -136,7 +136,6 @@ def populate_tree(self): parent_item = tree.AppendItem(tree_root, family) device_item = tree.AppendItem(parent_item, info) tree.SetItemData(device_item, index) - tree.ExpandAll() def on_text_filter(self, event): self.filter = self.text_filter.GetValue() diff --git a/meerk40t/lihuiyu/plugin.py b/meerk40t/lihuiyu/plugin.py index bd4e62d2b3..a7ee0e1caa 100644 --- a/meerk40t/lihuiyu/plugin.py +++ b/meerk40t/lihuiyu/plugin.py @@ -35,8 +35,7 @@ def plugin(kernel, lifecycle=None): + "The most recent and popular revision version is 6C6879-LASER-M2:9." ), "priority": 99, - "family": _("CO2-Laser"), - "family_priority": 99, + "family": _("K-Series CO2-Laser"), "choices": [ { "attr": "label", @@ -66,8 +65,7 @@ def plugin(kernel, lifecycle=None): + "The M3Nano Plus variation replaces the A4988 stepper motor chips with TMC stepper motor chips." ), "priority": 90, - "family": _("CO2-Laser"), - "family_priority": 99, + "family": _("K-Series CO2-Laser"), "choices": [ { "attr": "board", diff --git a/meerk40t/moshi/plugin.py b/meerk40t/moshi/plugin.py index dac25bb107..d151f5d0bb 100644 --- a/meerk40t/moshi/plugin.py +++ b/meerk40t/moshi/plugin.py @@ -28,8 +28,7 @@ def plugin(kernel, lifecycle=None): + "The boards are usually red and sport two large black heatsinks for their stepper motor chips." ), "priority": 0, - "family": _("CO2-Laser"), - "family_priority": 99, + "family": _("Generic CO2-Laser"), "choices": [ { "attr": "label", diff --git a/meerk40t/newly/plugin.py b/meerk40t/newly/plugin.py index 8c541f4ba4..15ea1b568c 100644 --- a/meerk40t/newly/plugin.py +++ b/meerk40t/newly/plugin.py @@ -62,8 +62,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("RayLaser/U-SET"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -90,8 +89,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Beijing SZTaiming"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -118,8 +116,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Gama"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -146,8 +143,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Cybertech ltd - u-set"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -174,8 +170,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Artsign JSM-40U/3040U/3060U"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -212,8 +207,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Artsign JSM-40N/3040N/3060N"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -250,8 +244,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Light Technology LH40U/3040U/3060U"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -288,8 +281,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Greatsign LE40U/3040U/3060U"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -326,8 +318,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Helo Lasergraviermaschine-HLG 40N"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -364,8 +355,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Workline laser"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -402,8 +392,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("HPC LASER-LS 3020"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -440,8 +429,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Sicano - SIC-L40B"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -478,8 +466,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Rabbit - Rabbit40B"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -516,8 +503,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("ZL Tech - ZL40B"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -554,8 +540,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Jinan Suke"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -592,8 +577,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Jinan Jinweik - Laser B"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -637,8 +621,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Lion laser"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -671,8 +654,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Villa L. & Figlio S.R.L. - Laser B"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -713,8 +695,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("AMC CO damascus - Laser B"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -759,8 +740,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Jinan Ruijie - Laser U"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -793,8 +773,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Mini Laser - USB"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -827,8 +806,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Jinan Xinyi - USB"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -861,8 +839,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Weifang Tiangong - Laser B"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -895,8 +872,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Duowei Laser - Laser U"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -929,8 +905,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Weifang Tiangong - Laser B"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -963,8 +938,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Jinan DaGong - TLU series"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -993,8 +967,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Jinan Senfeng - Laser U"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -1027,8 +1000,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("ZhengZhou LeCai - LC Laser"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -1061,8 +1033,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("ZhengZhou LeCai - LC Plasma"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -1103,8 +1074,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Wuhan Jinli - JL Cylinder"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -1137,8 +1107,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("DongGuan EverTech - ETL3525 Laser"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -1171,8 +1140,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Wuhan Anwei - AW-U"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", @@ -1213,8 +1181,7 @@ def plugin(kernel, lifecycle): "friendly_name": _("Liaocheng Xinxing - U"), "extended_info": _("Older CO2 Laser running the NewlyDraw software"), "priority": 5, - "family": _("Older CO2-Laser"), - "family_priority": 15, + "family": _("Newly CO2-Laser"), "choices": [ { "attr": "label", diff --git a/meerk40t/ruida/plugin.py b/meerk40t/ruida/plugin.py index 213ca2fb58..54ba459b24 100644 --- a/meerk40t/ruida/plugin.py +++ b/meerk40t/ruida/plugin.py @@ -27,8 +27,7 @@ def plugin(kernel, lifecycle=None): "friendly_name": _("K50/K60-CO2-Laser (Ruida-Controller) (INCOMPLETE)"), "extended_info": _("This driver is incomplete. Use at your own risk."), "priority": -1, - "family": _("CO2-Laser"), - "family_priority": 0, + "family": _("K-Series CO2-Laser"), "choices": [ { "attr": "label", From c9a0b091c6fac621c9213024381e4aa3218d8ba3 Mon Sep 17 00:00:00 2001 From: Laserology Date: Tue, 22 Oct 2024 18:54:36 -0700 Subject: [PATCH 2/3] Fixup --- meerk40t/gui/devicepanel.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/meerk40t/gui/devicepanel.py b/meerk40t/gui/devicepanel.py index 412c69d80a..31c081e1c8 100644 --- a/meerk40t/gui/devicepanel.py +++ b/meerk40t/gui/devicepanel.py @@ -111,13 +111,27 @@ def __init__(self, *args, context=None, **kwds): self.Layout() self.populate_tree() + # Used for proper sorting in the device add menu. + sort_family_name = { + _("K-Series CO2-Laser"): 99, + _("Ortur Diode-Laser"): 98, + _("Longer Diode-Laser"): 97, + _("Newly CO2-Laser"): 96, + _("Generic UV-Laser"): 95, + _("Generic CO2-Laser"): 94, + _("Generic Fibre-Laser"): 93, + _("Generic Diode-Laser"): 92, + _("Generic"): 91, + } + def populate_tree(self): tree = self.tree_devices tree.DeleteAllItems() tree_root = tree.AddRoot(_("Devices")) self.dev_infos = list(self.context.find("dev_info")) + self.dev_infos.sort( - key=lambda e: str(e[0].get("family", 0)) + key=lambda e: str(self.sort_family_name[e[0].get("family", 0)]) + "_" + str(e[0].get("priority", 0)), reverse=True, From 163cb86adf2598ef85fd939ca32d2ddde4a98ac2 Mon Sep 17 00:00:00 2001 From: Laserology Date: Wed, 23 Oct 2024 00:00:03 -0700 Subject: [PATCH 3/3] Minor naming tweaks --- meerk40t/grbl/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meerk40t/grbl/plugin.py b/meerk40t/grbl/plugin.py index 112a7d9b8d..e1289feaa0 100644 --- a/meerk40t/grbl/plugin.py +++ b/meerk40t/grbl/plugin.py @@ -175,7 +175,7 @@ def plugin(kernel, lifecycle=None): { "provider": "provider/device/grbl", "friendly_name": _("Longer Ray5 (GRBL)"), - "extended_info": _("Longer-branded 10w/20w grbl diode laser."), + "extended_info": _("Longer-branded 5w/10w/20w grbl diode laser.\nMake sure you verify your bed size! This machine has several upgrade kits."), "priority": 21, "family": _("Longer Diode-Laser"), "choices": [