Skip to content

Commit

Permalink
Merge pull request meerk40t#2656 from Laserology/main
Browse files Browse the repository at this point in the history
Simplify device listings and add longer ray5
  • Loading branch information
jpirnay authored Oct 23, 2024
2 parents 079f1a3 + 4b92fe6 commit e69d929
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 95 deletions.
12 changes: 4 additions & 8 deletions meerk40t/balormk/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
47 changes: 36 additions & 11 deletions meerk40t/grbl/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -59,7 +58,6 @@ def plugin(kernel, lifecycle=None):
),
"priority": 20,
"family": _("Generic"),
"family_priority": 20,
"choices": [
{
"attr": "label",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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 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": [
{
"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)
Expand Down
17 changes: 15 additions & 2 deletions meerk40t/gui/devicepanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_priority", 0))
key=lambda e: str(self.sort_family_name[e[0].get("family", 0)])
+ "_"
+ str(e[0].get("priority", 0)),
reverse=True,
Expand All @@ -136,7 +150,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()
Expand Down
6 changes: 2 additions & 4 deletions meerk40t/lihuiyu/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions meerk40t/moshi/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading

0 comments on commit e69d929

Please sign in to comment.