Просмотр исходного кода

Merge remote-tracking branch 'origin/main' into ed/sovol-rework

Jelle Spijker 2 лет назад
Родитель
Сommit
b558e6ac2a

+ 5 - 1
.github/workflows/printer-linter-format.yml

@@ -3,7 +3,11 @@ name: printer-linter-format
 on:
     push:
         paths:
-            - 'resources/**'
+            - 'resources/definitions/**'
+            - 'resources/extruders/**'
+            - 'resources/intent/**'
+            - 'resources/quality/**'
+            - 'resources/variants/**'
 
 jobs:
     printer-linter-format:

+ 3 - 3
UltiMaker-Cura.spec.jinja

@@ -16,9 +16,9 @@ datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
 # Add dynamic libs in the venv bin/Script Path. This is needed because we might copy some additional libs
 # e.q.: OpenSSL 1.1.1l in that directory with a separate:
 # `conan install openssl@1.1.1l -g deploy && cp openssl/bin/*.so cura_inst/bin`
-binaries.extend([(str(bin), ".") for bin in Path("{{ venv_script_path }}").glob("*.so*")])
-binaries.extend([(str(bin), ".") for bin in Path("{{ venv_script_path }}").glob("*.dll")])
-binaries.extend([(str(bin), ".") for bin in Path("{{ venv_script_path }}").glob("*.dylib")])
+binaries.extend([(str(bin), ".") for bin in Path(r"{{ venv_script_path }}").glob("*.so*")])
+binaries.extend([(str(bin), ".") for bin in Path(r"{{ venv_script_path }}").glob("*.dll")])
+binaries.extend([(str(bin), ".") for bin in Path(r"{{ venv_script_path }}").glob("*.dylib")])
 
 block_cipher = None
 

+ 70 - 10
plugins/PostProcessingPlugin/scripts/FilamentChange.py

@@ -24,20 +24,29 @@ class FilamentChange(Script):
             "version": 2,
             "settings":
             {
+                "enabled":
+                {
+                    "label": "Enable",
+                    "description": "Uncheck to temporarily disable this feature.",
+                    "type": "bool",
+                    "default_value": true
+                },
                 "layer_number":
                 {
                     "label": "Layer",
                     "description": "At what layer should color change occur. This will be before the layer starts printing. Specify multiple color changes with a comma.",
                     "unit": "",
                     "type": "str",
-                    "default_value": "1"
+                    "default_value": "1",
+                    "enabled": "enabled"
                 },
                 "firmware_config":
                 {
                     "label": "Use Firmware Configuration",
                     "description": "Use the settings in your firmware, or customise the parameters of the filament change here.",
                     "type": "bool",
-                    "default_value": false
+                    "default_value": false,
+                    "enabled": "enabled"
                 },
                 "initial_retract":
                 {
@@ -46,7 +55,7 @@ class FilamentChange(Script):
                     "unit": "mm",
                     "type": "float",
                     "default_value": 30.0,
-                    "enabled": "not firmware_config"
+                    "enabled": "enabled and not firmware_config"
                 },
                 "later_retract":
                 {
@@ -55,7 +64,7 @@ class FilamentChange(Script):
                     "unit": "mm",
                     "type": "float",
                     "default_value": 300.0,
-                    "enabled": "not firmware_config"
+                    "enabled": "enabled and not firmware_config"
                 },
                 "x_position":
                 {
@@ -64,7 +73,7 @@ class FilamentChange(Script):
                     "unit": "mm",
                     "type": "float",
                     "default_value": 0,
-                    "enabled": "not firmware_config"
+                    "enabled": "enabled and not firmware_config"
                 },
                 "y_position":
                 {
@@ -73,7 +82,7 @@ class FilamentChange(Script):
                     "unit": "mm",
                     "type": "float",
                     "default_value": 0,
-                    "enabled": "not firmware_config"
+                    "enabled": "enabled and not firmware_config"
                 },
                 "z_position":
                 {
@@ -82,7 +91,8 @@ class FilamentChange(Script):
                     "unit": "mm",
                     "type": "float",
                     "default_value": 0,
-                    "minimum_value": 0
+                    "minimum_value": 0,
+                    "enabled": "enabled"
                 },
                 "retract_method":
                 {
@@ -92,7 +102,7 @@ class FilamentChange(Script):
                     "options": {"U": "Marlin (M600 U)", "L": "Reprap (M600 L)"},
                     "default_value": "U",
                     "value": "\\\"L\\\" if machine_gcode_flavor==\\\"RepRap (RepRap)\\\" else \\\"U\\\"",
-                    "enabled": "not firmware_config"
+                    "enabled": "enabled and not firmware_config"
                 },                    
                 "machine_gcode_flavor":
                 {
@@ -113,6 +123,40 @@ class FilamentChange(Script):
                     },
                     "default_value": "RepRap (Marlin/Sprinter)",
                     "enabled": "false"
+                },
+                "enable_before_macro":
+                {
+                    "label": "Enable G-code Before",
+                    "description": "Use this to insert a custom G-code macro before the filament change happens",
+                    "type": "bool",
+                    "default_value": false,
+                    "enabled": "enabled"
+                },
+                "before_macro":
+                {
+                    "label": "G-code Before",
+                    "description": "Any custom G-code to run before the filament change happens, for example, M300 S1000 P10000 for a long beep.",
+                    "unit": "",
+                    "type": "str",
+                    "default_value": "M300 S1000 P10000",
+                    "enabled": "enabled and enable_before_macro"
+                },
+                "enable_after_macro":
+                {
+                    "label": "Enable G-code After",
+                    "description": "Use this to insert a custom G-code macro after the filament change",
+                    "type": "bool",
+                    "default_value": false,
+                    "enabled": "enabled"
+                },
+                "after_macro":
+                {
+                    "label": "G-code After",
+                    "description": "Any custom G-code to run after the filament has been changed right before continuing the print, for example, you can add a sequence to purge filament and wipe the nozzle.",
+                    "unit": "",
+                    "type": "str",
+                    "default_value": "M300 S440 P500",
+                    "enabled": "enabled and enable_after_macro"
                 }
             }
         }"""
@@ -134,6 +178,7 @@ class FilamentChange(Script):
         :param data: A list of layers of g-code.
         :return: A similar list, with filament change commands inserted.
         """
+        enabled = self.getSettingValueByKey("enabled")
         layer_nums = self.getSettingValueByKey("layer_number")
         initial_retract = self.getSettingValueByKey("initial_retract")
         later_retract = self.getSettingValueByKey("later_retract")
@@ -141,8 +186,20 @@ class FilamentChange(Script):
         y_pos = self.getSettingValueByKey("y_position")
         z_pos = self.getSettingValueByKey("z_position")
         firmware_config = self.getSettingValueByKey("firmware_config")
+        enable_before_macro = self.getSettingValueByKey("enable_before_macro")
+        before_macro = self.getSettingValueByKey("before_macro")
+        enable_after_macro = self.getSettingValueByKey("enable_after_macro")
+        after_macro = self.getSettingValueByKey("after_macro")
+
+        if not enabled:
+            return data
+
+        color_change = ";BEGIN FilamentChange plugin\n"
 
-        color_change = "M600"
+        if enable_before_macro:
+            color_change = color_change + before_macro + "\n"
+
+        color_change = color_change + "M600\n"
 
         if not firmware_config:
             if initial_retract is not None and initial_retract > 0.:
@@ -163,7 +220,10 @@ class FilamentChange(Script):
             if z_pos is not None and z_pos > 0.:
                 color_change = color_change + (" Z%.2f" % z_pos)
 
-        color_change = color_change + " ; Generated by FilamentChange plugin\n"
+        if enable_after_macro:
+            color_change = color_change + after_macro + "\n"
+
+        color_change = color_change + ";END FilamentChange plugin\n"
 
         layer_targets = layer_nums.split(",")
         if len(layer_targets) > 0:

+ 3 - 1
printer-linter/src/printerlinter/linters/meshes.py

@@ -4,12 +4,14 @@ from typing import Iterator
 from ..diagnostic import Diagnostic
 from .linter import Linter
 
+MAX_MESH_FILE_SIZE = 1 * 1024 * 1024  # 1MB
+
 
 class Meshes(Linter):
     def __init__(self, file: Path, settings: dict) -> None:
         """ Finds issues in model files, such as incorrect file format or too large size """
         super().__init__(file, settings)
-        self._max_file_size = self._settings.get("diagnostic-mesh-file-size", 1e6)
+        self._max_file_size = self._settings.get("diagnostic-mesh-file-size", MAX_MESH_FILE_SIZE)
 
     def check(self) -> Iterator[Diagnostic]:
         if self._settings["checks"].get("diagnostic-mesh-file-extension", False):

+ 1 - 1
resources/definitions/dagoma_sigma.def.json

@@ -8,7 +8,7 @@
         "author": "Dagoma",
         "manufacturer": "Dagoma",
         "file_formats": "text/x-gcode",
-        "platform": "dagoma_sigma.obj",
+        "platform": "dagoma_sigma.stl",
         "has_machine_quality": true,
         "has_materials": true,
         "has_variants": true,

+ 88 - 0
resources/definitions/modix_v3_base.def.json

@@ -0,0 +1,88 @@
+{
+    "version": 2,
+    "name": "Modix Base Printer",
+    "inherits": "fdmprinter",
+    "metadata":
+    {
+        "author": "Modix",
+        "manufacturer": "Modix",
+        "file_formats": "text/x-gcode",
+        "has_variants": true,
+        "machine_extruder_trains":
+        {
+            "0": "modix_v3_extruder_0",
+            "1": "modix_v3_extruder_1"
+        },
+        "preferred_variant_name": "0.4 mm Nozzle",
+        "variants_name": "Nozzle Size"
+    },
+    "overrides":
+    {
+        "adhesion_type": { "default_value": "skirt" },
+        "cool_fan_full_at_height": { "value": "layer_height_0 + 2 * layer_height" },
+        "fill_outline_gaps": { "value": false },
+        "gantry_height": { "value": "90.0" },
+        "infill_before_walls": { "value": false },
+        "infill_overlap": { "value": 30.0 },
+        "infill_pattern": { "value": "'cubic'" },
+        "infill_sparse_density": { "value": "15" },
+        "layer_height_0": { "value": "round(machine_nozzle_size / 2, 1)" },
+        "line_width": { "value": "machine_nozzle_size * 1.05" },
+        "machine_end_gcode": { "default_value": "M83 ; extruder relative moves \nG1 E-5 F2700 ;retract a bit \nG10 P0 S0 R0 ; turn off extruder 0 \nG10 P1 S0 R0 ; turn off extruder 1 \nM106 S0 ; turn off fans \nT-1 P0 ; deselect any tools \nG4 P1 ; dwell 1ms \nG91 ;relative positioning \nG1 Z2 F500 ; Move print head up 2mm \nG90 ; absolute positioning \nG1 X{move.axes[0].min+2} Y{move.axes[1].max-2} F6000 ; move to the back left \nM84 ; disable motors" },
+        "machine_gcode_flavor": { "default_value": "RepRap (RepRap)" },
+        "machine_head_with_fans_polygon":
+        {
+            "default_value": [
+                [-100, 30],
+                [-100, 65],
+                [30, -105],
+                [-31, -100]
+            ]
+        },
+        "machine_name": { "default_value": "Modix Base Printer" },
+        "machine_start_gcode": { "default_value": "G28 ; home all axes" },
+        "material_diameter": { "default_value": 1.75 },
+        "material_final_print_temperature": { "value": "material_print_temperature" },
+        "material_initial_print_temperature": { "value": "material_print_temperature" },
+        "minimum_interface_area": { "value": 10 },
+        "minimum_support_area": { "value": 2 },
+        "optimize_wall_printing_order": { "value": "True" },
+        "retraction_amount": { "value": 1 },
+        "retraction_combing": { "value": "'off' if retraction_hop_enabled else 'infill'" },
+        "retraction_combing_max_distance": { "value": 5 },
+        "retraction_count_max": { "value": 50 },
+        "retraction_extrusion_window": { "value": 1 },
+        "retraction_hop": { "value": "layer_height*4" },
+        "retraction_hop_enabled": { "value": "support_enable" },
+        "retraction_prime_speed": { "value": 40 },
+        "retraction_retract_speed": { "value": 40 },
+        "retraction_speed": { "default_value": 40 },
+        "skin_overlap": { "value": 10.0 },
+        "skirt_brim_minimal_length": { "default_value": 200 },
+        "skirt_gap": { "value": 5.0 },
+        "skirt_line_count": { "value": 3 },
+        "speed_layer_0": { "value": 20.0 },
+        "speed_prime_tower": { "value": "speed_topbottom" },
+        "speed_support": { "value": "speed_wall_0" },
+        "speed_support_interface": { "value": "speed_topbottom" },
+        "speed_travel": { "value": 110.0 },
+        "speed_wall_x": { "value": "speed_wall" },
+        "speed_z_hop": { "value": 5 },
+        "support_angle": { "value": 55 },
+        "support_brim_enable": { "value": true },
+        "support_brim_width": { "value": 5 },
+        "support_infill_rate": { "value": "0 if support_enable and support_structure == 'tree' else 15" },
+        "support_interface_density": { "value": 40 },
+        "support_interface_enable": { "value": true },
+        "support_interface_height": { "value": "layer_height * 3" },
+        "support_use_towers": { "value": false },
+        "support_xy_distance": { "value": "wall_line_width_0 * 2" },
+        "support_xy_distance_overhang": { "value": "wall_line_width_0" },
+        "support_z_distance": { "value": "layer_height if layer_height >= 0.2 else layer_height * 2" },
+        "top_bottom_thickness": { "value": "layer_height_0 + layer_height * 3" },
+        "travel_avoid_supports": { "value": true },
+        "travel_retract_before_outer_wall": { "value": true },
+        "wall_thickness": { "value": "line_width * 2" },
+        "z_seam_corner": { "value": "z_seam_corner_weighted" }
+    }
+}

+ 13 - 0
resources/definitions/modix_v3_big120X.def.json

@@ -0,0 +1,13 @@
+{
+    "version": 2,
+    "name": "Modix V3 BIG-120X",
+    "inherits": "modix_v3_base",
+    "metadata": { "visible": true },
+    "overrides":
+    {
+        "machine_depth": { "default_value": 600 },
+        "machine_height": { "default_value": 640 },
+        "machine_name": { "default_value": "Modix BIG-120X V3" },
+        "machine_width": { "default_value": 1200 }
+    }
+}

+ 13 - 0
resources/definitions/modix_v3_big120Z.def.json

@@ -0,0 +1,13 @@
+{
+    "version": 2,
+    "name": "Modix V3 BIG-120Z",
+    "inherits": "modix_v3_base",
+    "metadata": { "visible": true },
+    "overrides":
+    {
+        "machine_depth": { "default_value": 600 },
+        "machine_height": { "default_value": 1200 },
+        "machine_name": { "default_value": "Modix BIG-120Z V3" },
+        "machine_width": { "default_value": 600 }
+    }
+}

+ 13 - 0
resources/definitions/modix_v3_big180X.def.json

@@ -0,0 +1,13 @@
+{
+    "version": 2,
+    "name": "Modix V3 BIG-180X",
+    "inherits": "modix_v3_base",
+    "metadata": { "visible": true },
+    "overrides":
+    {
+        "machine_depth": { "default_value": 600 },
+        "machine_height": { "default_value": 600 },
+        "machine_name": { "default_value": "Modix BIG-180X V3" },
+        "machine_width": { "default_value": 1800 }
+    }
+}

+ 13 - 0
resources/definitions/modix_v3_big40.def.json

@@ -0,0 +1,13 @@
+{
+    "version": 2,
+    "name": "Modix V3 BIG-40",
+    "inherits": "modix_v3_base",
+    "metadata": { "visible": true },
+    "overrides":
+    {
+        "machine_depth": { "default_value": 400 },
+        "machine_height": { "default_value": 800 },
+        "machine_name": { "default_value": "Modix BIG-40 V3" },
+        "machine_width": { "default_value": 400 }
+    }
+}

Некоторые файлы не были показаны из-за большого количества измененных файлов