Skip to content

Commit

Permalink
Merge branch 'main' into CURA-10475_engineplugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jellespijker committed Aug 1, 2023
2 parents 0f7b092 + 60dba90 commit 730dec8
Show file tree
Hide file tree
Showing 36 changed files with 1,700 additions and 184 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,4 @@ graph_info.json
Ultimaker-Cura.spec
.run/
/printer-linter/src/printerlinter.egg-info/
/resources/qml/Dialogs/AboutDialogVersionsList.qml
61 changes: 61 additions & 0 deletions AboutDialogVersionsList.qml.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import QtQuick 2.2
import QtQuick.Controls 2.9

import UM 1.6 as UM
import Cura 1.5 as Cura


ListView
{
id: projectBuildInfoList
visible: false
anchors.top: creditsNotes.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height
width: parent.width
height: base.height - y - (2 * UM.Theme.getSize("default_margin").height + closeButton.height)

ScrollBar.vertical: UM.ScrollBar
{
id: projectBuildInfoListScrollBar
}

delegate: Row
{
spacing: UM.Theme.getSize("narrow_margin").width
UM.Label
{
text: (model.name)
width: (projectBuildInfoList.width* 0.4) | 0
elide: Text.ElideRight
}
UM.Label
{
text: (model.version)
width: (projectBuildInfoList.width *0.6) | 0
elide: Text.ElideRight
}

}
model: ListModel
{
id: developerInfo
}
Component.onCompleted:
{
var conan_installs = {{ conan_installs }};
var python_installs = {{ python_installs }};
developerInfo.append({ name : "<H1>Conan Installs</H1>", version : '' });
for (var n in conan_installs)
{
developerInfo.append({ name : conan_installs[n][0], version : conan_installs[n][1] });
}
developerInfo.append({ name : '', version : '' });
developerInfo.append({ name : "<H1>Python Installs</H1>", version : '' });
for (var n in python_installs)
{
developerInfo.append({ name : python_installs[n][0], version : python_installs[n][1] });
}

}
}

26 changes: 25 additions & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CuraConan(ConanFile):
description = "3D printer / slicing GUI built on top of the Uranium framework"
topics = ("conan", "python", "pyqt6", "qt", "qml", "3d-printing", "slicer")
build_policy = "missing"
exports = "LICENSE*", "UltiMaker-Cura.spec.jinja", "CuraVersion.py.jinja"
exports = "LICENSE*", "UltiMaker-Cura.spec.jinja", "CuraVersion.py.jinja", "AboutDialogVersionsList.qml.jinja"
settings = "os", "compiler", "build_type", "arch"

# FIXME: Remove specific branch once merged to main
Expand Down Expand Up @@ -138,6 +138,29 @@ def _pyinstaller_spec_arch(self):
return "'x86_64'"
return "None"

def _generate_about_versions(self, location):
with open(os.path.join(self.recipe_folder, "AboutDialogVersionsList.qml.jinja"), "r") as f:
cura_version_py = Template(f.read())

conan_installs = []
python_installs = []

# list of conan installs
for _, dependency in self.dependencies.host.items():
conan_installs.append([dependency.ref.name,dependency.ref.version])

#list of python installs
import pkg_resources
for package in pkg_resources.working_set:
python_installs.append([package.key, package.version])

with open(os.path.join(location, "AboutDialogVersionsList.qml"), "w") as f:
f.write(cura_version_py.render(
conan_installs = conan_installs,
python_installs = python_installs
))


def _generate_cura_version(self, location):
with open(os.path.join(self.recipe_folder, "CuraVersion.py.jinja"), "r") as f:
cura_version_py = Template(f.read())
Expand Down Expand Up @@ -309,6 +332,7 @@ def generate(self):
vr.generate()

self._generate_cura_version(os.path.join(self.source_folder, "cura"))
self._generate_about_versions(os.path.join(self.source_folder, "resources/qml/Dialogs"))

if self.options.devtools:
entitlements_file = "'{}'".format(os.path.join(self.source_folder, "packaging", "MacOS", "cura.entitlements"))
Expand Down
19 changes: 10 additions & 9 deletions cura/Machines/Models/IntentSelectionModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ def _onChange(self) -> None:

def _update(self) -> None:
Logger.log("d", "Updating {model_class_name}.".format(model_class_name = self.__class__.__name__))

global_stack = cura.CuraApplication.CuraApplication.getInstance().getGlobalContainerStack()
cura_application = cura.CuraApplication.CuraApplication.getInstance()
global_stack = cura_application.getGlobalContainerStack()
if global_stack is None:
self.setItems([])
Logger.log("d", "No active GlobalStack, set quality profile model as empty.")
return

# Check for material compatibility
if not cura.CuraApplication.CuraApplication.getInstance().getMachineManager().activeMaterialsCompatible():
if not cura_application.getMachineManager().activeMaterialsCompatible():
Logger.log("d", "No active material compatibility, set quality profile model as empty.")
self.setItems([])
return
Expand All @@ -101,17 +101,18 @@ def _update(self) -> None:
else:
# There can be multiple intents with the same category, use one of these
# intent-metadata's for the icon/description defintions for the intent
intent_metadata = cura.CuraApplication.CuraApplication \
.getInstance() \
.getContainerRegistry() \
.findContainersMetadata(type="intent", definition=global_stack.definition.getId(),
intent_category=category)[0]



intent_metadata = cura_application.getContainerRegistry().findContainersMetadata(type="intent",
definition=global_stack.findInstanceContainerDefinitionId(global_stack.definition),
intent_category=category)[0]

intent_name = intent_metadata.get("name", category.title())
icon = intent_metadata.get("icon", None)
description = intent_metadata.get("description", None)

if icon is not None:
if icon is not None and icon != '':
try:
icon = QUrl.fromLocalFile(
Resources.getPath(cura.CuraApplication.CuraApplication.ResourceTypes.ImageFiles, icon))
Expand Down
4 changes: 2 additions & 2 deletions cura/Settings/CuraContainerStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def _getMachineDefinition(self) -> DefinitionContainer:
return self.definition

@classmethod
def _findInstanceContainerDefinitionId(cls, machine_definition: DefinitionContainerInterface) -> str:
def findInstanceContainerDefinitionId(cls, machine_definition: DefinitionContainerInterface) -> str:
"""Find the ID that should be used when searching for instance containers for a specified definition.
This handles the situation where the definition specifies we should use a different definition when
Expand All @@ -379,7 +379,7 @@ def _findInstanceContainerDefinitionId(cls, machine_definition: DefinitionContai
Logger.log("w", "Unable to find parent definition {parent} for machine {machine}", parent = quality_definition, machine = machine_definition.id) #type: ignore
return machine_definition.id #type: ignore

return cls._findInstanceContainerDefinitionId(definitions[0])
return cls.findInstanceContainerDefinitionId(definitions[0])

def getExtruderPositionValueWithDefault(self, key):
"""getProperty for extruder positions, with translation from -1 to default extruder number"""
Expand Down
45 changes: 0 additions & 45 deletions resources/definitions/anycubic_kossel.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,51 +18,6 @@
{
"machine_center_is_zero": { "default_value": true },
"machine_depth": { "default_value": 180 },
"machine_disallowed_areas":
{
"default_value": [
[
[-50, -85],
[-85, -85],
[-90, -90]
],
[
[-85, -85],
[-85, -50],
[-90, -90]
],
[
[50, -85],
[85, -85],
[90, -90]
],
[
[85, -85],
[85, -50],
[90, -90]
],
[
[-50, 85],
[-85, 85],
[-90, 90]
],
[
[-85, 85],
[-85, 50],
[-90, 90]
],
[
[50, 85],
[85, 85],
[90, 90]
],
[
[85, 85],
[85, 50],
[90, 90]
]
]
},
"machine_end_gcode": { "default_value": "M400 ;Free buffer\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 F{speed_travel} Z+1 E-5 ;move Z up a bit and retract filament even more\nG90 ;absolute positioning\nM104 S0 ;extruder heater off\nM140 S0 ;heated bed heater off\nM107 ;fan off\nM84 ;steppers off\nG28 ;move to endstop\nM84 ;steppers off" },
"machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" },
"machine_heated_bed": { "default_value": true },
Expand Down
45 changes: 0 additions & 45 deletions resources/definitions/anycubic_kossel_linear_plus.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,51 +16,6 @@
"overrides":
{
"machine_depth": { "default_value": 240 },
"machine_disallowed_areas":
{
"default_value": [
[
[-50, -115],
[-115, -115],
[-90, -90]
],
[
[-115, -115],
[-115, -50],
[-90, -90]
],
[
[50, -115],
[115, -115],
[90, -90]
],
[
[115, -115],
[115, -50],
[90, -90]
],
[
[-50, 115],
[-115, 115],
[-90, 90]
],
[
[-115, 115],
[-115, 50],
[-90, 90]
],
[
[50, 115],
[115, 115],
[90, 90]
],
[
[115, 115],
[115, 50],
[90, 90]
]
]
},
"machine_name": { "default_value": "Anycubic Kossel Linear Plus" },
"machine_width": { "default_value": 240 }
}
Expand Down
2 changes: 1 addition & 1 deletion resources/definitions/creality_ender3pro.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"machine_height": { "default_value": 250 },
"machine_name": { "default_value": "Creality Ender-3 Pro" },
"machine_start_gcode": { "default_value": "; Ender 3 Custom Start G-code\nG92 E0 ; Reset Extruder\nG28 ; Home all axes\nM104 S{material_standby_temperature} ; Start heating up the nozzle most of the way\nM190 S{material_bed_temperature_layer_0} ; Start heating the bed, wait until target temperature reached\nM109 S{material_print_temperature_layer_0} ; Finish heating the nozzle\nG1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position\nG1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line\nG1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little\nG1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line\nG92 E0 ; Reset Extruder\nG1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish" },
"machine_start_gcode": { "default_value": "; Ender 3 Custom Start G-code\nG92 E0 ; Reset Extruder\nG28 ; Home all axes\nG1 Z5.0 F3000 ; Move Z Axis up a bit during heating to not damage bed\nM104 S{material_standby_temperature} ; Start heating up the nozzle most of the way\nM190 S{material_bed_temperature_layer_0} ; Start heating the bed, wait until target temperature reached\nM109 S{material_print_temperature_layer_0} ; Finish heating the nozzle\nG1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position\nG1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line\nG1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little\nG1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line\nG92 E0 ; Reset Extruder\nG1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish" },
"machine_width": { "default_value": 220 }
}
}
2 changes: 1 addition & 1 deletion resources/definitions/creality_ender3s1.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"machine_height": { "default_value": 270 },
"machine_name": { "default_value": "Creality Ender-3 S1" },
"machine_start_gcode": { "default_value": "; Ender 3 S1 Start G-code\n; M413 S0 ; Disable power loss recovery\nG92 E0 ; Reset Extruder\n\n; Prep surfaces before auto home for better accuracy\nM140 S{material_bed_temperature_layer_0}\nM104 S{material_print_temperature_layer_0}\n\nG28 O ; Home all untrusted axes\nG1 Z10.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X0 Y0\n\nM190 S{material_bed_temperature_layer_0}\nM109 S{material_print_temperature_layer_0}\n\nG1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position\nG1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line\nG1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little\nG1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line\nG92 E0 ; Reset Extruder\nG1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish\n" },
"machine_start_gcode": { "default_value": "; Ender 3 S1 Start G-code\n; M413 S0 ; Disable power loss recovery\nG92 E0 ; Reset Extruder\n\n; Prep surfaces before auto home for better accuracy\nM140 S{material_bed_temperature_layer_0}\nM104 S{material_print_temperature_layer_0}\n\nG28 ; Home all axes\nG1 Z10.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X0 Y0\n\nM190 S{material_bed_temperature_layer_0}\nM109 S{material_print_temperature_layer_0}\n\nG1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position\nG1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line\nG1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little\nG1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line\nG92 E0 ; Reset Extruder\nG1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish\n" },
"machine_width": { "default_value": 220 },
"retraction_amount": { "value": 0.8 },
"retraction_extrusion_window": { "value": 1.5 },
Expand Down
2 changes: 1 addition & 1 deletion resources/definitions/creality_ender3s1plus.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"machine_height": { "default_value": 300 },
"machine_name": { "default_value": "Creality Ender-3 S1 Plus" },
"machine_start_gcode": { "default_value": "; Ender 3 S1 Plus Start G-code\n; M413 S0 ; Disable power loss recovery\nG92 E0 ; Reset Extruder\n\n; Prep surfaces before auto home for better accuracy\nM140 S{material_bed_temperature_layer_0}\nM104 S{material_print_temperature_layer_0}\n\nG28 O ; Home all untrusted axes\nG1 Z10.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X0 Y0\n\nM190 S{material_bed_temperature_layer_0}\nM109 S{material_print_temperature_layer_0}\n\nG1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position\nG1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line\nG1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little\nG1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line\nG92 E0 ; Reset Extruder\nG1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish\n" },
"machine_start_gcode": { "default_value": "; Ender 3 S1 Plus Start G-code\n; M413 S0 ; Disable power loss recovery\nG92 E0 ; Reset Extruder\n\n; Prep surfaces before auto home for better accuracy\nM140 S{material_bed_temperature_layer_0}\nM104 S{material_print_temperature_layer_0}\n\nG28 ; Home all axes\nG1 Z10.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X0 Y0\n\nM190 S{material_bed_temperature_layer_0}\nM109 S{material_print_temperature_layer_0}\n\nG1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position\nG1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line\nG1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little\nG1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line\nG92 E0 ; Reset Extruder\nG1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish\n" },
"machine_width": { "default_value": 300 },
"retraction_amount": { "value": 0.8 },
"retraction_extrusion_window": { "value": 1.5 },
Expand Down
2 changes: 1 addition & 1 deletion resources/definitions/creality_ender3s1pro.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"machine_height": { "default_value": 270 },
"machine_name": { "default_value": "Creality Ender-3 S1 Pro" },
"machine_start_gcode": { "default_value": "; Ender 3 S1 Pro Start G-code\n; M413 S0 ; Disable power loss recovery\nG92 E0 ; Reset Extruder\n\n; Prep surfaces before auto home for better accuracy\nM140 S{material_bed_temperature_layer_0}\nM104 S{material_print_temperature_layer_0}\n\nG28 O ; Home all untrusted axes\nG1 Z10.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X0 Y0\n\nM190 S{material_bed_temperature_layer_0}\nM109 S{material_print_temperature_layer_0}\n\nG1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position\nG1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line\nG1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little\nG1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line\nG92 E0 ; Reset Extruder\nG1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish\n" },
"machine_start_gcode": { "default_value": "; Ender 3 S1 Pro Start G-code\n; M413 S0 ; Disable power loss recovery\nG92 E0 ; Reset Extruder\n\n; Prep surfaces before auto home for better accuracy\nM140 S{material_bed_temperature_layer_0}\nM104 S{material_print_temperature_layer_0}\n\nG28 ; Home all axes\nG1 Z10.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X0 Y0\n\nM190 S{material_bed_temperature_layer_0}\nM109 S{material_print_temperature_layer_0}\n\nG1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position\nG1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line\nG1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little\nG1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line\nG92 E0 ; Reset Extruder\nG1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed\nG1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish\n" },
"machine_width": { "default_value": 220 },
"retraction_amount": { "value": 0.8 },
"retraction_extrusion_window": { "value": 1.5 },
Expand Down
Loading

0 comments on commit 730dec8

Please sign in to comment.