mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 06:09:00 +08:00
Merge remote-tracking branch 'origin/master' into CURA-6856_signed_plugins_and_packages
This commit is contained in:
commit
36b924154b
@ -1,8 +1,11 @@
|
||||
import collections
|
||||
from typing import Dict, Optional
|
||||
|
||||
from UM.i18n import i18nCatalog
|
||||
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"] = {
|
||||
"name": catalog.i18nc("@label", "Default")
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
{
|
||||
"version": 2,
|
||||
"name": "Leapfrog Bolt Pro",
|
||||
"inherits": "fdmprinter",
|
||||
@ -72,7 +72,6 @@
|
||||
"zyyx_pro_flex",
|
||||
"zyyx_pro_pla"
|
||||
],
|
||||
|
||||
"machine_extruder_trains":
|
||||
{
|
||||
"0": "leapfrog_bolt_pro_extruder_right",
|
||||
@ -107,10 +106,9 @@
|
||||
"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"},
|
||||
"prime_tower_enable": { "resolve": "extruders_enabled_count > 1"},
|
||||
"prime_tower_circular": {"default_value": false},
|
||||
"prime_tower_position_x": {"value": "169"},
|
||||
"prime_tower_position_y": {"value": "25"},
|
||||
"speed_travel": { "value": "200"},
|
||||
"prime_tower_position_x": {"value": "169" },
|
||||
"prime_tower_position_y": {"value": "25" },
|
||||
"speed_travel": { "value": "200" },
|
||||
"build_volume_temperature": {"enabled": false},
|
||||
"material_standby_temperature": {"enabled": false }
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
{
|
||||
"id": "leapfrog_bolt_pro_extruder_left",
|
||||
"version": 2,
|
||||
"name": "Left extruder",
|
||||
"inherits": "fdmextruder",
|
||||
@ -7,7 +6,6 @@
|
||||
"machine": "leapfrog_bolt_pro",
|
||||
"position": "1"
|
||||
},
|
||||
|
||||
"overrides": {
|
||||
"extruder_nr": {
|
||||
"default_value": 1,
|
||||
@ -18,6 +16,6 @@
|
||||
"machine_nozzle_head_distance": { "default_value": 22 },
|
||||
"machine_nozzle_offset_x": { "default_value": 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" }
|
||||
}
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
{
|
||||
"id": "leapfrog_bolt_pro_extruder_right",
|
||||
"version": 2,
|
||||
"name": "Right extruder",
|
||||
"inherits": "fdmextruder",
|
||||
@ -7,7 +6,6 @@
|
||||
"machine": "leapfrog_bolt_pro",
|
||||
"position": "0"
|
||||
},
|
||||
|
||||
"overrides": {
|
||||
"extruder_nr": {
|
||||
"default_value": 0,
|
||||
@ -16,7 +14,7 @@
|
||||
"machine_nozzle_size": { "default_value": 0.4 },
|
||||
"material_diameter": { "default_value": 1.75 },
|
||||
"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_extruder_start_code": { "default_value": "G1 Y-32 F12000\nG1 X296 F1000\nG1 X334 F4000\nG1 X296"}
|
||||
}
|
||||
|
@ -3,11 +3,12 @@
|
||||
|
||||
import json # To check files for unnecessarily overridden properties.
|
||||
import os
|
||||
import os.path
|
||||
import pytest #This module contains automated tests.
|
||||
from typing import Any, Dict
|
||||
import uuid
|
||||
|
||||
from unittest.mock import patch, MagicMock
|
||||
|
||||
import UM.Settings.ContainerRegistry #To create empty instance containers.
|
||||
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.
|
||||
@ -24,6 +25,10 @@ definition_filepaths = machine_filepaths + extruder_filepaths
|
||||
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"))
|
||||
|
||||
# Loading definition files needs a functioning ContainerRegistry
|
||||
cr = UM.Settings.ContainerRegistry.ContainerRegistry(None)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def definition_container():
|
||||
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":
|
||||
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):
|
||||
with open(file_path, encoding = "utf-8") as data:
|
||||
|
Loading…
x
Reference in New Issue
Block a user