Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 3 New UI Settings #19333

Merged
merged 7 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plugins/CuraEngineBackend/StartSliceJob.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ def _buildExtruderMessage(self, stack: ContainerStack) -> None:

# Replace the setting tokens in start and end g-code.
extruder_nr = stack.getProperty("extruder_nr", "value")
settings["machine_extruder_prestart_code"] = self._expandGcodeTokens(settings["machine_extruder_prestart_code"], extruder_nr)
settings["machine_extruder_start_code"] = self._expandGcodeTokens(settings["machine_extruder_start_code"], extruder_nr)
settings["machine_extruder_end_code"] = self._expandGcodeTokens(settings["machine_extruder_end_code"], extruder_nr)

Expand Down
74 changes: 64 additions & 10 deletions plugins/MachineSettingsAction/MachineSettingsExtruderTab.qml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Item
{
anchors.top: parent.top
anchors.left: parent.left
width: parent.width * 2 / 3
width: parent.width / 2

spacing: base.columnSpacing

Expand Down Expand Up @@ -139,6 +139,39 @@ Item
decimals: 0
forceUpdateOnChangeFunction: forceUpdateFunction
}
}


// =======================================
// Right-side column "Nozzle Settings"
// =======================================
Column
{
anchors.top: parent.top
anchors.right: parent.right
width: parent.width / 2

spacing: base.columnSpacing

UM.Label // Title Label
{
text: catalog.i18nc("@title:label", " ")
font: UM.Theme.getFont("medium_bold")
}

Cura.NumericTextFieldWithUnit
{
id: extruderChangeDurationFieldId
containerStackId: base.extruderStackId
settingKey: "machine_extruder_change_duration"
settingStoreIndex: propertyStoreIndex
labelText: catalog.i18nc("@label", "Extruder Change duration")
labelFont: base.labelFont
labelWidth: base.labelWidth
controlWidth: base.controlWidth
unitText: catalog.i18nc("@label", "s")
forceUpdateOnChangeFunction: forceUpdateFunction
}

Cura.NumericTextFieldWithUnit
{
Expand Down Expand Up @@ -179,25 +212,46 @@ Item
anchors.right: parent.right
anchors.margins: UM.Theme.getSize("default_margin").width

Cura.GcodeTextArea // "Extruder Start G-code"
Column
{
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
anchors.left: parent.left
width: base.columnWidth - UM.Theme.getSize("default_margin").width
anchors.bottom: parent.bottom
width: parent.width / 2

labelText: catalog.i18nc("@title:label", "Extruder Start G-code")
containerStackId: base.extruderStackId
settingKey: "machine_extruder_start_code"
settingStoreIndex: propertyStoreIndex
spacing: base.columnSpacing

Cura.GcodeTextArea // "Extruder Prestart G-code"
{
anchors.top: parent.top
anchors.left: parent.left
height: (parent.height / 2) - UM.Theme.getSize("default_margin").height
width: base.columnWidth - UM.Theme.getSize("default_margin").width

labelText: catalog.i18nc("@title:label", "Extruder Prestart G-code")
containerStackId: base.extruderStackId
settingKey: "machine_extruder_prestart_code"
settingStoreIndex: propertyStoreIndex
}

Cura.GcodeTextArea // "Extruder Start G-code"
{
anchors.bottom: parent.bottom
anchors.left: parent.left
height: (parent.height / 2) - UM.Theme.getSize("default_margin").height
width: base.columnWidth - UM.Theme.getSize("default_margin").width

labelText: catalog.i18nc("@title:label", "Extruder Start G-code")
containerStackId: base.extruderStackId
settingKey: "machine_extruder_start_code"
settingStoreIndex: propertyStoreIndex
}
}

Cura.GcodeTextArea // "Extruder End G-code"
{
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
anchors.right: parent.right
width: base.columnWidth - UM.Theme.getSize("default_margin").width

Expand Down
15 changes: 15 additions & 0 deletions plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,21 @@ Item
labelWidth: base.labelWidth
forceUpdateOnChangeFunction: forceUpdateFunction
}

/*
- Allows user to toggle if Start Gcode is the absolute first gcode.
*/
Cura.SimpleCheckBox // "Make sure Start Code is before all gcodes"
{
id: applyStartGcodeFirstCheckbox
containerStackId: machineStackId
settingKey: "machine_start_gcode_first"
settingStoreIndex: propertyStoreIndex
labelText: catalog.i18nc("@label", "Start GCode must be first")
labelFont: base.labelFont
labelWidth: base.labelWidth
forceUpdateOnChangeFunction: forceUpdateFunction
}


/* The "Shared Heater" feature is temporarily disabled because its
Expand Down
23 changes: 23 additions & 0 deletions resources/definitions/fdmextruder.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@
"type": "float",
"unit": "mm"
},
"machine_extruder_change_duration":
{
"default_value": 0,
"description": "When using a multi tool setup, this value is the tool change time in seconds. This value will be added to the estimate time based on the number of changes that occur.",
"label": "Extruder Change duration",
"minimum_value": "0",
"settable_globally": false,
"settable_per_extruder": true,
"settable_per_mesh": false,
"settable_per_meshgroup": false,
"type": "float"
},
"machine_extruder_cooling_fan_number":
{
"default_value": 0,
Expand Down Expand Up @@ -109,6 +121,17 @@
"type": "float",
"unit": "mm"
},
"machine_extruder_prestart_code":
{
"default_value": "",
"description": "Prestart g-code to execute before switching to this extruder.",
"label": "Extruder Prestart G-Code",
"settable_globally": false,
"settable_per_extruder": true,
"settable_per_mesh": false,
"settable_per_meshgroup": false,
"type": "str"
},
"machine_extruder_start_code":
{
"default_value": "",
Expand Down
10 changes: 10 additions & 0 deletions resources/definitions/fdmprinter.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,16 @@
"settable_per_extruder": false,
"settable_per_meshgroup": false
},
"machine_start_gcode_first":
{
"label": "Start GCode must be first",
"description": "This setting controls if the start-gcode is forced to always be the first g-code. Without this option other g-code, such as a T0 can be inserted before the start g-code.",
"type": "bool",
"default_value": false,
"settable_per_mesh": false,
"settable_per_extruder": false,
"settable_per_meshgroup": false
},
"extruder_prime_pos_z":
{
"label": "Extruder Prime Z Position",
Expand Down
3 changes: 2 additions & 1 deletion resources/definitions/voron2_stealthchanger_base.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"machine_end_gcode": { "default_value": "PRINT_END" },
"machine_extruder_count": { "default_value": 1 },
"machine_name": { "default_value": "VORON2 StealthChanger" },
"machine_start_gcode": { "default_value": "PRINT_START TOOL_TEMP={material_print_temperature_layer_0} T{initial_extruder_nr}_TEMP={material_print_temperature_layer_0} BED_TEMP={material_bed_temperature_layer_0} TOOL={initial_extruder_nr}" }
"machine_start_gcode": { "default_value": "PRINT_START TOOL_TEMP={material_print_temperature_layer_0} T{initial_extruder_nr}_TEMP={material_print_temperature_layer_0} BED_TEMP={material_bed_temperature_layer_0} TOOL={initial_extruder_nr}" },
"machine_start_gcode_first": { "default_value": true }
}
}
2 changes: 2 additions & 0 deletions resources/extruders/voron2_stealthchanger_extruder_0.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
"default_value": 0,
"maximum_value": 7
},
"machine_extruder_change_duration": { "default_value": 10.0 },
"machine_extruder_end_pos_abs": { "default_value": true },
"machine_extruder_end_pos_x": { "value": "prime_tower_position_x" },
"machine_extruder_end_pos_y": { "value": "prime_tower_position_y" },
"machine_extruder_prestart_code": { "default_value": "M104 S{material_print_temperature} T{extruder_nr}" },
"machine_extruder_start_pos_abs": { "default_value": true },
"machine_extruder_start_pos_x": { "value": "prime_tower_position_x" },
"machine_extruder_start_pos_y": { "value": "prime_tower_position_y" },
Expand Down
2 changes: 2 additions & 0 deletions resources/extruders/voron2_stealthchanger_extruder_1.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
"default_value": 1,
"maximum_value": 7
},
"machine_extruder_change_duration": { "default_value": 10.0 },
"machine_extruder_end_pos_abs": { "default_value": true },
"machine_extruder_end_pos_x": { "value": "prime_tower_position_x" },
"machine_extruder_end_pos_y": { "value": "prime_tower_position_y" },
"machine_extruder_prestart_code": { "default_value": "M104 S{material_print_temperature} T{extruder_nr}" },
"machine_extruder_start_pos_abs": { "default_value": true },
"machine_extruder_start_pos_x": { "value": "prime_tower_position_x" },
"machine_extruder_start_pos_y": { "value": "prime_tower_position_y" },
Expand Down
2 changes: 2 additions & 0 deletions resources/extruders/voron2_stealthchanger_extruder_2.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
"default_value": 2,
"maximum_value": 7
},
"machine_extruder_change_duration": { "default_value": 10.0 },
"machine_extruder_end_pos_abs": { "default_value": true },
"machine_extruder_end_pos_x": { "value": "prime_tower_position_x" },
"machine_extruder_end_pos_y": { "value": "prime_tower_position_y" },
"machine_extruder_prestart_code": { "default_value": "M104 S{material_print_temperature} T{extruder_nr}" },
"machine_extruder_start_pos_abs": { "default_value": true },
"machine_extruder_start_pos_x": { "value": "prime_tower_position_x" },
"machine_extruder_start_pos_y": { "value": "prime_tower_position_y" },
Expand Down
2 changes: 2 additions & 0 deletions resources/extruders/voron2_stealthchanger_extruder_3.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
"default_value": 3,
"maximum_value": 7
},
"machine_extruder_change_duration": { "default_value": 10.0 },
"machine_extruder_end_pos_abs": { "default_value": true },
"machine_extruder_end_pos_x": { "value": "prime_tower_position_x" },
"machine_extruder_end_pos_y": { "value": "prime_tower_position_y" },
"machine_extruder_prestart_code": { "default_value": "M104 S{material_print_temperature} T{extruder_nr}" },
"machine_extruder_start_pos_abs": { "default_value": true },
"machine_extruder_start_pos_x": { "value": "prime_tower_position_x" },
"machine_extruder_start_pos_y": { "value": "prime_tower_position_y" },
Expand Down
2 changes: 2 additions & 0 deletions resources/extruders/voron2_stealthchanger_extruder_4.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
"default_value": 4,
"maximum_value": 7
},
"machine_extruder_change_duration": { "default_value": 10.0 },
"machine_extruder_end_pos_abs": { "default_value": true },
"machine_extruder_end_pos_x": { "value": "prime_tower_position_x" },
"machine_extruder_end_pos_y": { "value": "prime_tower_position_y" },
"machine_extruder_prestart_code": { "default_value": "M104 S{material_print_temperature} T{extruder_nr}" },
"machine_extruder_start_pos_abs": { "default_value": true },
"machine_extruder_start_pos_x": { "value": "prime_tower_position_x" },
"machine_extruder_start_pos_y": { "value": "prime_tower_position_y" },
Expand Down
2 changes: 2 additions & 0 deletions resources/extruders/voron2_stealthchanger_extruder_5.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
"default_value": 5,
"maximum_value": 7
},
"machine_extruder_change_duration": { "default_value": 10.0 },
"machine_extruder_end_pos_abs": { "default_value": true },
"machine_extruder_end_pos_x": { "value": "prime_tower_position_x" },
"machine_extruder_end_pos_y": { "value": "prime_tower_position_y" },
"machine_extruder_prestart_code": { "default_value": "M104 S{material_print_temperature} T{extruder_nr}" },
"machine_extruder_start_pos_abs": { "default_value": true },
"machine_extruder_start_pos_x": { "value": "prime_tower_position_x" },
"machine_extruder_start_pos_y": { "value": "prime_tower_position_y" },
Expand Down
2 changes: 2 additions & 0 deletions resources/extruders/voron2_stealthchanger_extruder_6.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
"default_value": 6,
"maximum_value": 7
},
"machine_extruder_change_duration": { "default_value": 10.0 },
"machine_extruder_end_pos_abs": { "default_value": true },
"machine_extruder_end_pos_x": { "value": "prime_tower_position_x" },
"machine_extruder_end_pos_y": { "value": "prime_tower_position_y" },
"machine_extruder_prestart_code": { "default_value": "M104 S{material_print_temperature} T{extruder_nr}" },
"machine_extruder_start_pos_abs": { "default_value": true },
"machine_extruder_start_pos_x": { "value": "prime_tower_position_x" },
"machine_extruder_start_pos_y": { "value": "prime_tower_position_y" },
Expand Down
2 changes: 2 additions & 0 deletions resources/extruders/voron2_stealthchanger_extruder_7.def.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
"default_value": 7,
"maximum_value": 7
},
"machine_extruder_change_duration": { "default_value": 10.0 },
"machine_extruder_end_pos_abs": { "default_value": true },
"machine_extruder_end_pos_x": { "value": "prime_tower_position_x" },
"machine_extruder_end_pos_y": { "value": "prime_tower_position_y" },
"machine_extruder_prestart_code": { "default_value": "M104 S{material_print_temperature} T{extruder_nr}" },
"machine_extruder_start_pos_abs": { "default_value": true },
"machine_extruder_start_pos_x": { "value": "prime_tower_position_x" },
"machine_extruder_start_pos_y": { "value": "prime_tower_position_y" },
Expand Down