Merge remote-tracking branch 'origin/master' into CURA-6856_signed_plugins_and_packages

This commit is contained in:
Lipu Fei 2019-11-06 15:54:19 +01:00
commit 36b924154b
5 changed files with 139 additions and 131 deletions

View File

@ -1,8 +1,11 @@
import collections import collections
from typing import Dict, Optional
from UM.i18n import i18nCatalog from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura") catalog = i18nCatalog("cura")
intent_translations = collections.OrderedDict() # type: "collections.OrderedDict[str, Dict[str, Optional[str]]]"
intent_translations = collections.OrderedDict() # type: collections.OrderedDict[str, Dict[str, Optional[str]]]
intent_translations["default"] = { intent_translations["default"] = {
"name": catalog.i18nc("@label", "Default") "name": catalog.i18nc("@label", "Default")
} }
@ -17,4 +20,4 @@ intent_translations["engineering"] = {
intent_translations["quick"] = { intent_translations["quick"] = {
"name": catalog.i18nc("@label", "Draft"), "name": catalog.i18nc("@label", "Draft"),
"description": catalog.i18nc("@text", "The draft profile is designed to print initial prototypes and concept validation with the intent of significant print time reduction.") "description": catalog.i18nc("@text", "The draft profile is designed to print initial prototypes and concept validation with the intent of significant print time reduction.")
} }

View File

@ -1,117 +1,115 @@
{ {
"version": 2, "version": 2,
"name": "Leapfrog Bolt Pro", "name": "Leapfrog Bolt Pro",
"inherits": "fdmprinter", "inherits": "fdmprinter",
"metadata": { "metadata": {
"visible": true, "visible": true,
"author": "Karan and Vincent 20191104", "author": "Karan and Vincent 20191104",
"manufacturer": "Leapfrog B.V.", "manufacturer": "Leapfrog B.V.",
"category": "Other", "category": "Other",
"platform": "leapfrog_bolt_pro_platform.stl", "platform": "leapfrog_bolt_pro_platform.stl",
"platform_offset": [0, 0, -14], "platform_offset": [0, 0, -14],
"file_formats": "text/x-gcode", "file_formats": "text/x-gcode",
"supports_usb_connection": false, "supports_usb_connection": false,
"supports_network_connection": false, "supports_network_connection": false,
"has_materials": true, "has_materials": true,
"has_machine_quality": true, "has_machine_quality": true,
"has_variants": true, "has_variants": true,
"preferred_variant_name": "Brass 0.4", "preferred_variant_name": "Brass 0.4",
"preferred_material": "leapfrog_epla_natural", "preferred_material": "leapfrog_epla_natural",
"variants_name": "Hot end", "variants_name": "Hot end",
"exclude_materials": [ "exclude_materials": [
"generic_pla_175", "generic_pla_175",
"generic_abs_175", "generic_abs_175",
"generic_cpe_175", "generic_cpe_175",
"generic_hips_175", "generic_hips_175",
"generic_nylon_175", "generic_nylon_175",
"generic_pc_175", "generic_pc_175",
"generic_petg_175", "generic_petg_175",
"generic_pva_175", "generic_pva_175",
"generic_tpu_175", "generic_tpu_175",
"chromatik_pla", "chromatik_pla",
"dsm_arnitel2045_175", "dsm_arnitel2045_175",
"dsm_novamid1070_175", "dsm_novamid1070_175",
"emotiontech_abs", "emotiontech_abs",
"emotiontech_petg", "emotiontech_petg",
"emotiontech_pla", "emotiontech_pla",
"emotiontech_pva-m", "emotiontech_pva-m",
"emotiontech_pva-oks", "emotiontech_pva-oks",
"emotiontech_pva-s", "emotiontech_pva-s",
"emotiontech_tpu98a", "emotiontech_tpu98a",
"fabtotum_abs", "fabtotum_abs",
"fabtotum_nylon", "fabtotum_nylon",
"fabtotum_pla", "fabtotum_pla",
"fabtotum_tpu", "fabtotum_tpu",
"fiberlogy_hd_pla", "fiberlogy_hd_pla",
"filo3d_pla", "filo3d_pla",
"filo3d_pla_green", "filo3d_pla_green",
"filo3d_pla_red", "filo3d_pla_red",
"imade3d_petg_175", "imade3d_petg_175",
"imade3d_pla_175", "imade3d_pla_175",
"innofill_innoflex60_175", "innofill_innoflex60_175",
"octofiber_pla", "octofiber_pla",
"polyflex_pla", "polyflex_pla",
"polymax_pla", "polymax_pla",
"polyplus_pla", "polyplus_pla",
"polywood_pla", "polywood_pla",
"tizyx_abs", "tizyx_abs",
"tizyx_pla", "tizyx_pla",
"tizyx_flex", "tizyx_flex",
"tizyx_petg", "tizyx_petg",
"tizyx_pva", "tizyx_pva",
"tizyx_pla_bois", "tizyx_pla_bois",
"verbatim_bvoh_175", "verbatim_bvoh_175",
"Vertex_Delta_ABS", "Vertex_Delta_ABS",
"Vertex_Delta_PET", "Vertex_Delta_PET",
"Vertex_Delta_PLA_Glitter", "Vertex_Delta_PLA_Glitter",
"Vertex_Delta_PLA_Mat", "Vertex_Delta_PLA_Mat",
"Vertex_Delta_PLA_Satin", "Vertex_Delta_PLA_Satin",
"Vertex_Delta_PLA_Wood", "Vertex_Delta_PLA_Wood",
"Vertex_Delta_PLA", "Vertex_Delta_PLA",
"Vertex_Delta_TPU", "Vertex_Delta_TPU",
"zyyx_pro_flex", "zyyx_pro_flex",
"zyyx_pro_pla" "zyyx_pro_pla"
], ],
"machine_extruder_trains":
"machine_extruder_trains": {
{ "0": "leapfrog_bolt_pro_extruder_right",
"0": "leapfrog_bolt_pro_extruder_right", "1": "leapfrog_bolt_pro_extruder_left"
"1": "leapfrog_bolt_pro_extruder_left" }
} },
}, "overrides": {
"overrides": { "machine_name": {"default_value": "Leapfrog Bolt Pro" },
"machine_name": {"default_value": "Leapfrog Bolt Pro" }, "machine_extruder_count": {"default_value": 2},
"machine_extruder_count": {"default_value": 2}, "machine_center_is_zero": {"default_value": false},
"machine_center_is_zero": {"default_value": false}, "machine_width": {"default_value": 302},
"machine_width": {"default_value": 302}, "machine_height": {"default_value": 205},
"machine_height": {"default_value": 205}, "machine_depth": {"default_value": 322},
"machine_depth": {"default_value": 322}, "machine_heated_bed": {"default_value": true},
"machine_heated_bed": {"default_value": true}, "machine_head_with_fans_polygon": {"default_value": [[-60, 110 ], [-60, -45], [60, -45 ], [60, 110]]},
"machine_head_with_fans_polygon": {"default_value": [[-60, 110 ], [-60, -45], [60, -45 ], [60, 110]]}, "machine_max_feedrate_z": {"default_value": 16.7 },
"machine_max_feedrate_z": {"default_value": 16.7 }, "machine_max_feedrate_e": {"default_value": 50 },
"machine_max_feedrate_e": {"default_value": 50 }, "machine_max_acceleration_z": {"default_value": 100 },
"machine_max_acceleration_z": {"default_value": 100 }, "machine_acceleration": {"default_value": 400 },
"machine_acceleration": {"default_value": 400 }, "machine_max_jerk_xy": {"default_value": 20 },
"machine_max_jerk_xy": {"default_value": 20 }, "machine_max_jerk_z": {"default_value": 0.4 },
"machine_max_jerk_z": {"default_value": 0.4 }, "machine_max_jerk_e": {"default_value": 5 },
"machine_max_jerk_e": {"default_value": 5 }, "machine_gcode_flavor": {"default_value": "RepRap (Marlin/Sprinter)"},
"machine_gcode_flavor": {"default_value": "RepRap (Marlin/Sprinter)"}, "material_final_print_temperature": {"value": "default_material_print_temperature" },
"material_final_print_temperature": {"value": "default_material_print_temperature" }, "material_initial_print_temperature": {"value": "default_material_print_temperature" },
"material_initial_print_temperature": {"value": "default_material_print_temperature" }, "gantry_height": {"value": "20"},
"gantry_height": {"value": "20"}, "retraction_combing": { "default_value": "all" },
"retraction_combing": { "default_value": "all" }, "retraction_amount": {"default_value": 2},
"retraction_amount": {"default_value": 2}, "adhesion_type": {"default_value": "skirt"},
"adhesion_type": {"default_value": "skirt"}, "skirt_line_count": {"default_value": 3},
"skirt_line_count": {"default_value": 3}, "machine_use_extruder_offset_to_offset_coords": {"default_value": true},
"machine_use_extruder_offset_to_offset_coords": {"default_value": true}, "machine_start_gcode": {"default_value": "G90\nG28 X0 Y0 Z0\nG1 Z5 F1000\nG92 E0\nG1 Y-32 F12000\nG1 E15 F1000\nG1 E45 F150\nG4 S5"},
"machine_start_gcode": {"default_value": "G90\nG28 X0 Y0 Z0\nG1 Z5 F1000\nG92 E0\nG1 Y-32 F12000\nG1 E15 F1000\nG1 E45 F150\nG4 S5"}, "machine_end_gcode": {"default_value": "G92 E0\nG1 E-3 F300\nM104 S0 T0\nM104 S0 T1\nM140 S0\nG28 X0 Y0\nM84"},
"machine_end_gcode": {"default_value": "G92 E0\nG1 E-3 F300\nM104 S0 T0\nM104 S0 T1\nM140 S0\nG28 X0 Y0\nM84"}, "prime_tower_enable": { "resolve": "extruders_enabled_count > 1"},
"prime_tower_enable": { "resolve": "extruders_enabled_count > 1"}, "prime_tower_position_x": {"value": "169" },
"prime_tower_circular": {"default_value": false}, "prime_tower_position_y": {"value": "25" },
"prime_tower_position_x": {"value": "169"}, "speed_travel": { "value": "200" },
"prime_tower_position_y": {"value": "25"}, "build_volume_temperature": {"enabled": false},
"speed_travel": { "value": "200"}, "material_standby_temperature": {"enabled": false }
"build_volume_temperature": {"enabled": false}, }
"material_standby_temperature": {"enabled": false } }
}
}

View File

@ -1,5 +1,4 @@
{ {
"id": "leapfrog_bolt_pro_extruder_left",
"version": 2, "version": 2,
"name": "Left extruder", "name": "Left extruder",
"inherits": "fdmextruder", "inherits": "fdmextruder",
@ -7,7 +6,6 @@
"machine": "leapfrog_bolt_pro", "machine": "leapfrog_bolt_pro",
"position": "1" "position": "1"
}, },
"overrides": { "overrides": {
"extruder_nr": { "extruder_nr": {
"default_value": 1, "default_value": 1,
@ -18,6 +16,6 @@
"machine_nozzle_head_distance": { "default_value": 22 }, "machine_nozzle_head_distance": { "default_value": 22 },
"machine_nozzle_offset_x": { "default_value": 0 }, "machine_nozzle_offset_x": { "default_value": 0 },
"machine_nozzle_offset_y": { "default_value": 0.0 }, "machine_nozzle_offset_y": { "default_value": 0.0 },
"machine_extruder_start_code": { "default_value": "G1 Y-32 F12000\nG1 X6 F1000\nG1 X-32 F4000\nG1 X6"} "machine_extruder_start_code": { "default_value": "G1 Y-32 F12000\nG1 X6 F1000\nG1 X-32 F4000\nG1 X6" }
} }
} }

View File

@ -1,5 +1,4 @@
{ {
"id": "leapfrog_bolt_pro_extruder_right",
"version": 2, "version": 2,
"name": "Right extruder", "name": "Right extruder",
"inherits": "fdmextruder", "inherits": "fdmextruder",
@ -7,17 +6,16 @@
"machine": "leapfrog_bolt_pro", "machine": "leapfrog_bolt_pro",
"position": "0" "position": "0"
}, },
"overrides": { "overrides": {
"extruder_nr": { "extruder_nr": {
"default_value": 0, "default_value": 0,
"maximum_value": "1" "maximum_value": "1"
}, },
"machine_nozzle_size": { "default_value": 0.4 }, "machine_nozzle_size": { "default_value": 0.4 },
"material_diameter": { "default_value": 1.75 }, "material_diameter": { "default_value": 1.75 },
"machine_nozzle_head_distance": { "default_value": 22 }, "machine_nozzle_head_distance": { "default_value": 22 },
"machine_nozzle_offset_x": { "default_value": 0}, "machine_nozzle_offset_x": { "default_value": 0 },
"machine_nozzle_offset_y": { "default_value": 0.0 }, "machine_nozzle_offset_y": { "default_value": 0.0 },
"machine_extruder_start_code": { "default_value": "G1 Y-32 F12000\nG1 X296 F1000\nG1 X334 F4000\nG1 X296"} "machine_extruder_start_code": { "default_value": "G1 Y-32 F12000\nG1 X296 F1000\nG1 X334 F4000\nG1 X296"}
} }
} }

View File

@ -3,11 +3,12 @@
import json # To check files for unnecessarily overridden properties. import json # To check files for unnecessarily overridden properties.
import os import os
import os.path
import pytest #This module contains automated tests. import pytest #This module contains automated tests.
from typing import Any, Dict from typing import Any, Dict
import uuid import uuid
from unittest.mock import patch, MagicMock
import UM.Settings.ContainerRegistry #To create empty instance containers. import UM.Settings.ContainerRegistry #To create empty instance containers.
import UM.Settings.ContainerStack #To set the container registry the container stacks use. import UM.Settings.ContainerStack #To set the container registry the container stacks use.
from UM.Settings.DefinitionContainer import DefinitionContainer #To check against the class of DefinitionContainer. from UM.Settings.DefinitionContainer import DefinitionContainer #To check against the class of DefinitionContainer.
@ -24,6 +25,10 @@ definition_filepaths = machine_filepaths + extruder_filepaths
all_meshes = os.listdir(os.path.join(os.path.dirname(__file__), "..", "..", "resources", "meshes")) all_meshes = os.listdir(os.path.join(os.path.dirname(__file__), "..", "..", "resources", "meshes"))
all_images = os.listdir(os.path.join(os.path.dirname(__file__), "..", "..", "resources", "images")) all_images = os.listdir(os.path.join(os.path.dirname(__file__), "..", "..", "resources", "images"))
# Loading definition files needs a functioning ContainerRegistry
cr = UM.Settings.ContainerRegistry.ContainerRegistry(None)
@pytest.fixture @pytest.fixture
def definition_container(): def definition_container():
uid = str(uuid.uuid4()) uid = str(uuid.uuid4())
@ -39,7 +44,13 @@ def test_validateMachineDefinitionContainer(file_path, definition_container):
if file_name == "fdmprinter.def.json" or file_name == "fdmextruder.def.json": if file_name == "fdmprinter.def.json" or file_name == "fdmextruder.def.json":
return # Stop checking, these are root files. return # Stop checking, these are root files.
assertIsDefinitionValid(definition_container, file_path) from UM.VersionUpgradeManager import FilesDataUpdateResult
mocked_vum = MagicMock()
mocked_vum.updateFilesData = lambda ct, v, fdl, fnl: FilesDataUpdateResult(ct, v, fdl, fnl)
with patch("UM.VersionUpgradeManager.VersionUpgradeManager.getInstance", MagicMock(return_value = mocked_vum)):
assertIsDefinitionValid(definition_container, file_path)
def assertIsDefinitionValid(definition_container, file_path): def assertIsDefinitionValid(definition_container, file_path):
with open(file_path, encoding = "utf-8") as data: with open(file_path, encoding = "utf-8") as data: