diff --git a/.github/workflows/printer-linter-pr-diagnose.yml b/.github/workflows/printer-linter-pr-diagnose.yml index 881ea1df3e..54bbda4c1d 100644 --- a/.github/workflows/printer-linter-pr-diagnose.yml +++ b/.github/workflows/printer-linter-pr-diagnose.yml @@ -1,59 +1,59 @@ name: printer-linter-pr-diagnose on: - pull_request: - path: - - 'resources/**' + pull_request: + path: + - "resources/**" jobs: - printer-linter-diagnose: - name: Printer linter PR diagnose + printer-linter-diagnose: + name: Printer linter PR diagnose - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 2 + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 2 - - name: Setup Python and pip - uses: actions/setup-python@v4 - with: - python-version: 3.11.x - cache: 'pip' - cache-dependency-path: .github/workflows/requirements-printer-linter.txt + - name: Setup Python and pip + uses: actions/setup-python@v4 + with: + python-version: 3.11.x + cache: "pip" + cache-dependency-path: .github/workflows/requirements-printer-linter.txt - - uses: technote-space/get-diff-action@v6 - with: - PATTERNS: | - resources/+(extruders|definitions)/*.def.json - resources/+(intent|quality|variants)/**/*.inst.cfg + - uses: technote-space/get-diff-action@v6 + with: + PATTERNS: | + resources/+(extruders|definitions)/*.def.json + resources/+(intent|quality|variants)/**/*.inst.cfg - - name: Install Python requirements for runner - if: env.GIT_DIFF && !env.MATCHED_FILES - run: pip install -r .github/workflows/requirements-printer-linter.txt + - name: Install Python requirements for runner + if: env.GIT_DIFF && !env.MATCHED_FILES + run: pip install -r .github/workflows/requirements-printer-linter.txt - - name: Create results directory - run: mkdir printer-linter-result + - name: Create results directory + run: mkdir printer-linter-result - - name: Diagnose file(s) - if: env.GIT_DIFF && !env.MATCHED_FILES - run: python printer-linter/src/terminal.py --diagnose --report printer-linter-result/fixes.yml ${{ env.GIT_DIFF_FILTERED }} + - name: Diagnose file(s) + if: env.GIT_DIFF && !env.MATCHED_FILES + run: python printer-linter/src/terminal.py --diagnose --report printer-linter-result/fixes.yml ${{ env.GIT_DIFF_FILTERED }} - - name: Save PR metadata - run: | - echo ${{ github.event.number }} > printer-linter-result/pr-id.txt - echo ${{ github.event.pull_request.head.repo.full_name }} > printer-linter-result/pr-head-repo.txt - echo ${{ github.event.pull_request.head.ref }} > printer-linter-result/pr-head-ref.txt + - name: Save PR metadata + run: | + echo ${{ github.event.number }} > printer-linter-result/pr-id.txt + echo ${{ github.event.pull_request.head.repo.full_name }} > printer-linter-result/pr-head-repo.txt + echo ${{ github.event.pull_request.head.ref }} > printer-linter-result/pr-head-ref.txt - - uses: actions/upload-artifact@v2 - with: - name: printer-linter-result - path: printer-linter-result/ + - uses: actions/upload-artifact@v2 + with: + name: printer-linter-result + path: printer-linter-result/ - - name: Run clang-tidy-pr-comments action - uses: platisd/clang-tidy-pr-comments@fix_suggestions_for_multiline_comments - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - clang_tidy_fixes: result.yml - request_changes: true + - name: Run clang-tidy-pr-comments action + uses: platisd/clang-tidy-pr-comments@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + clang_tidy_fixes: result.yml + request_changes: true diff --git a/.github/workflows/printer-linter-pr-post.yml b/.github/workflows/printer-linter-pr-post.yml index 6a79714e59..f6c0924d1c 100644 --- a/.github/workflows/printer-linter-pr-post.yml +++ b/.github/workflows/printer-linter-pr-post.yml @@ -1,81 +1,81 @@ name: printer-linter-pr-post on: - workflow_run: - workflows: [ "printer-linter-pr-diagnose" ] - types: [ completed ] + workflow_run: + workflows: ["printer-linter-pr-diagnose"] + types: [completed] jobs: - clang-tidy-results: - # Trigger the job only if the previous (insecure) workflow completed successfully - if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-latest - steps: - - name: Download analysis results - uses: actions/github-script@v3.1.0 - with: - script: | - let artifacts = await github.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{github.event.workflow_run.id }}, - }); - let matchArtifact = artifacts.data.artifacts.filter((artifact) => { - return artifact.name == "printer-linter-result" - })[0]; - let download = await github.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: "zip", - }); - let fs = require("fs"); - fs.writeFileSync("${{github.workspace}}/printer-linter-result.zip", Buffer.from(download.data)); + clang-tidy-results: + # Trigger the job only if the previous (insecure) workflow completed successfully + if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest + steps: + - name: Download analysis results + uses: actions/github-script@v3.1.0 + with: + script: | + let artifacts = await github.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: ${{github.event.workflow_run.id }}, + }); + let matchArtifact = artifacts.data.artifacts.filter((artifact) => { + return artifact.name == "printer-linter-result" + })[0]; + let download = await github.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: matchArtifact.id, + archive_format: "zip", + }); + let fs = require("fs"); + fs.writeFileSync("${{github.workspace}}/printer-linter-result.zip", Buffer.from(download.data)); - - name: Set environment variables - run: | - mkdir printer-linter-result - unzip printer-linter-result.zip -d printer-linter-result - echo "pr_id=$(cat printer-linter-result/pr-id.txt)" >> $GITHUB_ENV - echo "pr_head_repo=$(cat printer-linter-result/pr-head-repo.txt)" >> $GITHUB_ENV - echo "pr_head_ref=$(cat printer-linter-result/pr-head-ref.txt)" >> $GITHUB_ENV + - name: Set environment variables + run: | + mkdir printer-linter-result + unzip printer-linter-result.zip -d printer-linter-result + echo "pr_id=$(cat printer-linter-result/pr-id.txt)" >> $GITHUB_ENV + echo "pr_head_repo=$(cat printer-linter-result/pr-head-repo.txt)" >> $GITHUB_ENV + echo "pr_head_ref=$(cat printer-linter-result/pr-head-ref.txt)" >> $GITHUB_ENV - - uses: actions/checkout@v3 - with: - repository: ${{ env.pr_head_repo }} - ref: ${{ env.pr_head_ref }} - persist-credentials: false + - uses: actions/checkout@v3 + with: + repository: ${{ env.pr_head_repo }} + ref: ${{ env.pr_head_ref }} + persist-credentials: false - - name: Redownload analysis results - uses: actions/github-script@v3.1.0 - with: - script: | - let artifacts = await github.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{github.event.workflow_run.id }}, - }); - let matchArtifact = artifacts.data.artifacts.filter((artifact) => { - return artifact.name == "printer-linter-result" - })[0]; - let download = await github.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: "zip", - }); - let fs = require("fs"); - fs.writeFileSync("${{github.workspace}}/printer-linter-result.zip", Buffer.from(download.data)); + - name: Redownload analysis results + uses: actions/github-script@v3.1.0 + with: + script: | + let artifacts = await github.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: ${{github.event.workflow_run.id }}, + }); + let matchArtifact = artifacts.data.artifacts.filter((artifact) => { + return artifact.name == "printer-linter-result" + })[0]; + let download = await github.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: matchArtifact.id, + archive_format: "zip", + }); + let fs = require("fs"); + fs.writeFileSync("${{github.workspace}}/printer-linter-result.zip", Buffer.from(download.data)); - - name: Extract analysis results - run: | - mkdir printer-linter-result - unzip printer-linter-result.zip -d printer-linter-result + - name: Extract analysis results + run: | + mkdir printer-linter-result + unzip printer-linter-result.zip -d printer-linter-result - - name: Run clang-tidy-pr-comments action - uses: platisd/clang-tidy-pr-comments@fix_suggestions_for_multiline_comments - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - clang_tidy_fixes: printer-linter-result/fixes.yml - pull_request_id: ${{ env.pr_id }} - request_changes: true + - name: Run clang-tidy-pr-comments action + uses: platisd/clang-tidy-pr-comments@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + clang_tidy_fixes: printer-linter-result/fixes.yml + pull_request_id: ${{ env.pr_id }} + request_changes: true diff --git a/cura/Settings/ExtruderManager.py b/cura/Settings/ExtruderManager.py index f429a0de19..e465b6bb68 100755 --- a/cura/Settings/ExtruderManager.py +++ b/cura/Settings/ExtruderManager.py @@ -2,13 +2,15 @@ # Cura is released under the terms of the LGPLv3 or higher. from PyQt6.QtCore import pyqtSignal, pyqtProperty, QObject, QVariant # For communicating data and events to Qt. + +from UM.Application import Application from UM.FlameProfiler import pyqtSlot import cura.CuraApplication # To get the global container stack to find the current machine. +from UM.Util import parseBool from cura.Settings.GlobalStack import GlobalStack from UM.Logger import Logger from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator -from UM.Scene.SceneNode import SceneNode from UM.Scene.Selection import Selection from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator from UM.Settings.ContainerRegistry import ContainerRegistry # Finding containers by ID. @@ -45,6 +47,7 @@ class ExtruderManager(QObject): self._selected_object_extruders = [] # type: List[Union[str, "ExtruderStack"]] Selection.selectionChanged.connect(self.resetSelectedObjectExtruders) + Application.getInstance().globalContainerStackChanged.connect(self.emitGlobalStackExtrudersChanged) # When the machine is swapped we must update the active machine extruders extrudersChanged = pyqtSignal(QVariant) """Signal to notify other components when the list of extruders for a machine definition changes.""" @@ -52,6 +55,21 @@ class ExtruderManager(QObject): activeExtruderChanged = pyqtSignal() """Notify when the user switches the currently active extruder.""" + def emitGlobalStackExtrudersChanged(self): + # HACK + # The emit function can't be directly connected to another signal. This wrapper function is required. + # The extrudersChanged signal is emitted early when changing machines. This triggers it a second time + # after the extruder have changed properly. This is important for any QML using ExtruderManager.extruderIds + # This is a hack, but other behaviour relys on the updating in this order. + self.extrudersChanged.emit(self._application.getGlobalContainerStack().getId()) + + @pyqtProperty(int, notify = extrudersChanged) + def enabledExtruderCount(self) -> int: + global_container_stack = self._application.getGlobalContainerStack() + if global_container_stack: + return len([extruder for extruder in global_container_stack.extruderList if parseBool(extruder.getMetaDataEntry("enabled", "True"))]) + return 0 + @pyqtProperty(str, notify = activeExtruderChanged) def activeExtruderStackId(self) -> Optional[str]: """Gets the unique identifier of the currently active extruder stack. diff --git a/cura/Settings/SimpleModeSettingsManager.py b/cura/Settings/SimpleModeSettingsManager.py index af8707f235..7ea21ed295 100644 --- a/cura/Settings/SimpleModeSettingsManager.py +++ b/cura/Settings/SimpleModeSettingsManager.py @@ -42,21 +42,8 @@ class SimpleModeSettingsManager(QObject): for extruder_stack in global_stack.extruderList: user_setting_keys.update(extruder_stack.userChanges.getAllKeys()) - # remove settings that are visible in recommended (we don't show the reset button for those) - for skip_key in self.__ignored_custom_setting_keys: - if skip_key in user_setting_keys: - user_setting_keys.remove(skip_key) - has_customized_user_settings = len(user_setting_keys) > 0 if has_customized_user_settings != self._is_profile_customized: self._is_profile_customized = has_customized_user_settings self.isProfileCustomizedChanged.emit() - - # These are the settings included in the Simple ("Recommended") Mode, so only when the other settings have been - # changed, we consider it as a user customized profile in the Simple ("Recommended") Mode. - __ignored_custom_setting_keys = ["support_enable", - "infill_sparse_density", - "gradual_infill_steps", - "adhesion_type", - "support_extruder_nr"] diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorBuildplateConfiguration.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorBuildplateConfiguration.qml index 0bd57e76d8..a81bec3884 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorBuildplateConfiguration.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorBuildplateConfiguration.qml @@ -27,7 +27,7 @@ Item Row { height: parent.height - spacing: UM.Theme.getSize("print_setup_slider_handle").width // TODO: Theme! (Should be same as extruder spacing) + spacing: UM.Theme.getSize("slider_handle").width // TODO: Theme! (Should be same as extruder spacing) // This wrapper ensures that the buildplate icon is located centered // below an extruder icon. diff --git a/resources/definitions/creality_sermoonv1.def.json b/resources/definitions/creality_sermoonv1.def.json index f64b91c228..d40c172f43 100644 --- a/resources/definitions/creality_sermoonv1.def.json +++ b/resources/definitions/creality_sermoonv1.def.json @@ -27,6 +27,8 @@ "machine_height": { "default_value": 165 }, "machine_name": { "default_value": "Creality Sermoon V1" }, "machine_start_gcode": { "default_value": "; -- START GCODE --\nG28 ;Home\n\nG92 E0 ;Reset Extruder\nG1 Z2.0 F3000 ;Move Z Axis up\nG1 X10.1 Y20 Z0.28 F5000.0 ;Move to start position\nG1 X10.1 Y170.0 Z0.28 F1500.0 E12 ;Draw the first line\nG1 X10.4 Y170.0 Z0.28 F5000.0 ;Move to side a little\nG1 X10.4 Y20 Z0.28 F1500.0 E25 ;Draw the second line\nG92 E0 ;Reset Extruder\nG1 Z2.0 F3000 ;Move Z Axis up" }, - "machine_width": { "default_value": 175 } + "machine_width": { "default_value": 175 }, + "retraction_amount": { "value": 0.8 }, + "retraction_speed": { "default_value": 40 } } } \ No newline at end of file diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 7522227940..7f0edb21ba 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -8161,6 +8161,7 @@ "small_feature_max_length": { "label": "Small Feature Max Length", + "enabled": "small_hole_max_size > 0", "description": "Feature outlines that are shorter than this length will be printed using Small Feature Speed.", "unit": "mm", "type": "float", @@ -8174,6 +8175,7 @@ "small_feature_speed_factor": { "label": "Small Feature Speed", + "enabled": "small_hole_max_size > 0", "description": "Small features will be printed at this percentage of their normal print speed. Slower printing can help with adhesion and accuracy.", "unit": "%", "type": "float", @@ -8186,6 +8188,7 @@ "small_feature_speed_factor_0": { "label": "Small Feature Initial Layer Speed", + "enabled": "small_hole_max_size > 0", "description": "Small features on the first layer will be printed at this percentage of their normal print speed. Slower printing can help with adhesion and accuracy.", "unit": "%", "type": "float", diff --git a/resources/definitions/ultimaker2.def.json b/resources/definitions/ultimaker2.def.json index b28ce07770..f68d51dd6c 100644 --- a/resources/definitions/ultimaker2.def.json +++ b/resources/definitions/ultimaker2.def.json @@ -2,102 +2,105 @@ "version": 2, "name": "Ultimaker 2", "inherits": "ultimaker", - "metadata": { + "metadata": + { "visible": true, "author": "Ultimaker", "manufacturer": "Ultimaker B.V.", - "weight": 3, "file_formats": "text/x-gcode", "platform": "ultimaker2_platform.obj", - "platform_texture": "Ultimaker2backplate.png", - "platform_offset": [9, 0, 0], - "has_materials": false, - "has_machine_quality": true, - "preferred_variant_name": "0.4 mm", - "machine_extruder_trains": - { - "0": "ultimaker2_extruder_0" - }, + "exclude_materials": [ + "generic_hips", + "generic_petg", + "structur3d_dap100silicone", + "ultimaker_petg_red", + "ultimaker_petg_blue", + "ultimaker_petg_grey", + "ultimaker_petg_black", + "ultimaker_petg_green", + "ultimaker_petg_white", + "ultimaker_petg_orange", + "ultimaker_petg_silver", + "ultimaker_petg_yellow", + "ultimaker_petg_transparent", + "ultimaker_petg_red_translucent", + "ultimaker_petg_blue_translucent", + "ultimaker_petg_green_translucent", + "ultimaker_petg_yellow_fluorescent" + ], "firmware_file": "MarlinUltimaker2.hex", - "exclude_materials": [ "generic_hips", "generic_petg", "structur3d_dap100silicone", "ultimaker_petg_red", "ultimaker_petg_blue", "ultimaker_petg_grey", "ultimaker_petg_black", "ultimaker_petg_green", "ultimaker_petg_white", "ultimaker_petg_orange", "ultimaker_petg_silver", "ultimaker_petg_yellow", "ultimaker_petg_transparent", "ultimaker_petg_red_translucent", "ultimaker_petg_blue_translucent", "ultimaker_petg_green_translucent", "ultimaker_petg_yellow_fluorescent"] + "has_machine_quality": true, + "has_materials": false, + "machine_extruder_trains": { "0": "ultimaker2_extruder_0" }, + "platform_offset": [ + 9, + 0, + 0 + ], + "platform_texture": "Ultimaker2backplate.png", + "preferred_variant_name": "0.4 mm", + "weight": 3 }, - "overrides": { - "machine_name": { "default_value": "Ultimaker 2" }, - "machine_start_gcode" : { - "value": "\"G0 F3000 Y50 ;avoid prime blob\" if machine_gcode_flavor == \"UltiGCode\" else \"G21 ;metric values\\nG90 ;absolute positioning\\nM82 ;set extruder to absolute mode\\nM107 ;start with the fan off\\nG28 Z0 ;move Z to bottom endstops\\nG28 X0 Y0 ;move X/Y to endstops\\nG1 X15 Y0 F4000 ;move X/Y to front of printer\\nG1 Z15.0 F9000 ;move the platform to 15mm\\nG92 E0 ;zero the extruded length\\nG1 F200 E10 ;extrude 10 mm of feed stock\\nG92 E0 ;zero the extruded length again\\nG1 Y50 F9000\\n;Put printing message on LCD screen\\nM117 Printing...\"" - }, - "machine_end_gcode" : { - "value": "\";Version _2.6 of the firmware can abort the print too early if the file ends\\n;too soon. However if the file hasn't ended yet because there are comments at\\n;the end of the file, it won't abort yet. Therefore we have to put at least 512\\n;bytes at the end of the g-code so that the file is not yet finished by the\\n;time that the motion planner gets flushed. With firmware version _3.3 this\\n;should be fixed, so this comment wouldn't be necessary any more. Now we have\\n;to pad this text to make precisely 512 bytes.\" if machine_gcode_flavor == \"UltiGCode\" else \"M104 S0 ;extruder heater off\\nM140 S0 ;heated bed heater off (if you have it)\\nG91 ;relative positioning\\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\\nG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\\nM84 ;steppers off\\nG90 ;absolute positioning\\n;Version _2.6 of the firmware can abort the print too early if the file ends\\n;too soon. However if the file hasn't ended yet because there are comments at\\n;the end of the file, it won't abort yet. Therefore we have to put at least 512\\n;bytes at the end of the g-code so that the file is not yet finished by the\\n;time that the motion planner gets flushed. With firmware version _3.3 this\\n;should be fixed, so this comment wouldn't be necessary any more. Now we have\\n;to pad this text to make precisely 512 bytes.\"" - }, - "machine_width": { - "default_value": 223 - }, - "machine_depth": { - "default_value": 223 - }, - "machine_height": { - "default_value": 205 - }, - "machine_heated_bed": { - "default_value": true + "overrides": + { + "cool_fan_speed_0": { "value": 0 }, + "gantry_height": { "value": "48" }, + "layer_height_0": { "value": 0.3 }, + "machine_acceleration": { "default_value": 3000 }, + "machine_center_is_zero": { "default_value": false }, + "machine_depth": { "default_value": 223 }, + "machine_disallowed_areas": + { + "default_value": [ + [ + [-115, 112.5], + [-82, 112.5], + [-84, 102.5], + [-115, 102.5] + ], + [ + [115, 112.5], + [115, 102.5], + [110, 102.5], + [108, 112.5] + ], + [ + [-115, -112.5], + [-115, -104.5], + [-84, -104.5], + [-82, -112.5] + ], + [ + [115, -112.5], + [108, -112.5], + [110, -104.5], + [115, -104.5] + ] + ] }, + "machine_end_gcode": { "value": "\";Version _2.6 of the firmware can abort the print too early if the file ends\\n;too soon. However if the file hasn't ended yet because there are comments at\\n;the end of the file, it won't abort yet. Therefore we have to put at least 512\\n;bytes at the end of the g-code so that the file is not yet finished by the\\n;time that the motion planner gets flushed. With firmware version _3.3 this\\n;should be fixed, so this comment wouldn't be necessary any more. Now we have\\n;to pad this text to make precisely 512 bytes.\" if machine_gcode_flavor == \"UltiGCode\" else \"M104 S0 ;extruder heater off\\nM140 S0 ;heated bed heater off (if you have it)\\nG91 ;relative positioning\\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\\nG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\\nM84 ;steppers off\\nG90 ;absolute positioning\\n;Version _2.6 of the firmware can abort the print too early if the file ends\\n;too soon. However if the file hasn't ended yet because there are comments at\\n;the end of the file, it won't abort yet. Therefore we have to put at least 512\\n;bytes at the end of the g-code so that the file is not yet finished by the\\n;time that the motion planner gets flushed. With firmware version _3.3 this\\n;should be fixed, so this comment wouldn't be necessary any more. Now we have\\n;to pad this text to make precisely 512 bytes.\"" }, + "machine_gcode_flavor": { "default_value": "UltiGCode" }, "machine_head_with_fans_polygon": { "default_value": [ - [ -42, 12 ], - [ -42, -32 ], - [ 62, 12 ], - [ 62, -32 ] + [-42, 12], + [-42, -32], + [62, 12], + [62, -32] ] }, - "machine_center_is_zero": { - "default_value": false - }, - "gantry_height": { - "value": "48" - }, - "machine_use_extruder_offset_to_offset_coords": { - "default_value": true - }, - "machine_gcode_flavor": { - "default_value": "UltiGCode" - }, - "machine_disallowed_areas": { - "default_value": [ - [[-115, 112.5], [ -82, 112.5], [ -84, 102.5], [-115, 102.5]], - [[ 115, 112.5], [ 115, 102.5], [ 110, 102.5], [ 108, 112.5]], - [[-115, -112.5], [-115, -104.5], [ -84, -104.5], [ -82, -112.5]], - [[ 115, -112.5], [ 108, -112.5], [ 110, -104.5], [ 115, -104.5]] - ]}, - "machine_nozzle_tip_outer_diameter": { - "default_value": 1 - }, - "machine_nozzle_head_distance": { - "default_value": 3 - }, - "machine_max_feedrate_x": { - "default_value": 300 - }, - "machine_max_feedrate_y": { - "default_value": 300 - }, - "machine_max_feedrate_z": { - "default_value": 40 - }, - "machine_acceleration": { - "default_value": 3000 - }, - "support_z_distance": { - "value": "0.1" - }, - "cool_fan_speed_0": { - "value": 0 - }, - "layer_height_0": { - "value": 0.3 - }, - "speed_slowdown_layers": { - "value": 2 - } + "machine_heated_bed": { "default_value": true }, + "machine_height": { "default_value": 205 }, + "machine_max_feedrate_x": { "default_value": 300 }, + "machine_max_feedrate_y": { "default_value": 300 }, + "machine_max_feedrate_z": { "default_value": 40 }, + "machine_name": { "default_value": "Ultimaker 2" }, + "machine_nozzle_head_distance": { "default_value": 3 }, + "machine_nozzle_tip_outer_diameter": { "default_value": 1 }, + "machine_start_gcode": { "value": "\"G0 F3000 Y50 ;avoid prime blob\" if machine_gcode_flavor == \"UltiGCode\" else \"G21 ;metric values\\nG90 ;absolute positioning\\nM82 ;set extruder to absolute mode\\nM107 ;start with the fan off\\nG28 Z0 ;move Z to bottom endstops\\nG28 X0 Y0 ;move X/Y to endstops\\nG1 X15 Y0 F4000 ;move X/Y to front of printer\\nG1 Z15.0 F9000 ;move the platform to 15mm\\nG92 E0 ;zero the extruded length\\nG1 F200 E10 ;extrude 10 mm of feed stock\\nG92 E0 ;zero the extruded length again\\nG1 Y50 F9000\\n;Put printing message on LCD screen\\nM117 Printing...\"" }, + "machine_use_extruder_offset_to_offset_coords": { "default_value": true }, + "machine_width": { "default_value": 223 }, + "speed_slowdown_layers": { "value": 2 }, + "support_z_distance": { "value": "0.1" } } -} +} \ No newline at end of file diff --git a/resources/definitions/ultimaker2_extended.def.json b/resources/definitions/ultimaker2_extended.def.json index 572634c602..92adfae7e4 100644 --- a/resources/definitions/ultimaker2_extended.def.json +++ b/resources/definitions/ultimaker2_extended.def.json @@ -2,25 +2,21 @@ "version": 2, "name": "Ultimaker 2 Extended", "inherits": "ultimaker2", - "metadata": { + "metadata": + { "author": "Ultimaker", "manufacturer": "Ultimaker B.V.", - "quality_definition": "ultimaker2", - "weight": 3, "file_formats": "text/x-gcode", "platform": "ultimaker2_platform.obj", + "firmware_file": "MarlinUltimaker2extended.hex", + "machine_extruder_trains": { "0": "ultimaker2_extended_extruder_0" }, "platform_texture": "Ultimaker2Extendedbackplate.png", - "machine_extruder_trains": - { - "0": "ultimaker2_extended_extruder_0" - }, - "firmware_file": "MarlinUltimaker2extended.hex" + "quality_definition": "ultimaker2", + "weight": 3 }, - - "overrides": { - "machine_name": { "default_value": "Ultimaker 2 Extended" }, - "machine_height": { - "default_value": 305 - } + "overrides": + { + "machine_height": { "default_value": 305 }, + "machine_name": { "default_value": "Ultimaker 2 Extended" } } -} +} \ No newline at end of file diff --git a/resources/definitions/ultimaker2_extended_olsson.def.json b/resources/definitions/ultimaker2_extended_olsson.def.json index d2eb7f9a5d..f2afc8c6d0 100644 --- a/resources/definitions/ultimaker2_extended_olsson.def.json +++ b/resources/definitions/ultimaker2_extended_olsson.def.json @@ -2,11 +2,9 @@ "version": 2, "name": "Ultimaker 2 Extended with Olsson", "inherits": "ultimaker2_extended", - "metadata": { - "has_variants": true - }, - - "overrides": { + "metadata": { "has_variants": true }, + "overrides": + { "machine_name": { "default_value": "Ultimaker 2 Extended with Olsson" } } -} +} \ No newline at end of file diff --git a/resources/definitions/ultimaker2_extended_plus.def.json b/resources/definitions/ultimaker2_extended_plus.def.json index 0242115057..23f8a15f40 100644 --- a/resources/definitions/ultimaker2_extended_plus.def.json +++ b/resources/definitions/ultimaker2_extended_plus.def.json @@ -2,25 +2,21 @@ "version": 2, "name": "Ultimaker 2 Extended+", "inherits": "ultimaker2_plus", - "metadata": { + "metadata": + { "author": "Ultimaker", "manufacturer": "Ultimaker B.V.", - "quality_definition": "ultimaker2_plus", - "weight": 2, "file_formats": "text/x-gcode", "platform": "ultimaker2_platform.obj", + "firmware_file": "MarlinUltimaker2extended-plus.hex", + "machine_extruder_trains": { "0": "ultimaker2_extended_plus_extruder_0" }, "platform_texture": "Ultimaker2ExtendedPlusbackplate.png", - "machine_extruder_trains": - { - "0": "ultimaker2_extended_plus_extruder_0" - }, - "firmware_file": "MarlinUltimaker2extended-plus.hex" + "quality_definition": "ultimaker2_plus", + "weight": 2 }, - - "overrides": { - "machine_name": { "default_value": "Ultimaker 2 Extended+" }, - "machine_height": { - "default_value": 305 - } + "overrides": + { + "machine_height": { "default_value": 305 }, + "machine_name": { "default_value": "Ultimaker 2 Extended+" } } -} +} \ No newline at end of file diff --git a/resources/definitions/ultimaker2_go.def.json b/resources/definitions/ultimaker2_go.def.json index 774d215bef..e7ba8d1358 100644 --- a/resources/definitions/ultimaker2_go.def.json +++ b/resources/definitions/ultimaker2_go.def.json @@ -1,44 +1,59 @@ { - "version": 2, + "version": 2, "name": "Ultimaker 2 Go", "inherits": "ultimaker2", - "metadata": { + "metadata": + { "author": "Ultimaker", "manufacturer": "Ultimaker B.V.", - "quality_definition": "ultimaker2", - "weight": 3, "file_formats": "text/x-gcode", "platform": "ultimaker2go_platform.obj", + "firmware_file": "MarlinUltimaker2go.hex", + "machine_extruder_trains": { "0": "ultimaker2_go_extruder_0" }, + "platform_offset": [ + 0, + 0, + 0 + ], "platform_texture": "Ultimaker2Gobackplate.png", - "platform_offset": [0, 0, 0], - "machine_extruder_trains": - { - "0": "ultimaker2_go_extruder_0" - }, - "firmware_file": "MarlinUltimaker2go.hex" + "quality_definition": "ultimaker2", + "weight": 3 }, - - "overrides": { - "machine_name": { "default_value": "Ultimaker 2 Go" }, - "machine_width": { - "default_value": 120 - }, - "machine_depth": { - "default_value": 120 - }, - "machine_height": { - "default_value": 115 - }, - "machine_heated_bed": { - "default_value": false - }, - "machine_disallowed_areas": { + "overrides": + { + "machine_depth": { "default_value": 120 }, + "machine_disallowed_areas": + { "default_value": [ - [[-60, 60], [-33, 60], [-35, 52], [-60, 52]], - [[ 60, 60], [ 60, 52], [ 35, 52], [ 33, 60]], - [[-60, -60], [-60, -52], [-35, -52], [-33, -60]], - [[ 60, -60], [ 33, -60], [ 35, -52], [ 60, -52]] + [ + [-60, 60], + [-33, 60], + [-35, 52], + [-60, 52] + ], + [ + [60, 60], + [60, 52], + [35, 52], + [33, 60] + ], + [ + [-60, -60], + [-60, -52], + [-35, -52], + [-33, -60] + ], + [ + [60, -60], + [33, -60], + [35, -52], + [60, -52] + ] ] - } + }, + "machine_heated_bed": { "default_value": false }, + "machine_height": { "default_value": 115 }, + "machine_name": { "default_value": "Ultimaker 2 Go" }, + "machine_width": { "default_value": 120 } } -} +} \ No newline at end of file diff --git a/resources/definitions/ultimaker2_olsson.def.json b/resources/definitions/ultimaker2_olsson.def.json index 2f8b877942..74c562988f 100644 --- a/resources/definitions/ultimaker2_olsson.def.json +++ b/resources/definitions/ultimaker2_olsson.def.json @@ -2,12 +2,13 @@ "version": 2, "name": "Ultimaker 2 with Olsson Block", "inherits": "ultimaker2", - "metadata": { + "metadata": + { "has_variants": true, "quality_definition": "ultimaker2" }, - - "overrides": { + "overrides": + { "machine_name": { "default_value": "Ultimaker 2 with Olsson Block" } } -} +} \ No newline at end of file diff --git a/resources/definitions/ultimaker2_plus.def.json b/resources/definitions/ultimaker2_plus.def.json index 0d4191383d..18b377813a 100644 --- a/resources/definitions/ultimaker2_plus.def.json +++ b/resources/definitions/ultimaker2_plus.def.json @@ -2,72 +2,104 @@ "version": 2, "name": "Ultimaker 2+", "inherits": "ultimaker2", - "metadata": { + "metadata": + { "author": "Ultimaker", "manufacturer": "Ultimaker B.V.", - "weight": 1, "file_formats": "text/x-gcode", "platform": "ultimaker2_platform.obj", + "exclude_materials": [ + "generic_hips", + "generic_petg", + "generic_bam", + "ultimaker_bam", + "generic_pva", + "ultimaker_pva", + "generic_tough_pla", + "ultimaker_tough_pla_black", + "ultimaker_tough_pla_green", + "ultimaker_tough_pla_red", + "ultimaker_tough_pla_white", + "generic_cffcpe", + "generic_cffpa", + "generic_gffcpe", + "generic_gffpa", + "structur3d_dap100silicone", + "ultimaker_petg_red", + "ultimaker_petg_blue", + "ultimaker_petg_grey", + "ultimaker_petg_black", + "ultimaker_petg_green", + "ultimaker_petg_white", + "ultimaker_petg_orange", + "ultimaker_petg_silver", + "ultimaker_petg_yellow", + "ultimaker_petg_transparent", + "ultimaker_petg_red_translucent", + "ultimaker_petg_blue_translucent", + "ultimaker_petg_green_translucent", + "ultimaker_petg_yellow_fluorescent" + ], + "firmware_file": "MarlinUltimaker2plus.hex", + "first_start_actions": [], + "has_machine_quality": true, + "has_materials": true, + "has_variants": true, + "machine_extruder_trains": { "0": "ultimaker2_plus_extruder_0" }, "platform_texture": "Ultimaker2Plusbackplate.png", "preferred_variant_name": "0.4 mm", - "has_variants": true, - "has_materials": true, - "has_machine_quality": true, - "exclude_materials": ["generic_hips", "generic_petg", "generic_bam", "ultimaker_bam", "generic_pva", "ultimaker_pva", "generic_tough_pla", "ultimaker_tough_pla_black", "ultimaker_tough_pla_green", "ultimaker_tough_pla_red", "ultimaker_tough_pla_white", "generic_cffcpe", "generic_cffpa", "generic_gffcpe", "generic_gffpa", "structur3d_dap100silicone", "ultimaker_petg_red", "ultimaker_petg_blue", "ultimaker_petg_grey", "ultimaker_petg_black", "ultimaker_petg_green", "ultimaker_petg_white", "ultimaker_petg_orange", "ultimaker_petg_silver", "ultimaker_petg_yellow", "ultimaker_petg_transparent", "ultimaker_petg_red_translucent", "ultimaker_petg_blue_translucent", "ultimaker_petg_green_translucent", "ultimaker_petg_yellow_fluorescent"], - "first_start_actions": [], "supported_actions": [], - "machine_extruder_trains": - { - "0": "ultimaker2_plus_extruder_0" - }, - "firmware_file": "MarlinUltimaker2plus.hex" + "weight": 1 }, - - "overrides": { - "machine_name": { "default_value": "Ultimaker 2+" }, - "speed_infill": { - "value": "speed_print" - }, - "speed_wall_x": { - "value": "speed_wall" - }, - "layer_height_0": { - "value": "round(machine_nozzle_size / 1.5, 2)" - }, - "speed_support": { - "value": "speed_wall_0" - }, - "machine_height": { - "default_value": 205 - }, - "machine_show_variants": { - "default_value": true - }, - "gantry_height": { - "value": "52" - }, - "machine_nozzle_head_distance": { - "default_value": 5 - }, - "machine_heat_zone_length": { - "default_value": 20 + "overrides": + { + "gantry_height": { "value": "52" }, + "layer_height_0": { "value": "round(machine_nozzle_size / 1.5, 2)" }, + "machine_disallowed_areas": + { + "default_value": [ + [ + [-115, 112.5], + [-78, 112.5], + [-80, 102.5], + [-115, 102.5] + ], + [ + [115, 112.5], + [115, 102.5], + [105, 102.5], + [103, 112.5] + ], + [ + [-115, -112.5], + [-115, -104.5], + [-84, -104.5], + [-82, -112.5] + ], + [ + [115, -112.5], + [108, -112.5], + [110, -104.5], + [115, -104.5] + ] + ] }, "machine_head_with_fans_polygon": { "default_value": [ - [ -44, 14 ], - [ -44, -34 ], - [ 64, 14 ], - [ 64, -34 ] + [-44, 14], + [-44, -34], + [64, 14], + [64, -34] ] }, - "machine_disallowed_areas": { - "default_value": [ - [[-115, 112.5], [ -78, 112.5], [ -80, 102.5], [-115, 102.5]], - [[ 115, 112.5], [ 115, 102.5], [ 105, 102.5], [ 103, 112.5]], - [[-115, -112.5], [-115, -104.5], [ -84, -104.5], [ -82, -112.5]], - [[ 115, -112.5], [ 108, -112.5], [ 110, -104.5], [ 115, -104.5]] - ] - } + "machine_heat_zone_length": { "default_value": 20 }, + "machine_height": { "default_value": 205 }, + "machine_name": { "default_value": "Ultimaker 2+" }, + "machine_nozzle_head_distance": { "default_value": 5 }, + "machine_show_variants": { "default_value": true }, + "speed_infill": { "value": "speed_print" }, + "speed_support": { "value": "speed_wall_0" }, + "speed_wall_x": { "value": "speed_wall" } } -} +} \ No newline at end of file diff --git a/resources/definitions/ultimaker2_plus_connect.def.json b/resources/definitions/ultimaker2_plus_connect.def.json index 5674b4f030..ac3c84546d 100644 --- a/resources/definitions/ultimaker2_plus_connect.def.json +++ b/resources/definitions/ultimaker2_plus_connect.def.json @@ -2,87 +2,131 @@ "version": 2, "name": "Ultimaker 2+ Connect", "inherits": "ultimaker2", - "metadata": { + "metadata": + { "author": "Ultimaker", "manufacturer": "Ultimaker B.V.", - "weight": 1, "file_formats": "application/x-ufp;text/x-gcode", "platform": "ultimaker2_plus_connect_platform.obj", - "platform_texture": "Ultimaker2PlusConnectbackplate.png", - "platform_offset": [-1, -6, 0], - "preferred_variant_name": "0.4 mm", - "has_variants": true, - "has_materials": true, + "exclude_materials": [ + "generic_hips", + "generic_petg", + "generic_bam", + "ultimaker_bam", + "generic_pva", + "ultimaker_pva", + "generic_tough_pla", + "ultimaker_tough_pla_black", + "ultimaker_tough_pla_green", + "ultimaker_tough_pla_red", + "ultimaker_tough_pla_white", + "generic_cffcpe", + "generic_cffpa", + "generic_gffcpe", + "generic_gffpa", + "structur3d_dap100silicone" + ], + "first_start_actions": [], "has_machine_materials": true, "has_machine_quality": true, - "exclude_materials": ["generic_hips", "generic_petg", "generic_bam", "ultimaker_bam", "generic_pva", "ultimaker_pva", "generic_tough_pla", "ultimaker_tough_pla_black", "ultimaker_tough_pla_green", "ultimaker_tough_pla_red", "ultimaker_tough_pla_white", "generic_cffcpe", "generic_cffpa", "generic_gffcpe", "generic_gffpa", "structur3d_dap100silicone" ], - "first_start_actions": [], + "has_materials": true, + "has_variants": true, + "machine_extruder_trains": { "0": "ultimaker2_plus_connect_extruder_0" }, + "platform_offset": [ + -1, + -6, + 0 + ], + "platform_texture": "Ultimaker2PlusConnectbackplate.png", + "preferred_variant_name": "0.4 mm", "supported_actions": [], - "machine_extruder_trains": - { - "0": "ultimaker2_plus_connect_extruder_0" - }, + "supports_network_connection": true, "supports_usb_connection": false, - "supports_network_connection": true + "weight": 1 }, - - "overrides": { - "machine_name": { "default_value": "Ultimaker 2+ Connect" }, - "machine_gcode_flavor": { "default_value": "Griffin" }, - "machine_width": { "default_value": 223 }, - "machine_depth": { "default_value": 220 }, - "machine_height": { "default_value": 205 }, - "machine_show_variants": { "default_value": true }, + "overrides": + { "gantry_height": { "value": "52" }, - "machine_nozzle_head_distance": { "default_value": 5 }, - "machine_heat_zone_length": { "default_value": 20 }, + "infill_overlap": { "value": "0" }, + "infill_pattern": { "value": "'zigzag' if infill_sparse_density > 80 else 'grid'" }, + "infill_wipe_dist": { "value": "0" }, + "layer_height_0": { "value": "round(machine_nozzle_size / 1.5, 2)" }, + "machine_depth": { "default_value": 220 }, + "machine_disallowed_areas": + { + "default_value": [ + [ + [-115, 112.5], + [-83, 112.5], + [-85, 104.0], + [-115, 104.0] + ], + [ + [115, 112.5], + [115, 104.0], + [104, 104.0], + [102, 112.5] + ], + [ + [-115, -112.5], + [-115, -104.0], + [-87, -104.0], + [-85, -112.5] + ], + [ + [115, -112.5], + [104, -112.5], + [106, -104.0], + [115, -104.0] + ] + ] + }, + "machine_end_gcode": { "value": "''" }, + "machine_gcode_flavor": { "default_value": "Griffin" }, "machine_head_with_fans_polygon": { "default_value": [ - [ -44, 14 ], - [ -44, -34 ], - [ 64, 14 ], - [ 64, -34 ] + [-44, 14], + [-44, -34], + [64, 14], + [64, -34] ] }, - "machine_disallowed_areas": - { - "default_value": [ - [[-115, 112.5], [ -83, 112.5], [ -85, 104.0], [-115, 104.0]], - [[ 115, 112.5], [ 115, 104.0], [ 104, 104.0], [ 102, 112.5]], - [[-115, -112.5], [-115, -104.0], [ -87, -104.0], [ -85, -112.5]], - [[ 115, -112.5], [ 104, -112.5], [ 106, -104.0], [ 115, -104.0]] - ] - }, - "infill_wipe_dist": { "value": "0" }, - "infill_overlap": { "value": "0" }, - "infill_pattern": { "value": "'zigzag' if infill_sparse_density > 80 else 'grid'" }, - "layer_height_0": { "value": "round(machine_nozzle_size / 1.5, 2)" }, - "optimize_wall_printing_order": { "value": "True" }, - "zig_zaggify_infill": { "value": "gradual_infill_steps == 0" }, - "speed_support": { "value": "speed_wall_0" }, - "material_initial_print_temperature": { - "value": "material_print_temperature", - "maximum_value": 260 - }, - "material_final_print_temperature": { - "value": "material_print_temperature", - "maximum_value": 260 - }, - "material_print_temperature_layer_0": { - "maximum_value": 260 - }, + "machine_heat_zone_length": { "default_value": 20 }, + "machine_height": { "default_value": 205 }, + "machine_name": { "default_value": "Ultimaker 2+ Connect" }, + "machine_nozzle_head_distance": { "default_value": 5 }, + "machine_show_variants": { "default_value": true }, "machine_start_gcode": { "value": "''" }, - "machine_end_gcode": { "value": "''" }, + "machine_width": { "default_value": 223 }, "material_bed_temperature": { "maximum_value": 110 }, "material_bed_temperature_layer_0": { "maximum_value": 110 }, + "material_final_print_temperature": + { + "maximum_value": 260, + "value": "material_print_temperature" + }, + "material_initial_print_temperature": + { + "maximum_value": 260, + "value": "material_print_temperature" + }, "material_print_temperature": { "maximum_value": 260 }, - "meshfix_maximum_resolution": { "value": "(speed_wall_0 + speed_wall_x) / 60" }, + "material_print_temperature_layer_0": { "maximum_value": 260 }, "meshfix_maximum_deviation": { "value": "(layer_height / 3) if magic_spiralize else (layer_height / 4)" }, + "meshfix_maximum_resolution": { "value": "(speed_wall_0 + speed_wall_x) / 60" }, "meshfix_maximum_travel_resolution": { "value": 0.5 }, - "prime_blob_enable": { "enabled": true, "default_value": true, "value": "resolveOrValue('print_sequence') != 'one_at_a_time'" }, + "optimize_wall_printing_order": { "value": "True" }, + "prime_blob_enable": + { + "default_value": true, + "enabled": true, + "value": "resolveOrValue('print_sequence') != 'one_at_a_time'" + }, "retraction_prime_speed": { "value": "15" }, - "retraction_speed": {"value": "45" }, - "speed_wall_x": { "value": "speed_wall" } + "retraction_speed": { "value": "45" }, + "speed_support": { "value": "speed_wall_0" }, + "speed_wall_x": { "value": "speed_wall" }, + "zig_zaggify_infill": { "value": "gradual_infill_steps == 0" } } -} +} \ No newline at end of file diff --git a/resources/definitions/ultimaker3.def.json b/resources/definitions/ultimaker3.def.json index eb19058a98..11e99f8460 100644 --- a/resources/definitions/ultimaker3.def.json +++ b/resources/definitions/ultimaker3.def.json @@ -2,85 +2,54 @@ "version": 2, "name": "Ultimaker 3", "inherits": "ultimaker", - "metadata": { + "metadata": + { + "visible": true, "author": "Ultimaker", "manufacturer": "Ultimaker B.V.", - "visible": true, "file_formats": "application/gzip;text/x-gcode", "platform": "ultimaker3_platform.obj", - "platform_texture": "Ultimaker3backplate.png", - "platform_offset": [0, 0, 0], + "bom_numbers": [ + 9066 + ], + "exclude_materials": [ + "generic_hips", + "generic_cffcpe", + "generic_cffpa", + "generic_gffcpe", + "generic_gffpa", + "structur3d_dap100silicone" + ], + "firmware_update_info": + { + "check_urls": [ "https://software.ultimaker.com/releases/firmware/9066/stable/um-update.swu.version" ], + "id": 9066, + "update_url": "https://ultimaker.com/firmware?utm_source=cura&utm_medium=software&utm_campaign=fw-update" + }, + "first_start_actions": [ "DiscoverUM3Action" ], "has_machine_quality": true, "has_materials": true, "has_variants": true, - "exclude_materials": [ "generic_hips", "generic_cffcpe", "generic_cffpa", "generic_gffcpe", "generic_gffpa", "structur3d_dap100silicone" ], - "preferred_variant_name": "AA 0.4", - "preferred_quality_type": "normal", - "variants_name": "Print core", "machine_extruder_trains": { "0": "ultimaker3_extruder_left", "1": "ultimaker3_extruder_right" }, - "first_start_actions": [ "DiscoverUM3Action" ], + "platform_offset": [ + 0, + 0, + 0 + ], + "platform_texture": "Ultimaker3backplate.png", + "preferred_quality_type": "normal", + "preferred_variant_name": "AA 0.4", "supported_actions": [ "DiscoverUM3Action" ], - "supports_usb_connection": false, "supports_network_connection": true, - "firmware_update_info": { - "id": 9066, - "check_urls": - [ - "https://software.ultimaker.com/releases/firmware/9066/stable/um-update.swu.version" - ], - "update_url": "https://ultimaker.com/firmware?utm_source=cura&utm_medium=software&utm_campaign=fw-update" - }, - "bom_numbers": [ - 9066 - ] + "supports_usb_connection": false, + "variants_name": "Print core" }, - - - - "overrides": { - "machine_name": { "default_value": "Ultimaker 3" }, - "machine_width": { "default_value": 233 }, - "machine_depth": { "default_value": 215 }, - "machine_height": { "default_value": 200 }, - "machine_heated_bed": { "default_value": true }, - "machine_nozzle_heat_up_speed": { "default_value": 1.4 }, - "machine_nozzle_cool_down_speed": { "default_value": 0.8 }, - "machine_head_with_fans_polygon": - { - "default_value": - [ - [ -41.9, -45.8 ], - [ -41.9, 33.9 ], - [ 59.9, 33.9 ], - [ 59.9, -45.8 ] - ] - }, - "machine_gcode_flavor": { "default_value": "Griffin" }, - "machine_max_feedrate_x": { "default_value": 300 }, - "machine_max_feedrate_y": { "default_value": 300 }, - "machine_max_feedrate_z": { "default_value": 40 }, - "machine_acceleration": { "default_value": 3000 }, - "gantry_height": { "value": "60" }, - "machine_disallowed_areas": { "default_value": [ - [[92.8, -53.4], [92.8, -97.5], [116.5, -97.5], [116.5, -53.4]], - [[73.8, 107.5], [73.8, 100.5], [116.5, 100.5], [116.5, 107.5]], - [[74.6, 107.5], [74.6, 100.5], [116.5, 100.5], [116.5, 107.5]], - [[74.9, -97.5], [74.9, -107.5], [116.5, -107.5], [116.5, -97.5]], - [[-116.5, -103.5], [-116.5, -107.5], [-100.9, -107.5], [-100.9, -103.5]], - [[-116.5, 105.8], [-96.9, 105.8], [-96.9, 107.5], [-116.5, 107.5]] - ]}, - "machine_extruder_count": { "default_value": 2 }, - "extruder_prime_pos_abs": { "default_value": true }, - "machine_start_gcode": { "default_value": "" }, - "machine_end_gcode": { "default_value": "G91 ;Relative movement\nG0 F15000 X8.0 Z0.5 E-4.5 ;Wiping+material retraction\nG0 F10000 Z1.5 E4.5 ;Compensation for the retraction\nG90 ;Disable relative movement" }, - "prime_tower_position_x": { "value": "machine_depth - max(extruderValue(adhesion_extruder_nr, 'brim_width') * extruderValue(adhesion_extruder_nr, 'initial_layer_line_width_factor') / 100 if adhesion_type == 'brim' else (extruderValue(adhesion_extruder_nr, 'raft_margin') if adhesion_type == 'raft' else (extruderValue(adhesion_extruder_nr, 'skirt_gap') if adhesion_type == 'skirt' else 0)), max(extruderValues('travel_avoid_distance'))) - max(extruderValues('support_offset')) - sum(extruderValues('skirt_brim_line_width')) - 30" }, - "prime_tower_wipe_enabled": { "default_value": false }, - - "prime_blob_enable": { "enabled": true, "default_value": true, "value": "resolveOrValue('print_sequence') != 'one_at_a_time'" }, + "overrides": + { "acceleration_enabled": { "value": true }, "acceleration_prime_tower": { "value": "math.ceil(acceleration_print * 2000 / 3500)" }, "acceleration_print": { "value": "3500" }, @@ -93,22 +62,97 @@ "cool_fan_speed": { "value": "50" }, "cool_fan_speed_max": { "value": "100" }, "cool_min_speed": { "value": "5" }, + "default_material_print_temperature": { "value": "200" }, + "extruder_prime_pos_abs": { "default_value": true }, + "gantry_height": { "value": "60" }, "infill_overlap": { "value": "0" }, "infill_pattern": { "value": "'zigzag' if infill_sparse_density > 80 else 'triangles'" }, "infill_wipe_dist": { "value": "0" }, "jerk_enabled": { "value": "True" }, "layer_start_x": { "value": "sum(extruderValues('machine_extruder_start_pos_x')) / len(extruderValues('machine_extruder_start_pos_x'))" }, "layer_start_y": { "value": "sum(extruderValues('machine_extruder_start_pos_y')) / len(extruderValues('machine_extruder_start_pos_y'))" }, + "machine_acceleration": { "default_value": 3000 }, + "machine_depth": { "default_value": 215 }, + "machine_disallowed_areas": + { + "default_value": [ + [ + [92.8, -53.4], + [92.8, -97.5], + [116.5, -97.5], + [116.5, -53.4] + ], + [ + [73.8, 107.5], + [73.8, 100.5], + [116.5, 100.5], + [116.5, 107.5] + ], + [ + [74.6, 107.5], + [74.6, 100.5], + [116.5, 100.5], + [116.5, 107.5] + ], + [ + [74.9, -97.5], + [74.9, -107.5], + [116.5, -107.5], + [116.5, -97.5] + ], + [ + [-116.5, -103.5], + [-116.5, -107.5], + [-100.9, -107.5], + [-100.9, -103.5] + ], + [ + [-116.5, 105.8], + [-96.9, 105.8], + [-96.9, 107.5], + [-116.5, 107.5] + ] + ] + }, + "machine_end_gcode": { "default_value": "G91 ;Relative movement\nG0 F15000 X8.0 Z0.5 E-4.5 ;Wiping+material retraction\nG0 F10000 Z1.5 E4.5 ;Compensation for the retraction\nG90 ;Disable relative movement" }, + "machine_extruder_count": { "default_value": 2 }, + "machine_gcode_flavor": { "default_value": "Griffin" }, + "machine_head_with_fans_polygon": + { + "default_value": [ + [-41.9, -45.8], + [-41.9, 33.9], + [59.9, 33.9], + [59.9, -45.8] + ] + }, + "machine_heated_bed": { "default_value": true }, + "machine_height": { "default_value": 200 }, + "machine_max_feedrate_x": { "default_value": 300 }, + "machine_max_feedrate_y": { "default_value": 300 }, + "machine_max_feedrate_z": { "default_value": 40 }, "machine_min_cool_heat_time_window": { "value": "15" }, - "default_material_print_temperature": { "value": "200" }, + "machine_name": { "default_value": "Ultimaker 3" }, + "machine_nozzle_cool_down_speed": { "default_value": 0.8 }, + "machine_nozzle_heat_up_speed": { "default_value": 1.4 }, + "machine_start_gcode": { "default_value": "" }, + "machine_width": { "default_value": 233 }, "material_bed_temperature": { "maximum_value": "115" }, "material_bed_temperature_layer_0": { "maximum_value": "115" }, "multiple_mesh_overlap": { "value": "0" }, "optimize_wall_printing_order": { "value": "True" }, + "prime_blob_enable": + { + "default_value": true, + "enabled": true, + "value": "resolveOrValue('print_sequence') != 'one_at_a_time'" + }, "prime_tower_enable": { "default_value": true }, + "prime_tower_position_x": { "value": "machine_depth - max(extruderValue(adhesion_extruder_nr, 'brim_width') * extruderValue(adhesion_extruder_nr, 'initial_layer_line_width_factor') / 100 if adhesion_type == 'brim' else (extruderValue(adhesion_extruder_nr, 'raft_margin') if adhesion_type == 'raft' else (extruderValue(adhesion_extruder_nr, 'skirt_gap') if adhesion_type == 'skirt' else 0)), max(extruderValues('travel_avoid_distance'))) - max(extruderValues('support_offset')) - sum(extruderValues('skirt_brim_line_width')) - 30" }, + "prime_tower_wipe_enabled": { "default_value": false }, "retraction_amount": { "value": "6.5" }, "retraction_hop": { "value": "2" }, - "retraction_hop_enabled": { "value": "extruders_enabled_count > 1" }, + "retraction_hop_enabled": { "value": "extruders_enabled_count > 1" }, "retraction_hop_only_when_collides": { "value": "True" }, "retraction_min_travel": { "value": "5" }, "retraction_prime_speed": { "value": "15" }, @@ -130,4 +174,4 @@ "wall_0_inset": { "value": "0" }, "zig_zaggify_infill": { "value": "gradual_infill_steps == 0" } } -} +} \ No newline at end of file diff --git a/resources/definitions/ultimaker3_extended.def.json b/resources/definitions/ultimaker3_extended.def.json index 970d3a405d..5afbbce1da 100644 --- a/resources/definitions/ultimaker3_extended.def.json +++ b/resources/definitions/ultimaker3_extended.def.json @@ -2,42 +2,45 @@ "version": 2, "name": "Ultimaker 3 Extended", "inherits": "ultimaker3", - "metadata": { + "metadata": + { + "visible": true, "author": "Ultimaker", "manufacturer": "Ultimaker B.V.", - "quality_definition": "ultimaker3", - "visible": true, "file_formats": "application/gzip;text/x-gcode", "platform": "ultimaker3_platform.obj", - "platform_texture": "Ultimaker3Extendedbackplate.png", - "platform_offset": [0, 0, 0], + "bom_numbers": [ + 9511 + ], + "firmware_update_info": + { + "check_urls": [ "https://software.ultimaker.com/releases/firmware/9066/stable/um-update.swu.version" ], + "id": 9511, + "update_url": "https://ultimaker.com/firmware?utm_source=cura&utm_medium=software&utm_campaign=fw-update" + }, + "first_start_actions": [ "DiscoverUM3Action" ], "has_machine_quality": true, "has_materials": true, "has_variants": true, - "preferred_variant_name": "AA 0.4", - "variants_name": "Print core", "machine_extruder_trains": { "0": "ultimaker3_extended_extruder_left", "1": "ultimaker3_extended_extruder_right" }, - "first_start_actions": [ "DiscoverUM3Action" ], + "platform_offset": [ + 0, + 0, + 0 + ], + "platform_texture": "Ultimaker3Extendedbackplate.png", + "preferred_variant_name": "AA 0.4", + "quality_definition": "ultimaker3", "supported_actions": [ "DiscoverUM3Action" ], - "firmware_update_info": { - "id": 9511, - "check_urls": - [ - "https://software.ultimaker.com/releases/firmware/9066/stable/um-update.swu.version" - ], - "update_url": "https://ultimaker.com/firmware?utm_source=cura&utm_medium=software&utm_campaign=fw-update" - }, - "bom_numbers": [ - 9511 - ] + "variants_name": "Print core" }, - - "overrides": { - "machine_name": { "default_value": "Ultimaker 3 Extended" }, - "machine_height": { "default_value": 300 } + "overrides": + { + "machine_height": { "default_value": 300 }, + "machine_name": { "default_value": "Ultimaker 3 Extended" } } -} +} \ No newline at end of file diff --git a/resources/definitions/ultimaker_original.def.json b/resources/definitions/ultimaker_original.def.json index e9afb3977e..c34dd4aadf 100644 --- a/resources/definitions/ultimaker_original.def.json +++ b/resources/definitions/ultimaker_original.def.json @@ -2,75 +2,84 @@ "version": 2, "name": "Ultimaker Original", "inherits": "ultimaker", - "metadata": { + "metadata": + { "visible": true, "author": "Ultimaker", "manufacturer": "Ultimaker B.V.", - "weight": 4, "file_formats": "text/x-gcode", "platform": "ultimaker_platform.3mf", - "has_materials": true, - "has_machine_quality": true, - "exclude_materials": ["generic_hips", "generic_petg", "generic_bam", "ultimaker_bam", "generic_pva", "ultimaker_pva", "generic_tough_pla", "ultimaker_tough_pla_black", "ultimaker_tough_pla_green", "ultimaker_tough_pla_red", "ultimaker_tough_pla_white", "generic_cffcpe", "generic_cffpa", "generic_gffcpe", "generic_gffpa", "structur3d_dap100silicone", "ultimaker_petg_blue", "ultimaker_petg_grey", "ultimaker_petg_black", "ultimaker_petg_green", "ultimaker_petg_white", "ultimaker_petg_orange", "ultimaker_petg_silver", "ultimaker_petg_yellow", "ultimaker_petg_transparent", "ultimaker_petg_red_translucent", "ultimaker_petg_blue_translucent", "ultimaker_petg_green_translucent", "ultimaker_petg_yellow_fluorescent", "ultimaker_petg_red" ], - "first_start_actions": ["UMOUpgradeSelection", "BedLevel"], - "supported_actions": ["UMOUpgradeSelection", "BedLevel"], - "machine_extruder_trains": - { - "0": "ultimaker_original_extruder_0" - }, + "exclude_materials": [ + "generic_hips", + "generic_petg", + "generic_bam", + "ultimaker_bam", + "generic_pva", + "ultimaker_pva", + "generic_tough_pla", + "ultimaker_tough_pla_black", + "ultimaker_tough_pla_green", + "ultimaker_tough_pla_red", + "ultimaker_tough_pla_white", + "generic_cffcpe", + "generic_cffpa", + "generic_gffcpe", + "generic_gffpa", + "structur3d_dap100silicone", + "ultimaker_petg_blue", + "ultimaker_petg_grey", + "ultimaker_petg_black", + "ultimaker_petg_green", + "ultimaker_petg_white", + "ultimaker_petg_orange", + "ultimaker_petg_silver", + "ultimaker_petg_yellow", + "ultimaker_petg_transparent", + "ultimaker_petg_red_translucent", + "ultimaker_petg_blue_translucent", + "ultimaker_petg_green_translucent", + "ultimaker_petg_yellow_fluorescent", + "ultimaker_petg_red" + ], "firmware_file": "MarlinUltimaker-{baudrate}.hex", - "firmware_hbk_file": "MarlinUltimaker-HBK-{baudrate}.hex" + "firmware_hbk_file": "MarlinUltimaker-HBK-{baudrate}.hex", + "first_start_actions": [ + "UMOUpgradeSelection", + "BedLevel" + ], + "has_machine_quality": true, + "has_materials": true, + "machine_extruder_trains": { "0": "ultimaker_original_extruder_0" }, + "supported_actions": [ + "UMOUpgradeSelection", + "BedLevel" + ], + "weight": 4 }, - - "overrides": { - "machine_name": { "default_value": "Ultimaker Original" }, - "machine_width": { - "default_value": 205 - }, - "machine_height": { - "default_value": 200 - }, - "machine_depth": { - "default_value": 205 - }, - "machine_center_is_zero": { - "default_value": false - }, + "overrides": + { + "cool_fan_speed_0": { "value": 0 }, + "gantry_height": { "value": "55" }, + "infill_before_walls": { "value": "False" }, + "layer_height_0": { "value": 0.3 }, + "machine_center_is_zero": { "default_value": false }, + "machine_depth": { "default_value": 205 }, + "machine_end_gcode": { "value": "'M104 S0 ;extruder heater off' + ('\\nM140 S0 ;heated bed heater off' if machine_heated_bed else '') + '\\nG91 ;relative positioning\\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\\nG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\\nM84 ;steppers off\\nG90 ;absolute positioning'" }, + "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, "machine_head_with_fans_polygon": { "default_value": [ - [ -75, 35 ], - [ -75, -18 ], - [ 18, 35 ], - [ 18, -18 ] + [-75, 35], + [-75, -18], + [18, 35], + [18, -18] ] }, - "gantry_height": { - "value": "55" - }, - "machine_use_extruder_offset_to_offset_coords": { - "default_value": true - }, - "machine_gcode_flavor": { - "default_value": "RepRap (Marlin/Sprinter)" - }, - "machine_start_gcode": { - "default_value": "G21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nG1 Z15.0 F9000 ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E6 ;extrude 6 mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 Y50 F9000\n;Put printing message on LCD screen\nM117 Printing..." - }, - "machine_end_gcode": { - "value": "'M104 S0 ;extruder heater off' + ('\\nM140 S0 ;heated bed heater off' if machine_heated_bed else '') + '\\nG91 ;relative positioning\\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\\nG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\\nM84 ;steppers off\\nG90 ;absolute positioning'" - }, - "infill_before_walls": { - "value": "False" - }, - "cool_fan_speed_0": { - "value": 0 - }, - "layer_height_0": { - "value": 0.3 - }, - "speed_slowdown_layers": { - "value": 2 - } + "machine_height": { "default_value": 200 }, + "machine_name": { "default_value": "Ultimaker Original" }, + "machine_start_gcode": { "default_value": "G21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nG1 Z15.0 F9000 ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E6 ;extrude 6 mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 Y50 F9000\n;Put printing message on LCD screen\nM117 Printing..." }, + "machine_use_extruder_offset_to_offset_coords": { "default_value": true }, + "machine_width": { "default_value": 205 }, + "speed_slowdown_layers": { "value": 2 } } -} +} \ No newline at end of file diff --git a/resources/definitions/ultimaker_original_dual.def.json b/resources/definitions/ultimaker_original_dual.def.json index bda8a0ce12..59bc4fb8bb 100644 --- a/resources/definitions/ultimaker_original_dual.def.json +++ b/resources/definitions/ultimaker_original_dual.def.json @@ -2,74 +2,88 @@ "version": 2, "name": "Ultimaker Original Dual Extrusion", "inherits": "ultimaker", - "metadata": { + "metadata": + { "visible": true, "author": "Ultimaker", "manufacturer": "Ultimaker B.V.", - "weight": 4, "file_formats": "text/x-gcode", "platform": "ultimaker_platform.3mf", - "has_materials": true, + "exclude_materials": [ + "generic_hips", + "generic_petg", + "generic_bam", + "ultimaker_bam", + "generic_pva", + "ultimaker_pva", + "generic_tough_pla", + "ultimaker_tough_pla_black", + "ultimaker_tough_pla_green", + "ultimaker_tough_pla_red", + "ultimaker_tough_pla_white", + "generic_cffcpe", + "generic_cffpa", + "generic_gffcpe", + "generic_gffpa", + "structur3d_dap100silicone", + "ultimaker_petg_blue", + "ultimaker_petg_grey", + "ultimaker_petg_black", + "ultimaker_petg_green", + "ultimaker_petg_white", + "ultimaker_petg_orange", + "ultimaker_petg_silver", + "ultimaker_petg_yellow", + "ultimaker_petg_transparent", + "ultimaker_petg_red_translucent", + "ultimaker_petg_blue_translucent", + "ultimaker_petg_green_translucent", + "ultimaker_petg_yellow_fluorescent", + "ultimaker_petg_red" + ], + "firmware_file": "MarlinUltimaker-{baudrate}-dual.hex", + "firmware_hbk_file": "MarlinUltimaker-HBK-{baudrate}-dual.hex", + "first_start_actions": [ + "UMOUpgradeSelection", + "BedLevel" + ], "has_machine_quality": true, - "quality_definition": "ultimaker_original", - "exclude_materials": ["generic_hips", "generic_petg", "generic_bam", "ultimaker_bam", "generic_pva", "ultimaker_pva", "generic_tough_pla", "ultimaker_tough_pla_black", "ultimaker_tough_pla_green", "ultimaker_tough_pla_red", "ultimaker_tough_pla_white", "generic_cffcpe", "generic_cffpa", "generic_gffcpe", "generic_gffpa", "structur3d_dap100silicone", "ultimaker_petg_blue", "ultimaker_petg_grey", "ultimaker_petg_black", "ultimaker_petg_green", "ultimaker_petg_white", "ultimaker_petg_orange", "ultimaker_petg_silver", "ultimaker_petg_yellow", "ultimaker_petg_transparent", "ultimaker_petg_red_translucent", "ultimaker_petg_blue_translucent", "ultimaker_petg_green_translucent", "ultimaker_petg_yellow_fluorescent", "ultimaker_petg_red" ], + "has_materials": true, "machine_extruder_trains": { "0": "ultimaker_original_dual_1st", "1": "ultimaker_original_dual_2nd" }, - "firmware_file": "MarlinUltimaker-{baudrate}-dual.hex", - "firmware_hbk_file": "MarlinUltimaker-HBK-{baudrate}-dual.hex", - "first_start_actions": ["UMOUpgradeSelection", "BedLevel"], - "supported_actions": ["UMOUpgradeSelection", "BedLevel"] + "quality_definition": "ultimaker_original", + "supported_actions": [ + "UMOUpgradeSelection", + "BedLevel" + ], + "weight": 4 }, - - "overrides": { - "machine_name": { "default_value": "Ultimaker Original" }, - "machine_width": { - "default_value": 205 - }, - "machine_height": { - "default_value": 200 - }, - "machine_depth": { - "default_value": 195 - }, - "machine_center_is_zero": { - "default_value": false - }, + "overrides": + { + "gantry_height": { "value": "55" }, + "machine_center_is_zero": { "default_value": false }, + "machine_depth": { "default_value": 195 }, + "machine_end_gcode": { "default_value": "M104 T0 S0 ;1st extruder heater off\nM104 T1 S0 ;2nd extruder heater off\nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nM84 ;steppers off\nG90 ;absolute positioning" }, + "machine_extruder_count": { "default_value": 2 }, + "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, "machine_head_with_fans_polygon": { "default_value": [ - [ -75, 35 ], - [ -75, -18 ], - [ 18, 35 ], - [ 18, -18 ] + [-75, 35], + [-75, -18], + [18, 35], + [18, -18] ] }, - "gantry_height": { - "value": "55" - }, - "machine_use_extruder_offset_to_offset_coords": { - "default_value": true - }, - "machine_gcode_flavor": { - "default_value": "RepRap (Marlin/Sprinter)" - }, - "machine_start_gcode": { - "default_value": "G21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nG1 Z15.0 F9000 ;move the platform down 15mm\nT1 ;Switch to the 2nd extruder\nG92 E0 ;zero the extruded length\nG1 F200 E6 ;extrude 6 mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F200 E-{switch_extruder_retraction_amount}\nT0 ;Switch to the 1st extruder\nG92 E0 ;zero the extruded length\nG1 F200 E6 ;extrude 6 mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F9000\n;Put printing message on LCD screen\nM117 Printing..." - }, - "machine_end_gcode": { - "default_value": "M104 T0 S0 ;1st extruder heater off\nM104 T1 S0 ;2nd extruder heater off\nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nM84 ;steppers off\nG90 ;absolute positioning" - }, - "machine_extruder_count": { - "default_value": 2 - }, - "prime_tower_position_x": { - "value": "195" - }, - "prime_tower_position_y": { - "value": "149" - } + "machine_height": { "default_value": 200 }, + "machine_name": { "default_value": "Ultimaker Original" }, + "machine_start_gcode": { "default_value": "G21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nG1 Z15.0 F9000 ;move the platform down 15mm\nT1 ;Switch to the 2nd extruder\nG92 E0 ;zero the extruded length\nG1 F200 E6 ;extrude 6 mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F200 E-{switch_extruder_retraction_amount}\nT0 ;Switch to the 1st extruder\nG92 E0 ;zero the extruded length\nG1 F200 E6 ;extrude 6 mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F9000\n;Put printing message on LCD screen\nM117 Printing..." }, + "machine_use_extruder_offset_to_offset_coords": { "default_value": true }, + "machine_width": { "default_value": 205 }, + "prime_tower_position_x": { "value": "195" }, + "prime_tower_position_y": { "value": "149" } } -} +} \ No newline at end of file diff --git a/resources/definitions/ultimaker_original_plus.def.json b/resources/definitions/ultimaker_original_plus.def.json index 949e2e8d0d..26924a8ba6 100644 --- a/resources/definitions/ultimaker_original_plus.def.json +++ b/resources/definitions/ultimaker_original_plus.def.json @@ -2,31 +2,25 @@ "version": 2, "name": "Ultimaker Original+", "inherits": "ultimaker_original", - "metadata": { + "metadata": + { "author": "Ultimaker", "manufacturer": "Ultimaker B.V.", - "weight": 4, "file_formats": "text/x-gcode", "platform": "ultimaker2_platform.obj", + "firmware_file": "MarlinUltimaker-UMOP-{baudrate}.hex", + "firmware_hbk_file": "MarlinUltimaker-UMOP-{baudrate}.hex", + "first_start_actions": [ "BedLevel" ], + "machine_extruder_trains": { "0": "ultimaker_original_plus_extruder_0" }, "platform_texture": "UltimakerPlusbackplate.png", "quality_definition": "ultimaker_original", - "first_start_actions": ["BedLevel"], - "supported_actions": ["BedLevel"], - "machine_extruder_trains": - { - "0": "ultimaker_original_plus_extruder_0" - }, - "firmware_file": "MarlinUltimaker-UMOP-{baudrate}.hex", - "firmware_hbk_file": "MarlinUltimaker-UMOP-{baudrate}.hex" + "supported_actions": [ "BedLevel" ], + "weight": 4 }, - - "overrides": { - "machine_name": { "default_value": "Ultimaker Original+" }, - "machine_heated_bed": { - "default_value": true - }, - "machine_max_feedrate_z": { - "default_value": 30 - } + "overrides": + { + "machine_heated_bed": { "default_value": true }, + "machine_max_feedrate_z": { "default_value": 30 }, + "machine_name": { "default_value": "Ultimaker Original+" } } -} +} \ No newline at end of file diff --git a/resources/definitions/ultimaker_s3.def.json b/resources/definitions/ultimaker_s3.def.json index ce94981307..ecd9e8e09c 100644 --- a/resources/definitions/ultimaker_s3.def.json +++ b/resources/definitions/ultimaker_s3.def.json @@ -2,78 +2,53 @@ "version": 2, "name": "Ultimaker S3", "inherits": "ultimaker", - "metadata": { + "metadata": + { + "visible": true, "author": "Ultimaker", "manufacturer": "Ultimaker B.V.", - "visible": true, "file_formats": "application/x-ufp;text/x-gcode", "platform": "ultimaker_s3_platform.obj", - "platform_texture": "UltimakerS3backplate.png", - "platform_offset": [0, 0, 0], + "bom_numbers": [213482, 213483], + "exclude_materials": [ + "generic_hips", + "generic_petg", + "structur3d_dap100silicone" + ], + "firmware_update_info": + { + "check_urls": [ "https://software.ultimaker.com/releases/firmware/213482/stable/um-update.swu.version" ], + "id": 213482, + "update_url": "https://ultimaker.com/firmware?utm_source=cura&utm_medium=software&utm_campaign=fw-update" + }, + "first_start_actions": [ "DiscoverUM3Action" ], "has_machine_quality": true, "has_materials": true, "has_variant_buildplates": false, "has_variants": true, - "exclude_materials": [ "generic_hips", "generic_petg", "structur3d_dap100silicone" ], - "preferred_variant_name": "AA 0.4", - "preferred_quality_type": "normal", - "variants_name": "Print core", - "nozzle_offsetting_for_disallowed_areas": false, "machine_extruder_trains": { "0": "ultimaker_s3_extruder_left", "1": "ultimaker_s3_extruder_right" }, - "first_start_actions": [ "DiscoverUM3Action" ], + "nozzle_offsetting_for_disallowed_areas": false, + "platform_offset": [ + 0, + 0, + 0 + ], + "platform_texture": "UltimakerS3backplate.png", + "preferred_quality_type": "normal", + "preferred_variant_name": "AA 0.4", "supported_actions": [ "DiscoverUM3Action" ], - "supports_usb_connection": false, "supports_material_export": true, - "weight": -1, - "firmware_update_info": { - "id": 213482, - "check_urls": ["https://software.ultimaker.com/releases/firmware/213482/stable/um-update.swu.version"], - "update_url": "https://ultimaker.com/firmware?utm_source=cura&utm_medium=software&utm_campaign=fw-update" - }, - "bom_numbers": [ - 213482, 213483 - ] + "supports_usb_connection": false, + "variants_name": "Print core", + "weight": -1 }, - - "overrides": { - "machine_name": { "default_value": "Ultimaker S3" }, - "machine_width": { "default_value": 230 }, - "machine_depth": { "default_value": 190 }, - "machine_height": { "default_value": 200 }, - "machine_heated_bed": { "default_value": true }, - "machine_nozzle_heat_up_speed": { "default_value": 1.4 }, - "machine_nozzle_cool_down_speed": { "default_value": 0.8 }, - "machine_head_with_fans_polygon": - { - "default_value": - [ - [ -41.4, -45.8 ], - [ -41.4, 36.0 ], - [ 63.3, 36.0 ], - [ 63.3, -45.8 ] - ] - }, - "machine_gcode_flavor": { "default_value": "Griffin" }, - "machine_max_feedrate_x": { "default_value": 300 }, - "machine_max_feedrate_y": { "default_value": 300 }, - "machine_max_feedrate_z": { "default_value": 40 }, - "machine_acceleration": { "default_value": 3000 }, - "gantry_height": { "value": "55" }, - "machine_extruder_count": { "default_value": 2 }, - "extruder_prime_pos_abs": { "default_value": true }, - "machine_start_gcode": { "default_value": "" }, - "machine_end_gcode": { "default_value": "" }, - "prime_blob_enable": { "enabled": true, "default_value": false }, + "overrides": + { "acceleration_enabled": { "value": true }, - "speed_travel": - { - "maximum_value": "150", - "value": "150" - }, "acceleration_prime_tower": { "value": "math.ceil(acceleration_print * 2000 / 3500)" }, "acceleration_print": { "value": "3500" }, "acceleration_support": { "value": "math.ceil(acceleration_print * 2000 / 3500)" }, @@ -85,30 +60,66 @@ "cool_fan_speed": { "value": "50" }, "cool_fan_speed_max": { "value": "100" }, "cool_min_speed": { "value": "5" }, + "default_material_print_temperature": { "value": "200" }, + "extruder_prime_pos_abs": { "default_value": true }, + "gantry_height": { "value": "55" }, "infill_overlap": { "value": "0" }, "infill_pattern": { "value": "'zigzag' if infill_sparse_density > 80 else 'triangles'" }, "infill_wipe_dist": { "value": "0" }, "jerk_enabled": { "value": "True" }, "layer_start_x": { "value": "sum(extruderValues('machine_extruder_start_pos_x')) / len(extruderValues('machine_extruder_start_pos_x'))" }, "layer_start_y": { "value": "sum(extruderValues('machine_extruder_start_pos_y')) / len(extruderValues('machine_extruder_start_pos_y'))" }, + "machine_acceleration": { "default_value": 3000 }, + "machine_depth": { "default_value": 190 }, + "machine_end_gcode": { "default_value": "" }, + "machine_extruder_count": { "default_value": 2 }, + "machine_gcode_flavor": { "default_value": "Griffin" }, + "machine_head_with_fans_polygon": + { + "default_value": [ + [-41.4, -45.8], + [-41.4, 36.0], + [63.3, 36.0], + [63.3, -45.8] + ] + }, + "machine_heated_bed": { "default_value": true }, + "machine_height": { "default_value": 200 }, + "machine_max_feedrate_x": { "default_value": 300 }, + "machine_max_feedrate_y": { "default_value": 300 }, + "machine_max_feedrate_z": { "default_value": 40 }, "machine_min_cool_heat_time_window": { "value": "15" }, - "default_material_print_temperature": { "value": "200" }, + "machine_name": { "default_value": "Ultimaker S3" }, + "machine_nozzle_cool_down_speed": { "default_value": 0.8 }, + "machine_nozzle_heat_up_speed": { "default_value": 1.4 }, + "machine_start_gcode": { "default_value": "" }, + "machine_width": { "default_value": 230 }, "multiple_mesh_overlap": { "value": "0" }, "optimize_wall_printing_order": { "value": "True" }, + "prime_blob_enable": + { + "default_value": false, + "enabled": true + }, "prime_tower_enable": { "value": "True" }, "retraction_amount": { "value": "6.5" }, "retraction_hop": { "value": "2" }, - "retraction_hop_enabled": { "value": "extruders_enabled_count > 1" }, + "retraction_hop_enabled": { "value": "extruders_enabled_count > 1" }, "retraction_hop_only_when_collides": { "value": "True" }, "retraction_min_travel": { "value": "5" }, "retraction_prime_speed": { "value": "15" }, - "retraction_speed": {"value": "45" }, + "retraction_speed": { "value": "45" }, "skin_overlap": { "value": "10" }, "speed_prime_tower": { "value": "speed_topbottom" }, "speed_print": { "value": "35" }, "speed_support": { "value": "speed_wall_0" }, "speed_support_interface": { "value": "speed_topbottom" }, "speed_topbottom": { "value": "math.ceil(speed_print * 20 / 35)" }, + "speed_travel": + { + "maximum_value": "150", + "value": "150" + }, "speed_wall": { "value": "math.ceil(speed_print * 30 / 35)" }, "speed_wall_0": { "value": "math.ceil(speed_wall * 20 / 30)" }, "speed_wall_x": { "value": "speed_wall" }, @@ -120,4 +131,4 @@ "wall_0_inset": { "value": "0" }, "zig_zaggify_infill": { "value": "gradual_infill_steps == 0" } } -} +} \ No newline at end of file diff --git a/resources/definitions/ultimaker_s5.def.json b/resources/definitions/ultimaker_s5.def.json index a77148c2c4..7f54455742 100644 --- a/resources/definitions/ultimaker_s5.def.json +++ b/resources/definitions/ultimaker_s5.def.json @@ -2,80 +2,53 @@ "version": 2, "name": "Ultimaker S5", "inherits": "ultimaker", - "metadata": { + "metadata": + { + "visible": true, "author": "Ultimaker", "manufacturer": "Ultimaker B.V.", - "visible": true, "file_formats": "application/x-ufp;text/x-gcode", "platform": "ultimaker_s5_platform.obj", - "platform_texture": "UltimakerS5backplate.png", - "platform_offset": [0, -30, -10], + "bom_numbers": [ + 9051, + 214475, + 214476 + ], + "firmware_update_info": + { + "check_urls": [ "https://software.ultimaker.com/releases/firmware/9051/stable/um-update.swu.version" ], + "id": 9051, + "update_url": "https://ultimaker.com/firmware?utm_source=cura&utm_medium=software&utm_campaign=fw-update" + }, + "first_start_actions": [ "DiscoverUM3Action" ], "has_machine_quality": true, "has_materials": true, "has_variant_buildplates": true, "has_variants": true, - "preferred_variant_name": "AA 0.4", - "preferred_variant_buildplate_name": "Glass", - "preferred_quality_type": "normal", - "variants_name": "Print core", - "nozzle_offsetting_for_disallowed_areas": false, "machine_extruder_trains": { "0": "ultimaker_s5_extruder_left", "1": "ultimaker_s5_extruder_right" }, - "first_start_actions": [ "DiscoverUM3Action" ], + "nozzle_offsetting_for_disallowed_areas": false, + "platform_offset": [ + 0, + -30, + -10 + ], + "platform_texture": "UltimakerS5backplate.png", + "preferred_quality_type": "normal", + "preferred_variant_buildplate_name": "Glass", + "preferred_variant_name": "AA 0.4", "supported_actions": [ "DiscoverUM3Action" ], - "supports_usb_connection": false, - "supports_network_connection": true, "supports_material_export": true, - "weight": -2, - "firmware_update_info": { - "id": 9051, - "check_urls": ["https://software.ultimaker.com/releases/firmware/9051/stable/um-update.swu.version"], - "update_url": "https://ultimaker.com/firmware?utm_source=cura&utm_medium=software&utm_campaign=fw-update" - }, - "bom_numbers": [ - 9051, 214475, 214476 - ] + "supports_network_connection": true, + "supports_usb_connection": false, + "variants_name": "Print core", + "weight": -2 }, - - "overrides": { - "machine_name": { "default_value": "Ultimaker S5" }, - "machine_width": { "default_value": 330 }, - "machine_depth": { "default_value": 240 }, - "machine_height": { "default_value": 300 }, - "machine_heated_bed": { "default_value": true }, - "machine_heated_build_volume": { "default_value": true }, - "machine_nozzle_heat_up_speed": { "default_value": 1.4 }, - "machine_nozzle_cool_down_speed": { "default_value": 0.8 }, - "machine_head_with_fans_polygon": - { - "default_value": - [ - [ -41.4, -45.8 ], - [ -41.4, 36.0 ], - [ 63.3, 36.0 ], - [ 63.3, -45.8 ] - ] - }, - "machine_gcode_flavor": { "default_value": "Griffin" }, - "machine_max_feedrate_x": { "default_value": 300 }, - "machine_max_feedrate_y": { "default_value": 300 }, - "machine_max_feedrate_z": { "default_value": 40 }, - "machine_acceleration": { "default_value": 3000 }, - "gantry_height": { "value": "55" }, - "machine_extruder_count": { "default_value": 2 }, - "extruder_prime_pos_abs": { "default_value": true }, - "machine_start_gcode": { "default_value": "" }, - "machine_end_gcode": { "default_value": "" }, - "prime_blob_enable": { "enabled": true, "default_value": false }, - - "speed_travel": - { - "maximum_value": "150", - "value": "150" - }, + "overrides": + { "acceleration_enabled": { "value": true }, "acceleration_prime_tower": { "value": "math.ceil(acceleration_print * 2000 / 3500)" }, "acceleration_print": { "value": "3500" }, @@ -85,33 +58,72 @@ "acceleration_wall": { "value": "math.ceil(acceleration_print * 1500 / 3500)" }, "acceleration_wall_0": { "value": "math.ceil(acceleration_wall * 1000 / 1000)" }, "brim_width": { "value": "3" }, + "build_volume_temperature": { "maximum_value": 50 }, "cool_fan_speed": { "value": "50" }, "cool_fan_speed_max": { "value": "100" }, "cool_min_speed": { "value": "5" }, + "default_material_print_temperature": { "value": "200" }, + "extruder_prime_pos_abs": { "default_value": true }, + "gantry_height": { "value": "55" }, "infill_overlap": { "value": "0" }, "infill_pattern": { "value": "'zigzag' if infill_sparse_density > 80 else 'triangles'" }, "infill_wipe_dist": { "value": "0" }, "jerk_enabled": { "value": "True" }, "layer_start_x": { "value": "sum(extruderValues('machine_extruder_start_pos_x')) / len(extruderValues('machine_extruder_start_pos_x'))" }, "layer_start_y": { "value": "sum(extruderValues('machine_extruder_start_pos_y')) / len(extruderValues('machine_extruder_start_pos_y'))" }, + "machine_acceleration": { "default_value": 3000 }, + "machine_depth": { "default_value": 240 }, + "machine_end_gcode": { "default_value": "" }, + "machine_extruder_count": { "default_value": 2 }, + "machine_gcode_flavor": { "default_value": "Griffin" }, + "machine_head_with_fans_polygon": + { + "default_value": [ + [-41.4, -45.8], + [-41.4, 36.0], + [63.3, 36.0], + [63.3, -45.8] + ] + }, + "machine_heated_bed": { "default_value": true }, + "machine_heated_build_volume": { "default_value": true }, + "machine_height": { "default_value": 300 }, + "machine_max_feedrate_x": { "default_value": 300 }, + "machine_max_feedrate_y": { "default_value": 300 }, + "machine_max_feedrate_z": { "default_value": 40 }, "machine_min_cool_heat_time_window": { "value": "15" }, - "default_material_print_temperature": { "value": "200" }, + "machine_name": { "default_value": "Ultimaker S5" }, + "machine_nozzle_cool_down_speed": { "default_value": 0.8 }, + "machine_nozzle_heat_up_speed": { "default_value": 1.4 }, + "machine_start_gcode": { "default_value": "" }, + "machine_width": { "default_value": 330 }, "multiple_mesh_overlap": { "value": "0" }, + "optimize_wall_printing_order": { "value": "True" }, + "prime_blob_enable": + { + "default_value": false, + "enabled": true + }, "prime_tower_enable": { "value": "True" }, "retraction_amount": { "value": "6.5" }, - "retraction_combing": { "value": "'no_outer_surfaces'"}, + "retraction_combing": { "value": "'no_outer_surfaces'" }, "retraction_hop": { "value": "2" }, - "retraction_hop_enabled": { "value": "extruders_enabled_count > 1" }, + "retraction_hop_enabled": { "value": "extruders_enabled_count > 1" }, "retraction_hop_only_when_collides": { "value": "True" }, "retraction_min_travel": { "value": "5" }, "retraction_prime_speed": { "value": "15" }, - "retraction_speed": {"value": "45" }, + "retraction_speed": { "value": "45" }, "skin_overlap": { "value": "10" }, "speed_prime_tower": { "value": "speed_topbottom" }, "speed_print": { "value": "35" }, "speed_support": { "value": "speed_wall_0" }, "speed_support_interface": { "value": "speed_topbottom" }, "speed_topbottom": { "value": "math.ceil(speed_print * 20 / 35)" }, + "speed_travel": + { + "maximum_value": "150", + "value": "150" + }, "speed_wall": { "value": "math.ceil(speed_print * 30 / 35)" }, "speed_wall_0": { "value": "math.ceil(speed_wall * 20 / 30)" }, "speed_wall_x": { "value": "speed_wall" }, @@ -121,8 +133,6 @@ "top_bottom_thickness": { "value": "1" }, "travel_avoid_distance": { "value": "3 if extruders_enabled_count > 1 else machine_nozzle_tip_outer_diameter / 2 * 1.5" }, "wall_0_inset": { "value": "0" }, - "optimize_wall_printing_order": { "value": "True" }, - "zig_zaggify_infill": { "value": "gradual_infill_steps == 0" }, - "build_volume_temperature": { "maximum_value": 50 } + "zig_zaggify_infill": { "value": "gradual_infill_steps == 0" } } -} +} \ No newline at end of file diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index e5216a3404..99d46ed327 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Ultimaker B.V. +// Copyright (c) 2022 UltiMaker // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.15 @@ -6,8 +6,8 @@ import QtQuick.Controls 2.2 import QtQuick.Window 2.1 import QtQuick.Layouts 1.1 -import UM 1.5 as UM -import Cura 1.1 as Cura +import UM 1.7 as UM +import Cura 1.7 as Cura /* @@ -28,8 +28,11 @@ UM.Dialog // however with the current implementation of the dialog this is not possible, so instead we calculate // the size of the dialog ourselves. // Ugly workaround for windows having overlapping elements due to incorrect dialog width - minimumWidth: content.width + (Qt.platform.os == "windows" ? 4 * margin : 2 * margin) - minimumHeight: content.height + footer.height + (Qt.platform.os == "windows" ? 5 * margin : 3 * margin) + minimumWidth: content.width + (Qt.platform.os === "windows" ? 4 * margin : 2 * margin) + minimumHeight: { + const footerHeight = Math.max(okButton.height, cancelButton.height); + return content.height + footerHeight + (Qt.platform.os === "windows" ? 5 * margin : 3 * margin); + } property alias color: colorInput.text property var swatchColors: [ @@ -119,7 +122,7 @@ UM.Dialog text = `#${text}`; } } - validator: RegularExpressionValidator { regularExpression: /^#([a-fA-F0-9]{0,6})$/ } + validator: UM.HexColorValidator {} } Rectangle @@ -136,10 +139,12 @@ UM.Dialog rightButtons: [ Cura.TertiaryButton { + id: cancelButton text: catalog.i18nc("@action:button", "Cancel") onClicked: base.close() }, Cura.PrimaryButton { + id: okButton text: catalog.i18nc("@action:button", "OK") onClicked: base.accept() } diff --git a/resources/qml/ExtruderButton.qml b/resources/qml/ExtruderButton.qml index 204e9a5469..9a760bafc9 100644 --- a/resources/qml/ExtruderButton.qml +++ b/resources/qml/ExtruderButton.qml @@ -12,17 +12,14 @@ UM.ToolbarButton id: base property var extruder - - text: catalog.i18ncp("@label %1 is filled in with the name of an extruder", "Print Selected Model with %1", "Print Selected Models with %1", UM.Selection.selectionCount).arg(extruder.name) - - checked: Cura.ExtruderManager.selectedObjectExtruders.indexOf(extruder.id) != -1 - enabled: UM.Selection.hasSelection && extruder.stack.isEnabled + property var extruderNumberFont: UM.Theme.getFont("small_emphasis") toolItem: ExtruderIcon { materialColor: extruder.color extruderEnabled: extruder.stack.isEnabled iconVariant: "default" + font: extruderNumberFont property int index: extruder.index } diff --git a/resources/qml/ExtruderIcon.qml b/resources/qml/ExtruderIcon.qml index 718f1bcd87..c59521cdc3 100644 --- a/resources/qml/ExtruderIcon.qml +++ b/resources/qml/ExtruderIcon.qml @@ -14,6 +14,7 @@ Item property bool extruderEnabled: true property var iconSize: UM.Theme.getSize("extruder_icon").width property string iconVariant: "medium" + property alias font: extruderNumberText.font implicitWidth: iconSize implicitHeight: iconSize diff --git a/resources/qml/MachineSettings/ComboBoxWithOptions.qml b/resources/qml/MachineSettings/ComboBoxWithOptions.qml index 4ff7cf7092..7ba7c0f701 100644 --- a/resources/qml/MachineSettings/ComboBoxWithOptions.qml +++ b/resources/qml/MachineSettings/ComboBoxWithOptions.qml @@ -68,18 +68,27 @@ UM.TooltipArea function updateModel() { clear() - // Options come in as a string-representation of an OrderedDict - if(propertyProvider.properties.options) + + if(!propertyProvider.properties.options) { - var options = propertyProvider.properties.options.match(/^OrderedDict\(\[\((.*)\)\]\)$/); - if(options) + return + } + + if (typeof propertyProvider.properties["options"] === "string") + { + return + } + + + for (var i = 0; i < propertyProvider.properties["options"].keys().length; i++) + { + var key = propertyProvider.properties["options"].keys()[i] + var value = propertyProvider.properties["options"][key] + append({ text: value, code: key }) + + if (propertyProvider.properties.value === key) { - options = options[1].split("), ("); - for(var i = 0; i < options.length; i++) - { - var option = options[i].substring(1, options[i].length - 1).split("', '"); - append({ text: option[1], value: option[0] }); - } + comboBox.currentIndex = i } } } @@ -123,7 +132,7 @@ UM.TooltipArea onActivated: { var newValue = model.get(index).value - if (propertyProvider.properties.value != newValue) + if (propertyProvider.properties.value !== newValue && newValue !== undefined) { if (setValueFunction !== null) { diff --git a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml index 2484adb912..64beeb9834 100644 --- a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml +++ b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml @@ -59,7 +59,7 @@ UM.TooltipArea UM.SettingPropertyProvider { id: propertyProvider - watchedProperties: [ "value", "description" ] + watchedProperties: [ "value", "description", "validationState" ] } UM.Label diff --git a/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml b/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml index e53aa693e1..9d3da51356 100644 --- a/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml +++ b/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml @@ -67,6 +67,11 @@ Item top: parent.top } visible: currentModeIndex == PrintSetupSelectorContents.Mode.Recommended + + function onModeChanged() + { + currentModeIndex = PrintSetupSelectorContents.Mode.Custom; + } } CustomPrintSetup @@ -116,13 +121,21 @@ Item width: parent.width height: UM.Theme.getSize("default_lining").height color: UM.Theme.getColor("lining") + visible: currentModeIndex == PrintSetupSelectorContents.Mode.Custom } Item { id: buttonRow property real padding: UM.Theme.getSize("default_margin").width - height: recommendedButton.height + 2 * padding + (draggableArea.visible ? draggableArea.height : 0) + height: + { + if (currentModeIndex == PrintSetupSelectorContents.Mode.Custom) + { + return recommendedButton.height + 2 * padding + (draggableArea.visible ? draggableArea.height : 0) + } + return 0 + } anchors { @@ -145,25 +158,6 @@ Item onClicked: currentModeIndex = PrintSetupSelectorContents.Mode.Recommended } - Cura.SecondaryButton - { - id: customSettingsButton - anchors.top: parent.top - anchors.right: parent.right - anchors.margins: UM.Theme.getSize("default_margin").width - leftPadding: UM.Theme.getSize("default_margin").width - rightPadding: UM.Theme.getSize("default_margin").width - text: catalog.i18nc("@button", "Custom") - iconSource: UM.Theme.getIcon("ChevronSingleRight") - isIconOnRightSide: true - visible: currentModeIndex == PrintSetupSelectorContents.Mode.Recommended - onClicked: - { - currentModeIndex = PrintSetupSelectorContents.Mode.Custom - updateDragPosition(); - } - } - //Invisible area at the bottom with which you can resize the panel. MouseArea { diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedAdhesionSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedAdhesionSelector.qml index 8d31d6292d..2183ef7d5e 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedAdhesionSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedAdhesionSelector.qml @@ -1,89 +1,37 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2022 UltiMaker // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 +import QtQuick.Layouts 1.3 import UM 1.5 as UM -import Cura 1.0 as Cura +import Cura 1.7 as Cura -// -// Adhesion -// -Item +RecommendedSettingSection { id: enableAdhesionRow - height: enableAdhesionContainer.height - property real labelColumnWidth: Math.round(width / 3) + title: catalog.i18nc("@label", "Adhesion") + icon: UM.Theme.getIcon("Adhesion") + enableSectionSwitchVisible: platformAdhesionType.properties.enabled === "True" + enableSectionSwitchChecked: platformAdhesionType.properties.value !== "skirt" && platformAdhesionType.properties.value !== "none" + enableSectionSwitchEnabled: recommendedPrintSetup.settingsEnabled + tooltipText: catalog.i18nc("@label", "Enable printing a brim or raft. This will add a flat area around or under your object which is easy to cut off afterwards.") + property var curaRecommendedMode: Cura.RecommendedMode {} - Cura.IconWithText + property UM.SettingPropertyProvider platformAdhesionType: UM.SettingPropertyProvider { - id: enableAdhesionRowTitle - anchors.top: parent.top - anchors.left: parent.left - source: UM.Theme.getIcon("Adhesion") - text: catalog.i18nc("@label", "Adhesion") - font: UM.Theme.getFont("medium") - width: labelColumnWidth - iconSize: UM.Theme.getSize("medium_button_icon").width - } - - Item - { - id: enableAdhesionContainer - height: enableAdhesionCheckBox.height - - anchors - { - left: enableAdhesionRowTitle.right - right: parent.right - verticalCenter: enableAdhesionRowTitle.verticalCenter - } - - UM.CheckBox - { - id: enableAdhesionCheckBox - anchors.verticalCenter: parent.verticalCenter - - //: Setting enable printing build-plate adhesion helper checkbox - enabled: recommendedPrintSetup.settingsEnabled - - visible: platformAdhesionType.properties.enabled == "True" - checked: platformAdhesionType.properties.value != "skirt" && platformAdhesionType.properties.value != "none" - - MouseArea - { - id: adhesionMouseArea - anchors.fill: parent - hoverEnabled: true - // propagateComposedEvents used on adhesionTooltipMouseArea does not work with Controls Components. - // It only works with other MouseAreas, so this is required - onClicked: curaRecommendedMode.setAdhesion(!parent.checked) - } - } - } - - MouseArea - { - id: adhesionTooltipMouseArea - anchors.fill: parent - propagateComposedEvents: true - hoverEnabled: true - - onEntered:base.showTooltip(enableAdhesionCheckBox, Qt.point(-enableAdhesionContainer.x - UM.Theme.getSize("thick_margin").width, 0), - catalog.i18nc("@label", "Enable printing a brim or raft. This will add a flat area around or under your object which is easy to cut off afterwards.")); - onExited: base.hideTooltip() - } - - UM.SettingPropertyProvider - { - id: platformAdhesionType containerStack: Cura.MachineManager.activeMachine removeUnusedValue: false //Doesn't work with settings that are resolved. key: "adhesion_type" watchedProperties: [ "value", "resolve", "enabled" ] storeIndex: 0 } + + function onEnableSectionChanged(state) + { + curaRecommendedMode.setAdhesion(state) + } } diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml deleted file mode 100644 index 0317cb7814..0000000000 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright (c) 2022 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.7 -import QtQuick.Controls 2.15 - -import UM 1.5 as UM -import Cura 1.0 as Cura - - -// -// Infill -// -Item -{ - id: infillRow - height: childrenRect.height - - property real labelColumnWidth: Math.round(width / 3) - - // Create a binding to update the icon when the infill density changes - Binding - { - target: infillRowTitle - property: "source" - value: - { - var density = parseInt(infillDensity.properties.value) - if (parseInt(infillSteps.properties.value) != 0) - { - return UM.Theme.getIcon("InfillGradual") - } - if (density <= 0) - { - return UM.Theme.getIcon("Infill0") - } - if (density < 40) - { - return UM.Theme.getIcon("Infill3") - } - if (density < 90) - { - return UM.Theme.getIcon("Infill2") - } - return UM.Theme.getIcon("Infill100") - } - } - - // We use a binding to make sure that after manually setting infillSlider.value it is still bound to the property provider - Binding - { - target: infillSlider - property: "value" - value: { - // The infill slider has a max value of 100. When it is given a value > 100 onValueChanged updates the setting to be 100. - // When changing to an intent with infillDensity > 100, it would always be clamped to 100. - // This will force the slider to ignore the first onValueChanged for values > 100 so higher values can be set. - var density = parseInt(infillDensity.properties.value) - if (density > 100) { - infillSlider.ignoreValueChange = true - } - - return density - } - } - - // Here are the elements that are shown in the left column - Cura.IconWithText - { - id: infillRowTitle - anchors.top: parent.top - anchors.left: parent.left - source: UM.Theme.getIcon("Infill1") - text: catalog.i18nc("@label", "Infill") + " (%)" - font: UM.Theme.getFont("medium") - width: labelColumnWidth - iconSize: UM.Theme.getSize("medium_button_icon").width - tooltipText: catalog.i18nc("@label", "Gradual infill will gradually increase the amount of infill towards the top.") - } - - Item - { - id: infillSliderContainer - height: childrenRect.height - - anchors - { - left: infillRowTitle.right - right: parent.right - verticalCenter: infillRowTitle.verticalCenter - } - - Slider - { - id: infillSlider - - property var ignoreValueChange: false - - width: parent.width - height: UM.Theme.getSize("print_setup_slider_handle").height // The handle is the widest element of the slider - - from: 0 - to: 100 - stepSize: 1 - - // disable slider when gradual support is enabled - enabled: parseInt(infillSteps.properties.value) == 0 - - // set initial value from stack - value: parseInt(infillDensity.properties.value) - - //Draw line - background: Rectangle - { - id: backgroundLine - height: UM.Theme.getSize("print_setup_slider_groove").height - width: parent.width - UM.Theme.getSize("print_setup_slider_handle").width - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - color: infillSlider.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable") - - Repeater - { - id: repeater - anchors.fill: parent - model: infillSlider.to / infillSlider.stepSize + 1 - - Rectangle - { - color: infillSlider.enabled ? UM.Theme.getColor("quality_slider_available") : UM.Theme.getColor("quality_slider_unavailable") - implicitWidth: UM.Theme.getSize("print_setup_slider_tickmarks").width - implicitHeight: UM.Theme.getSize("print_setup_slider_tickmarks").height - anchors.verticalCenter: parent.verticalCenter - - // Do not use Math.round otherwise the tickmarks won't be aligned - // (space between steps) * index of step - x: (backgroundLine.width / (repeater.count - 1)) * index - - radius: Math.round(implicitWidth / 2) - visible: (index % 10) == 0 // Only show steps of 10% - - UM.Label - { - text: index - visible: (index % 20) == 0 // Only show steps of 20% - anchors.horizontalCenter: parent.horizontalCenter - y: UM.Theme.getSize("thin_margin").height - color: UM.Theme.getColor("quality_slider_available") - } - } - } - } - - handle: Rectangle - { - id: handleButton - x: infillSlider.leftPadding + infillSlider.visualPosition * (infillSlider.availableWidth - width) - y: infillSlider.topPadding + infillSlider.availableHeight / 2 - height / 2 - color: infillSlider.enabled ? UM.Theme.getColor("primary") : UM.Theme.getColor("quality_slider_unavailable") - implicitWidth: UM.Theme.getSize("print_setup_slider_handle").width - implicitHeight: implicitWidth - radius: Math.round(implicitWidth / 2) - border.color: UM.Theme.getColor("slider_groove_fill") - border.width: UM.Theme.getSize("default_lining").height - } - - Connections - { - target: infillSlider - function onValueChanged() - { - if (infillSlider.ignoreValueChange) - { - infillSlider.ignoreValueChange = false - return - } - - // Don't update if the setting value, if the slider has the same value - if (parseInt(infillDensity.properties.value) == infillSlider.value) - { - return - } - - // Round the slider value to the nearest multiple of 10 (simulate step size of 10) - var roundedSliderValue = Math.round(infillSlider.value / 10) * 10 - - // Update the slider value to represent the rounded value - infillSlider.value = roundedSliderValue - - // Update value only if the Recommended mode is Active, - // Otherwise if I change the value in the Custom mode the Recommended view will try to repeat - // same operation - const active_mode = UM.Preferences.getValue("cura/active_mode") - - if (visible // Workaround: 'visible' is checked because on startup in Windows it spuriously gets an 'onValueChanged' with value '0' if this isn't checked. - && (active_mode == 0 || active_mode == "simple")) - { - Cura.MachineManager.setSettingForAllExtruders("infill_sparse_density", "value", roundedSliderValue) - Cura.MachineManager.resetSettingForAllExtruders("infill_line_distance") - } - } - } - } - } - - // Gradual Support Infill Checkbox - UM.CheckBox - { - id: enableGradualInfillCheckBox - property alias _hovered: enableGradualInfillMouseArea.containsMouse - - anchors.top: infillSliderContainer.bottom - anchors.topMargin: UM.Theme.getSize("wide_margin").height - anchors.left: infillSliderContainer.left - - text: catalog.i18nc("@label", "Gradual infill") - enabled: recommendedPrintSetup.settingsEnabled - visible: infillSteps.properties.enabled == "True" - checked: parseInt(infillSteps.properties.value) > 0 - - MouseArea - { - id: enableGradualInfillMouseArea - - anchors.fill: parent - hoverEnabled: true - enabled: true - - property var previousInfillDensity: parseInt(infillDensity.properties.value) - - onClicked: - { - // Set to 90% only when enabling gradual infill - var newInfillDensity; - if (parseInt(infillSteps.properties.value) == 0) - { - previousInfillDensity = parseInt(infillDensity.properties.value) - newInfillDensity = 90 - } else { - newInfillDensity = previousInfillDensity - } - Cura.MachineManager.setSettingForAllExtruders("infill_sparse_density", "value", String(newInfillDensity)) - - var infill_steps_value = 0 - if (parseInt(infillSteps.properties.value) == 0) - { - infill_steps_value = 5 - } - - Cura.MachineManager.setSettingForAllExtruders("gradual_infill_steps", "value", infill_steps_value) - } - - onEntered: base.showTooltip(enableGradualInfillCheckBox, Qt.point(-infillSliderContainer.x - UM.Theme.getSize("thick_margin").width, 0), - catalog.i18nc("@label", "Gradual infill will gradually increase the amount of infill towards the top.")) - - onExited: base.hideTooltip() - } - } - - UM.SettingPropertyProvider - { - id: infillDensity - containerStackId: Cura.MachineManager.activeStackId - key: "infill_sparse_density" - watchedProperties: [ "value" ] - storeIndex: 0 - } - - UM.SettingPropertyProvider - { - id: infillSteps - containerStackId: Cura.MachineManager.activeStackId - key: "gradual_infill_steps" - watchedProperties: ["value", "enabled"] - storeIndex: 0 - } -} diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml index 37517709a9..f78ae38dce 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml @@ -1,4 +1,4 @@ -//Copyright (c) 2022 Ultimaker B.V. +// Copyright (c) 2022 UltiMaker //Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 @@ -17,7 +17,9 @@ Item property bool settingsEnabled: Cura.ExtruderManager.activeExtruderStackId || extrudersEnabledCount.properties.value == 1 property real padding: UM.Theme.getSize("default_margin").width - ColumnLayout + function onModeChanged() {} + + Column { spacing: UM.Theme.getSize("default_margin").height @@ -47,7 +49,6 @@ Item RecommendedResolutionSelector { id: recommendedResolutionSelector - Layout.fillWidth: true width: parent.width } @@ -55,55 +56,72 @@ Item { width: parent.width visible: !recommendedResolutionSelector.visible - Layout.fillWidth: true } + Item { height: UM.Theme.getSize("default_margin").height } // Spacer ProfileWarningReset { width: parent.width - Layout.fillWidth: true - Layout.topMargin: UM.Theme.getSize("default_margin").height - Layout.bottomMargin: UM.Theme.getSize("thin_margin").height } + Item { height: UM.Theme.getSize("thin_margin").height + UM.Theme.getSize("narrow_margin").height} // Spacer + //Line between the sections. Rectangle { width: parent.width height: UM.Theme.getSize("default_lining").height - Layout.topMargin: UM.Theme.getSize("narrow_margin").height - Layout.bottomMargin: UM.Theme.getSize("narrow_margin").height - Layout.fillWidth: true color: UM.Theme.getColor("lining") } - UM.Label - { - text: catalog.i18nc("@label", "Print settings") - font: UM.Theme.getFont("medium") - } + Item { height: UM.Theme.getSize("narrow_margin").height } //Spacer - RecommendedInfillDensitySelector + Column { + id: settingColumn width: parent.width - labelColumnWidth: parent.firstColumnWidth - Layout.fillWidth: true - Layout.rightMargin: UM.Theme.getSize("default_margin").width - } + spacing: UM.Theme.getSize("thin_margin").height - RecommendedSupportSelector - { - width: parent.width - labelColumnWidth: parent.firstColumnWidth - Layout.fillWidth: true - } + Item + { + id: recommendedPrintSettingsHeader + height: childrenRect.height + width: parent.width + UM.Label + { + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + text: catalog.i18nc("@label", "Recommended print settings") + font: UM.Theme.getFont("medium") + } - RecommendedAdhesionSelector - { - width: parent.width - labelColumnWidth: parent.firstColumnWidth - Layout.fillWidth: true + Cura.SecondaryButton + { + id: customSettingsButton + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + text: catalog.i18nc("@button", "Show Custom") + textFont: UM.Theme.getFont("medium_bold") + outlineColor: "transparent" + onClicked: onModeChanged() + } + } + + RecommendedStrengthSelector + { + width: parent.width + } + + RecommendedSupportSelector + { + width: parent.width + } + + RecommendedAdhesionSelector + { + width: parent.width + } } } diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedSettingItem.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedSettingItem.qml new file mode 100644 index 0000000000..ceebc3808e --- /dev/null +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedSettingItem.qml @@ -0,0 +1,90 @@ +// Copyright (c) 2022 UltiMaker +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 2.10 + +import UM 1.5 as UM +import Cura 1.7 as Cura + + +Item +{ + id: settingItem + width: parent.width + Layout.minimumHeight: UM.Theme.getSize("section_header").height + Layout.fillWidth: true + + property alias settingControl: settingContainer.children + property alias settingName: settingLabel.text + property string tooltipText: "" + property bool isCompressed: false + + UM.Label + { + id: settingLabel + width: leftColumnWidth + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + // These numbers come from the IconWithText in RecommendedSettingSection + anchors.leftMargin: UM.Theme.getSize("medium_button_icon").width + UM.Theme.getSize("default_margin").width + } + + MouseArea + { + id: tooltipArea + anchors.fill: settingLabel + propagateComposedEvents: true + hoverEnabled: true + onEntered: base.showTooltip(parent, Qt.point(-UM.Theme.getSize("thick_margin").width, 0), tooltipText) + onExited: base.hideTooltip() + } + + Item + { + id: settingContainer + height: childrenRect.height + anchors.left: settingLabel.right + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + } + + states: + [ + State + { + name: "sectionClosed" // Section is hidden when the switch in parent is off + when: isCompressed + PropertyChanges + { + target: settingItem; + opacity: 0 + height: 0 + implicitHeight: 0 + Layout.preferredHeight: 0 + Layout.minimumHeight: 0 + enabled: false // Components can still be clickable with height 0 so they need to be disabled as well. + } + }, + State + { + // All values are default. This state is only here for the animation. + name: "sectionOpened" + when: !isCompressed + } + ] + + transitions: Transition + { + from: "sectionOpened"; to: "sectionClosed" + reversible: true + ParallelAnimation + { + // Animate section compressing as it closes + NumberAnimation { property: "Layout.minimumHeight"; duration: 100; } + // Animate section dissapearring as it closes + NumberAnimation { property: "opacity"; duration: 100; } + } + } +} \ No newline at end of file diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedSettingSection.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedSettingSection.qml new file mode 100644 index 0000000000..a8cfaee79f --- /dev/null +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedSettingSection.qml @@ -0,0 +1,129 @@ +// Copyright (c) 2022 UltiMaker +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 2.10 + +import UM 1.7 as UM +import Cura 1.7 as Cura + +Item +{ + id: settingSection + property alias title: sectionTitle.text + property alias icon: sectionTitle.source + + property alias enableSectionSwitchVisible: enableSectionSwitch.visible + property alias enableSectionSwitchChecked: enableSectionSwitch.checked + property alias enableSectionSwitchEnabled: enableSectionSwitch.enabled + property string tooltipText: "" + property var enableSectionClicked: { return } + property int leftColumnWidth: Math.floor(width * 0.35) + property bool isCompressed: false + + property alias contents: settingColumn.children + + function onEnableSectionChanged(state) {} + + height: childrenRect.height + + Item + { + id: sectionHeader + anchors.top: parent.top + anchors.right: parent.right + anchors.left: parent.left + height: UM.Theme.getSize("section_header").height + + Cura.IconWithText + { + id: sectionTitle + width: leftColumnWidth + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + source: UM.Theme.getIcon("PrintQuality") + spacing: UM.Theme.getSize("default_margin").width + iconSize: UM.Theme.getSize("medium_button_icon").width + iconColor: UM.Theme.getColor("text") + font: UM.Theme.getFont("medium_bold") + } + + MouseArea + { + id: tooltipArea + anchors.fill: sectionTitle + propagateComposedEvents: true + hoverEnabled: true + onEntered: base.showTooltip(parent, Qt.point(-UM.Theme.getSize("thick_margin").width, 0), tooltipText) + onExited: base.hideTooltip() + } + + } + + UM.Switch + { + id: enableSectionSwitch + anchors.left: parent.left + // These numbers come from the IconWithText in RecommendedSettingSection. + anchors.leftMargin: leftColumnWidth + UM.Theme.getSize("medium_button_icon").width + UM.Theme.getSize("default_margin").width + anchors.verticalCenter: sectionHeader.verticalCenter + visible: false + + // This delay forces the setting change to happen after the setting section open/close animation. This is so the animation is smooth. + Timer + { + id: updateTimer + interval: 500 // This interval is set long enough so you can spam click the button on/off without lag. + repeat: false + onTriggered: onEnableSectionChanged(enableSectionSwitch.checked) + } + onClicked: updateTimer.restart() + } + + ColumnLayout + { + id: settingColumn + width: parent.width + spacing: UM.Theme.getSize("thin_margin").height + anchors.left: parent.left + anchors.right: parent.right + anchors.top: sectionHeader.bottom + anchors.topMargin: UM.Theme.getSize("narrow_margin").height + } + + states: + [ + State + { + name: "settingListClosed" + when: !enableSectionSwitchChecked && enableSectionSwitchEnabled + PropertyChanges + { + target: settingSection + isCompressed: true + implicitHeight: 0 + } + PropertyChanges + { + target: settingColumn + spacing: 0 + } + }, + State + { + // Use default properties. This is only here for the animation. + name: "settingListOpened" + when: enableSectionSwitchChecked && enableSectionSwitchEnabled + } + ] + + // Animate section closing + transitions: Transition + { + from: "settingListOpened"; to: "settingListClosed" + reversible: true + // Animate section compressing as it closes + NumberAnimation { property: "implicitHeight"; duration: 100; } + } +} \ No newline at end of file diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedStrengthSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedStrengthSelector.qml new file mode 100644 index 0000000000..75e8abd676 --- /dev/null +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedStrengthSelector.qml @@ -0,0 +1,105 @@ +// Copyright (c) 2022 UltiMaker +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.7 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 2.10 + +import UM 1.7 as UM +import Cura 1.7 as Cura + + +RecommendedSettingSection +{ + id: strengthSection + + title: catalog.i18nc("@label", "Strength") + icon: UM.Theme.getIcon("Hammer") + enableSectionSwitchVisible: false + enableSectionSwitchEnabled: false + tooltipText: catalog.i18nc("@label", "The following settings define the strength of your part.") + + UM.SettingPropertyProvider + { + id: infillSteps + containerStackId: Cura.MachineManager.activeStackId + key: "gradual_infill_steps" + watchedProperties: ["value", "enabled"] + storeIndex: 0 + } + + contents: [ + RecommendedSettingItem + { + settingName: catalog.i18nc("infill_sparse_density description", "Infill Density") + tooltipText: catalog.i18nc("@label", "Adjusts the density of infill of the print.") + settingControl: Cura.SingleSettingSlider + { + height: UM.Theme.getSize("combobox").height + width: parent.width + settingName: "infill_sparse_density" + updateAllExtruders: true + // disable slider when gradual support is enabled + enabled: parseInt(infillSteps.properties.value) === 0 + + function updateSetting(value) + { + Cura.MachineManager.setSettingForAllExtruders("infill_sparse_density", "value", value) + Cura.MachineManager.resetSettingForAllExtruders("infill_line_distance") + } + } + }, + RecommendedSettingItem + { + settingName: catalog.i18nc("@action:label", "Infill Pattern") + tooltipText: catalog.i18nc("@label", + "The pattern of the infill material of the print:\n\nFor quick prints of non functional model choose line, zig zag or lighting infill.\n\nFor functional part not subjected to a lot of stress we reccomend grid or triangle or tri hexagon.\n\nFor functional 3D prints which require high strenght in multiple directions use cubic, cubic subdivision, quarter cubic, octet, and gyroid.") + + settingControl: Cura.SingleSettingComboBox + { + width: parent.width + settingName: "infill_pattern" + updateAllExtruders: true + } + }, + RecommendedSettingItem + { + settingName: catalog.i18nc("@action:label", "Shell Thickness") + tooltipText: catalog.i18nc("@label", "Defines the tickness of your part side walls, roof and floor.") + + settingControl: RowLayout + { + anchors.fill: parent + spacing: UM.Theme.getSize("default_margin").width + UM.ComponentWithIcon + { + Layout.fillWidth: true + source: UM.Theme.getIcon("PrintWalls") + + Cura.SingleSettingTextField + { + width: parent.width + settingName: "wall_thickness" + updateAllExtruders: true + validator: UM.FloatValidator {} + unitText: catalog.i18nc("@label", "mm") + } + } + UM.ComponentWithIcon + { + Layout.fillWidth: true + source: UM.Theme.getIcon("PrintTopBottom") + + Cura.SingleSettingTextField + { + width: parent.width + settingName: "top_bottom_thickness" + updateAllExtruders: true + validator: UM.FloatValidator {} + unitText: catalog.i18nc("@label", "mm") + } + } + } + } + ] +} diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml index 3e40c16d74..44b3d28e24 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml @@ -1,307 +1,31 @@ -// Copyright (c) 2022 Ultimaker B.V. +// Copyright (c) 2022 UltiMaker // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.3 import UM 1.5 as UM -import Cura 1.0 as Cura +import Cura 1.7 as Cura -// -// Enable support -// -Item +RecommendedSettingSection { id: enableSupportRow - height: UM.Theme.getSize("print_setup_big_item").height - property real labelColumnWidth: Math.round(width / 3) + title: catalog.i18nc("@label", "Support") + icon: UM.Theme.getIcon("Support") + enableSectionSwitchVisible: supportEnabled.properties.enabled == "True" + enableSectionSwitchChecked: supportEnabled.properties.value == "True" + enableSectionSwitchEnabled: recommendedPrintSetup.settingsEnabled + tooltipText: catalog.i18nc("@label", "Generate structures to support parts of the model which have overhangs. Without these structures, these parts would collapse during printing.") - Item + function onEnableSectionChanged(state) { - id: enableSupportContainer - width: labelColumnWidth + enableSupportCheckBox.width - - anchors - { - left: parent.left - top: parent.top - bottom: parent.bottom - rightMargin: UM.Theme.getSize("thick_margin").width - } - - Cura.IconWithText - { - id: enableSupportRowTitle - anchors.left: parent.left - visible: enableSupportCheckBox.visible - source: UM.Theme.getIcon("Support") - text: catalog.i18nc("@label", "Support") - font: UM.Theme.getFont("medium") - width: labelColumnWidth - iconSize: UM.Theme.getSize("medium_button_icon").width - tooltipText: catalog.i18nc("@label", "Generate structures to support parts of the model which have overhangs. Without these structures, such parts would collapse during printing.") - } - - UM.CheckBox - { - id: enableSupportCheckBox - anchors.verticalCenter: parent.verticalCenter - anchors.left: enableSupportRowTitle.right - - property alias _hovered: enableSupportMouseArea.containsMouse - - enabled: recommendedPrintSetup.settingsEnabled - - visible: supportEnabled.properties.enabled == "True" - checked: supportEnabled.properties.value == "True" - - MouseArea - { - id: enableSupportMouseArea - anchors.fill: parent - hoverEnabled: true - // propagateComposedEvents used on supportToolTipMouseArea does not work with Controls Components. - // It only works with other MouseAreas, so this is required - onClicked: supportEnabled.setPropertyValue("value", supportEnabled.properties.value != "True") - } - } - - MouseArea - { - id: supportToolTipMouseArea - anchors.fill: parent - propagateComposedEvents: true - hoverEnabled: true - onEntered: base.showTooltip(enableSupportContainer, Qt.point(-enableSupportContainer.x - UM.Theme.getSize("thick_margin").width, 0), - catalog.i18nc("@label", "Generate structures to support parts of the model which have overhangs. Without these structures, such parts would collapse during printing.")) - onExited: base.hideTooltip() - } + supportEnabled.setPropertyValue("value", state) } - ComboBox - { - id: supportExtruderCombobox - - height: UM.Theme.getSize("print_setup_big_item").height - anchors - { - left: enableSupportContainer.right - right: parent.right - leftMargin: UM.Theme.getSize("default_margin").width - rightMargin: UM.Theme.getSize("thick_margin").width - verticalCenter: parent.verticalCenter - } - - enabled: recommendedPrintSetup.settingsEnabled - visible: enableSupportCheckBox.visible && (supportEnabled.properties.value == "True") && (extrudersEnabledCount.properties.value > 1) - textRole: "name" // this solves that the combobox isn't populated in the first time Cura is started - - model: extruderModel - - // knowing the extruder position, try to find the item index in the model - function getIndexByPosition(position) - { - var itemIndex = -1 // if position is not found, return -1 - for (var item_index in model.items) - { - var item = model.getItem(item_index) - if (item.index == position) - { - itemIndex = item_index - break - } - } - return itemIndex - } - - onActivated: - { - if (model.getItem(index).enabled) - { - forceActiveFocus(); - supportExtruderNr.setPropertyValue("value", model.getItem(index).index); - } else - { - currentIndex = supportExtruderNr.properties.value; // keep the old value - } - } - - currentIndex: (supportExtruderNr.properties.value !== undefined) ? supportExtruderNr.properties.value : 0 - - property string color: "#fff" - Connections - { - target: extruderModel - function onModelChanged() - { - var maybeColor = supportExtruderCombobox.model.getItem(supportExtruderCombobox.currentIndex).color - if (maybeColor) - { - supportExtruderCombobox.color = maybeColor - } - } - } - onCurrentIndexChanged: - { - var maybeColor = supportExtruderCombobox.model.getItem(supportExtruderCombobox.currentIndex).color - if(maybeColor) - { - supportExtruderCombobox.color = maybeColor - } - } - - Binding - { - target: supportExtruderCombobox - property: "currentIndex" - value: supportExtruderCombobox.getIndexByPosition(supportExtruderNr.properties.value) - // Sometimes when the value is already changed, the model is still being built. - // The when clause ensures that the current index is not updated when this happens. - when: supportExtruderCombobox.model.count > 0 - } - - indicator: UM.ColorImage - { - id: downArrow - x: supportExtruderCombobox.width - width - supportExtruderCombobox.rightPadding - y: supportExtruderCombobox.topPadding + Math.round((supportExtruderCombobox.availableHeight - height) / 2) - - source: UM.Theme.getIcon("ChevronSingleDown") - width: UM.Theme.getSize("standard_arrow").width - height: UM.Theme.getSize("standard_arrow").height - - color: UM.Theme.getColor("setting_control_button") - } - - background: Rectangle - { - color: - { - if (!enabled) - { - return UM.Theme.getColor("setting_control_disabled") - } - if (supportExtruderCombobox.hovered || base.activeFocus) - { - return UM.Theme.getColor("setting_control_highlight") - } - return UM.Theme.getColor("setting_control") - } - radius: UM.Theme.getSize("setting_control_radius").width - border.width: UM.Theme.getSize("default_lining").width - border.color: - { - if (!enabled) - { - return UM.Theme.getColor("setting_control_disabled_border") - } - if (supportExtruderCombobox.hovered || supportExtruderCombobox.activeFocus) - { - return UM.Theme.getColor("setting_control_border_highlight") - } - return UM.Theme.getColor("setting_control_border") - } - } - - contentItem: UM.Label - { - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width - anchors.right: downArrow.left - rightPadding: swatch.width + UM.Theme.getSize("setting_unit_margin").width - - text: supportExtruderCombobox.currentText - textFormat: Text.PlainText - color: enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") - - elide: Text.ElideLeft - - - background: Rectangle - { - id: swatch - height: Math.round(parent.height / 2) - width: height - radius: Math.round(width / 2) - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - anchors.rightMargin: UM.Theme.getSize("thin_margin").width - - color: supportExtruderCombobox.color - } - } - - popup: Popup - { - y: supportExtruderCombobox.height - UM.Theme.getSize("default_lining").height - width: supportExtruderCombobox.width - implicitHeight: contentItem.implicitHeight + 2 * UM.Theme.getSize("default_lining").width - padding: UM.Theme.getSize("default_lining").width - - contentItem: ListView - { - implicitHeight: contentHeight - - ScrollBar.vertical: UM.ScrollBar {} - clip: true - model: supportExtruderCombobox.popup.visible ? supportExtruderCombobox.delegateModel : null - currentIndex: supportExtruderCombobox.highlightedIndex - } - - background: Rectangle - { - color: UM.Theme.getColor("setting_control") - border.color: UM.Theme.getColor("setting_control_border") - } - } - - delegate: ItemDelegate - { - width: supportExtruderCombobox.width - 2 * UM.Theme.getSize("default_lining").width - height: supportExtruderCombobox.height - highlighted: supportExtruderCombobox.highlightedIndex == index - - contentItem: UM.Label - { - anchors.fill: parent - anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width - anchors.rightMargin: UM.Theme.getSize("setting_unit_margin").width - - text: model.name - color: model.enabled ? UM.Theme.getColor("setting_control_text"): UM.Theme.getColor("action_button_disabled_text") - - elide: Text.ElideRight - rightPadding: swatch.width + UM.Theme.getSize("setting_unit_margin").width - - background: Rectangle - { - id: swatch - height: Math.round(parent.height / 2) - width: height - radius: Math.round(width / 2) - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - anchors.rightMargin: UM.Theme.getSize("thin_margin").width - - color: supportExtruderCombobox.model.getItem(index).color - } - } - - background: Rectangle - { - color: parent.highlighted ? UM.Theme.getColor("setting_control_highlight") : "transparent" - border.color: parent.highlighted ? UM.Theme.getColor("setting_control_border_highlight") : "transparent" - } - } - } - - property var extruderModel: CuraApplication.getExtrudersModel() - - - UM.SettingPropertyProvider + property UM.SettingPropertyProvider supportEnabled: UM.SettingPropertyProvider { id: supportEnabled containerStack: Cura.MachineManager.activeMachine @@ -310,21 +34,45 @@ Item storeIndex: 0 } - UM.SettingPropertyProvider - { - id: supportExtruderNr - containerStack: Cura.MachineManager.activeMachine - key: "support_extruder_nr" - watchedProperties: [ "value" ] - storeIndex: 0 - } + contents: [ + RecommendedSettingItem + { + settingName: catalog.i18nc("@action:label", "Support Type") + tooltipText: catalog.i18nc("@label", "Chooses between the techniques available to generate support. \n\n\"Normal\" support creates a support structure directly below the overhanging parts and drops those areas straight down. \n\n\"Tree\" support creates branches towards the overhanging areas that support the model on the tips of those branches, and allows the branches to crawl around the model to support it from the build plate as much as possible.") + isCompressed: enableSupportRow.isCompressed - UM.SettingPropertyProvider - { - id: machineExtruderCount - containerStack: Cura.MachineManager.activeMachine - key: "machine_extruder_count" - watchedProperties: ["value"] - storeIndex: 0 - } + settingControl: Cura.SingleSettingComboBox + { + width: parent.width + settingName: "support_structure" + } + }, + RecommendedSettingItem + { + Layout.preferredHeight: childrenRect.height + settingName: catalog.i18nc("@action:label", "Print with") + tooltipText: catalog.i18nc("@label", "The extruder train to use for printing the support. This is used in multi-extrusion.") + // Hide this component when there is only one extruder + enabled: Cura.ExtruderManager.enabledExtruderCount > 1 + visible: Cura.ExtruderManager.enabledExtruderCount > 1 + isCompressed: enableSupportRow.isCompressed || Cura.ExtruderManager.enabledExtruderCount <= 1 + + settingControl: Cura.SingleSettingExtruderSelectorBar + { + extruderSettingName: "support_extruder_nr" + } + }, + RecommendedSettingItem + { + settingName: catalog.i18nc("@action:label", "Placement") + tooltipText: catalog.i18nc("support_type description", "Adjusts the placement of the support structures. The placement can be set to touching build plate or everywhere. When set to everywhere the support structures will also be printed on the model.") + isCompressed: enableSupportRow.isCompressed + + settingControl: Cura.SingleSettingComboBox + { + width: parent.width + settingName: "support_type" + } + } + ] } diff --git a/resources/qml/PrintSetupTooltip.qml b/resources/qml/PrintSetupTooltip.qml index af4280342c..195f7fb204 100644 --- a/resources/qml/PrintSetupTooltip.qml +++ b/resources/qml/PrintSetupTooltip.qml @@ -11,7 +11,7 @@ UM.PointingRectangle id: base property real sourceWidth: 0 width: UM.Theme.getSize("tooltip").width - height: textScroll.height + UM.Theme.getSize("tooltip_margins").height * 2 + height: textScroll.height + UM.Theme.getSize("tooltip_margins").height color: UM.Theme.getColor("tooltip") arrowSize: UM.Theme.getSize("default_arrow").width diff --git a/resources/qml/Settings/SettingTextField.qml b/resources/qml/Settings/SettingTextField.qml index 4e72bca93e..d8e90e4951 100644 --- a/resources/qml/Settings/SettingTextField.qml +++ b/resources/qml/Settings/SettingTextField.qml @@ -4,7 +4,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 -import UM 1.5 as UM +import UM 1.7 as UM SettingItem { @@ -14,6 +14,11 @@ SettingItem property string textBeforeEdit property bool textHasChanged property bool focusGainedByClick: false + + readonly property UM.IntValidator intValidator: UM.IntValidator {} + readonly property UM.FloatValidator floatValidator: UM.FloatValidator {} + readonly property UM.IntListValidator intListValidator: UM.IntListValidator {} + onFocusReceived: { textHasChanged = false; @@ -159,7 +164,23 @@ SettingItem // should be done as little as possible) clip: definition.type == "str" || definition.type == "[int]" - validator: RegularExpressionValidator { regularExpression: (definition.type == "[int]") ? /^\[?(\s*-?[0-9]{0,11}\s*,)*(\s*-?[0-9]{0,11})\s*\]?$/ : (definition.type == "int") ? /^-?[0-9]{0,12}$/ : (definition.type == "float") ? /^-?[0-9]{0,11}[.,]?[0-9]{0,3}$/ : /^.*$/ } // definition.type property from parent loader used to disallow fractional number entry + validator: RegularExpressionValidator + { + regularExpression: + { + switch (definition.type) + { + case "[int]": + return new RegExp(intListValidator.regexString) + case "int": + return new RegExp(intValidator.regexString) + case "float": + return new RegExp(floatValidator.regexString) + default: + return new RegExp("^.*$") + } + } + } Binding { diff --git a/resources/qml/Toolbar.qml b/resources/qml/Toolbar.qml index 6ecdc9dce0..fd48ef7448 100644 --- a/resources/qml/Toolbar.qml +++ b/resources/qml/Toolbar.qml @@ -5,7 +5,7 @@ import QtQuick 2.2 import QtQuick.Controls 2.3 import UM 1.5 as UM -import Cura 1.0 as Cura +import Cura 1.7 as Cura Item { @@ -29,13 +29,13 @@ Item anchors { fill: toolButtons - leftMargin: -radius - border.width - rightMargin: -border.width - topMargin: -border.width - bottomMargin: -border.width + leftMargin: -radius - border.width // Removes border on left side } radius: UM.Theme.getSize("default_radius").width - color: UM.Theme.getColor("lining") + color: UM.Theme.getColor("toolbar_background") + border.color: UM.Theme.getColor("lining") + border.width: UM.Theme.getSize("default_lining").width + } Column @@ -111,13 +111,12 @@ Item anchors { fill: extruderButtons - leftMargin: -radius - border.width - rightMargin: -border.width - topMargin: -border.width - bottomMargin: -border.width + leftMargin: -radius - border.width // Removes border on left side } radius: UM.Theme.getSize("default_radius").width - color: UM.Theme.getColor("lining") + color: UM.Theme.getColor("toolbar_background") + border.color: UM.Theme.getColor("lining") + border.width: UM.Theme.getSize("default_lining").width visible: extrudersModel.items.length > 1 } @@ -135,11 +134,21 @@ Item height: childrenRect.height model: extrudersModel.items.length > 1 ? extrudersModel : 0 - delegate: ExtruderButton + delegate: Cura.ExtruderButton { extruder: model - isTopElement: extrudersModel.getItem(0).id == model.id - isBottomElement: extrudersModel.getItem(extrudersModel.rowCount() - 1).id == model.id + isTopElement: extrudersModel.getItem(0).id === model.id + isBottomElement: extrudersModel.getItem(extrudersModel.rowCount() - 1).id === model.id + text: catalog.i18ncp("@label %1 is filled in with the name of an extruder", "Print Selected Model with %1", "Print Selected Models with %1", UM.Selection.selectionCount).arg(extruder.name) + checked: Cura.ExtruderManager.selectedObjectExtruders.indexOf(extruder.id) !== -1 + enabled: UM.Selection.hasSelection && extruder.stack.isEnabled + font: UM.Theme.getFont("small_emphasis") + + onClicked: + { + forceActiveFocus() //First grab focus, so all the text fields are updated + CuraActions.setExtruderForSelection(extruder.id) + } } } } diff --git a/resources/qml/Widgets/ComboBox.qml b/resources/qml/Widgets/ComboBox.qml index efe14497bc..912403a33e 100644 --- a/resources/qml/Widgets/ComboBox.qml +++ b/resources/qml/Widgets/ComboBox.qml @@ -25,6 +25,8 @@ ComboBox enabled: delegateModel.count > 0 + height: UM.Theme.getSize("combobox").height + onVisibleChanged: { popup.close() } states: [ diff --git a/resources/qml/Widgets/SingleSettingComboBox.qml b/resources/qml/Widgets/SingleSettingComboBox.qml new file mode 100644 index 0000000000..338e14b144 --- /dev/null +++ b/resources/qml/Widgets/SingleSettingComboBox.qml @@ -0,0 +1,102 @@ +// Copyright (c) 2022 UltiMaker +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.3 + +import UM 1.5 as UM +import Cura 1.7 as Cura + +// This ComboBox allows changing of a single setting. Only the setting name has to be passed in to "settingName". +// All of the setting updating logic is handled by this component. +// This uses the "options" value of a setting to populate the drop down. This will only work for settings with "options" +// If the setting is limited to a single extruder or is settable with different values per extruder use "updateAllExtruders: true" +Cura.ComboBox { + textRole: "text" + property alias settingName: propertyProvider.key + + // If true, all extruders will have "settingName" property updated. + // The displayed value will be read from the extruder with index "defaultExtruderIndex" instead of the machine. + property bool updateAllExtruders: false + // This is only used if updateAllExtruders == true + property int defaultExtruderIndex: 0 + + model: ListModel + { + id: comboboxModel + + // The propertyProvider has not loaded the setting when this components onComplete triggers. Populating the model + // is defered until propertyProvider signals "onIsValueUsedChanged". The defered upate is triggered with this function. + function updateModel() + { + clear() + + if(!propertyProvider.properties.options) // No options have been loaded yet to populate combobox + { + return + } + + for (var i = 0; i < propertyProvider.properties["options"].keys().length; i++) + { + var key = propertyProvider.properties["options"].keys()[i] + var value = propertyProvider.properties["options"][key] + comboboxModel.append({ text: value, code: key}) + + if (propertyProvider.properties.value === key) + { + // The combobox is cleared after each value change so the currentIndex must be set each time. + currentIndex = i + } + } + } + } + + // Updates to the setting are delayed by interval. The signal onIsValueUsedChanged() is emitted early for some reason. + // This causes the selected value in the combobox to be updated to the previous value. (This issue is present with infill_pattern setting) + // This is a hack. If you see this in the future, try removing it and see if the combobox still works. + Timer + { + id: updateTimer + interval: 100 + repeat: false + onTriggered: comboboxModel.updateModel(false) + } + + property UM.SettingPropertyProvider propertyProvider: UM.SettingPropertyProvider + { + id: propertyProvider + containerStackId: updateAllExtruders ? Cura.ExtruderManager.extruderIds[defaultExtruderIndex] : Cura.MachineManager.activeMachine.id + watchedProperties: ["value" , "options"] + } + + Connections + { + target: propertyProvider + function onContainerStackChanged() { updateTimer.restart() } + function onIsValueUsedChanged() { updateTimer.restart() } + } + + onCurrentIndexChanged: parseValueAndUpdateSetting() + + function parseValueAndUpdateSetting() + { + if (comboboxModel.get(currentIndex) && comboboxModel.get(currentIndex).code !== propertyProvider.properties.value) + { + updateSetting(comboboxModel.get(currentIndex).code) + } + + } + + function updateSetting(value) + { + if (updateAllExtruders) + { + Cura.MachineManager.setSettingForAllExtruders(propertyProvider.key, "value", value) + } + else + { + propertyProvider.setPropertyValue("value", value) + } + } +} diff --git a/resources/qml/Widgets/SingleSettingExtruderSelectorBar.qml b/resources/qml/Widgets/SingleSettingExtruderSelectorBar.qml new file mode 100644 index 0000000000..d753bb9167 --- /dev/null +++ b/resources/qml/Widgets/SingleSettingExtruderSelectorBar.qml @@ -0,0 +1,70 @@ +// Copyright (c) 2022 UltiMaker +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Layouts 1.3 + +import UM 1.5 as UM +import Cura 1.5 as Cura + +// This component displays a row of extruder icons, clicking on the extruder will update the setting passed to "settingName" +// with the index of that extruder. +// This will only work for settings that take an extruder index. +Row +{ + id: extruderSelectionBar + + width: parent.width + height: childrenRect.height + spacing: 0 + + property int selectedIndex: extruderSettingProvider.properties.value !== undefined ? extruderSettingProvider.properties.value : 0 + property alias model: extruderButtonRepeater.model + property alias extruderSettingName: extruderSettingProvider.key + property alias containerStack: extruderSettingProvider.containerStack + + property UM.SettingPropertyProvider extruderSettingProvider: UM.SettingPropertyProvider + { + id: extruderSettingProvider + containerStack: Cura.MachineManager.activeMachine + watchedProperties: [ "value" ] + storeIndex: 0 + } + + function onClickExtruder(index) + { + forceActiveFocus(); + extruderSettingProvider.setPropertyValue("value", index); + } + + + Repeater + { + id: extruderButtonRepeater + + model: CuraApplication.getExtrudersModel() + + delegate: Item + { + width: { + // This will "squish" the extruder buttons together when the fill up the horizontal space + const maximum_width = Math.floor(extruderSelectionBar.width / extruderButtonRepeater.count); + return Math.min(UM.Theme.getSize("large_button").width, maximum_width); + } + height: childrenRect.height + + Cura.ExtruderButton + { + anchors.margins: 0 + padding: 0 + extruder: model + checked: extruder.index === selectedIndex + iconScale: 0.8 + font: UM.Theme.getFont("tiny_emphasis") + buttonSize: UM.Theme.getSize("small_button").width + onClicked: extruder.enabled && onClickExtruder(extruder.index) + } + } + } +} diff --git a/resources/qml/Widgets/SingleSettingSlider.qml b/resources/qml/Widgets/SingleSettingSlider.qml new file mode 100644 index 0000000000..27e2be562c --- /dev/null +++ b/resources/qml/Widgets/SingleSettingSlider.qml @@ -0,0 +1,105 @@ +// Copyright (c) 2022 UltiMaker +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.7 +import QtQuick.Controls 2.15 + +import UM 1.7 as UM +import Cura 1.7 as Cura + +// This silder allows changing of a single setting. Only the setting name has to be passed in to "settingName". +// All of the setting updating logic is handled by this component. +// This component allows you to choose values between minValue -> maxValue and rounds them to the nearest 10. +// If the setting is limited to a single extruder or is settable with different values per extruder use "updateAllExtruders: true" +UM.Slider +{ + id: settingSlider + + property alias settingName: propertyProvider.key + + // If true, all extruders will have "settingName" property updated. + // The displayed value will be read from the extruder with index "defaultExtruderIndex" instead of the machine. + property bool updateAllExtruders: false + // This is only used if updateAllExtruders == true + property int defaultExtruderIndex: 0 + property int previousValue: -1 + + // set range from 0 to 100 + from: 0; to: 100 + // set stepSize to 10 and set snapMode to snap on release snapMode is needed + // otherwise the used percentage and slider handle show different values + stepSize: 10; snapMode: Slider.SnapOnRelease + + UM.SettingPropertyProvider + { + id: propertyProvider + containerStackId: updateAllExtruders ? Cura.ExtruderManager.extruderIds[defaultExtruderIndex] : Cura.MachineManager.activeMachine.id + watchedProperties: ["value"] + storeIndex: 0 + } + + // set initial value from stack + value: parseInt(propertyProvider.properties.value) + + // When the slider is released trigger an update immediately. This forces the slider to snap to the rounded value. + onPressedChanged: function(pressed) + { + if(!pressed) + { + updateSetting(settingSlider.value); + } + } + + Connections + { + target: propertyProvider + function onContainerStackChanged() + { + updateTimer.restart() + } + function onIsValueUsedChanged() + { + updateTimer.restart() + } + } + + // Updates to the setting are delayed by interval. This reduces lag by waiting a bit after a setting change to update the slider contents. + Timer + { + id: updateTimer + interval: 100 + repeat: false + onTriggered: parseValueUpdateSetting(false) + } + + function updateSlider(value) + { + settingSlider.value = value + } + + function parseValueUpdateSetting(triggerUpdate) + { + // Only run when the setting value is updated by something other than the slider. + // This sets the slider value based on the setting value, it does not update the setting value. + + if (parseInt(propertyProvider.properties.value) == settingSlider.value) + { + return + } + + settingSlider.value = propertyProvider.properties.value + } + + // Override this function to update a setting differently + function updateSetting(value) + { + if (updateAllExtruders) + { + Cura.MachineManager.setSettingForAllExtruders(propertyProvider.key, "value", value) + } + else + { + propertyProvider.setPropertyValue("value", value) + } + } +} diff --git a/resources/qml/Widgets/SingleSettingTextField.qml b/resources/qml/Widgets/SingleSettingTextField.qml new file mode 100644 index 0000000000..5bff7fdb5a --- /dev/null +++ b/resources/qml/Widgets/SingleSettingTextField.qml @@ -0,0 +1,188 @@ +// Copyright (c) 2022 UltiMaker +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.3 + +import UM 1.7 as UM +import Cura 1.7 as Cura + +// This text field allows you to edit a single setting. The setting can be passed by "settingName". +// You must specify a validator with Validator. We store our default setting validators in qml/Validators +// If the setting is limited to a single extruder or is settable with different values per extruder use "updateAllExtruders: true" +UM.TextField +{ + id: control + property alias settingName: propertyProvider.key + + // If true, all extruders will have "settingName" property updated. + // The displayed value will be read from the extruder with index "defaultExtruderIndex" instead of the machine. + property bool updateAllExtruders: false + // This is only used if updateAllExtruders == true + property int defaultExtruderIndex: 0 + + // Resolving the value in the textField. + Binding + { + target: control + property: "text" + + value: + { + if (control.activeFocus) + { + // This stops the text being reformatted as you edit. For example "10.1" -Edit-> "10." -Auto Format-> "10.0". + return control.text + } + + if (( propertyProvider.properties.resolve != "None" && propertyProvider.properties.resolve) && ( propertyProvider.properties.stackLevels[0] != 0) && ( propertyProvider.properties.stackLevels[0] != 1)) + { + // We have a resolve function. Indicates that the setting is not settable per extruder and that + // we have to choose between the resolved value (default) and the global value + // (if user has explicitly set this). + return base.resolve + } + + return propertyProvider.properties.value + } + + } + + property UM.SettingPropertyProvider propertyProvider: UM.SettingPropertyProvider + { + id: propertyProvider + watchedProperties: ["value", "validationState", "resolve"] + containerStackId: updateAllExtruders ? Cura.ExtruderManager.extruderIds[defaultExtruderIndex] : Cura.MachineManager.activeMachine.id + } + + Connections + { + target: propertyProvider + function onContainerStackChanged() + { + updateTimer.restart() + } + function onIsValueUsedChanged() + { + updateTimer.restart() + } + } + + // Restart update timer right after releasing a key. This stops lag while typing, but you still get warning and error + // textfield styling while typing. + Keys.onReleased: updateTimer.restart() + // Forces formatting when you finish editing "10.1" -Edit-> "10." -Focus Change-> "10" + onActiveFocusChanged: updateTimer.restart() + + // Updates to the setting are delayed by interval. This stops lag caused by calling the + // parseValueUpdateSetting() function being called repeatedly while changing the text value. + Timer + { + id: updateTimer + interval: 50 + repeat: false + onTriggered: parseValueUpdateSetting() + } + + function parseValueUpdateSetting() + { + if (propertyProvider.properties.value === text || (parseFloat(propertyProvider.properties.value) === parseFloat(text))) + { + // Don't set the property value from the control. It already has the same value + return + } + + if (propertyProvider && text !== propertyProvider.properties.value) + { + updateSetting(text); + } + } + + function updateSetting(value) + { + if (updateAllExtruders) + { + Cura.MachineManager.setSettingForAllExtruders(propertyProvider.key, "value", value) + } + else + { + propertyProvider.setPropertyValue("value", text) + } + } + + // Forced to override parent states using overrideState. Otherwise hover in TextField.qml would override the validation states. + // The first state to evaluate true applies styling. States in inheriting components get appended to the state list of their parent. + overrideState: true + states: + [ + State + { + name: "validationError" + when: propertyProvider.properties.validationState === "ValidatorState.Exception" || propertyProvider.properties.validationState === "ValidatorState.MinimumError" || propertyProvider.properties.validationState === "ValidatorState.MaximumError" + PropertyChanges + { + target: background + liningColor: UM.Theme.getColor("setting_validation_error") + color: UM.Theme.getColor("setting_validation_error_background") + } + }, + State + { + name: "validationWarning" + when: propertyProvider.properties.validationState === "ValidatorState.MinimumWarning" || propertyProvider.properties.validationState === "ValidatorState.MaximumWarning" + PropertyChanges + { + target: background + liningColor: UM.Theme.getColor("setting_validation_warning") + color: UM.Theme.getColor("setting_validation_warning_background") + } + }, + State + { + name: "disabled" + when: !control.enabled + PropertyChanges + { + target: control + color: UM.Theme.getColor("text_field_text_disabled") + } + PropertyChanges + { + target: background + liningColor: UM.Theme.getColor("text_field_border_disabled") + } + }, + State + { + name: "invalid" + when: !control.acceptableInput + PropertyChanges + { + target: background + color: UM.Theme.getColor("setting_validation_error_background") + } + }, + State + { + name: "active" + when: control.activeFocus + PropertyChanges + { + target: background + liningColor: UM.Theme.getColor("text_field_border_active") + borderColor: UM.Theme.getColor("text_field_border_active") + } + }, + State + { + name: "hovered" + when: control.hovered && !control.activeFocus + PropertyChanges + { + target: background + liningColor: UM.Theme.getColor("text_field_border_hovered") + } + } + ] +} diff --git a/resources/qml/Widgets/TextField.qml b/resources/qml/Widgets/TextField.qml index 085c7b7742..f16d4abb11 100644 --- a/resources/qml/Widgets/TextField.qml +++ b/resources/qml/Widgets/TextField.qml @@ -4,87 +4,12 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.5 as UM +import UM 1.7 as UM import Cura 1.1 as Cura - -// -// Cura-style TextField -// -TextField +UM.TextField { id: control - - property alias leftIcon: iconLeft.source - height: UM.Theme.getSize("setting_control").height - - hoverEnabled: true - selectByMouse: true - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text_field_text") - selectedTextColor: UM.Theme.getColor("text_field_text") - placeholderTextColor: UM.Theme.getColor("text_field_text_disabled") - renderType: Text.NativeRendering - selectionColor: UM.Theme.getColor("text_selection") - leftPadding: iconLeft.visible ? iconLeft.width + UM.Theme.getSize("default_margin").width * 2 : UM.Theme.getSize("thin_margin").width - - states: [ - State - { - name: "disabled" - when: !control.enabled - PropertyChanges { target: control; color: UM.Theme.getColor("text_field_text_disabled")} - PropertyChanges { target: backgroundRectangle; liningColor: UM.Theme.getColor("text_field_border_disabled")} - }, - State - { - name: "invalid" - when: !control.acceptableInput - PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_validation_error_background")} - }, - State - { - name: "active" - when: control.activeFocus - PropertyChanges - { - target: backgroundRectangle - liningColor: UM.Theme.getColor("text_field_border_active") - borderColor: UM.Theme.getColor("text_field_border_active") - } - }, - State - { - name: "hovered" - when: control.hovered && !control.activeFocus - PropertyChanges - { - target: backgroundRectangle - liningColor: UM.Theme.getColor("text_field_border_hovered") - } - } - ] - - background: UM.UnderlineBackground - { - id: backgroundRectangle - //Optional icon added on the left hand side. - UM.ColorImage - { - id: iconLeft - - anchors - { - verticalCenter: parent.verticalCenter - left: parent.left - leftMargin: UM.Theme.getSize("default_margin").width - } - - visible: source != "" - height: UM.Theme.getSize("small_button_icon").height - width: visible ? height : 0 - color: control.color - } - } + leftPadding: UM.Theme.getSize("thin_margin").width } diff --git a/resources/qml/qmldir b/resources/qml/qmldir index d5184f1d8c..8fce82c858 100644 --- a/resources/qml/qmldir +++ b/resources/qml/qmldir @@ -19,7 +19,6 @@ SettingView 1.0 SettingView.qml ProfileMenu 1.0 ProfileMenu.qml PrintSelectorCard 1.0 PrintSelectorCard.qml - # Cura/WelcomePages WizardPanel 1.0 WizardPanel.qml @@ -38,6 +37,11 @@ ScrollView 1.0 ScrollView.qml Menu 1.0 Menu.qml MenuItem 1.0 MenuItem.qml MenuSeparator 1.0 MenuSeparator.qml +SingleSettingExtruderSelectorBar 1.7 SingleSettingExtruderSelectorBar.qml +ExtruderButton 1.7 ExtruderButton.qml +SingleSettingComboBox 1.7 SingleSettingComboBox.qml +SingleSettingSlider 1.7 SingleSettingSlider.qml +SingleSettingTextField 1.7 SingleSettingTextField.qml # Cura/MachineSettings diff --git a/resources/themes/cura-light/icons/default/Hammer.svg b/resources/themes/cura-light/icons/default/Hammer.svg new file mode 100644 index 0000000000..c32f27a0e2 --- /dev/null +++ b/resources/themes/cura-light/icons/default/Hammer.svg @@ -0,0 +1,3 @@ + + + diff --git a/resources/themes/cura-light/icons/default/PrintWalls.svg b/resources/themes/cura-light/icons/default/PrintWalls.svg new file mode 100644 index 0000000000..f582a5599d --- /dev/null +++ b/resources/themes/cura-light/icons/default/PrintWalls.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 22986b3d68..ad32573288 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -172,6 +172,26 @@ "size": 0.9, "weight": 700, "family": "Noto Sans" + }, + "tiny_emphasis": { + "size": 0.7, + "weight": 700, + "family": "Noto Sans" + }, + "tiny_emphasis_ja_JP": { + "size": 0.7, + "weight": 700, + "family": "Noto Sans" + }, + "tiny_emphasis_zh_CN": { + "size": 0.7, + "weight": 700, + "family": "Noto Sans" + }, + "tiny_emphasis_zh_TW": { + "size": 0.7, + "weight": 700, + "family": "Noto Sans" } }, @@ -354,6 +374,10 @@ "checkbox_text": "text_default", "checkbox_text_disabled": "text_disabled", + "switch": "background_1", + "switch_state_checked": "accent_1", + "switch_state_unchecked": "text_disabled", + "radio": "background_1", "radio_disabled": "background_2", "radio_selected": "accent_1", @@ -486,9 +510,9 @@ "print_setup_widget": [38.0, 30.0], "print_setup_extruder_box": [0.0, 6.0], - "print_setup_slider_groove": [0.16, 0.16], - "print_setup_slider_handle": [1.0, 1.0], - "print_setup_slider_tickmarks": [0.32, 0.32], + "slider_widget_groove": [0.16, 0.16], + "slider_widget_handle": [1.3, 1.3], + "slider_widget_tickmarks": [0.5, 0.5], "print_setup_big_item": [28, 2.5], "print_setup_icon": [1.2, 1.2], "drag_icon": [1.416, 0.25], @@ -649,6 +673,8 @@ "recommended_button_icon": [1.7, 1.7], + "recommended_section_setting_item": [14.0, 2.0], + "reset_profile_icon": [1, 1] } } diff --git a/tests/conftest.py b/tests/conftest.py index efe9141e29..377a525ba7 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -6,6 +6,7 @@ from unittest.mock import MagicMock, patch import pytest +from UM.Application import Application from UM.Qt.QtApplication import QtApplication # QtApplication import is required, even though it isn't used. from cura.CuraApplication import CuraApplication @@ -22,6 +23,12 @@ def application() -> CuraApplication: app = MagicMock() return app +@pytest.fixture() +def um_application() -> Application: + app = MagicMock() + app.getInstance = MagicMock(return_value=app) + return app + # Returns a MachineActionManager instance. @pytest.fixture() @@ -43,14 +50,15 @@ def container_registry(application, global_stack) -> ContainerRegistry: @pytest.fixture() -def extruder_manager(application, container_registry) -> ExtruderManager: +def extruder_manager(application, um_application, container_registry) -> ExtruderManager: if ExtruderManager.getInstance() is not None: # Reset the data ExtruderManager._ExtruderManager__instance = None with patch("cura.CuraApplication.CuraApplication.getInstance", MagicMock(return_value=application)): with patch("UM.Settings.ContainerRegistry.ContainerRegistry.getInstance", MagicMock(return_value=container_registry)): - manager = ExtruderManager() + with patch("UM.Application.Application.getInstance", um_application): + manager = ExtruderManager() return manager