Merge branch 'main' into CURA-8890-hole-horizontal-expansion-max-diameter

This commit is contained in:
Rijk van Manen 2023-02-23 16:22:03 +01:00
commit 26a8d4790e
6953 changed files with 335715 additions and 325775 deletions

33
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,33 @@
# Description
<!-- Please include a summary of which issue is fixed or feature was added. Please also include relevant motivation and context.
If this pull request adds settings definitions for machines/materials, list them here.
This fixes... OR This improves... -->
## Type of change
<!-- Please delete options that are not relevant. -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Printer definition file(s)
- [ ] Translations
# How Has This Been Tested?
<!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration -->
- [ ] Test A
- [ ] Test B
**Test Configuration**:
* Operating System:
# Checklist:
<!-- Check if relevant -->
- [ ] My code follows the style guidelines of this project as described in [UltiMaker Meta](https://github.com/Ultimaker/Meta) and [Cura QML best practices](https://github.com/Ultimaker/Cura/wiki/QML-Best-Practices)
- [ ] I have read the [Contribution guide](https://github.com/Ultimaker/Cura/blob/main/contributing.md)
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have uploaded any files required to test this change

View file

@ -7,13 +7,18 @@ on:
required: true
type: string
recipe_id_full:
required: true
type: string
build_id:
required: true
type: number
recipe_id_full:
required: true
type: string
build_info:
required: false
default: true
type: boolean
recipe_id_latest:
required: false
@ -45,11 +50,6 @@ on:
default: true
type: boolean
create_from_source:
required: false
default: false
type: boolean
env:
CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
@ -75,7 +75,8 @@ jobs:
cache-dependency-path: .github/workflows/requirements-conan-package.txt
- name: Install Python requirements for runner
run: pip install -r .github/workflows/requirements-conan-package.txt
run: pip install -r https://raw.githubusercontent.com/Ultimaker/Cura/main/.github/workflows/requirements-conan-package.txt
# Note the runner requirements are always installed from the main branch in the Ultimaker/Cura repo
- name: Use Conan download cache (Bash)
if: ${{ runner.os != 'Windows' }}
@ -92,7 +93,7 @@ jobs:
path: |
$HOME/.conan/data
$HOME/.conan/conan_download_cache
key: conan-${{ runner.os }}-${{ runner.arch }}-create-cache
key: conan-${{ inputs.runs_on }}-${{ runner.arch }}-create-cache
- name: Cache Conan local repository packages (Powershell)
uses: actions/cache@v3
@ -102,19 +103,23 @@ jobs:
C:\Users\runneradmin\.conan\data
C:\.conan
C:\Users\runneradmin\.conan\conan_download_cache
key: conan-${{ runner.os }}-${{ runner.arch }}-create-cache
key: conan-${{ inputs.runs_on }}-${{ runner.arch }}-create-cache
- name: Install MacOS system requirements
if: ${{ runner.os == 'Macos' }}
run: brew install autoconf automake ninja
# NOTE: Due to what are probably github issues, we have to remove the cache and reconfigure before the rest.
# This is maybe because grub caches the disk it uses last time, which is recreated each time.
- name: Install Linux system requirements
if: ${{ runner.os == 'Linux' }}
run: |
sudo rm /var/cache/debconf/config.dat
sudo dpkg --configure -a
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt update
sudo apt upgrade
sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev pkg-config -y
sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev pkg-config flex bison -y
- name: Install GCC-12 on ubuntu-22.04
if: ${{ startsWith(inputs.runs_on, 'ubuntu-22.04') }}
@ -140,34 +145,48 @@ jobs:
if: ${{ inputs.conan_config_branch == '' }}
run: conan config install https://github.com/Ultimaker/conan-config.git
- name: Create the Packages
if: ${{ !inputs.create_from_source }}
- name: Create the lock file
if: ${{ inputs.build_info }}
run: |
conan_build_info --v2 start ${{ inputs.project_name }} ${{ github.run_number }}000${{ inputs.build_id }}
conan lock create --reference ${{ inputs.recipe_id_full }} --build=missing --update
conan install ${{ inputs.recipe_id_full }} --build=missing --update --lockfile=conan.lock
conan_build_info --v2 create buildinfo.json --lockfile conan.lock --user ${{ secrets.CONAN_USER }} --password ${{ secrets.CONAN_PASS }}
conan_build_info --v2 publish buildinfo.json --url https://ultimaker.jfrog.io/artifactory --user ${{ secrets.CONAN_USER }} --password ${{ secrets.CONAN_PASS }}
conan_build_info --v2 stop
conan lock create --reference ${{ inputs.recipe_id_full }} --lockfile-out=conan.lock
- name: Create the Packages (from source)
if: ${{ inputs.create_from_source }}
run: conan create . ${{ inputs.recipe_id_full }} --build=missing --update
- name: Create the Packages using lockfile
if: ${{ inputs.build_info }}
run: conan install ${{ inputs.recipe_id_full }} --build=missing --update --lockfile=conan.lock --lockfile-out=conan.lock
- name: Remove the latest alias
if: ${{ inputs.create_from_source && inputs.recipe_id_latest != '' && runner.os == 'Linux' }}
run: |
conan remove ${{ inputs.recipe_id_latest }} -r cura -f || true
conan remove ${{ inputs.recipe_id_latest }} -r cura-ce -f || true
- name: Create the Packages
if: ${{ ! inputs.build_info }}
run: conan install ${{ inputs.recipe_id_full }} --build=missing --update
- name: Create the latest alias
if: ${{ inputs.create_from_source && inputs.recipe_id_latest != '' && always() }}
run: conan alias ${{ inputs.recipe_id_latest }} ${{ inputs.recipe_id_full }}
- name: Create the build info
if: ${{ inputs.build_info }}
run: conan_build_info --v2 create buildinfo.json --lockfile conan.lock --user ${{ secrets.CONAN_USER }} --password ${{ secrets.CONAN_PASS }}
- name: Upload the Package(s)
if: always()
run: conan upload "*" -r cura --all -c
- name: Upload the build info
if: ${{ inputs.build_info }}
run: |
conan_build_info --v2 publish buildinfo.json --url https://ultimaker.jfrog.io/artifactory --user ${{ secrets.CONAN_USER }} --password ${{ secrets.CONAN_PASS }}
conan_build_info --v2 stop
- name: Upload the Package(s) community
if: ${{ always() && inputs.conan_upload_community == true }}
run: conan upload "*" -r cura-ce -c
- name: Upload the log and build artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: log-${{ inputs.runs_on }}-${{ runner.arch }}
path: |
buildinfo.json
conan.lock
conanbuildinfo.txt
conaninfo.txt
graph_info.json
build/**
retention-days: 1

View file

@ -7,110 +7,149 @@ name: conan-package
# It should run on pushes against main or CURA-* branches, but it will only create the binaries for main and release branches
on:
workflow_dispatch:
inputs:
create_binaries_windows:
required: true
default: false
description: 'create binaries Windows'
create_binaries_linux:
required: true
default: false
description: 'create binaries Linux'
create_binaries_macos:
required: true
default: false
description: 'create binaries Macos'
workflow_dispatch:
inputs:
create_binaries_windows:
required: true
default: false
description: 'create binaries Windows'
create_binaries_linux:
required: true
default: false
description: 'create binaries Linux'
create_binaries_macos:
required: true
default: false
description: 'create binaries Macos'
push:
paths:
- 'plugins/**'
- 'resources/**'
- 'cura/**'
- 'icons/**'
- 'tests/**'
- 'packaging/**'
- '.github/workflows/conan-*.yml'
- '.github/workflows/notify.yml'
- '.github/workflows/requirements-conan-package.txt'
- 'requirements*.txt'
- 'conanfile.py'
- 'conandata.yml'
- 'GitVersion.yml'
- '*.jinja'
branches:
- main
- 'CURA-*'
- '[1-9].[0-9]'
- '[1-9].[0-9][0-9]'
tags:
- '[1-9].[0-9].[0-9]*'
- '[1-9].[0-9].[0-9]'
- '[1-9].[0-9][0-9].[0-9]*'
push:
paths:
- 'plugins/**'
- 'resources/**'
- 'cura/**'
- 'icons/**'
- 'tests/**'
- 'packaging/**'
- '.github/workflows/conan-*.yml'
- '.github/workflows/notify.yml'
- '.github/workflows/requirements-conan-package.txt'
- 'requirements*.txt'
- 'conanfile.py'
- 'conandata.yml'
- 'GitVersion.yml'
- '*.jinja'
branches:
- main
- 'CURA-*'
- '[1-9].[0-9]'
- '[1-9].[0-9][0-9]'
tags:
- '[1-9].[0-9].[0-9]*'
- '[1-9].[0-9].[0-9]'
- '[1-9].[0-9][0-9].[0-9]*'
env:
CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
CONAN_LOGIN_USERNAME_CURA_CE: ${{ secrets.CONAN_USER }}
CONAN_PASSWORD_CURA_CE: ${{ secrets.CONAN_PASS }}
CONAN_LOG_RUN_TO_OUTPUT: 1
CONAN_LOGGING_LEVEL: ${{ inputs.conan_logging_level }}
CONAN_NON_INTERACTIVE: 1
permissions: {}
jobs:
conan-recipe-version:
permissions:
contents: read
conan-recipe-version:
permissions:
contents: read
uses: ultimaker/cura/.github/workflows/conan-recipe-version.yml@main
uses: ultimaker/cura/.github/workflows/conan-recipe-version.yml@main
with:
project_name: cura
conan-package-create-linux:
needs: [ conan-recipe-version ]
runs-on: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python and pip
uses: actions/setup-python@v4
with:
project_name: cura
python-version: '3.10.x'
cache: 'pip'
cache-dependency-path: .github/workflows/requirements-conan-package.txt
conan-package-export:
permissions:
contents: read
- name: Install Python requirements for runner
run: pip install -r https://raw.githubusercontent.com/Ultimaker/Cura/main/.github/workflows/requirements-conan-package.txt
# Note the runner requirements are always installed from the main branch in the Ultimaker/Cura repo
needs: [ conan-recipe-version ]
uses: ultimaker/cura/.github/workflows/conan-recipe-export.yml@main
- name: Use Conan download cache (Bash)
if: ${{ runner.os != 'Windows' }}
run: conan config set storage.download_cache="$HOME/.conan/conan_download_cache"
- name: Cache Conan local repository packages (Bash)
uses: actions/cache@v3
with:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }}
runs_on: 'ubuntu-20.04'
python_version: '3.10.x'
conan_logging_level: 'info'
secrets: inherit
path: |
$HOME/.conan/data
$HOME/.conan/conan_download_cache
key: conan-ubuntu-${{ runner.arch }}-create-cache
conan-package-create-linux:
permissions:
contents: read
# NOTE: Due to what are probably github issues, we have to remove the cache and reconfigure before the rest.
# This is maybe because grub caches the disk it uses last time, which is recreated each time.
- name: Install Linux system requirements
if: ${{ runner.os == 'Linux' }}
run: |
sudo rm /var/cache/debconf/config.dat
sudo dpkg --configure -a
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt update
sudo apt upgrade
sudo apt install efibootmgr build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev pkg-config flex bison -y
if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || (github.event_name == 'workflow_dispatch' && inputs.create_binaries_linux) }}
needs: [ conan-recipe-version, conan-package-export ]
- name: Install GCC-12
run: |
sudo apt install g++-12 gcc-12 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12
uses: ultimaker/cura/.github/workflows/conan-package-create.yml@main
with:
project_name: cura
build_id: 1
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
runs_on: 'ubuntu-20.04'
python_version: '3.10.x'
conan_logging_level: 'info'
secrets: inherit
- name: Create the default Conan profile
run: conan profile new default --detect
notify-export:
if: ${{ always() }}
needs: [ conan-recipe-version, conan-package-export ]
- name: Get Conan configuration
run: conan config install https://github.com/Ultimaker/conan-config.git
uses: ultimaker/cura/.github/workflows/notify.yml@main
with:
success: ${{ contains(join(needs.*.result, ','), 'success') }}
success_title: "New Conan recipe exported in ${{ github.repository }}"
success_body: "Exported ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
failure_title: "Failed to export Conan Export in ${{ github.repository }}"
failure_body: "Failed to exported ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
secrets: inherit
- name: Create the Packages using lockfile
run: conan create . ${{ needs.conan-recipe-version.outputs.recipe_id_full }} --build=missing --update -o ${{ needs.conan-recipe-version.outputs.project_name }}:devtools=True
notify-create:
if: ${{ always() && ((github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || (github.event_name == 'workflow_dispatch' && inputs.create_binaries_linux)) }}
needs: [ conan-recipe-version, conan-package-create-linux ]
- name: Remove the latest alias
if: ${{ needs.conan-recipe-version.outputs.recipe_id_latest != '' }}
run: |
conan remove ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} -r cura -f || true
conan remove ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} -r cura-ce -f || true
uses: ultimaker/cura/.github/workflows/notify.yml@main
with:
success: ${{ contains(join(needs.*.result, ','), 'success') }}
success_title: "New binaries created in ${{ github.repository }}"
success_body: "Created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
failure_title: "Failed to create binaries in ${{ github.repository }}"
failure_body: "Failed to created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
secrets: inherit
- name: Create the latest alias
if: ${{ needs.conan-recipe-version.outputs.recipe_id_latest != '' && always() }}
run: conan alias ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
- name: Upload the Package(s)
if: always()
run: |
conan upload "*" -r cura --all -c
conan upload "*" -r cura-ce -c
notify-create:
if: ${{ always() && (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) }}
needs: [ conan-recipe-version, conan-package-create-linux ]
uses: ultimaker/cura/.github/workflows/notify.yml@main
with:
success: ${{ contains(join(needs.*.result, ','), 'success') }}
success_title: "New binaries created in ${{ github.repository }}"
success_body: "Created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
failure_title: "Failed to create binaries in ${{ github.repository }}"
failure_body: "Failed to created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
secrets: inherit

View file

@ -62,8 +62,9 @@ jobs:
- name: Install Python requirements and Create default Conan profile
run: |
pip install -r .github/workflows/requirements-conan-package.txt
pip install -r https://raw.githubusercontent.com/Ultimaker/Cura/main/.github/workflows/requirements-conan-package.txt
conan profile new default --detect
# Note the runner requirements are always installed from the main branch in the Ultimaker/Cura repo
- name: Cache Conan local repository packages
uses: actions/cache@v3

View file

@ -7,6 +7,11 @@ on:
required: true
type: string
user:
required: false
default: ultimaker
type: string
additional_buildmetadata:
required: false
default: ""
@ -29,14 +34,18 @@ on:
description: "is current branch a release branch?"
value: ${{ jobs.get-semver.outputs.release_branch }}
recipe_user:
user:
description: "The conan user"
value: ${{ jobs.get-semver.outputs.user }}
recipe_channel:
channel:
description: "The conan channel"
value: ${{ jobs.get-semver.outputs.channel }}
project_name:
description: "The conan projectname"
value: ${{ inputs.project_name }}
jobs:
get-semver:
@ -63,8 +72,7 @@ jobs:
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.base_ref }}
- name: Setup Python and pip
uses: actions/setup-python@v4
@ -82,12 +90,13 @@ jobs:
name: Get Conan broadcast data
run: |
import subprocess
import os
from conans import tools
from conans.errors import ConanException
from git import Repo
repo = Repo('.')
user = "${{ github.repository_owner }}".lower()
user = "${{ inputs.user }}".lower()
project_name = "${{ inputs.project_name }}"
event_name = "${{ github.event_name }}"
issue_number = "${{ github.ref }}".split('/')[2]
@ -115,7 +124,7 @@ jobs:
elif ref_name in ("main", "master"):
channel = 'testing'
else:
channel = repo.active_branch.name.split("_")[0].replace("-", "_").lower()
channel = "_".join(repo.active_branch.name.replace("-", "_").split("_")[:2]).lower()
if "pull_request" in event_name:
channel = f"pr_{issue_number}"
@ -130,7 +139,8 @@ jobs:
version = tools.Version(tag)
except ConanException:
continue
if version > latest_branch_version:
if version > latest_branch_version and version < tools.Version("10.0.0"):
# FIXME: stupid old Cura tags 13.04 etc. keep popping up
latest_branch_version = version
latest_branch_tag = repo.tag(tag)
@ -154,7 +164,9 @@ jobs:
else:
channel_metadata = f"{channel}_{no_commits}"
if is_release_branch:
if latest_branch_version.prerelease == "":
if latest_branch_version.prerelease == "" and branch_version > latest_branch_version:
actual_version = f"{branch_version.major}.{branch_version.minor}.0-beta.1+{buildmetadata}{channel_metadata}"
elif latest_branch_version.prerelease == "":
# An actual full release has been created, we are working on patch
bump_up_patch = int(latest_branch_version.patch) + 1
actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{bump_up_patch}-beta.1+{buildmetadata}{channel_metadata}"
@ -163,34 +175,47 @@ jobs:
bump_up_release_tag = int(latest_branch_version.prerelease.split('.')[1]) + 1
actual_version = f"{latest_branch_version.major}.{latest_branch_version.minor}.{latest_branch_version.patch}-{latest_branch_version.prerelease.split('.')[0]}.{bump_up_release_tag}+{buildmetadata}{channel_metadata}"
else:
bump_up_minor = int(latest_branch_version.minor) + 1
reset_patch = 0
actual_version = f"{latest_branch_version.major}.{bump_up_minor}.{reset_patch}-alpha+{buildmetadata}{channel_metadata}"
max_branches_version = tools.Version("0.0.0")
branches_no_commits = no_commits
for branch in repo.references:
try:
if "remotes/origin" in branch.abspath:
b_version = tools.Version(branch.name.split("/")[-1])
if b_version < tools.Version("10.0.0") and b_version > max_branches_version:
max_branches_version = b_version
branches_no_commits = repo.commit().count() - branch.commit.count()
except:
pass
if max_branches_version > latest_branch_version:
actual_version = f"{max_branches_version.major}.{int(max_branches_version.minor) + 1}.0-alpha+{buildmetadata}{channel}_{branches_no_commits}"
else:
actual_version = f"{latest_branch_version.major}.{int(latest_branch_version.minor) + 1}.0-alpha+{buildmetadata}{channel_metadata}"
# %% print to output
cmd_name = ["echo", f"::set-output name=name::{project_name}"]
subprocess.call(cmd_name)
cmd_version = ["echo", f"::set-output name=version::{actual_version}"]
subprocess.call(cmd_version)
cmd_channel = ["echo", f"::set-output name=channel::{channel}"]
subprocess.call(cmd_channel)
cmd_id_full= ["echo", f"::set-output name=recipe_id_full::{project_name}/{actual_version}@{user}/{channel}"]
subprocess.call(cmd_id_full)
cmd_id_latest = ["echo", f"::set-output name=recipe_id_latest::{project_name}/latest@{user}/{channel}"]
subprocess.call(cmd_id_latest)
cmd_semver_full = ["echo", f"::set-output name=semver_full::{actual_version}"]
subprocess.call(cmd_semver_full)
cmd_is_release_branch = ["echo", f"::set-output name=is_release_branch::{str(is_release_branch).lower()}"]
subprocess.call(cmd_is_release_branch)
# %% Set the environment output
output_env = os.environ["GITHUB_OUTPUT"]
content = ""
if os.path.exists(output_env):
with open(output_env, "r") as f:
content = f.read()
print("::group::Conan Recipe Information")
print(f"name = {project_name}")
print(f"version = {actual_version}")
print(f"user = {user}")
print(f"channel = {channel}")
print(f"= {project_name}/{actual_version}@{user}/{channel}")
print(f"recipe_id_latest = {project_name}/latest@{user}/{channel}")
print(f"semver_full = {actual_version}")
print(f"is_release_branch = {str(is_release_branch).lower()}")
print("::endgroup::")
with open(output_env, "w") as f:
f.write(content)
f.writelines(f"name={project_name}\n")
f.writelines(f"version={actual_version}\n")
f.writelines(f"channel={channel}\n")
f.writelines(f"recipe_id_full={project_name}/{actual_version}@{user}/{channel}\n")
f.writelines(f"recipe_id_latest={project_name}/latest@{user}/{channel}\n")
f.writelines(f"semver_full={actual_version}\n")
f.writelines(f"is_release_branch={str(is_release_branch).lower()}\n")
summary_env = os.environ["GITHUB_STEP_SUMMARY"]
with open(summary_env, "w") as f:
f.writelines(f"# {project_name}\n")
f.writelines(f"name={project_name}\n")
f.writelines(f"version={actual_version}\n")
f.writelines(f"channel={channel}\n")
f.writelines(f"recipe_id_full={project_name}/{actual_version}@{user}/{channel}\n")
f.writelines(f"recipe_id_latest={project_name}/latest@{user}/{channel}\n")
f.writelines(f"semver_full={actual_version}\n")
f.writelines(f"is_release_branch={str(is_release_branch).lower()}\n")
shell: python

View file

@ -0,0 +1,151 @@
name: Cura All Installers
run-name: ${{ inputs.cura_conan_version }} for exe ${{ inputs.build_windows_exe }}, msi ${{ inputs.build_windows_msi }}, dmg ${{ inputs.build_macos }}, pkg ${{ inputs.build_macos_installer }}, appimage ${{ inputs.build_linux }} - enterprise ${{ inputs.enterprise }}
on:
workflow_dispatch:
inputs:
cura_conan_version:
description: 'Cura Conan Version'
default: 'cura/latest@ultimaker/testing'
required: true
type: string
conan_args:
description: 'Conan args: eq.: --require-override'
default: ''
required: false
type: string
conan_config:
description: 'Conan config branch to use'
default: ''
required: false
type: string
enterprise:
description: 'Build Cura as an Enterprise edition'
default: false
required: true
type: boolean
staging:
description: 'Use staging API'
default: false
required: true
type: boolean
installer:
description: 'Create the installer'
default: true
required: true
type: boolean
build_windows_exe:
description: 'Build for Windows exe'
default: false
required: true
type: boolean
build_windows_msi:
description: 'Build for msi+pkg'
default: true
required: true
type: boolean
build_linux:
description: 'Build for Linux'
default: true
required: true
type: boolean
build_macos:
description: 'Build dmg for MacOS'
default: true
required: true
type: boolean
# Run the nightly at 3:25 UTC on working days
schedule:
- cron: '25 3 * * 1-5'
jobs:
windows-installer-create-exe:
if: ${{ inputs.build_windows_exe }}
uses: ./.github/workflows/cura-installer.yml
with:
platform: 'windows-2022'
os_name: 'win64'
cura_conan_version: ${{ inputs.cura_conan_version }}
conan_args: ${{ inputs.conan_args }}
conan_config: ${{ inputs.conan_config }}
enterprise: ${{ inputs.enterprise }}
staging: ${{ inputs.staging }}
installer: ${{ inputs.installer }}
msi_installer: false
secrets: inherit
windows-installer-create-msi:
if: ${{ inputs.build_windows_msi }}
uses: ./.github/workflows/cura-installer.yml
with:
platform: 'windows-2022'
os_name: 'win64'
cura_conan_version: ${{ inputs.cura_conan_version }}
conan_args: ${{ inputs.conan_args }}
conan_config: ${{ inputs.conan_config }}
enterprise: ${{ inputs.enterprise }}
staging: ${{ inputs.staging }}
installer: ${{ inputs.installer }}
msi_installer: true
secrets: inherit
linux-installer-create:
if: ${{ inputs.build_linux }}
uses: ./.github/workflows/cura-installer.yml
with:
platform: 'ubuntu-20.04'
os_name: 'linux'
cura_conan_version: ${{ inputs.cura_conan_version }}
conan_args: ${{ inputs.conan_args }}
conan_config: ${{ inputs.conan_config }}
enterprise: ${{ inputs.enterprise }}
staging: ${{ inputs.staging }}
installer: ${{ inputs.installer }}
msi_installer: false
secrets: inherit
linux-modern-installer-create:
if: ${{ inputs.build_linux }}
uses: ./.github/workflows/cura-installer.yml
with:
platform: 'ubuntu-22.04'
os_name: 'linux-modern'
cura_conan_version: ${{ inputs.cura_conan_version }}
conan_args: ${{ inputs.conan_args }}
conan_config: ${{ inputs.conan_config }}
enterprise: ${{ inputs.enterprise }}
staging: ${{ inputs.staging }}
installer: ${{ inputs.installer }}
msi_installer: false
secrets: inherit
macos-dmg-create:
if: ${{ inputs.build_macos }}
uses: ./.github/workflows/cura-installer.yml
with:
platform: 'macos-11'
os_name: 'mac'
cura_conan_version: ${{ inputs.cura_conan_version }}
conan_args: ${{ inputs.conan_args }}
conan_config: ${{ inputs.conan_config }}
enterprise: ${{ inputs.enterprise }}
staging: ${{ inputs.staging }}
installer: ${{ inputs.installer }}
msi_installer: false
secrets: inherit
macos-installer-create:
if: ${{ inputs.build_macos }}
uses: ./.github/workflows/cura-installer.yml
with:
platform: 'macos-11'
os_name: 'mac'
cura_conan_version: ${{ inputs.cura_conan_version }}
conan_args: ${{ inputs.conan_args }}
conan_config: ${{ inputs.conan_config }}
enterprise: ${{ inputs.enterprise }}
staging: ${{ inputs.staging }}
installer: ${{ inputs.installer }}
msi_installer: true
secrets: inherit

View file

@ -1,41 +1,54 @@
name: Cura Installer
run-name: ${{ inputs.cura_conan_version }} by @${{ github.actor }}
run-name: ${{ inputs.cura_conan_version }} for ${{ inputs.platform }} by @${{ github.actor }}
on:
workflow_dispatch:
workflow_call:
inputs:
platform:
description: 'Selected Installer OS'
default: 'ubuntu-20.04'
required: true
type: string
os_name:
description: 'OS Friendly Name'
default: 'linux'
required: true
type: string
cura_conan_version:
description: 'Cura Conan Version'
default: 'cura/latest@ultimaker/testing'
required: true
type: string
conan_args:
description: 'Conan args: eq.: --require-override'
default: ''
required: false
type: string
conan_config:
description: 'Conan config branch to use'
default: ''
required: false
type: string
enterprise:
description: 'Build Cura as an Enterprise edition'
required: true
default: false
required: true
type: boolean
staging:
description: 'Use staging API'
required: true
default: false
required: true
type: boolean
installer:
description: 'Create the installer'
required: true
default: true
required: true
type: boolean
msi_installer:
description: 'Create the msi'
default: false
required: true
type: boolean
# Run the nightly at 3:25 UTC on working days
#FIXME: Provide the same default values as the workflow dispatch
schedule:
- cron: '25 3 * * 1-5'
env:
CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
@ -49,26 +62,19 @@ env:
MAC_NOTARIZE_USER: ${{ secrets.MAC_NOTARIZE_USER }}
MAC_NOTARIZE_PASS: ${{ secrets.MAC_NOTARIZE_PASS }}
MACOS_CERT_P12: ${{ secrets.MACOS_CERT_P12 }}
MACOS_CERT_PASS: ${{ secrets.MACOS_CERT_PASS }}
MACOS_CERT_INSTALLER_P12: ${{ secrets.MACOS_CERT_INSTALLER_P12 }}
MACOS_CERT_USER: ${{ secrets.MACOS_CERT_USER }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
MACOS_CERT_PASSPHRASE: ${{ secrets.MACOS_CERT_PASSPHRASE }}
WIN_CERT_INSTALLER_CER: ${{ secrets.WIN_CERT_INSTALLER_CER }}
WIN_CERT_INSTALLER_CER_PASS: ${{ secrets.WIN_CERT_INSTALLER_CER_PASS }}
CURA_CONAN_VERSION: ${{ inputs.cura_conan_version }}
ENTERPRISE: ${{ inputs.enterprise }}
STAGING: ${{ inputs.staging }}
jobs:
cura-installer-create:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { os: macos-11, os_id: 'mac' }
- { os: windows-2022, os_id: 'win64' }
- { os: ubuntu-20.04, os_id: 'linux' }
- { os: ubuntu-22.04, os_id: 'linux-modern' }
runs-on: ${{ inputs.platform }}
steps:
- name: Checkout
@ -82,7 +88,8 @@ jobs:
cache-dependency-path: .github/workflows/requirements-conan-package.txt
- name: Install Python requirements for runner
run: pip install -r .github/workflows/requirements-conan-package.txt
run: pip install -r https://raw.githubusercontent.com/Ultimaker/Cura/main/.github/workflows/requirements-conan-package.txt
# Note the runner requirements are always installed from the main branch in the Ultimaker/Cura repo
- name: Use Conan download cache (Bash)
if: ${{ runner.os != 'Windows' }}
@ -113,11 +120,19 @@ jobs:
- name: Install MacOS system requirements
if: ${{ runner.os == 'Macos' }}
run: brew install autoconf automake ninja create-dmg
run: brew install autoconf automake ninja create-dmg # Delete create-dmg when deprecating dmg
- name: Hack needed specifically for ubuntu-22.04 from mid-Feb 2023 onwards
if: ${{ runner.os == 'Linux' && startsWith(inputs.platform, 'ubuntu-22.04') }}
run: sudo apt remove libodbc2 libodbcinst2 unixodbc-common -y
# NOTE: Due to what are probably github issues, we have to remove the cache and reconfigure before the rest.
# This is maybe because grub caches the disk it uses last time, which is recreated each time.
- name: Install Linux system requirements
if: ${{ runner.os == 'Linux' }}
run: |
sudo rm /var/cache/debconf/config.dat
sudo dpkg --configure -a
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt update
sudo apt upgrade
@ -127,14 +142,14 @@ jobs:
echo "APPIMAGETOOL_LOCATION=$GITHUB_WORKSPACE/appimagetool" >> $GITHUB_ENV
- name: Install GCC-12 on ubuntu-22.04
if: ${{ startsWith(inputs.runs_on, 'ubuntu-22.04') }}
if: ${{ startsWith(inputs.platform, 'ubuntu-22.04') }}
run: |
sudo apt install g++-12 gcc-12 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12
- name: Use GCC-10 on ubuntu-20.04
if: ${{ startsWith(inputs.runs_on, 'ubuntu-20.04') }}
if: ${{ startsWith(inputs.platform, 'ubuntu-20.04') }}
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
@ -146,24 +161,42 @@ jobs:
if: ${{ runner.os == 'Linux' }}
run: echo -n "$GPG_PRIVATE_KEY" | base64 --decode | gpg --import
- name: Configure Macos keychain (Bash)
id: macos-keychain
- name: Configure Macos keychain Developer Cert(Bash)
id: macos-keychain-developer-cert
if: ${{ runner.os == 'Macos' }}
uses: apple-actions/import-codesign-certs@v1
with:
keychain-password: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }}
p12-file-base64: ${{ secrets.MACOS_CERT_P12 }}
p12-password: ${{ secrets.MACOS_CERT_PASSPHRASE }}
- name: Clean Conan local cache
if: ${{ inputs.conan_clean_local_cache }}
run: conan remove "*" -f
- name: Configure Macos keychain Installer Cert (Bash)
id: macos-keychain-installer-cert
if: ${{ runner.os == 'Macos' }}
uses: apple-actions/import-codesign-certs@v1
with:
keychain-password: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }}
create-keychain: false # keychain is created in previous use of action.
p12-file-base64: ${{ secrets.MACOS_CERT_INSTALLER_P12 }}
p12-password: ${{ secrets.MACOS_CERT_PASSPHRASE }}
- name: Create PFX certificate from BASE64_PFX_CONTENT secret
if: ${{ runner.os == 'Windows' }}
id: create-pfx
env:
PFX_CONTENT: ${{ secrets.WIN_CERT_INSTALLER_CER }}
run: |
$pfxPath = Join-Path -Path $env:RUNNER_TEMP -ChildPath "cert.pfx";
$encodedBytes = [System.Convert]::FromBase64String($env:PFX_CONTENT);
Set-Content $pfxPath -Value $encodedBytes -AsByteStream;
echo "PFX_PATH=$pfxPath" >> $env:GITHUB_OUTPUT;
- name: Get Conan configuration from branch
if: ${{ inputs.conan_config_branch != '' }}
run: conan config install https://github.com/Ultimaker/conan-config.git -a "-b ${{ inputs.conan_config_branch }}"
if: ${{ inputs.conan_config != '' }}
run: conan config install https://github.com/Ultimaker/conan-config.git -a "-b ${{ inputs.conan_config }}"
- name: Get Conan configuration
if: ${{ inputs.conan_config_branch == '' }}
if: ${{ inputs.conan_config == '' }}
run: conan config install https://github.com/Ultimaker/conan-config.git
- name: Create the Packages (Bash)
@ -183,6 +216,7 @@ jobs:
- name: Set Environment variables for Cura (Powershell)
if: ${{ runner.os == 'Windows' }}
run: |
echo "${Env:WIX}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
.\cura_inst\Scripts\activate_github_actions_env.ps1
.\cura_inst\Scripts\activate_github_actions_version_env.ps1
@ -190,7 +224,7 @@ jobs:
if: ${{ runner.os == 'Macos' }}
run: security unlock -p $TEMP_KEYCHAIN_PASSWORD signing_temp.keychain
env:
TEMP_KEYCHAIN_PASSWORD: ${{ steps.macos-keychain.outputs.keychain-password }}
TEMP_KEYCHAIN_PASSWORD: ${{ steps.macos-keychain-developer-cert.outputs.keychain-password }}
# FIXME: This is a workaround to ensure that we use and pack a shared library for OpenSSL 1.1.1l. We currently compile
# OpenSSL statically for CPython, but our Python Dependenies (such as PyQt6) require a shared library.
@ -213,45 +247,88 @@ jobs:
cp openssl/lib/*.lib ./cura_inst/Lib/
- name: Create the Cura dist
run: pyinstaller ./cura_inst/Ultimaker-Cura.spec
run: pyinstaller ./cura_inst/UltiMaker-Cura.spec
- name: Output the name file name and extension
id: filename
shell: python
run: |
import os
enterprise = "-Enterprise" if "${{ inputs.enterprise }}" == "true" else ""
installer_filename = f"UltiMaker-Cura-{os.getenv('CURA_VERSION_FULL')}{enterprise}-${{ inputs.os_name }}"
if "${{ runner.os }}" == "Windows":
installer_ext = "msi" if "${{ inputs.msi_installer }}" == "true" else "exe"
elif "${{ runner.os }}" == "macOS":
installer_ext = "pkg" if "${{ inputs.msi_installer }}" == "true" else "dmg"
else:
installer_ext = "AppImage"
output_env = os.environ["GITHUB_OUTPUT"]
content = ""
if os.path.exists(output_env):
with open(output_env, "r") as f:
content = f.read()
with open(output_env, "w") as f:
f.write(content)
f.writelines(f"INSTALLER_FILENAME={installer_filename}\n")
f.writelines(f"INSTALLER_EXT={installer_ext}\n")
f.writelines(f"FULL_INSTALLER_FILENAME={installer_filename}.{installer_ext}\n")
- name: Archive the artifacts (bash)
if: ${{ github.event.inputs.installer == 'false' && runner.os != 'Windows' }}
run: tar -zcf "./Ultimaker-Cura-$CURA_VERSION_FULL-${{ matrix.os_id }}.tar.gz" "./Ultimaker-Cura/"
if: ${{ !inputs.installer && runner.os != 'Windows' }}
run: tar -zcf "./${{ steps.filename.outputs.INSTALLER_FILENAME }}.tar.gz" "./UltiMaker-Cura/"
working-directory: dist
- name: Archive the artifacts (Powershell)
if: ${{ github.event.inputs.installer == 'false' && runner.os == 'Windows' }}
run: Compress-Archive -Path ".\Ultimaker-Cura" -DestinationPath ".\Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ matrix.os_id }}.zip"
if: ${{ !inputs.installer && runner.os == 'Windows' }}
run: Compress-Archive -Path ".\UltiMaker-Cura" -DestinationPath ".\${{ steps.filename.outputs.INSTALLER_FILENAME }}.zip"
working-directory: dist
- name: Create the Windows exe installer (Powershell)
if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Windows' }}
if: ${{ inputs.installer && runner.os == 'Windows' && !inputs.msi_installer }}
run: |
python ..\cura_inst\packaging\NSIS\create_windows_installer.py ../cura_inst . "Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ matrix.os_id }}.exe"
python ..\cura_inst\packaging\NSIS\create_windows_installer.py ../cura_inst . "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}"
working-directory: dist
- name: Create the Windows msi installer (Powershell)
if: ${{ inputs.installer && runner.os == 'Windows' && inputs.msi_installer }}
run: |
python ..\cura_inst\packaging\msi\create_windows_msi.py ..\cura_inst .\UltiMaker-Cura "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}" "$Env:CURA_APP_NAME"
working-directory: dist
- name: Sign the Windows exe installer (Powershell)
if: ${{ inputs.installer && runner.os == 'Windows' && !inputs.msi_installer }}
env:
PFX_PATH: ${{ steps.create-pfx.outputs.PFX_PATH }}
run: |
& "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe" sign /f $Env:PFX_PATH /p "$Env:WIN_CERT_INSTALLER_CER_PASS" /fd SHA256 /t http://timestamp.digicert.com "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}"
working-directory: dist
- name: Sign the Windows msi installer (Powershell)
if: ${{ inputs.installer && runner.os == 'Windows' && inputs.msi_installer }}
env:
PFX_PATH: ${{ steps.create-pfx.outputs.PFX_PATH }}
run: |
& "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe" sign /f $Env:PFX_PATH /p "$Env:WIN_CERT_INSTALLER_CER_PASS" /fd SHA256 /t http://timestamp.digicert.com "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}"
working-directory: dist
- name: Create the Linux AppImage (Bash)
if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Linux' }}
run: python ../cura_inst/packaging/AppImage/create_appimage.py ./Ultimaker-Cura $CURA_VERSION_FULL "Ultimaker-Cura-$CURA_VERSION_FULL-${{ matrix.os_id }}.AppImage"
if: ${{ inputs.installer && runner.os == 'Linux' }}
run: python ../cura_inst/packaging/AppImage/create_appimage.py ./UltiMaker-Cura $CURA_VERSION_FULL "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}"
working-directory: dist
- name: Create the MacOS dmg (Bash)
- name: Create the MacOS dmg and/or pkg (Bash)
if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Macos' }}
run: python ../cura_inst/packaging/dmg/dmg_sign_noterize.py ../cura_inst . "Ultimaker-Cura-$CURA_VERSION_FULL-${{ matrix.os_id }}.dmg"
run: python ../cura_inst/packaging/MacOS/build_macos.py ../cura_inst . $CURA_CONAN_VERSION "${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}" "$CURA_APP_NAME"
working-directory: dist
- name: Upload the artifacts
uses: actions/upload-artifact@v3
with:
name: Ultimaker-Cura-${{ env.CURA_VERSION_FULL }}-${{ matrix.os_id }}
name: ${{ steps.filename.outputs.INSTALLER_FILENAME }}-${{ steps.filename.outputs.INSTALLER_EXT }}
path: |
dist/*.tar.gz
dist/*.zip
dist/*.exe
dist/*.msi
dist/*.dmg
dist/*.AppImage
dist/${{ steps.filename.outputs.FULL_INSTALLER_FILENAME }}
dist/*.asc
retention-days: 5

View file

@ -0,0 +1,46 @@
name: printer-linter-format
on:
push:
paths:
- 'resources/definitions/**'
- 'resources/extruders/**'
- 'resources/intent/**'
- 'resources/quality/**'
- 'resources/variants/**'
jobs:
printer-linter-format:
name: Printer linter auto format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
resources/+(definitions|extruders)/*.def.json
resources/+(intent|quality|variants)/**/*.inst.cfg
- name: Setup Python and pip
if: env.GIT_DIFF && !env.MATCHED_FILES # If nothing happens with python and/or pip after, the clean-up crashes.
uses: actions/setup-python@v4
with:
python-version: 3.11.x
cache: 'pip'
cache-dependency-path: .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: Format file
if: env.GIT_DIFF && !env.MATCHED_FILES
run: python printer-linter/src/terminal.py --format ${{ env.GIT_DIFF_FILTERED }}
- uses: stefanzweifel/git-auto-commit-action@v4
if: env.GIT_DIFF && !env.MATCHED_FILES
with:
commit_message: "Applied printer-linter format"

View file

@ -0,0 +1,60 @@
name: printer-linter-pr-diagnose
on:
pull_request:
path:
- "resources/**"
jobs:
printer-linter-diagnose:
name: Printer linter PR diagnose
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
resources/+(extruders|definitions)/*.def.json
resources/+(intent|quality|variants)/**/*.inst.cfg
- name: Setup Python and pip
if: env.GIT_DIFF && !env.MATCHED_FILES # If nothing happens with python and/or pip after, the clean-up crashes.
uses: actions/setup-python@v4
with:
python-version: 3.11.x
cache: "pip"
cache-dependency-path: .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: 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
- 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@bc0bb7da034a8317d54e7fe1e819159002f4cc40
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
clang_tidy_fixes: result.yml
request_changes: true

View file

@ -0,0 +1,81 @@
name: printer-linter-pr-post
on:
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));
- 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
- 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: Run clang-tidy-pr-comments action
uses: platisd/clang-tidy-pr-comments@bc0bb7da034a8317d54e7fe1e819159002f4cc40
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
clang_tidy_fixes: printer-linter-result/fixes.yml
pull_request_id: ${{ env.pr_id }}
request_changes: true

View file

@ -0,0 +1,15 @@
name: process-pull-request
on:
pull_request_target:
types: [opened, reopened, edited, synchronize, review_requested, ready_for_review, assigned]
jobs:
add_label:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-ecosystem/action-add-labels@v1
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
with:
labels: 'PR: Community Contribution :crown:'

View file

@ -1,2 +1,2 @@
conan!=1.51.0,!=1.51.1,!=1.51.2,!=1.51.3,!=1.52.0
conan==1.56.0
sip

View file

@ -0,0 +1 @@
pyyaml

82
.github/workflows/unit-test-post.yml vendored Normal file
View file

@ -0,0 +1,82 @@
name: unit-test-post
on:
workflow_run:
workflows: [ "unit-test" ]
types: [ completed ]
jobs:
publish-test-results:
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 == "test-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}}/test-result.zip", Buffer.from(download.data));
- name: Set environment variables
run: |
mkdir pr_env
unzip test-result.zip -d pr_env
echo "pr_id=$(cat pr_env/pr-id.txt)" >> $GITHUB_ENV
echo "pr_head_repo=$(cat pr_env/pr-head-repo.txt)" >> $GITHUB_ENV
echo "pr_head_ref=$(cat pr_env/pr-head-ref.txt)" >> $GITHUB_ENV
- 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 == "test-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}}/test-result.zip", Buffer.from(download.data));
- name: Extract analysis results
run: |
mkdir -p tests
unzip test-result.zip -d tests
- name: Publish Unit Test Results
id: test-results
uses: EnricoMi/publish-unit-test-result-action@v1
with:
files: "tests/**/*.xml"
- name: Conclusion
run: echo "Conclusion is ${{ fromJSON( steps.test-results.outputs.json ).conclusion }}"

View file

@ -1,6 +1,5 @@
---
name: unit-test
# FIXME: This should be a reusable workflow
on:
push:
@ -76,6 +75,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Setup Python and pip
uses: actions/setup-python@v4
@ -104,9 +105,13 @@ jobs:
$HOME/.conan/conan_download_cache
key: conan-${{ runner.os }}-${{ runner.arch }}-unit-cache
# NOTE: Due to what are probably github issues, we have to remove the cache and reconfigure before the rest.
# This is maybe because grub caches the disk it uses last time, which is recreated each time.
- name: Install Linux system requirements
if: ${{ runner.os == 'Linux' }}
run: |
sudo rm /var/cache/debconf/config.dat
sudo dpkg --configure -a
sudo apt update
sudo apt upgrade
sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev pkg-config -y
@ -136,45 +141,21 @@ jobs:
pytest --junitxml=junit_cura.xml
working-directory: tests
- name: Save PR metadata
if: always()
run: |
echo ${{ github.event.number }} > pr-id.txt
echo ${{ github.event.pull_request.head.repo.full_name }} > pr-head-repo.txt
echo ${{ github.event.pull_request.head.ref }} > pr-head-ref.txt
working-directory: tests
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: Test Results
path: "tests/**/*.xml"
publish-test-results:
permissions:
contents: read # to fetch code (actions/checkout)
checks: write
pull-requests: write # to comment on pull request
runs-on: ubuntu-20.04
needs: [ testing ]
if: success() || failure()
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python and pip
uses: actions/setup-python@v4
with:
python-version: '3.10.x'
architecture: 'x64'
cache: 'pip'
cache-dependency-path: .github/workflows/requirements-conan-package.txt
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Publish Unit Test Results
id: test-results
uses: EnricoMi/publish-unit-test-result-action@v1
with:
files: "artifacts/**/*.xml"
- name: Conclusion
run: echo "Conclusion is ${{ fromJSON( steps.test-results.outputs.json ).conclusion }}"
name: test-result
path: |
tests/**/*.xml
tests/pr-id.txt
tests/pr-head-repo.txt
tests/pr-head-ref.txt

1
.gitignore vendored
View file

@ -99,3 +99,4 @@ conanbuildinfo.txt
graph_info.json
Ultimaker-Cura.spec
.run/
/printer-linter/src/printerlinter.egg-info/

17
.printer-linter Normal file
View file

@ -0,0 +1,17 @@
checks:
diagnostic-mesh-file-extension: true
diagnostic-mesh-file-size: true
diagnostic-definition-redundant-override: true
fixes:
diagnostic-definition-redundant-override: true
format:
format-definition-bracket-newline: true
format-definition-paired-coordinate-array: true
format-definition-sort-keys: true
format-definition-indent: 4
format-definition-single-value-single-line: true # Format dicts and lists with a single item on one line "dict": { "value": 10 }
format-profile-space-around-delimiters: true
format-profile-sort-keys: true
diagnostic-mesh-file-size: 1200000
diagnostic-definition-redundant-override-ignore:
- machine_.*

View file

@ -14,17 +14,17 @@ authors:
contact:
- email: info@ultimaker.com
name: "Ultimaker B.V."
url: 'https://ultimaker.com/software/ultimaker-cura'
repository-code: 'https://github.com/Ultimaker/Cura'
url: "https://ultimaker.com/software/ultimaker-cura"
repository-code: "https://github.com/Ultimaker/Cura"
license: LGPL-3.0
license-url: "https://github.com/Ultimaker/Cura/blob/main/LICENSE"
version: 5.0.0
date-released: '2022-05-17'
version: 5.2.1
date-released: "2022-10-19"
keywords:
- Ultimaker
- Cura
- Slicer
- Uranium
- Arachne
- 3DPrinting
- Slicer
...
- 3D Printing
- Additive Manufacturing

View file

@ -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.
CuraAppName = "{{ cura_app_name }}"

View file

@ -16,9 +16,9 @@ datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
# Add dynamic libs in the venv bin/Script Path. This is needed because we might copy some additional libs
# e.q.: OpenSSL 1.1.1l in that directory with a separate:
# `conan install openssl@1.1.1l -g deploy && cp openssl/bin/*.so cura_inst/bin`
binaries.extend([(str(bin), ".") for bin in Path("{{ venv_script_path }}").glob("*.so*")])
binaries.extend([(str(bin), ".") for bin in Path("{{ venv_script_path }}").glob("*.dll")])
binaries.extend([(str(bin), ".") for bin in Path("{{ venv_script_path }}").glob("*.dylib")])
binaries.extend([(str(bin), ".") for bin in Path(r"{{ venv_script_path }}").glob("*.so*")])
binaries.extend([(str(bin), ".") for bin in Path(r"{{ venv_script_path }}").glob("*.dll")])
binaries.extend([(str(bin), ".") for bin in Path(r"{{ venv_script_path }}").glob("*.dylib")])
block_cipher = None
@ -141,6 +141,7 @@ class UMBUNDLE(BUNDLE):
"CFBundleIconFile": os.path.basename(self.icon),
"CFBundleInfoDictionaryVersion": "6.0",
"CFBundlePackageType": "APPL",
"CFBundleVersionString": self.version,
"CFBundleShortVersionString": self.version,
}
@ -252,9 +253,9 @@ class UMBUNDLE(BUNDLE):
app = UMBUNDLE(
coll,
name='{{ name }}.app',
name='{{ display_name }}.app',
icon={{ icon }},
bundle_identifier={{ osx_bundle_identifier }},
bundle_identifier={{ osx_bundle_identifier }} + "_" + '{{ display_name }}'.replace(" ", "_") + "_" {{ short_version }},
version={{ version }},
info_plist={
'CFBundleDisplayName': '{{ display_name }}',
@ -263,6 +264,7 @@ app = UMBUNDLE(
'CFBundleExecutable': '{{ name }}',
'CFBundleInfoDictionaryVersion': '6.0',
'CFBundlePackageType': 'APPL',
'CFBundleVersionString': {{ version }},
'CFBundleShortVersionString': {{ short_version }},
'CFBundleDocumentTypes': [{
'CFBundleTypeRole': 'Viewer',

File diff suppressed because it is too large Load diff

View file

@ -4,29 +4,30 @@ from pathlib import Path
from jinja2 import Template
from conan import ConanFile
from conan.tools.files import copy, rmdir, save
from conan.tools.env import VirtualRunEnv, Environment
from conan.tools.files import copy, rmdir, save, mkdir
from conan.tools.microsoft import unix_path
from conan.tools.env import VirtualRunEnv, Environment, VirtualBuildEnv
from conan.tools.scm import Version
from conan.errors import ConanInvalidConfiguration, ConanException
required_conan_version = ">=1.50.0"
required_conan_version = ">=1.52.0"
class CuraConan(ConanFile):
name = "cura"
license = "LGPL-3.0"
author = "Ultimaker B.V."
author = "UltiMaker"
url = "https://github.com/Ultimaker/cura"
description = "3D printer / slicing GUI built on top of the Uranium framework"
topics = ("conan", "python", "pyqt5", "qt", "qml", "3d-printing", "slicer")
topics = ("conan", "python", "pyqt6", "qt", "qml", "3d-printing", "slicer")
build_policy = "missing"
exports = "LICENSE*", "Ultimaker-Cura.spec.jinja", "CuraVersion.py.jinja"
exports = "LICENSE*", "UltiMaker-Cura.spec.jinja", "CuraVersion.py.jinja"
settings = "os", "compiler", "build_type", "arch"
no_copy_source = True # We won't build so no need to copy sources to the build folder
# FIXME: Remove specific branch once merged to main
# Extending the conanfile with the UMBaseConanfile https://github.com/Ultimaker/conan-ultimaker-index/tree/CURA-9177_Fix_CI_CD/recipes/umbase
python_requires = "umbase/[>=0.1.7]@ultimaker/stable"
python_requires = "umbase/[>=0.1.7]@ultimaker/stable", "translationextractor/[>=1.0.0]@ultimaker/stable"
python_requires_extend = "umbase.UMBaseConanfile"
options = {
@ -43,16 +44,10 @@ class CuraConan(ConanFile):
"staging": "False",
"devtools": False,
"cloud_api_version": "1",
"display_name": "Ultimaker Cura",
"display_name": "UltiMaker Cura",
"cura_debug_mode": False, # Not yet implemented
"internal": False,
}
scm = {
"type": "git",
"subfolder": ".",
"url": "auto",
"revision": "auto"
}
@property
def _pycharm_targets(self):
@ -84,6 +79,12 @@ class CuraConan(ConanFile):
def _enterprise(self):
return self.options.enterprise in ["True", 'true']
@property
def _app_name(self):
if self._enterprise:
return str(self.options.display_name) + " Enterprise"
return str(self.options.display_name)
@property
def _cloud_api_root(self):
return "https://api-staging.ultimaker.com" if self._staging else "https://api.ultimaker.com"
@ -145,8 +146,16 @@ class CuraConan(ConanFile):
py_interp = Path(*[f'"{p}"' if " " in p else p for p in py_interp.parts])
return py_interp
@property
def _pyinstaller_spec_arch(self):
if self.settings.os == "Macos":
if self.settings.arch == "armv8":
return "'arm64'"
return "'x86_64'"
return "None"
def _generate_cura_version(self, location):
with open(Path(__file__).parent.joinpath("CuraVersion.py.jinja"), "r") as f:
with open(os.path.join(self.recipe_folder, "CuraVersion.py.jinja"), "r") as f:
cura_version_py = Template(f.read())
# If you want a specific Cura version to show up on the splash screen add the user configuration `user.cura:version=VERSION`
@ -157,10 +166,10 @@ class CuraConan(ConanFile):
internal_tag = f"+internal" if self.options.internal else ""
cura_version = f"{cura_version.major}.{cura_version.minor}.{cura_version.patch}{pre_tag}{build_tag}{internal_tag}"
with open(Path(location, "CuraVersion.py"), "w") as f:
with open(os.path.join(location, "CuraVersion.py"), "w") as f:
f.write(cura_version_py.render(
cura_app_name = self.name,
cura_app_display_name = self.options.display_name,
cura_app_display_name = self._app_name,
cura_version = cura_version,
cura_build_type = "Enterprise" if self._enterprise else "",
cura_debug_mode = self.options.cura_debug_mode,
@ -172,7 +181,7 @@ class CuraConan(ConanFile):
cura_latest_url = self._cura_latest_url))
def _generate_pyinstaller_spec(self, location, entrypoint_location, icon_path, entitlements_file):
pyinstaller_metadata = self._um_data()["pyinstaller"]
pyinstaller_metadata = self.conan_data["pyinstaller"]
datas = [(str(self._base_dir.joinpath("conan_install_info.json")), ".")]
for data in pyinstaller_metadata["datas"].values():
if not self.options.internal and data.get("internal", False):
@ -181,33 +190,33 @@ class CuraConan(ConanFile):
if "package" in data: # get the paths from conan package
if data["package"] == self.name:
if self.in_local_cache:
src_path = Path(self.package_folder, data["src"])
src_path = os.path.join(self.package_folder, data["src"])
else:
src_path = Path(self.source_folder, data["src"])
src_path = os.path.join(self.source_folder, data["src"])
else:
src_path = Path(self.deps_cpp_info[data["package"]].rootpath, data["src"])
src_path = os.path.join(self.deps_cpp_info[data["package"]].rootpath, data["src"])
elif "root" in data: # get the paths relative from the sourcefolder
src_path = Path(self.source_folder, data["root"], data["src"])
src_path = os.path.join(self.source_folder, data["root"], data["src"])
else:
continue
if src_path.exists():
if Path(src_path).exists():
datas.append((str(src_path), data["dst"]))
binaries = []
for binary in pyinstaller_metadata["binaries"].values():
if "package" in binary: # get the paths from conan package
src_path = Path(self.deps_cpp_info[binary["package"]].rootpath, binary["src"])
src_path = os.path.join(self.deps_cpp_info[binary["package"]].rootpath, binary["src"])
elif "root" in binary: # get the paths relative from the sourcefolder
src_path = Path(self.source_folder, binary["root"], binary["src"])
src_path = os.path.join(self.source_folder, binary["root"], binary["src"])
else:
continue
if not src_path.exists():
if not Path(src_path).exists():
self.output.warning(f"Source path for binary {binary['binary']} does not exist")
continue
for bin in src_path.glob(binary["binary"] + "*[.exe|.dll|.so|.dylib|.so.]*"):
for bin in Path(src_path).glob(binary["binary"] + "*[.exe|.dll|.so|.dylib|.so.]*"):
binaries.append((str(bin), binary["dst"]))
for bin in src_path.glob(binary["binary"]):
for bin in Path(src_path).glob(binary["binary"]):
binaries.append((str(bin), binary["dst"]))
# Make sure all Conan dependencies which are shared are added to the binary list for pyinstaller
@ -225,16 +234,16 @@ class CuraConan(ConanFile):
# Collect all dll's from PyQt6 and place them in the root
binaries.extend([(f"{p}", ".") for p in Path(self._site_packages, "PyQt6", "Qt6").glob("**/*.dll")])
with open(Path(__file__).parent.joinpath("Ultimaker-Cura.spec.jinja"), "r") as f:
with open(os.path.join(self.recipe_folder, "UltiMaker-Cura.spec.jinja"), "r") as f:
pyinstaller = Template(f.read())
version = self.conf_info.get("user.cura:version", default = self.version, check_type = str)
cura_version = Version(version)
with open(Path(location, "Ultimaker-Cura.spec"), "w") as f:
with open(os.path.join(location, "UltiMaker-Cura.spec"), "w") as f:
f.write(pyinstaller.render(
name = str(self.options.display_name).replace(" ", "-"),
display_name = self.options.display_name,
display_name = self._app_name,
entrypoint = entrypoint_location,
datas = datas,
binaries = binaries,
@ -246,12 +255,26 @@ class CuraConan(ConanFile):
osx_bundle_identifier = "'nl.ultimaker.cura'" if self.settings.os == "Macos" else "None",
upx = str(self.settings.os == "Windows"),
strip = False, # This should be possible on Linux and MacOS but, it can also cause issues on some distributions. Safest is to disable it for now
target_arch = "'x86_64'" if self.settings.os == "Macos" else "None", # FIXME: Make this dependent on the settings.arch_target
target_arch = self._pyinstaller_spec_arch,
macos = self.settings.os == "Macos",
version = f"'{version}'",
short_version = f"'{cura_version.major}.{cura_version.minor}.{cura_version.patch}'",
))
def export_sources(self):
copy(self, "*", os.path.join(self.recipe_folder, "plugins"), os.path.join(self.export_sources_folder, "plugins"))
copy(self, "*", os.path.join(self.recipe_folder, "resources"), os.path.join(self.export_sources_folder, "resources"), excludes = "*.mo")
copy(self, "*", os.path.join(self.recipe_folder, "tests"), os.path.join(self.export_sources_folder, "tests"))
copy(self, "*", os.path.join(self.recipe_folder, "cura"), os.path.join(self.export_sources_folder, "cura"), excludes="CuraVersion.py")
copy(self, "*", os.path.join(self.recipe_folder, "packaging"), os.path.join(self.export_sources_folder, "packaging"))
copy(self, "*", os.path.join(self.recipe_folder, ".run_templates"), os.path.join(self.export_sources_folder, "run_templates"))
copy(self, "requirements.txt", self.recipe_folder, self.export_sources_folder)
copy(self, "requirements-dev.txt", self.recipe_folder, self.export_sources_folder)
copy(self, "requirements-ultimaker.txt", self.recipe_folder, self.export_sources_folder)
copy(self, "UltiMaker-Cura.spec.jinja", self.recipe_folder, self.export_sources_folder)
copy(self, "CuraVersion.py.jinja", self.recipe_folder, self.export_sources_folder)
copy(self, "cura_app.py", self.recipe_folder, self.export_sources_folder)
def set_version(self):
if self.version is None:
self.version = self._umdefault_version()
@ -268,41 +291,75 @@ class CuraConan(ConanFile):
raise ConanInvalidConfiguration("Only versions 5+ are support")
def requirements(self):
for req in self._um_data()["requirements"]:
self.requires(req)
self.requires("pyarcus/5.2.2")
self.requires("curaengine/(latest)@ultimaker/testing")
self.requires("pysavitar/5.2.2")
self.requires("pynest2d/5.2.2")
self.requires("uranium/(latest)@ultimaker/testing")
self.requires("fdm_materials/(latest)@{}/testing".format("internal" if self.options.internal else "ultimaker"))
self.requires("cura_binary_data/(latest)@ultimaker/testing")
self.requires("cpython/3.10.4")
if self.options.internal:
for req in self._um_data()["internal_requirements"]:
self.requires(req)
self.requires("cura_private_data/(latest)@ultimaker/testing")
def build_requirements(self):
if self.options.devtools:
if self.settings.os != "Windows" or self.conf.get("tools.microsoft.bash:path", check_type = str):
# FIXME: once m4, autoconf, automake are Conan V2 ready use self.win_bash and add gettext as base tool_requirement
self.tool_requires("gettext/0.21", force_host_context=True)
def layout(self):
self.folders.source = "."
self.folders.build = "venv"
self.folders.generators = Path(self.folders.build, "conan")
self.folders.generators = os.path.join(self.folders.build, "conan")
self.cpp.package.libdirs = [os.path.join("site-packages", "cura")]
self.cpp.package.bindirs = ["bin"]
self.cpp.package.resdirs = ["resources", "plugins", "packaging", "pip_requirements"] # pip_requirements should be the last item in the list
def build(self):
pass
def generate(self):
copy(self, "cura_app.py", self.source_folder, str(self._script_dir))
cura_run_envvars = self._cura_run_env.vars(self, scope = "run")
ext = ".ps1" if self.settings.os == "Windows" else ".sh"
cura_run_envvars.save_script(self.folders.generators.joinpath(f"cura_run_environment{ext}"))
cura_run_envvars.save_script(os.path.join(self.folders.generators, f"cura_run_environment{ext}"))
vr = VirtualRunEnv(self)
vr.generate()
self._generate_cura_version(Path(self.source_folder, "cura"))
self._generate_cura_version(os.path.join(self.source_folder, "cura"))
if self.options.devtools:
entitlements_file = "'{}'".format(Path(self.source_folder, "packaging", "dmg", "cura.entitlements"))
entitlements_file = "'{}'".format(os.path.join(self.source_folder, "packaging", "MacOS", "cura.entitlements"))
self._generate_pyinstaller_spec(location = self.generators_folder,
entrypoint_location = "'{}'".format(Path(self.source_folder, self._um_data()["runinfo"]["entrypoint"])).replace("\\", "\\\\"),
icon_path = "'{}'".format(Path(self.source_folder, "packaging", self._um_data()["pyinstaller"]["icon"][str(self.settings.os)])).replace("\\", "\\\\"),
entrypoint_location = "'{}'".format(os.path.join(self.source_folder, self.conan_data["pyinstaller"]["runinfo"]["entrypoint"])).replace("\\", "\\\\"),
icon_path = "'{}'".format(os.path.join(self.source_folder, "packaging", self.conan_data["pyinstaller"]["icon"][str(self.settings.os)])).replace("\\", "\\\\"),
entitlements_file = entitlements_file if self.settings.os == "Macos" else "None")
# Update the po files
if self.settings.os != "Windows" or self.conf.get("tools.microsoft.bash:path", check_type=str):
vb = VirtualBuildEnv(self)
vb.generate()
# FIXME: once m4, autoconf, automake are Conan V2 ready use self.win_bash and add gettext as base tool_requirement
cpp_info = self.dependencies["gettext"].cpp_info
for po_file in self.source_path.joinpath("resources", "i18n").glob("**/*.po"):
pot_file = self.source_path.joinpath("resources", "i18n", po_file.with_suffix('.pot').name)
mkdir(self, str(unix_path(self, pot_file.parent)))
self.run(
f"{cpp_info.bindirs[0]}/msgmerge --no-wrap --no-fuzzy-matching -width=140 -o {po_file} {po_file} {pot_file}",
env="conanbuild", ignore_errors=True)
def build(self):
if self.options.devtools:
if self.settings.os != "Windows" or self.conf.get("tools.microsoft.bash:path", check_type = str):
# FIXME: once m4, autoconf, automake are Conan V2 ready use self.win_bash and add gettext as base tool_requirement
for po_file in self.source_path.joinpath("resources", "i18n").glob("**/*.po"):
mo_file = Path(self.build_folder, po_file.with_suffix('.mo').relative_to(self.source_path))
mo_file = mo_file.parent.joinpath("LC_MESSAGES", mo_file.name)
mkdir(self, str(unix_path(self, Path(mo_file).parent)))
cpp_info = self.dependencies["gettext"].cpp_info
self.run(f"{cpp_info.bindirs[0]}/msgfmt {po_file} -o {mo_file} -f", env="conanbuild", ignore_errors=True)
def imports(self):
self.copy("CuraEngine.exe", root_package = "curaengine", src = "@bindirs", dst = "", keep_path = False)
self.copy("CuraEngine", root_package = "curaengine", src = "@bindirs", dst = "", keep_path = False)
@ -312,8 +369,6 @@ class CuraConan(ConanFile):
self.copy("*.sig", root_package = "fdm_materials", src = "@resdirs", dst = "resources/materials", keep_path = False)
if self.options.internal:
self.copy("*.fdm_material", root_package = "fdm_materials_private", src = "@resdirs", dst = "resources/materials", keep_path = False)
self.copy("*.sig", root_package = "fdm_materials_private", src = "@resdirs", dst = "resources/materials", keep_path = False)
self.copy("*", root_package = "cura_private_data", src = self.deps_cpp_info["cura_private_data"].resdirs[0],
dst = self._share_dir.joinpath("cura", "resources"), keep_path = True)
@ -351,10 +406,6 @@ class CuraConan(ConanFile):
# Copy internal resources
if self.options.internal:
self.copy_deps("*.fdm_material", root_package = "fdm_materials_private", src = self.deps_cpp_info["fdm_materials_private"].resdirs[0],
dst = self._share_dir.joinpath("cura", "resources", "materials"), keep_path = False)
self.copy_deps("*.sig", root_package = "fdm_materials_private", src = self.deps_cpp_info["fdm_materials_private"].resdirs[0],
dst = self._share_dir.joinpath("cura", "resources", "materials"), keep_path = False)
self.copy_deps("*", root_package = "cura_private_data", src = self.deps_cpp_info["cura_private_data"].resdirs[0],
dst = self._share_dir.joinpath("cura", "resources"), keep_path = True)
self.copy_deps("*", root_package = "cura_private_data", src = self.deps_cpp_info["cura_private_data"].resdirs[1],
@ -368,7 +419,7 @@ class CuraConan(ConanFile):
self.copy_deps("*", root_package = "uranium", src = self.deps_cpp_info["uranium"].libdirs[0],
dst = self._site_packages.joinpath("UM"),
keep_path = True)
self.copy_deps("*", root_package = "uranium", src = str(Path(self.deps_cpp_info["uranium"].libdirs[0], "Qt", "qml", "UM")),
self.copy_deps("*", root_package = "uranium", src = str(os.path.join(self.deps_cpp_info["uranium"].libdirs[0], "Qt", "qml", "UM")),
dst = self._site_packages.joinpath("PyQt6", "Qt6", "qml", "UM"),
keep_path = True)
@ -401,31 +452,34 @@ echo "CURA_VERSION_MINOR={{ cura_version_minor }}" >> ${{ env_prefix }}GITHUB_EN
echo "CURA_VERSION_PATCH={{ cura_version_patch }}" >> ${{ env_prefix }}GITHUB_ENV
echo "CURA_VERSION_BUILD={{ cura_version_build }}" >> ${{ env_prefix }}GITHUB_ENV
echo "CURA_VERSION_FULL={{ cura_version_full }}" >> ${{ env_prefix }}GITHUB_ENV
echo "CURA_APP_NAME={{ cura_app_name }}" >> ${{ env_prefix }}GITHUB_ENV
""").render(cura_version_major = cura_version.major,
cura_version_minor = cura_version.minor,
cura_version_patch = cura_version.patch,
cura_version_build = cura_version.build if cura_version.build != "" else "0",
cura_version_full = self.version,
cura_app_name = self._app_name,
env_prefix = env_prefix)
ext = ".sh" if self.settings.os != "Windows" else ".ps1"
save(self, self._script_dir.joinpath(f"activate_github_actions_version_env{ext}"), activate_github_actions_version_env)
save(self, os.path.join(self._script_dir, f"activate_github_actions_version_env{ext}"), activate_github_actions_version_env)
self._generate_cura_version(Path(self._site_packages, "cura"))
self._generate_cura_version(os.path.join(self._site_packages, "cura"))
entitlements_file = "'{}'".format(Path(self.cpp_info.res_paths[2], "dmg", "cura.entitlements"))
entitlements_file = "'{}'".format(Path(self.cpp_info.res_paths[2], "MacOS", "cura.entitlements"))
self._generate_pyinstaller_spec(location = self._base_dir,
entrypoint_location = "'{}'".format(Path(self.cpp_info.bin_paths[0], self._um_data()["runinfo"]["entrypoint"])).replace("\\", "\\\\"),
icon_path = "'{}'".format(Path(self.cpp_info.res_paths[2], self._um_data()["pyinstaller"]["icon"][str(self.settings.os)])).replace("\\", "\\\\"),
entrypoint_location = "'{}'".format(os.path.join(self.package_folder, self.cpp_info.bindirs[0], self.conan_data["pyinstaller"]["runinfo"]["entrypoint"])).replace("\\", "\\\\"),
icon_path = "'{}'".format(os.path.join(self.package_folder, self.cpp_info.resdirs[2], self.conan_data["pyinstaller"]["icon"][str(self.settings.os)])).replace("\\", "\\\\"),
entitlements_file = entitlements_file if self.settings.os == "Macos" else "None")
def package(self):
self.copy("cura_app.py", src = ".", dst = self.cpp.package.bindirs[0])
self.copy("*", src = "cura", dst = self.cpp.package.libdirs[0])
self.copy("*", src = "resources", dst = self.cpp.package.resdirs[0])
self.copy("*", src = "plugins", dst = self.cpp.package.resdirs[1])
self.copy("requirement*.txt", src = ".", dst = self.cpp.package.resdirs[-1])
self.copy("*", src = "packaging", dst = self.cpp.package.resdirs[2])
copy(self, "cura_app.py", src = self.source_folder, dst = os.path.join(self.package_folder, self.cpp.package.bindirs[0]))
copy(self, "*", src = os.path.join(self.source_folder, "cura"), dst = os.path.join(self.package_folder, self.cpp.package.libdirs[0]))
copy(self, "*", src = os.path.join(self.source_folder, "resources"), dst = os.path.join(self.package_folder, self.cpp.package.resdirs[0]))
copy(self, "*.mo", os.path.join(self.build_folder, "resources"), os.path.join(self.package_folder, "resources"))
copy(self, "*", src = os.path.join(self.source_folder, "plugins"), dst = os.path.join(self.package_folder, self.cpp.package.resdirs[1]))
copy(self, "requirement*.txt", src = self.source_folder, dst = os.path.join(self.package_folder, self.cpp.package.resdirs[-1]))
copy(self, "*", src = os.path.join(self.source_folder, "packaging"), dst = os.path.join(self.package_folder, self.cpp.package.resdirs[2]))
def package_info(self):
self.user_info.pip_requirements = "requirements.txt"
@ -433,8 +487,8 @@ echo "CURA_VERSION_FULL={{ cura_version_full }}" >> ${{ env_prefix }}GITHUB_ENV
self.user_info.pip_requirements_build = "requirements-dev.txt"
if self.in_local_cache:
self.runenv_info.append_path("PYTHONPATH", str(Path(self.cpp_info.lib_paths[0]).parent))
self.runenv_info.append_path("PYTHONPATH", self.cpp_info.res_paths[1]) # Add plugins to PYTHONPATH
self.runenv_info.append_path("PYTHONPATH", os.path.join(self.package_folder, "site-packages"))
self.runenv_info.append_path("PYTHONPATH", os.path.join(self.package_folder, "plugins"))
else:
self.runenv_info.append_path("PYTHONPATH", self.source_folder)
self.runenv_info.append_path("PYTHONPATH", os.path.join(self.source_folder, "plugins"))

View file

@ -1,11 +1,11 @@
# Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
# Copyright (c) 2022 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
# ---------
# General constants used in Cura
# ---------
DEFAULT_CURA_APP_NAME = "cura"
DEFAULT_CURA_DISPLAY_NAME = "Ultimaker Cura"
DEFAULT_CURA_DISPLAY_NAME = "UltiMaker Cura"
DEFAULT_CURA_VERSION = "dev"
DEFAULT_CURA_BUILD_TYPE = ""
DEFAULT_CURA_DEBUG_MODE = False
@ -14,7 +14,7 @@ DEFAULT_CURA_LATEST_URL = "https://software.ultimaker.com/latest.json"
# Each release has a fixed SDK version coupled with it. It doesn't make sense to make it configurable because, for
# example Cura 3.2 with SDK version 6.1 will not work. So the SDK version is hard-coded here and left out of the
# CuraVersion.py.in template.
CuraSDKVersion = "8.2.0"
CuraSDKVersion = "8.3.0"
try:
from cura.CuraVersion import CuraLatestURL
@ -64,7 +64,7 @@ try:
if CuraAppDisplayName == "":
CuraAppDisplayName = DEFAULT_CURA_DISPLAY_NAME
if IsEnterpriseVersion:
CuraAppDisplayName = CuraAppDisplayName + " Enterprise"
CuraAppDisplayName = CuraAppDisplayName
except ImportError:
CuraAppDisplayName = DEFAULT_CURA_DISPLAY_NAME

View file

@ -1,5 +1,5 @@
# Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
# Copyright (c) 2022 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
import platform
import traceback
@ -110,7 +110,7 @@ class CrashHandler:
layout = QVBoxLayout(dialog)
label = QLabel()
label.setText(catalog.i18nc("@label crash message", """<p><b>Oops, Ultimaker Cura has encountered something that doesn't seem right.</p></b>
label.setText(catalog.i18nc("@label crash message", """<p><b>Oops, UltiMaker Cura has encountered something that doesn't seem right.</p></b>
<p>We encountered an unrecoverable error during start up. It was possibly caused by some incorrect configuration files. We suggest to backup and reset your configuration.</p>
<p>Backups can be found in the configuration folder.</p>
<p>Please send us this Crash Report to fix the problem.</p>
@ -119,7 +119,7 @@ class CrashHandler:
layout.addWidget(label)
# "send report" check box and show details
self._send_report_checkbox = QCheckBox(catalog.i18nc("@action:button", "Send crash report to Ultimaker"), dialog)
self._send_report_checkbox = QCheckBox(catalog.i18nc("@action:button", "Send crash report to UltiMaker"), dialog)
self._send_report_checkbox.setChecked(True)
show_details_button = QPushButton(catalog.i18nc("@action:button", "Show detailed crash report"), dialog)

View file

@ -130,7 +130,7 @@ class CuraApplication(QtApplication):
# SettingVersion represents the set of settings available in the machine/extruder definitions.
# You need to make sure that this version number needs to be increased if there is any non-backwards-compatible
# changes of the settings.
SettingVersion = 20
SettingVersion = 21
Created = False
@ -709,6 +709,7 @@ class CuraApplication(QtApplication):
self.showMessageBox.emit(title, text, informativeText, detailedText, buttons, icon)
showDiscardOrKeepProfileChanges = pyqtSignal()
showCompareAndSaveProfileChanges = pyqtSignal(int)
def discardOrKeepProfileChanges(self) -> bool:
has_user_interaction = False

View file

@ -54,6 +54,8 @@ class CompatibleMachineModel(ListModel):
# initialize & add current active material:
for extruder in printer.extruders:
if not extruder.activeMaterial:
continue
materials = [_makeMaterial(
extruder.activeMaterial.brand, extruder.activeMaterial.name, extruder.activeMaterial.color)]
extruder_configs[extruder.getPosition()] = {

View file

@ -5,7 +5,7 @@
# online cloud connected printers are represented within this ListModel. Additional information such as the number of
# connected printers for each printer type is gathered.
from typing import Optional
from typing import Optional, List, cast
from PyQt6.QtCore import Qt, QTimer, QObject, pyqtSlot, pyqtProperty, pyqtSignal
@ -14,7 +14,6 @@ from UM.Settings.ContainerStack import ContainerStack
from UM.Settings.Interfaces import ContainerInterface
from UM.i18n import i18nCatalog
from UM.Util import parseBool
from cura.PrinterOutput.PrinterOutputDevice import ConnectionType
from cura.Settings.CuraContainerRegistry import CuraContainerRegistry
from cura.Settings.GlobalStack import GlobalStack
@ -29,11 +28,13 @@ class MachineListModel(ListModel):
MachineCountRole = Qt.ItemDataRole.UserRole + 6
IsAbstractMachineRole = Qt.ItemDataRole.UserRole + 7
ComponentTypeRole = Qt.ItemDataRole.UserRole + 8
IsNetworkedMachineRole = Qt.ItemDataRole.UserRole + 9
def __init__(self, parent: Optional[QObject] = None) -> None:
def __init__(self, parent: Optional[QObject] = None, machines_filter: List[GlobalStack] = None, listenToChanges: bool = True) -> None:
super().__init__(parent)
self._show_cloud_printers = False
self._machines_filter = machines_filter
self._catalog = i18nCatalog("cura")
@ -45,17 +46,18 @@ class MachineListModel(ListModel):
self.addRoleName(self.MachineCountRole, "machineCount")
self.addRoleName(self.IsAbstractMachineRole, "isAbstractMachine")
self.addRoleName(self.ComponentTypeRole, "componentType")
self.addRoleName(self.IsNetworkedMachineRole, "isNetworked")
self._change_timer = QTimer()
self._change_timer.setInterval(200)
self._change_timer.setSingleShot(True)
self._change_timer.timeout.connect(self._update)
# Listen to changes
CuraContainerRegistry.getInstance().containerAdded.connect(self._onContainerChanged)
CuraContainerRegistry.getInstance().containerMetaDataChanged.connect(self._onContainerChanged)
CuraContainerRegistry.getInstance().containerRemoved.connect(self._onContainerChanged)
self._updateDelayed()
if listenToChanges:
CuraContainerRegistry.getInstance().containerAdded.connect(self._onContainerChanged)
CuraContainerRegistry.getInstance().containerMetaDataChanged.connect(self._onContainerChanged)
CuraContainerRegistry.getInstance().containerRemoved.connect(self._onContainerChanged)
self._updateDelayed()
showCloudPrintersChanged = pyqtSignal(bool)
@ -79,17 +81,33 @@ class MachineListModel(ListModel):
def _updateDelayed(self) -> None:
self._change_timer.start()
def _getMachineStacks(self) -> List[ContainerStack]:
return CuraContainerRegistry.getInstance().findContainerStacks(type = "machine")
def _getAbstractMachineStacks(self) -> List[ContainerStack]:
return CuraContainerRegistry.getInstance().findContainerStacks(is_abstract_machine = "True")
def set_machines_filter(self, machines_filter: Optional[List[GlobalStack]]) -> None:
self._machines_filter = machines_filter
self._update()
def _update(self) -> None:
self.clear()
from cura.CuraApplication import CuraApplication
machines_manager = CuraApplication.getInstance().getMachineManager()
other_machine_stacks = CuraContainerRegistry.getInstance().findContainerStacks(type="machine")
other_machine_stacks = self._getMachineStacks()
other_machine_stacks.sort(key = lambda machine: machine.getName().upper())
abstract_machine_stacks = CuraContainerRegistry.getInstance().findContainerStacks(is_abstract_machine = "True")
abstract_machine_stacks = self._getAbstractMachineStacks()
abstract_machine_stacks.sort(key = lambda machine: machine.getName().upper(), reverse = True)
if self._machines_filter is not None:
filter_ids = [machine_filter.id for machine_filter in self._machines_filter]
other_machine_stacks = [machine for machine in other_machine_stacks if machine.id in filter_ids]
abstract_machine_stacks = [machine for machine in abstract_machine_stacks if machine.id in filter_ids]
for abstract_machine in abstract_machine_stacks:
definition_id = abstract_machine.definition.getId()
online_machine_stacks = machines_manager.getMachinesWithDefinition(definition_id, online_only = True)
@ -97,7 +115,9 @@ class MachineListModel(ListModel):
online_machine_stacks = list(filter(lambda machine: machine.hasNetworkedConnection(), online_machine_stacks))
online_machine_stacks.sort(key=lambda machine: machine.getName().upper())
other_machine_stacks.remove(abstract_machine)
if abstract_machine in other_machine_stacks:
other_machine_stacks.remove(abstract_machine)
if abstract_machine in online_machine_stacks:
online_machine_stacks.remove(abstract_machine)
@ -113,18 +133,13 @@ class MachineListModel(ListModel):
other_machine_stacks.remove(stack)
if len(abstract_machine_stacks) > 0:
if self._show_cloud_printers:
self.appendItem({"componentType": "HIDE_BUTTON",
"isOnline": True,
"isAbstractMachine": False,
"machineCount": 0
})
else:
self.appendItem({"componentType": "SHOW_BUTTON",
"isOnline": True,
"isAbstractMachine": False,
"machineCount": 0
})
self.appendItem({
"componentType": "HIDE_BUTTON" if self._show_cloud_printers else "SHOW_BUTTON",
"isOnline": True,
"isAbstractMachine": False,
"machineCount": 0,
"catergory": "connected",
})
for stack in other_machine_stacks:
self.addItem(stack, False)
@ -134,11 +149,13 @@ class MachineListModel(ListModel):
return
self.appendItem({
"componentType": "MACHINE",
"name": container_stack.getName(),
"id": container_stack.getId(),
"metadata": container_stack.getMetaData().copy(),
"isOnline": is_online,
"isAbstractMachine": parseBool(container_stack.getMetaDataEntry("is_abstract_machine", False)),
"machineCount": machine_count,
})
"componentType": "MACHINE",
"name": container_stack.getName(),
"id": container_stack.getId(),
"metadata": container_stack.getMetaData().copy(),
"isOnline": is_online,
"isAbstractMachine": parseBool(container_stack.getMetaDataEntry("is_abstract_machine", False)),
"isNetworked": cast(GlobalStack, container_stack).hasNetworkedConnection() if isinstance(container_stack, GlobalStack) else False,
"machineCount": machine_count,
"catergory": "connected" if is_online else "other",
})

View file

@ -184,7 +184,8 @@ class QualityManagementModel(ListModel):
container_registry.addContainer(container.duplicate(new_id, new_name))
@pyqtSlot(str)
def createQualityChanges(self, base_name: str) -> None:
@pyqtSlot(str, bool)
def createQualityChanges(self, base_name: str, activate_after_success: bool = False) -> None:
"""Create quality changes containers from the user containers in the active stacks.
This will go through the global and extruder stacks and create quality_changes containers from the user
@ -233,6 +234,14 @@ class QualityManagementModel(ListModel):
container_registry.addContainer(new_changes)
if activate_after_success:
# At this point, the QualityChangesGroup object for the new changes may not exist yet.
# This can be forced by asking for all of them. At that point it's just as well to loop.
for quality_changes in ContainerTree.getInstance().getCurrentQualityChangesGroups():
if quality_changes.name == unique_name:
machine_manager.setQualityChangesGroup(quality_changes)
break
def _createQualityChanges(self, quality_type: str, intent_category: Optional[str], new_name: str, machine: "GlobalStack", extruder_stack: Optional["ExtruderStack"]) -> "InstanceContainer":
"""Create a quality changes container with the given set-up.

View file

@ -118,12 +118,14 @@ class UserChangesModel(ListModel):
if original_value is not None:
break
item_to_add = {"key": setting_key,
"label": label,
"user_value": str(user_changes.getProperty(setting_key, "value")),
"original_value": str(original_value),
"extruder": "",
"category": category_label}
item_to_add = {
"key": setting_key,
"label": label,
"user_value": str(user_changes.getProperty(setting_key, "value", default_value_resolve_context)),
"original_value": str(original_value),
"extruder": "",
"category": category_label,
}
if stack != global_stack:
item_to_add["extruder"] = stack.getName()

View file

@ -274,7 +274,7 @@ class AuthorizationService:
self._unable_to_get_data_message.show()
else:
self._unable_to_get_data_message = Message(i18n_catalog.i18nc("@info",
"Unable to reach the Ultimaker account server."),
"Unable to reach the UltiMaker account server."),
title = i18n_catalog.i18nc("@info:title", "Log-in failed"),
message_type = Message.MessageType.ERROR)
Logger.warning("Unable to get user profile using auth data from preferences.")

View file

@ -0,0 +1,48 @@
from dataclasses import dataclass
from typing import List
from UM import i18nCatalog
catalog = i18nCatalog("cura")
@dataclass
class ActiveQuality:
""" Represents the active intent+profile combination, contains all information needed to display active quality. """
intent_category: str = "" # Name of the base intent. For example "visual" or "engineering".
intent_name: str = "" # Name of the base intent formatted for display. For Example "Visual" or "Engineering"
profile: str = "" # Name of the base profile. For example "Fine" or "Fast"
custom_profile: str = "" # Name of the custom profile, this is based on profile. For example "MyCoolCustomProfile"
layer_height: float = None # Layer height of quality in mm. For example 0.4
is_experimental: bool = False # If the quality experimental.
def getMainStringParts(self) -> List[str]:
string_parts = []
if self.custom_profile is not None:
string_parts.append(self.custom_profile)
else:
string_parts.append(self.profile)
if self.intent_category != "default":
string_parts.append(self.intent_name)
return string_parts
def getTailStringParts(self) -> List[str]:
string_parts = []
if self.custom_profile is not None:
string_parts.append(self.profile)
if self.intent_category != "default":
string_parts.append(self.intent_name)
if self.layer_height:
string_parts.append(f"{self.layer_height}mm")
if self.is_experimental:
string_parts.append(catalog.i18nc("@label", "Experimental"))
return string_parts
def getStringParts(self) -> List[str]:
return self.getMainStringParts() + self.getTailStringParts()

View file

@ -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.

View file

@ -40,6 +40,7 @@ from cura.Settings.cura_empty_instance_containers import (empty_definition_chang
empty_material_container, empty_quality_container,
empty_quality_changes_container, empty_intent_container)
from cura.UltimakerCloud.UltimakerCloudConstants import META_UM_LINKED_TO_ACCOUNT
from .ActiveQuality import ActiveQuality
from .CuraStackBuilder import CuraStackBuilder
@ -1631,33 +1632,31 @@ class MachineManager(QObject):
# Examples:
# - "my_profile - Fine" (only based on a default quality, no intent involved)
# - "my_profile - Engineering - Fine" (based on an intent)
@pyqtProperty("QVariantMap", notify = activeQualityDisplayNameChanged)
def activeQualityDisplayNameMap(self) -> Dict[str, str]:
@pyqtProperty("QList<QString>", notify = activeQualityDisplayNameChanged)
def activeQualityDisplayNameStringParts(self) -> List[str]:
return self.activeQualityDisplayNameMap().getStringParts()
@pyqtProperty("QList<QString>", notify = activeQualityDisplayNameChanged)
def activeQualityDisplayNameMainStringParts(self) -> List[str]:
return self.activeQualityDisplayNameMap().getMainStringParts()
@pyqtProperty("QList<QString>", notify = activeQualityDisplayNameChanged)
def activeQualityDisplayNameTailStringParts(self) -> List[str]:
return self.activeQualityDisplayNameMap().getTailStringParts()
def activeQualityDisplayNameMap(self) -> ActiveQuality:
global_stack = self._application.getGlobalContainerStack()
if global_stack is None:
return {"main": "",
"suffix": ""}
return ActiveQuality()
display_name = global_stack.quality.getName()
intent_category = self.activeIntentCategory
if intent_category != "default":
intent_display_name = IntentCategoryModel.translation(intent_category,
"name",
intent_category.title())
display_name = "{intent_name} - {the_rest}".format(intent_name = intent_display_name,
the_rest = display_name)
main_part = display_name
suffix_part = ""
# Not a custom quality
if global_stack.qualityChanges != empty_quality_changes_container:
main_part = self.activeQualityOrQualityChangesName
suffix_part = display_name
return {"main": main_part,
"suffix": suffix_part}
return ActiveQuality(
profile = global_stack.quality.getName(),
intent_category = self.activeIntentCategory,
intent_name = IntentCategoryModel.translation(self.activeIntentCategory, "name", self.activeIntentCategory.title()),
custom_profile = self.activeQualityOrQualityChangesName if global_stack.qualityChanges is not empty_quality_changes_container else None,
layer_height = self.activeQualityLayerHeight if self.isActiveQualitySupported else None,
is_experimental = self.isActiveQualityExperimental and self.isActiveQualitySupported
)
@pyqtSlot(str)
def setIntentByCategory(self, intent_category: str) -> None:
@ -1776,7 +1775,9 @@ class MachineManager(QObject):
@pyqtProperty(bool, notify = activeQualityGroupChanged)
def hasNotSupportedQuality(self) -> bool:
global_container_stack = self._application.getGlobalContainerStack()
return (not global_container_stack is None) and global_container_stack.quality == empty_quality_container and global_container_stack.qualityChanges == empty_quality_changes_container
return global_container_stack is not None\
and global_container_stack.quality == empty_quality_container \
and global_container_stack.qualityChanges == empty_quality_changes_container
@pyqtProperty(bool, notify = activeQualityGroupChanged)
def isActiveQualityCustom(self) -> bool:

View file

@ -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"]

View file

@ -17,4 +17,9 @@ export OPENSSL_CONF="$scriptdir/openssl.cnf"
# unset `QT_STYLE_OVERRIDE` as a precaution
unset QT_STYLE_OVERRIDE
$scriptdir/Ultimaker-Cura "$@"
BIN=`basename "$ARGV0" .AppImage`
if [ -f $scriptdir/$BIN ]; then
$scriptdir/$BIN "$@"
else
$scriptdir/UltiMaker-Cura "$@"
fi;

View file

@ -1,6 +1,7 @@
# Copyright (c) 2022 Ultimaker B.V.
# Copyright (c) 2022 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
import argparse # Command line arguments parsing and help.
from jinja2 import Template
import os # Finding installation directory.
@ -71,6 +72,6 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser(description = "Create AppImages of Cura.")
parser.add_argument("dist_path", type=str, help="Path to where PyInstaller installed the distribution of Cura.")
parser.add_argument("version", type=str, help="Full version number of Cura (e.g. '5.1.0-beta')")
parser.add_argument("filename", type = str, help = "Filename of the AppImage (e.g. 'Ultimaker-Cura-5.1.0-beta-Linux-X64.AppImage')")
parser.add_argument("filename", type = str, help = "Filename of the AppImage (e.g. 'UltiMaker-Cura-5.1.0-beta-Linux-X64.AppImage')")
args = parser.parse_args()
build_appimage(args.dist_path, args.version, args.filename)

View file

@ -3,16 +3,16 @@
<id>com.ultimaker.cura</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>LGPL-3.0</project_license>
<name>Ultimaker Cura</name>
<name>UltiMaker Cura</name>
<summary>Slicer to prepare your 3D printing projects</summary>
<description>
<p>Ultimaker Cura is a slicer, an application that prepares your model for 3D printing. Optimized, expert-tested profiles for 3D printers and materials mean you can start printing reliably in no time. And with industry-standard software integration, you can streamline your workflow for maximum efficiency.</p>
<p>UltiMaker Cura is a slicer, an application that prepares your model for 3D printing. Optimized, expert-tested profiles for 3D printers and materials mean you can start printing reliably in no time. And with industry-standard software integration, you can streamline your workflow for maximum efficiency.</p>
</description>
<url type="homepage">https://ultimaker.com/en/software/ultimaker-cura</url>
<screenshots>
<screenshot type="default">
<caption>Print preparation screen</caption>
<image>https://raw.githubusercontent.com/Ultimaker/Cura/master/screenshot.png</image>
<image>https://raw.githubusercontent.com/Ultimaker/Cura/main/cura-logo.PNG</image>
</screenshot>
</screenshots>
</component>

View file

@ -1,11 +1,11 @@
[Desktop Entry]
Name=Ultimaker Cura
Name[de]=Ultimaker Cura
Name=UltiMaker Cura
Name[de]=UltiMaker Cura
GenericName=3D Printing Software
GenericName[de]=3D-Druck-Software
GenericName[nl]=3D-Print Software
Comment=Cura converts 3D models into paths for a 3D printer. It prepares your print for maximum accuracy, minimum printing time and good reliability with many extra features that make your print come out great.
Exec=Ultimaker-Cura %F
Exec=UltiMaker-Cura %F
Icon=cura-icon
Terminal=false
Type=Application

View file

@ -0,0 +1,155 @@
# Copyright (c) 2023 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
import os
import argparse # Command line arguments parsing and help.
import subprocess
from pathlib import Path
ULTIMAKER_CURA_DOMAIN = os.environ.get("ULTIMAKER_CURA_DOMAIN", "nl.ultimaker.cura")
def build_dmg(source_path: str, dist_path: str, filename: str, app_name: str) -> None:
create_dmg_executable = os.environ.get("CREATE_DMG_EXECUTABLE", "create-dmg")
arguments = [create_dmg_executable,
"--window-pos", "640", "360",
"--window-size", "690", "503",
"--app-drop-link", "520", "272",
"--volicon", f"{source_path}/packaging/icons/VolumeIcons_Cura.icns",
"--icon-size", "90",
"--icon", app_name, "169", "272",
"--eula", f"{source_path}/packaging/cura_license.txt",
"--background", f"{source_path}/packaging/MacOs/cura_background_dmg.png",
f"{dist_path}/{filename}",
f"{dist_path}/{app_name}"]
subprocess.run(arguments)
def build_pkg(dist_path: str, app_filename: str, component_filename: str, cura_version: str, installer_filename: str) -> None:
""" Builds and signs the pkg installer.
@param dist_path: Path to put output pkg in
@param app_filename: name of the .app file to bundle inside the pkg
@param component_filename: Name of the pkg component package to bundle the app in
@param cura_version: The version is used when automatically replacing existing versions with the installer.
@param installer_filename: Name of the installer that contains the component package
"""
pkg_build_executable = os.environ.get("PKG_BUILD_EXECUTABLE", "pkgbuild")
product_build_executable = os.environ.get("PRODUCT_BUILD_EXECUTABLE", "productbuild")
codesign_identity = os.environ.get("CODESIGN_IDENTITY")
# This builds the component package that contains UltiMaker-Cura.app. This component package will be bundled in a distribution package.
pkg_build_arguments = [
pkg_build_executable,
"--identifier", f"{ULTIMAKER_CURA_DOMAIN}_{cura_version}", # If we want to replace previous version automatically remove {cure_version}
"--component",
Path(dist_path, app_filename),
Path(dist_path, component_filename),
"--install-location", "/Applications",
]
if codesign_identity:
pkg_build_arguments.extend(["--sign", codesign_identity])
else:
print("CODESIGN_IDENTITY missing. The installer is not being signed")
subprocess.run(pkg_build_arguments)
# This automatically generates a distribution.xml file that is used to build the installer.
# If you want to make any changes to how the installer functions, this file should be changed to do that.
# TODO: Use --product {property_list_file} to pull keys out of file for distribution.xml. This can be used to set min requirements
distribution_creation_arguments = [
product_build_executable,
"--synthesize",
"--package", Path(dist_path, component_filename), # Package that will be inside installer
Path(dist_path, "distribution.xml"), # Output location for sythesized distributions file
]
subprocess.run(distribution_creation_arguments)
# This creates the distributable package (Installer)
installer_creation_arguments = [
product_build_executable,
"--distribution", Path(dist_path, "distribution.xml"),
"--package-path", dist_path, # Where to find the component packages mentioned in distribution.xml (UltiMaker-Cura.pkg)
Path(dist_path, installer_filename),
]
if codesign_identity:
installer_creation_arguments.extend(["--sign", codesign_identity])
subprocess.run(installer_creation_arguments)
def notarize_file(dist_path: str, filename: str) -> None:
""" Notarize a file. This takes 5+ minutes, there is indication that this step is successful."""
notarize_user = os.environ.get("MAC_NOTARIZE_USER")
notarize_password = os.environ.get("MAC_NOTARIZE_PASS")
altool_executable = os.environ.get("ALTOOL_EXECUTABLE", "altool")
notarize_arguments = [
"xcrun", altool_executable,
"--notarize-app",
"--primary-bundle-id", ULTIMAKER_CURA_DOMAIN,
"--username", notarize_user,
"--password", notarize_password,
"--file", Path(dist_path, filename)
]
subprocess.run(notarize_arguments)
def create_pkg_installer(filename: str, dist_path: str, cura_version: str, app_name: str) -> None:
""" Creates a pkg installer from {filename}.app called {filename}-Installer.pkg
The final package structure is UltiMaker-Cura-XXX-Installer.pkg[UltiMaker-Cura.pkg[UltiMaker-Cura.app]]. The outer
pkg file is a distributable pkg (Installer). Inside the distributable pkg there is a component pkg. The component
pkg contains the .app file that will be installed in the users Applications folder.
@param filename: The name of the app file and the app component package file without the extension
@param dist_path: The location to read the app from and save the pkg to
"""
filename_stem = Path(filename).stem
cura_component_package_name = f"{filename_stem}-Component.pkg" # This is a component package that is nested inside the installer, it contains the UltiMaker-Cura.app file This is the app file that will end up in your applications folder
build_pkg(dist_path, app_name, cura_component_package_name, cura_version, filename)
notarize = bool(os.environ.get("NOTARIZE_INSTALLER", "FALSE"))
if notarize:
notarize_file(dist_path, filename)
def create_dmg(filename: str, dist_path: str, source_path: str, app_name: str) -> None:
""" Creates a dmg executable from UltiMaker-Cura.app named {filename}.dmg
@param filename: The name of the app file and the output dmg file without the extension
@param dist_path: The location to read the app from and save the dmg to
@param source_path: The location of the project source files
"""
build_dmg(source_path, dist_path, filename, app_name)
notarize_dmg = bool(os.environ.get("NOTARIZE_DMG", "TRUE"))
if notarize_dmg:
notarize_file(dist_path, filename)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description = "Create installer for Cura.")
parser.add_argument("source_path", type = str, help = "Path to Pyinstaller source folder")
parser.add_argument("dist_path", type = str, help = "Path to Pyinstaller dist folder")
parser.add_argument("cura_conan_version", type = str, help="The version of cura")
parser.add_argument("filename", type = str, help = "Filename of the pkg/dmg (e.g. 'UltiMaker-Cura-5.1.0-beta-Macos-X64.pkg' or 'UltiMaker-Cura-5.1.0-beta-Macos-X64.dmg')")
parser.add_argument("app_name", type = str, help = "Filename of the .app that will be contained within the dmg/pkg")
args = parser.parse_args()
cura_version = args.cura_conan_version.split("/")[-1]
app_name = f"{args.app_name}.app"
if Path(args.filename).suffix == ".pkg":
create_pkg_installer(args.filename, args.dist_path, cura_version, app_name)
else:
create_dmg(args.filename, args.dist_path, args.source_path, app_name)

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 KiB

View file

@ -1,4 +1,4 @@
# Copyright (c) 2022 Ultimaker B.V.
# Copyright (c) 2022 UltiMaker B.V.
# Cura's build system is released under the terms of the AGPLv3 or higher.
!define APP_NAME "{{ app_name }}"
@ -64,7 +64,7 @@ InstallDir "$PROGRAMFILES64\${APP_NAME}"
!ifdef REG_START_MENU
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Ultimaker Cura"
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "UltiMaker Cura"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${REG_ROOT}"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${UNINSTALL_PATH}"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${REG_START_MENU}"
@ -113,8 +113,8 @@ CreateShortCut "$SMPROGRAMS\$SM_Folder\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE
CreateShortCut "$SMPROGRAMS\$SM_Folder\Uninstall ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe"
!ifdef WEB_SITE
WriteIniStr "$INSTDIR\Ultimaker Cura website.url" "InternetShortcut" "URL" "${WEB_SITE}"
CreateShortCut "$SMPROGRAMS\$SM_Folder\Ultimaker Cura website.lnk" "$INSTDIR\Ultimaker Cura website.url"
WriteIniStr "$INSTDIR\UltiMaker Cura website.url" "InternetShortcut" "URL" "${WEB_SITE}"
CreateShortCut "$SMPROGRAMS\$SM_Folder\UltiMaker Cura website.lnk" "$INSTDIR\UltiMaker Cura website.url"
!endif
!insertmacro MUI_STARTMENU_WRITE_END
!endif
@ -125,8 +125,8 @@ CreateShortCut "$SMPROGRAMS\{{ app_name }}\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP
CreateShortCut "$SMPROGRAMS\{{ app_name }}\Uninstall ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe"
!ifdef WEB_SITE
WriteIniStr "$INSTDIR\Ultimaker Cura website.url" "InternetShortcut" "URL" "${WEB_SITE}"
CreateShortCut "$SMPROGRAMS\{{ app_name }}\Ultimaker Cura website.lnk" "$INSTDIR\Ultimaker Cura website.url"
WriteIniStr "$INSTDIR\UltiMaker Cura website.url" "InternetShortcut" "URL" "${WEB_SITE}"
CreateShortCut "$SMPROGRAMS\{{ app_name }}\UltiMaker Cura website.lnk" "$INSTDIR\UltiMaker Cura website.url"
!endif
!endif
@ -170,7 +170,7 @@ RmDir /r /REBOOTOK "$INSTDIR"
Delete "$SMPROGRAMS\$SM_Folder\${APP_NAME}.lnk"
Delete "$SMPROGRAMS\$SM_Folder\Uninstall ${APP_NAME}.lnk"
!ifdef WEB_SITE
Delete "$SMPROGRAMS\$SM_Folder\Ultimaker Cura website.lnk"
Delete "$SMPROGRAMS\$SM_Folder\UltiMaker Cura website.lnk"
!endif
RmDir "$SMPROGRAMS\$SM_Folder"
!endif
@ -179,7 +179,7 @@ RmDir "$SMPROGRAMS\$SM_Folder"
Delete "$SMPROGRAMS\{{ app_name }}\${APP_NAME}.lnk"
Delete "$SMPROGRAMS\{{ app_name }}\Uninstall ${APP_NAME}.lnk"
!ifdef WEB_SITE
Delete "$SMPROGRAMS\{{ app_name }}\Ultimaker Cura website.lnk"
Delete "$SMPROGRAMS\{{ app_name }}\UltiMaker Cura website.lnk"
!endif
RmDir "$SMPROGRAMS\{{ app_name }}"
!endif

View file

@ -1,5 +1,7 @@
# Copyright (c) 2022 Ultimaker B.V.
# Copyright (c) 2022 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
import os
import argparse # Command line arguments parsing and help.
import subprocess
@ -16,15 +18,15 @@ def generate_nsi(source_path: str, dist_path: str, filename: str):
dist_loc = Path(os.getcwd(), dist_path)
source_loc = Path(os.getcwd(), source_path)
instdir = Path("$INSTDIR")
dist_paths = [p.relative_to(dist_loc.joinpath("Ultimaker-Cura")) for p in sorted(dist_loc.joinpath("Ultimaker-Cura").rglob("*")) if p.is_file()]
dist_paths = [p.relative_to(dist_loc.joinpath("UltiMaker-Cura")) for p in sorted(dist_loc.joinpath("UltiMaker-Cura").rglob("*")) if p.is_file()]
mapped_out_paths = {}
for dist_path in dist_paths:
if "__pycache__" not in dist_path.parts:
out_path = instdir.joinpath(dist_path).parent
if out_path not in mapped_out_paths:
mapped_out_paths[out_path] = [(dist_loc.joinpath("Ultimaker-Cura", dist_path), instdir.joinpath(dist_path))]
mapped_out_paths[out_path] = [(dist_loc.joinpath("UltiMaker-Cura", dist_path), instdir.joinpath(dist_path))]
else:
mapped_out_paths[out_path].append((dist_loc.joinpath("Ultimaker-Cura", dist_path), instdir.joinpath(dist_path)))
mapped_out_paths[out_path].append((dist_loc.joinpath("UltiMaker-Cura", dist_path), instdir.joinpath(dist_path)))
rmdir_paths = set()
for rmdir_f in mapped_out_paths.values():
@ -40,13 +42,13 @@ def generate_nsi(source_path: str, dist_path: str, filename: str):
nsis_content = template.render(
app_name = f"Ultimaker Cura {os.getenv('CURA_VERSION_FULL')}",
main_app = "Ultimaker-Cura.exe",
app_name = f"UltiMaker Cura {os.getenv('CURA_VERSION_FULL')}",
main_app = "UltiMaker-Cura.exe",
version = os.getenv('CURA_VERSION_FULL'),
version_major = os.environ.get("CURA_VERSION_MAJOR"),
version_minor = os.environ.get("CURA_VERSION_MINOR"),
version_patch = os.environ.get("CURA_VERSION_PATCH"),
company = "Ultimaker B.V.",
company = "UltiMaker",
web_site = "https://ultimaker.com",
year = datetime.now().year,
cura_license_file = str(source_loc.joinpath("packaging", "cura_license.txt")),
@ -58,7 +60,7 @@ def generate_nsi(source_path: str, dist_path: str, filename: str):
destination = filename
)
with open(dist_loc.joinpath("Ultimaker-Cura.nsi"), "w") as f:
with open(dist_loc.joinpath("UltiMaker-Cura.nsi"), "w") as f:
f.write(nsis_content)
shutil.copy(source_loc.joinpath("packaging", "NSIS", "fileassoc.nsh"), dist_loc.joinpath("fileassoc.nsh"))
@ -66,7 +68,7 @@ def generate_nsi(source_path: str, dist_path: str, filename: str):
def build(dist_path: str):
dist_loc = Path(os.getcwd(), dist_path)
command = ["makensis", "/V2", "/P4", str(dist_loc.joinpath("Ultimaker-Cura.nsi"))]
command = ["makensis", "/V2", "/P4", str(dist_loc.joinpath("UltiMaker-Cura.nsi"))]
subprocess.run(command)
@ -74,7 +76,7 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser(description = "Create Windows exe installer of Cura.")
parser.add_argument("source_path", type=str, help="Path to Conan install Cura folder.")
parser.add_argument("dist_path", type=str, help="Path to Pyinstaller dist folder")
parser.add_argument("filename", type = str, help = "Filename of the exe (e.g. 'Ultimaker-Cura-5.1.0-beta-Windows-X64.exe')")
parser.add_argument("filename", type = str, help = "Filename of the exe (e.g. 'UltiMaker-Cura-5.1.0-beta-Windows-X64.exe')")
args = parser.parse_args()
generate_nsi(args.source_path, args.dist_path, args.filename)
build(args.dist_path)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 KiB

After

Width:  |  Height:  |  Size: 604 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

View file

@ -1,67 +0,0 @@
import os
import argparse # Command line arguments parsing and help.
import subprocess
ULTIMAKER_CURA_DOMAIN = os.environ.get("ULTIMAKER_CURA_DOMAIN", "nl.ultimaker.cura")
def build_dmg(source_path: str, dist_path: str, filename: str) -> None:
create_dmg_executable = os.environ.get("CREATE_DMG_EXECUTABLE", "create-dmg")
arguments = [create_dmg_executable,
"--window-pos", "640", "360",
"--window-size", "690", "503",
"--app-drop-link", "520", "272",
"--volicon", f"{source_path}/packaging/icons/VolumeIcons_Cura.icns",
"--icon-size", "90",
"--icon", "Ultimaker-Cura.app", "169", "272",
"--eula", f"{source_path}/packaging/cura_license.txt",
"--background", f"{source_path}/packaging/dmg/cura_background_dmg.png",
f"{dist_path}/{filename}",
f"{dist_path}/Ultimaker-Cura.app"]
subprocess.run(arguments)
def sign(dist_path: str, filename: str) -> None:
codesign_executable = os.environ.get("CODESIGN", "codesign")
codesign_identity = os.environ.get("CODESIGN_IDENTITY")
arguments = [codesign_executable,
"-s", codesign_identity,
"--timestamp",
"-i", f"{ULTIMAKER_CURA_DOMAIN}.dmg", # TODO: check if this really should have the extra dmg. We seem to be doing this also in the old Rundeck scripts
f"{dist_path}/{filename}"]
subprocess.run(arguments)
def notarize(dist_path: str, filename: str) -> None:
notarize_user = os.environ.get("MAC_NOTARIZE_USER")
notarize_password = os.environ.get("MAC_NOTARIZE_PASS")
altool_executable = os.environ.get("ALTOOL_EXECUTABLE", "altool")
arguments = [
"xcrun", altool_executable,
"--notarize-app",
"--primary-bundle-id", ULTIMAKER_CURA_DOMAIN,
"--username", notarize_user,
"--password", notarize_password,
"--file", f"{dist_path}/{filename}"
]
subprocess.run(arguments)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description = "Create dmg of Cura.")
parser.add_argument("source_path", type=str, help="Path to Conan install Cura folder.")
parser.add_argument("dist_path", type=str, help="Path to Pyinstaller dist folder")
parser.add_argument("filename", type = str, help = "Filename of the dmg (e.g. 'Ultimaker-Cura-5.1.0-beta-Linux-X64.dmg')")
args = parser.parse_args()
build_dmg(args.source_path, args.dist_path, args.filename)
sign(args.dist_path, args.filename)
notarize_dmg = bool(os.environ.get("NOTARIZE_DMG", "TRUE"))
if notarize_dmg:
notarize(args.dist_path, args.filename)

View file

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wix="http://schemas.microsoft.com/wix/2006/wi"
xmlns="http://schemas.microsoft.com/wix/2006/wi"
version="1.0"
exclude-result-prefixes="xsl wix" >
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
<xsl:strip-space elements="*"/>
<!--
Find all <Component> elements with <File> elements with Source="" attributes ending in ".exe" and tag it with the "ExeToRemove" key.
<Component Id="cmpSYYKP6B1M7WSD5KLEQ7PZW4YLOPYG61L" Directory="INSTALLDIR" Guid="*">
<File Id="filKUS7ZRMJ0AOKDU6ATYY6IRUSR2ECPDFO" KeyPath="yes" Source="!(wix.StagingAreaPath)\ProofOfPEqualsNP.exe" />
</Component>
Because WiX's Heat.exe only supports XSLT 1.0 and not XSLT 2.0 we cannot use `ends-with( haystack, needle )` (e.g. `ends-with( wix:File/@Source, '.exe' )`...
...but we can use this longer `substring` expression instead (see https://github.com/wixtoolset/issues/issues/5609 )
-->
<xsl:key
name="ExeToRemove"
match="wix:Component[ substring( wix:File/@Source, string-length( wix:File/@Source ) - 3 ) = '.exe' ]"
use="@Id"
/> <!-- Get the last 4 characters of a string using `substring( s, len(s) - 3 )`, it uses -3 and not -4 because XSLT uses 1-based indexes, not 0-based indexes. -->
<!-- By default, copy all elements and nodes into the output... -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<!-- ...but if the element has the "ExeToRemove" key then don't render anything (i.e. removing it from the output) -->
<xsl:template match="*[ self::wix:Component or self::wix:ComponentRef ][ key( 'ExeToRemove', @Id ) ]"/>
</xsl:stylesheet>

View file

@ -0,0 +1,155 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:fw="http://schemas.microsoft.com/wix/FirewallExtension">
<Product
Id="*"
Name="{{ app_name }}"
Language="1033"
Version="{{ version_major }}.{{ version_minor }}.{{ version_patch }}"
Manufacturer="{{ company }}"
UpgradeCode="{{ upgrade_code }}"
>
<Package
Id="*"
InstallerVersion="500"
Compressed="yes"
InstallScope="perMachine"
Manufacturer="{{ company }}"
Description="UltiMaker Cura the most popular 3D printing slicer"
Keywords="UltiMaker,Cura,3D,printing,slicer"
Comments="Copyright (c) {{ year }} {{ company }}" />
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallFinalize">
<![CDATA[&UninstallOlderVersionFeature=3]]>
</RemoveExistingProducts>
</InstallExecuteSequence>
<Property Id="PREVIOUS_VERSIONS_INSTALLED" Secure="yes" />
<Upgrade Id="{{ upgrade_code }}">
<UpgradeVersion
Minimum="4.13.2" Maximum="{{ version_major }}.{{ version_minor }}.{{ version_patch }}"
Property="PREVIOUS_VERSIONS_INSTALLED"
IncludeMinimum="no" IncludeMaximum="yes"
/>
</Upgrade>
{% if "Enterprise" in app_name %}
<Property Id="PREVIOUS_413_INSTALLED" Secure="yes" />
<Upgrade Id="53C603BB-2B17-4206-A609-29C2E0D0B0AE">
<UpgradeVersion
Minimum="1.0.0" Maximum="4.13.2"
Property="PREVIOUS_VERSIONS_INSTALLED"
IncludeMinimum="yes" IncludeMaximum="yes"
/>
</Upgrade>
{% endif %}
<Condition Message= "OS must be Windows 8.1 64bit or higher.">
<![CDATA[Installed OR VersionNT64 >= 600]]>
</Condition>
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
<UIRef Id="WixUI_Mondo" />
<WixVariable Id="WixUILicenseRtf" Value="{{ cura_license_file }}" />
<WixVariable Id="WixUIDialogBmp" Value="{{ cura_banner_side }}" />
<WixVariable Id="WixUIBannerBmp" Value="{{ cura_banner_top }}" />
<Icon Id="ICO_Cura" SourceFile="{{ cura_icon }}" />
<Property Id="ARPPRODUCTICON" Value="ICO_Cura" />
<!--Directory structure-->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="APPLICATIONFOLDER" Name="{{ app_name }} {{ version }}" />
<Directory Id="ProgramMenuFolder">
<Directory Id="ShortCutDir" Name="{{ app_name }}" />
</Directory>
</Directory>
</Directory>
<Property Id="ApplicationFolderName" Value="{{ app_name }} {{ version }}" />
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />
<Component Id="CMP_UltiMaker_Cura_exe" Directory="APPLICATIONFOLDER" Guid="*">
<File Id="FILE_UltiMaker_Cura_exe" KeyPath="yes" Source="$(var.CuraDir)\{{ main_app }}" />
<ProgId Id="Cura" Description="{{ app_name }}" Icon="ICO_Cura" Advertise="yes">
<ProgId Id="3mf" Advertise="yes">
<Extension Id="3mf" ContentType="application/3mf">
<Verb Id="open_3mf" Command="Open" Argument='"%1"' />
<MIME Advertise="yes" ContentType="application/3mf" Default="yes" />
</Extension>
</ProgId>
<ProgId Id="stl" Advertise="yes">
<Extension Id="stl" ContentType="application/stl">
<Verb Id="open_stl" Command="Open" Argument='"%1"' />
<MIME Advertise="yes" ContentType="application/stl" Default="yes" />
</Extension>
</ProgId>
<ProgId Id="gcode" Advertise="yes">
<Extension Id="gcode" ContentType="text/x-gcode">
<Verb Id="open_gcode" Command="Open" Argument='"%1"' />
<MIME Advertise="yes" ContentType="text/x-gcode" Default="yes" />
</Extension>
</ProgId>
<ProgId Id="ufp" Advertise="yes">
<Extension Id="ufp" ContentType="application/x-ufp">
<Verb Id="open_ufp" Command="Open" Argument='"%1"' />
<MIME Advertise="yes" ContentType="application/x-ufp" Default="yes" />
</Extension>
</ProgId>
<ProgId Id="curapackage" Advertise="yes">
<Extension Id='curapackage' ContentType='application/curapackage'>
<Verb Id='open_curapackage' Command="Open" Argument='"%1"' />
<MIME Advertise="yes" ContentType="application/curapackage" Default="yes" />
</Extension>
</ProgId>
</ProgId>
<fw:FirewallException Id="FirewallExceptLocalFrontend" Name="Cura (Frontend) Connection (LocalHost)" File="FILE_UltiMaker_Cura_exe" IgnoreFailure="yes">
<fw:RemoteAddress>127.0.0.1</fw:RemoteAddress>
</fw:FirewallException>
</Component>
<Component Id="CMP_CuraEngine_exe" Directory="APPLICATIONFOLDER" Guid="*">
<File Id="FILE_CuraEngine_exe" KeyPath="yes" Source="$(var.CuraDir)\CuraEngine.exe" />
<fw:FirewallException Id="FirewallExceptLocalEngine" Name="CuraEngine (Backend) Connection (LocalHost)" File="FILE_CuraEngine_exe" IgnoreFailure="yes">
<fw:RemoteAddress>127.0.0.1</fw:RemoteAddress>
</fw:FirewallException>
</Component>
<!--Shortcuts-->
<DirectoryRef Id="ShortCutDir">
<Component Id="CMP_Shortcuts" Guid="*">
<Shortcut Id="SHRT_Cura"
Name="{{ app_name }} {{ version }}"
Description="{{ app_name }} {{ version }}"
Target="[APPLICATIONFOLDER]\{{ main_app }}"
Icon="ICO_Cura" />
<Shortcut Id="SHRT_UninstallShortcut"
Name="Uninstall {{ app_name }} {{ version }}"
Description= "Uninstalls {{ app_name }} {{ version }}"
Target="[System64Folder]msiexec.exe"
Arguments="/x [ProductCode]" />
<RemoveFolder Id="RemoveMyShortcutsDir"
On="uninstall" />
<RegistryValue Root="HKCU"
Key="Software\{{ company }}\{{ app_name }}\{{ version }}"
Name="installed"
Type="integer"
Value="1"
KeyPath="yes" />
</Component>
</DirectoryRef>
<Feature Id="ProductFeature" Title="{{ app_name }}" Level="1" ConfigurableDirectory="APPLICATIONFOLDER">
<ComponentRef Id="CMP_UltiMaker_Cura_exe" />
<ComponentRef Id="CMP_CuraEngine_exe" />
<ComponentGroupRef Id="NewFilesGroup" />
<ComponentRef Id="CMP_Shortcuts" />
</Feature>
<Feature Id="UninstallOlderVersionFeature" Title="Uninstall previous versions" Level="{{ 1 if "Enterprise" in app_name else 0 }}" Description="..."/>
</Product>
</Wix>

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

View file

@ -0,0 +1,122 @@
# Copyright (c) 2022 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
import argparse # Command line arguments parsing and help.
import os
import shutil
import subprocess
import uuid
from datetime import datetime
from pathlib import Path
from jinja2 import Template
def work_path(filename: Path) -> Path:
if not filename.is_absolute():
return Path(os.getcwd(), filename.parent)
else:
return filename.parent
def generate_wxs(source_path: Path, dist_path: Path, filename: Path, app_name: str):
source_loc = Path(os.getcwd(), source_path)
dist_loc = Path(os.getcwd(), dist_path)
work_loc = work_path(filename)
work_loc.mkdir(parents=True, exist_ok=True)
jinja_template_path = Path(source_loc.joinpath("packaging", "msi", "UltiMaker-Cura.wxs.jinja"))
with open(jinja_template_path, "r") as f:
template = Template(f.read())
wxs_content = template.render(
app_name=f"{app_name}",
main_app="UltiMaker-Cura.exe",
version=os.getenv('CURA_VERSION_FULL'),
version_major=os.environ.get("CURA_VERSION_MAJOR"),
version_minor=os.environ.get("CURA_VERSION_MINOR"),
version_patch=os.environ.get("CURA_VERSION_PATCH"),
company="UltiMaker",
web_site="https://ultimaker.com",
year=datetime.now().year,
upgrade_code=str(uuid.uuid5(uuid.NAMESPACE_DNS, app_name)),
cura_license_file=str(source_loc.joinpath("packaging", "msi", "cura_license.rtf")),
cura_banner_top=str(source_loc.joinpath("packaging", "msi", "banner_top.bmp")),
cura_banner_side=str(source_loc.joinpath("packaging", "msi", "banner_side.bmp")),
cura_icon=str(source_loc.joinpath("packaging", "icons", "Cura.ico")),
)
with open(work_loc.joinpath("UltiMaker-Cura.wxs"), "w") as f:
f.write(wxs_content)
try:
shutil.copy(source_loc.joinpath("packaging", "msi", "ExcludeComponents.xslt"),
work_loc.joinpath("ExcludeComponents.xslt"))
except shutil.SameFileError:
pass
def cleanup_artifacts(dist_path: Path):
dist_loc = Path(os.getcwd(), dist_path)
dirt = [d for d in dist_loc.rglob("__pycache__") if d.is_dir()]
dirt += [d for d in dist_loc.rglob("*.dist-info") if d.is_dir()]
for d in dirt:
if d.exists():
shutil.rmtree(d, ignore_errors=True)
def build(dist_path: Path, filename: Path):
dist_loc = Path(os.getcwd(), dist_path)
work_loc = work_path(filename)
wxs_loc = work_loc.joinpath("UltiMaker-Cura.wxs")
heat_loc = work_loc.joinpath("HeatFile.wxs")
exclude_components_loc = work_loc.joinpath("ExcludeComponents.xslt")
build_loc = work_loc.joinpath("build_msi")
heat_command = ["heat",
"dir", f"{dist_loc.as_posix()}\\",
"-dr", "APPLICATIONFOLDER",
"-cg", "NewFilesGroup",
"-sw5150", # Don't pollute logs with warnings from auto generated content
"-gg",
"-g1",
"-sf",
"-srd",
"-var", "var.CuraDir",
"-t", f"{exclude_components_loc.as_posix()}",
"-out", f"{heat_loc.as_posix()}"]
subprocess.call(heat_command)
build_command = ["candle",
"-arch", "x64",
f"-dCuraDir={dist_loc}\\",
"-ext", "WixFirewallExtension",
"-out", f"{build_loc.as_posix()}\\",
f"{wxs_loc.as_posix()}",
f"{heat_loc.as_posix()}"]
subprocess.call(build_command)
link_command = ["light",
f"{build_loc.joinpath(wxs_loc.name).with_suffix('.wixobj')}",
f"{build_loc.joinpath(heat_loc.name).with_suffix('.wixobj')}",
"-sw1076", # Don't pollute logs with warnings from auto generated content
"-dcl:high", # Use high compression ratio
"-sval", # Disable ICE validation otherwise the CI complains
"-ext", "WixUIExtension",
"-ext", "WixFirewallExtension",
"-out", f"{work_loc.joinpath(filename.name)}"]
subprocess.call(link_command)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Create Windows msi installer of Cura.")
parser.add_argument("source_path", type=Path, help="Path to Conan install Cura folder.")
parser.add_argument("dist_path", type=Path, help="Path to Pyinstaller dist folder")
parser.add_argument("filename", type=Path,
help="Filename of the exe (e.g. 'UltiMaker-Cura-5.1.0-beta-Windows-X64.msi')")
parser.add_argument("name", type=str, help="App name (e.g. 'UltiMaker Cura')")
args = parser.parse_args()
generate_wxs(args.source_path.resolve(), args.dist_path.resolve(), args.filename.resolve(), args.name)
cleanup_artifacts(args.dist_path.resolve())
build(args.dist_path.resolve(), args.filename)

View file

@ -0,0 +1,183 @@
{\rtf1\ansi\ansicpg1252\deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fmodern\fprq1\fcharset0 Courier New;}}
{\colortbl ;\red0\green0\blue255;}
{\stylesheet{ Normal;}{\s1 heading 1;}{\s2 heading 2;}{\s3 heading 3;}{\s4 heading 4;}}
{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\s3\sb100\sa100\qc\b\f0\fs27 GNU LESSER GENERAL PUBLIC LICENSE\par
\pard\sb100\sa100\qc\b0\fs24 Version 3, 29 June 2007\par
\pard Copyright \'a9 2007 Free Software Foundation, Inc. <{\field{\*\fldinst{HYPERLINK "http://fsf.org/"}}{\fldrslt{\ul\cf1 http://fsf.org/}}}\f0\fs24 >\par
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\par
This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.\par
\pard\s4\sb100\sa100\b 0. Additional Definitions.\par
\pard\sb100\sa100\b0 As used herein, \ldblquote this License\rdblquote refers to version 3 of the GNU Lesser General Public License, and the \ldblquote GNU GPL\rdblquote refers to version 3 of the GNU General Public License.\par
\ldblquote The Library\rdblquote refers to a covered work governed by this License, other than an Application or a Combined Work as defined below.\par
An \ldblquote Application\rdblquote is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library.\par
A \ldblquote Combined Work\rdblquote is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the \ldblquote Linked Version\rdblquote .\par
The \ldblquote Minimal Corresponding Source\rdblquote for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version.\par
The \ldblquote Corresponding Application Code\rdblquote for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work.\par
\pard\s4\sb100\sa100\b 1. Exception to Section 3 of the GNU GPL.\par
\pard\sb100\sa100\b0 You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL.\par
\pard\s4\sb100\sa100\b 2. Conveying Modified Versions.\par
\pard\sb100\sa100\b0 If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version:\par
\pard\fi-360\li720\sb100\sa100\tx720\f1\fs20\'b7\tab\f0\fs24 a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or\par
\pard\fi-360\li720\sb100\sa100\f1\fs20\'b7\tab\f0\fs24 b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy.\par
\pard\s4\sb100\sa100\b 3. Object Code Incorporating Material from Library Header Files.\par
\pard\sb100\sa100\b0 The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:\par
\pard\fi-360\li720\sb100\sa100\tx720\f1\fs20\'b7\tab\f0\fs24 a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.\par
\pard\fi-360\li720\sb100\sa100\f1\fs20\'b7\tab\f0\fs24 b) Accompany the object code with a copy of the GNU GPL and this license document.\par
\pard\s4\sb100\sa100\b 4. Combined Works.\par
\pard\sb100\sa100\b0 You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following:\par
\pard\fi-360\li720\sb100\sa100\tx720\f1\fs20\'b7\tab\f0\fs24 a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.\par
\pard\fi-360\li720\sb100\sa100\f1\fs20\'b7\tab\f0\fs24 b) Accompany the Combined Work with a copy of the GNU GPL and this license document.\par
\f1\fs20\'b7\tab\f0\fs24 c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.\par
\f1\fs20\'b7\tab\f0\fs24 d) Do one of the following: \par
\pard\fi-360\li1440\sb100\sa100\tx1440\f2\fs20 o\tab\f0\fs24 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.\par
\pard\fi-360\li1440\sb100\sa100\f2\fs20 o\tab\f0\fs24 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.\par
\pard\fi-360\li720\sb100\sa100\tx720\f1\fs20\'b7\tab\f0\fs24 e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)\par
\pard\s4\sb100\sa100\b 5. Combined Libraries.\par
\pard\sb100\sa100\b0 You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following:\par
\pard\fi-360\li720\sb100\sa100\tx720\f1\fs20\'b7\tab\f0\fs24 a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License.\par
\pard\fi-360\li720\sb100\sa100\f1\fs20\'b7\tab\f0\fs24 b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.\par
\pard\s4\sb100\sa100\b 6. Revised Versions of the GNU Lesser General Public License.\par
\pard\sb100\sa100\b0 The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\par
Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License \ldblquote or any later version\rdblquote applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation.\par
If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.\par
\par
\pard\s3\sb100\sa100\qc\b\fs27 GNU GENERAL PUBLIC LICENSE\par
\pard\sb100\sa100\qc\b0\fs24 Version 3, 29 June 2007\par
\pard Copyright \'a9 2007 Free Software Foundation, Inc. <{\field{\*\fldinst{HYPERLINK "http://fsf.org/"}}{\fldrslt{\ul\cf1 http://fsf.org/}}}\f0\fs24 >\par
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\par
\pard\s3\sb100\sa100\b\fs27 Preamble\par
\pard\sb100\sa100\b0\fs24 The GNU General Public License is a free, copyleft license for software and other kinds of works.\par
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.\par
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.\par
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.\par
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.\par
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.\par
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.\par
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.\par
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.\par
The precise terms and conditions for copying, distribution and modification follow.\par
\pard\s3\sb100\sa100\b\fs27 TERMS AND CONDITIONS\par
\pard\s4\sb100\sa100\fs24 0. Definitions.\par
\pard\sb100\sa100\b0\ldblquote This License\rdblquote refers to version 3 of the GNU General Public License.\par
\ldblquote Copyright\rdblquote also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.\par
\ldblquote The Program\rdblquote refers to any copyrightable work licensed under this License. Each licensee is addressed as \ldblquote you\rdblquote . \ldblquote Licensees\rdblquote and \ldblquote recipients\rdblquote may be individuals or organizations.\par
To \ldblquote modify\rdblquote a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a \ldblquote modified version\rdblquote of the earlier work or a work \ldblquote based on\rdblquote the earlier work.\par
A \ldblquote covered work\rdblquote means either the unmodified Program or a work based on the Program.\par
To \ldblquote propagate\rdblquote a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.\par
To \ldblquote convey\rdblquote a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.\par
An interactive user interface displays \ldblquote Appropriate Legal Notices\rdblquote to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.\par
\pard\s4\sb100\sa100\b 1. Source Code.\par
\pard\sb100\sa100\b0 The \ldblquote source code\rdblquote for a work means the preferred form of the work for making modifications to it. \ldblquote Object code\rdblquote means any non-source form of a work.\par
A \ldblquote Standard Interface\rdblquote means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.\par
The \ldblquote System Libraries\rdblquote of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A \ldblquote Major Component\rdblquote , in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.\par
The \ldblquote Corresponding Source\rdblquote for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.\par
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.\par
The Corresponding Source for a work in source code form is that same work.\par
\pard\s4\sb100\sa100\b 2. Basic Permissions.\par
\pard\sb100\sa100\b0 All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.\par
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.\par
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.\par
\pard\s4\sb100\sa100\b 3. Protecting Users' Legal Rights From Anti-Circumvention Law.\par
\pard\sb100\sa100\b0 No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.\par
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.\par
\pard\s4\sb100\sa100\b 4. Conveying Verbatim Copies.\par
\pard\sb100\sa100\b0 You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.\par
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.\par
\pard\s4\sb100\sa100\b 5. Conveying Modified Source Versions.\par
\pard\sb100\sa100\b0 You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:\par
\pard\fi-360\li720\sb100\sa100\tx720\f1\fs20\'b7\tab\f0\fs24 a) The work must carry prominent notices stating that you modified it, and giving a relevant date.\par
\pard\fi-360\li720\sb100\sa100\f1\fs20\'b7\tab\f0\fs24 b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to \ldblquote keep intact all notices\rdblquote .\par
\f1\fs20\'b7\tab\f0\fs24 c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.\par
\f1\fs20\'b7\tab\f0\fs24 d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.\par
\pard\sb100\sa100 A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an \ldblquote aggregate\rdblquote if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.\par
\pard\s4\sb100\sa100\b 6. Conveying Non-Source Forms.\par
\pard\sb100\sa100\b0 You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:\par
\pard\fi-360\li720\sb100\sa100\tx720\f1\fs20\'b7\tab\f0\fs24 a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.\par
\pard\fi-360\li720\sb100\sa100\f1\fs20\'b7\tab\f0\fs24 b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.\par
\f1\fs20\'b7\tab\f0\fs24 c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.\par
\f1\fs20\'b7\tab\f0\fs24 d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.\par
\f1\fs20\'b7\tab\f0\fs24 e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.\par
\pard\sb100\sa100 A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.\par
A \ldblquote User Product\rdblquote is either (1) a \ldblquote consumer product\rdblquote , which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, \ldblquote normally used\rdblquote refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.\par
\ldblquote Installation Information\rdblquote for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.\par
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).\par
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.\par
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.\par
\pard\s4\sb100\sa100\b 7. Additional Terms.\par
\pard\sb100\sa100\b0\ldblquote Additional permissions\rdblquote are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.\par
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.\par
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:\par
\pard\fi-360\li720\sb100\sa100\tx720\f1\fs20\'b7\tab\f0\fs24 a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or\par
\pard\fi-360\li720\sb100\sa100\f1\fs20\'b7\tab\f0\fs24 b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or\par
\f1\fs20\'b7\tab\f0\fs24 c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or\par
\f1\fs20\'b7\tab\f0\fs24 d) Limiting the use for publicity purposes of names of licensors or authors of the material; or\par
\f1\fs20\'b7\tab\f0\fs24 e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or\par
\f1\fs20\'b7\tab\f0\fs24 f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.\par
\pard\sb100\sa100 All other non-permissive additional terms are considered \ldblquote further restrictions\rdblquote within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.\par
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.\par
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.\par
\pard\s4\sb100\sa100\b 8. Termination.\par
\pard\sb100\sa100\b0 You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).\par
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.\par
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.\par
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.\par
\pard\s4\sb100\sa100\b 9. Acceptance Not Required for Having Copies.\par
\pard\sb100\sa100\b0 You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.\par
\pard\s4\sb100\sa100\b 10. Automatic Licensing of Downstream Recipients.\par
\pard\sb100\sa100\b0 Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.\par
An \ldblquote entity transaction\rdblquote is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.\par
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.\par
\pard\s4\sb100\sa100\b 11. Patents.\par
\pard\sb100\sa100\b0 A \ldblquote contributor\rdblquote is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's \ldblquote contributor version\rdblquote .\par
A contributor's \ldblquote essential patent claims\rdblquote are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, \ldblquote control\rdblquote includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.\par
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.\par
In the following three paragraphs, a \ldblquote patent license\rdblquote is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To \ldblquote grant\rdblquote such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.\par
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. \ldblquote Knowingly relying\rdblquote means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.\par
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.\par
A patent license is \ldblquote discriminatory\rdblquote if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.\par
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.\par
\pard\s4\sb100\sa100\b 12. No Surrender of Others' Freedom.\par
\pard\sb100\sa100\b0 If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.\par
\pard\s4\sb100\sa100\b 13. Use with the GNU Affero General Public License.\par
\pard\sb100\sa100\b0 Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.\par
\pard\s4\sb100\sa100\b 14. Revised Versions of this License.\par
\pard\sb100\sa100\b0 The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\par
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License \ldblquote or any later version\rdblquote applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.\par
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.\par
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.\par
\pard\s4\sb100\sa100\b 15. Disclaimer of Warranty.\par
\pard\sb100\sa100\b0 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \ldblquote AS IS\rdblquote WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\par
\pard\s4\sb100\sa100\b 16. Limitation of Liability.\par
\pard\sb100\sa100\b0 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\par
\pard\s4\sb100\sa100\b 17. Interpretation of Sections 15 and 16.\par
\pard\sb100\sa100\b0 If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.\par
END OF TERMS AND CONDITIONS\par
\pard\s3\sb100\sa100\b\fs27 How to Apply These Terms to Your New Programs\par
\pard\sb100\sa100\b0\fs24 If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.\par
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the \ldblquote copyright\rdblquote line and a pointer to where the full notice is found.\par
\pard\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\f2\fs20 <one line to give the program's name and a brief idea of what it does.>\par
Copyright (C) <year> <name of author>\par
\par
This program is free software: you can redistribute it and/or modify\par
it under the terms of the GNU General Public License as published by\par
the Free Software Foundation, either version 3 of the License, or\par
(at your option) any later version.\par
\par
This program is distributed in the hope that it will be useful,\par
but WITHOUT ANY WARRANTY; without even the implied warranty of\par
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\par
GNU General Public License for more details.\par
\par
You should have received a copy of the GNU General Public License\par
along with this program. If not, see <{\field{\*\fldinst{HYPERLINK "http://www.gnu.org/licenses/"}}{\fldrslt{\ul\cf1 http://www.gnu.org/licenses/}}}\f2\fs20 >.\par
\pard\sb100\sa100\f0\fs24 Also add information on how to contact you by electronic and paper mail.\par
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:\par
\pard\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\f2\fs20 <program> Copyright (C) <year> <name of author>\par
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\par
This is free software, and you are welcome to redistribute it\par
under certain conditions; type `show c' for details.\par
\pard\sb100\sa100\f0\fs24 The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an \ldblquote about box\rdblquote .\par
\pard You should also get your employer (if you work as a programmer) or school, if any, to sign a \ldblquote copyright disclaimer\rdblquote for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <{\field{\*\fldinst{HYPERLINK "http://www.gnu.org/licenses/"}}{\fldrslt{\ul\cf1 http://www.gnu.org/licenses/}}}\f0\fs24 >.\par
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <{\field{\*\fldinst{HYPERLINK "http://www.gnu.org/philosophy/why-not-lgpl.html"}}{\fldrslt{\ul\cf1 http://www.gnu.org/philosophy/why-not-lgpl.html}}}\f0\fs24 >.\par
\pard\sb100\sa100\par
}

View file

@ -9,6 +9,7 @@ from typing import cast, Dict, List, Optional, Tuple, Any, Set
import xml.etree.ElementTree as ET
from UM.Util import parseBool
from UM.Workspace.WorkspaceReader import WorkspaceReader
from UM.Application import Application
@ -599,7 +600,6 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
self._dialog.setNumUserSettings(num_user_settings)
self._dialog.setActiveMode(active_mode)
self._dialog.setUpdatableMachines(updatable_machines)
self._dialog.setMachineName(machine_name)
self._dialog.setMaterialLabels(material_labels)
self._dialog.setMachineType(machine_type)
self._dialog.setExtruders(extruders)
@ -608,6 +608,36 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
self._dialog.setMissingPackagesMetadata(missing_package_metadata)
self._dialog.show()
# Choosing the initially selected printer in MachineSelector
is_networked_machine = False
is_abstract_machine = False
if global_stack and isinstance(global_stack, GlobalStack):
# The machine included in the project file exists locally already, no need to change selected printers.
is_networked_machine = global_stack.hasNetworkedConnection()
is_abstract_machine = parseBool(existing_global_stack.getMetaDataEntry("is_abstract_machine", False))
self._dialog.setMachineToOverride(global_stack.getId())
self._dialog.setResolveStrategy("machine", "override")
elif self._dialog.updatableMachinesModel.count > 0:
# The machine included in the project file does not exist. There is another machine of the same type.
# This will always default to an abstract machine first.
machine = self._dialog.updatableMachinesModel.getItem(0)
machine_name = machine["name"]
is_networked_machine = machine["isNetworked"]
is_abstract_machine = machine["isAbstractMachine"]
self._dialog.setMachineToOverride(machine["id"])
self._dialog.setResolveStrategy("machine", "override")
else:
# The machine included in the project file does not exist. There are no other printers of the same type. Default to "Create New".
machine_name = i18n_catalog.i18nc("@button", "Create new")
is_networked_machine = False
is_abstract_machine = False
self._dialog.setMachineToOverride(None)
self._dialog.setResolveStrategy("machine", "new")
self._dialog.setIsNetworkedMachine(is_networked_machine)
self._dialog.setIsAbstractMachine(is_abstract_machine)
self._dialog.setMachineName(machine_name)
# Block until the dialog is closed.
self._dialog.waitForClose()
@ -670,7 +700,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
temp_preferences = Preferences()
try:
serialized = archive.open("Cura/preferences.cfg").read().decode("utf-8")
except KeyError:
except KeyError as e:
# If there is no preferences file, it's not a workspace, so notify user of failure.
Logger.log("w", "File %s is not a valid workspace.", file_name)
message = Message(i18n_catalog.i18nc("@info:error Don't translate the XML tags <filename> or <message>!",
@ -702,7 +732,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
application.expandedCategoriesChanged.emit() # Notify the GUI of the change
# If there are no machines of the same type, create a new machine.
if self._resolve_strategies["machine"] != "override" or self._dialog.updatableMachinesModel.count <= 1:
if self._resolve_strategies["machine"] != "override" or self._dialog.updatableMachinesModel.count == 0:
# We need to create a new machine
machine_name = self._container_registry.uniqueName(self._machine_info.name)

View file

@ -1,43 +0,0 @@
# Copyright (c) 2020 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import Dict, List
from PyQt6.QtCore import Qt
from UM.Qt.ListModel import ListModel
from cura.Settings.GlobalStack import GlobalStack
create_new_list_item = {
"id": "new",
"name": "Create new",
"displayName": "Create new",
"type": "default_option" # to make sure we are not mixing the "Create new" option with a printer with id "new"
} # type: Dict[str, str]
class UpdatableMachinesModel(ListModel):
"""Model that holds cura packages.
By setting the filter property the instances held by this model can be changed.
"""
def __init__(self, parent = None) -> None:
super().__init__(parent)
self.addRoleName(Qt.ItemDataRole.UserRole + 1, "id")
self.addRoleName(Qt.ItemDataRole.UserRole + 2, "name")
self.addRoleName(Qt.ItemDataRole.UserRole + 3, "displayName")
self.addRoleName(Qt.ItemDataRole.UserRole + 4, "type") # Either "default_option" or "machine"
def update(self, machines: List[GlobalStack]) -> None:
items = [create_new_list_item] # type: List[Dict[str, str]]
for machine in sorted(machines, key = lambda printer: printer.name):
items.append({
"id": machine.id,
"name": machine.name,
"displayName": "Update " + machine.name,
"type": "machine"
})
self.setItems(items)

View file

@ -5,6 +5,7 @@ from PyQt6.QtCore import pyqtSignal, QObject, pyqtProperty, QCoreApplication, QU
from PyQt6.QtGui import QDesktopServices
from typing import List, Optional, Dict, cast
from cura.Machines.Models.MachineListModel import MachineListModel
from cura.Settings.GlobalStack import GlobalStack
from UM.Application import Application
from UM.FlameProfiler import pyqtSlot
@ -14,8 +15,6 @@ from UM.Message import Message
from UM.PluginRegistry import PluginRegistry
from UM.Settings.ContainerRegistry import ContainerRegistry
from .UpdatableMachinesModel import UpdatableMachinesModel
import os
import threading
import time
@ -63,10 +62,12 @@ class WorkspaceDialog(QObject):
self._extruders = []
self._objects_on_plate = False
self._is_printer_group = False
self._updatable_machines_model = UpdatableMachinesModel(self)
self._updatable_machines_model = MachineListModel(self, listenToChanges=False)
self._missing_package_metadata: List[Dict[str, str]] = []
self._plugin_registry: PluginRegistry = CuraApplication.getInstance().getPluginRegistry()
self._install_missing_package_dialog: Optional[QObject] = None
self._is_abstract_machine = False
self._is_networked_machine = False
machineConflictChanged = pyqtSignal()
qualityChangesConflictChanged = pyqtSignal()
@ -80,6 +81,8 @@ class WorkspaceDialog(QObject):
intentNameChanged = pyqtSignal()
machineNameChanged = pyqtSignal()
updatableMachinesChanged = pyqtSignal()
isAbstractMachineChanged = pyqtSignal()
isNetworkedChanged = pyqtSignal()
materialLabelsChanged = pyqtSignal()
objectsOnPlateChanged = pyqtSignal()
numUserSettingsChanged = pyqtSignal()
@ -161,13 +164,31 @@ class WorkspaceDialog(QObject):
self.machineNameChanged.emit()
@pyqtProperty(QObject, notify = updatableMachinesChanged)
def updatableMachinesModel(self) -> UpdatableMachinesModel:
return cast(UpdatableMachinesModel, self._updatable_machines_model)
def updatableMachinesModel(self) -> MachineListModel:
return cast(MachineListModel, self._updatable_machines_model)
def setUpdatableMachines(self, updatable_machines: List[GlobalStack]) -> None:
self._updatable_machines_model.update(updatable_machines)
self._updatable_machines_model.set_machines_filter(updatable_machines)
self.updatableMachinesChanged.emit()
@pyqtProperty(bool, notify = isAbstractMachineChanged)
def isAbstractMachine(self) -> bool:
return self._is_abstract_machine
@pyqtSlot(bool)
def setIsAbstractMachine(self, is_abstract_machine: bool) -> None:
self._is_abstract_machine = is_abstract_machine
self.isAbstractMachineChanged.emit()
@pyqtProperty(bool, notify = isNetworkedChanged)
def isNetworked(self) -> bool:
return self._is_networked_machine
@pyqtSlot(bool)
def setIsNetworkedMachine(self, is_networked_machine: bool) -> None:
self._is_networked_machine = is_networked_machine
self.isNetworkedChanged.emit()
@pyqtProperty(str, notify=qualityTypeChanged)
def qualityType(self) -> str:
return self._quality_type

View file

@ -1,4 +1,4 @@
// Copyright (c) 2020 Ultimaker B.V.
// Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10
@ -11,47 +11,48 @@ import Cura 1.1 as Cura
UM.Dialog
{
id: base
id: workspaceDialog
title: catalog.i18nc("@title:window", "Open Project")
minimumWidth: UM.Theme.getSize("popup_dialog").width
minimumHeight: UM.Theme.getSize("popup_dialog").height
width: minimumWidth
backgroundColor: UM.Theme.getColor("main_background")
margin: UM.Theme.getSize("default_margin").width
property int comboboxHeight: UM.Theme.getSize("default_margin").height
minimumWidth: UM.Theme.getSize("modal_window_minimum").width
minimumHeight: UM.Theme.getSize("modal_window_minimum").height
onClosing: manager.notifyClosed()
onVisibleChanged:
backgroundColor: UM.Theme.getColor("detail_background")
headerComponent: Rectangle
{
if (visible)
height: childrenRect.height + 2 * UM.Theme.getSize("default_margin").height
color: UM.Theme.getColor("main_background")
UM.Label
{
machineResolveComboBox.currentIndex = 0
qualityChangesResolveComboBox.currentIndex = 0
materialResolveComboBox.currentIndex = 0
id: titleLabel
text: catalog.i18nc("@action:title", "Summary - Cura Project")
font: UM.Theme.getFont("large")
anchors.top: parent.top
anchors.left: parent.left
anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.leftMargin: UM.Theme.getSize("default_margin").height
}
}
Flickable
Rectangle
{
clip: true
width: parent.width
height: parent.height
contentHeight: dialogSummaryItem.height
ScrollBar.vertical: UM.ScrollBar { id: verticalScrollBar }
anchors.fill: parent
UM.I18nCatalog { id: catalog; name: "cura" }
color: UM.Theme.getColor("main_background")
Item
Flickable
{
id: dialogSummaryItem
width: verticalScrollBar.visible ? parent.width - verticalScrollBar.width - UM.Theme.getSize("default_margin").width : parent.width
height: childrenRect.height
anchors.margins: 10 * screenScaleFactor
width: parent.width
height: parent.height
UM.I18nCatalog
{
id: catalog
name: "cura"
}
clip: true
contentHeight: contentColumn.height
ScrollBar.vertical: UM.ScrollBar { id: scrollbar }
ListModel
{
@ -68,373 +69,245 @@ UM.Dialog
Column
{
width: parent.width
id: contentColumn
width: parent.width - scrollbar.width - UM.Theme.getSize("default_margin").width
height: childrenRect.height
spacing: UM.Theme.getSize("default_margin").height
leftPadding: UM.Theme.getSize("default_margin").width
rightPadding: UM.Theme.getSize("default_margin").width
Column
WorkspaceSection
{
width: parent.width
height: childrenRect.height
UM.Label
id: printerSection
title: catalog.i18nc("@action:label", "Printer settings")
iconSource: UM.Theme.getIcon("Printer")
content: Column
{
id: titleLabel
text: catalog.i18nc("@action:title", "Summary - Cura Project")
font: UM.Theme.getFont("large")
}
spacing: UM.Theme.getSize("default_margin").height
leftPadding: UM.Theme.getSize("medium_button_icon").width + UM.Theme.getSize("default_margin").width
Rectangle
{
id: separator
color: UM.Theme.getColor("text")
width: parent.width
height: UM.Theme.getSize("default_lining").height
}
}
Item
{
width: parent.width
height: childrenRect.height
UM.TooltipArea
{
id: machineResolveStrategyTooltip
anchors.top: parent.top
anchors.right: parent.right
width: (parent.width / 3) | 0
height: visible ? comboboxHeight : 0
visible: base.visible && machineResolveComboBox.model.count > 1
text: catalog.i18nc("@info:tooltip", "How should the conflict in the machine be resolved?")
Cura.ComboBox
WorkspaceRow
{
id: machineResolveComboBox
model: manager.updatableMachinesModel
visible: machineResolveStrategyTooltip.visible
textRole: "displayName"
width: parent.width
height: UM.Theme.getSize("button").height
onCurrentIndexChanged:
leftLabelText: catalog.i18nc("@action:label", "Type")
rightLabelText: manager.machineType
}
WorkspaceRow
{
leftLabelText: catalog.i18nc("@action:label", manager.isPrinterGroup ? "Printer Group" : "Printer Name")
rightLabelText: manager.machineName == catalog.i18nc("@button", "Create new") ? "" : manager.machineName
}
}
comboboxTitle: catalog.i18nc("@action:label", "Open With")
comboboxTooltipText: catalog.i18nc("@info:tooltip", "Printer settings will be updated to match the settings saved with the project.")
comboboxVisible: workspaceDialog.visible && manager.updatableMachinesModel.count > 1
combobox: Cura.MachineSelector
{
id: machineSelector
headerCornerSide: Cura.RoundedRectangle.Direction.All
width: parent.width
height: parent.height
machineListModel: manager.updatableMachinesModel
machineName: manager.machineName
isConnectedCloudPrinter: false
isCloudRegistered: false
isNetworkPrinter: manager.isNetworked
isGroup: manager.isAbstractMachine
connectionStatus: ""
minDropDownWidth: machineSelector.width
buttons: [
Cura.SecondaryButton
{
if (model.getItem(currentIndex).id == "new"
&& model.getItem(currentIndex).type == "default_option")
id: createNewPrinter
text: catalog.i18nc("@button", "Create new")
fixedWidthMode: true
width: parent.width - leftPadding * 1.5
onClicked:
{
toggleContent()
manager.setResolveStrategy("machine", "new")
}
else
{
manager.setResolveStrategy("machine", "override")
manager.setMachineToOverride(model.getItem(currentIndex).id)
machineSelector.machineName = catalog.i18nc("@button", "Create new")
manager.setIsAbstractMachine(false)
manager.setIsNetworkedMachine(false)
}
}
]
onVisibleChanged:
{
if (!visible) {return}
currentIndex = 0
// If the project printer exists in Cura, set it as the default dropdown menu option.
// No need to check object 0, which is the "Create new" option
for (var i = 1; i < model.count; i++)
{
if (model.getItem(i).name == manager.machineName)
{
currentIndex = i
break
}
}
// The project printer does not exist in Cura. If there is at least one printer of the same
// type, select the first one, else set the index to "Create new"
if (currentIndex == 0 && model.count > 1)
{
currentIndex = 1
}
}
}
}
Column
{
width: parent.width
height: childrenRect.height
UM.Label
onSelectPrinter: function(machine)
{
id: printer_settings_label
text: catalog.i18nc("@action:label", "Printer settings")
font: UM.Theme.getFont("default_bold")
}
Row
{
width: parent.width
height: childrenRect.height
UM.Label
{
text: catalog.i18nc("@action:label", "Type")
width: (parent.width / 3) | 0
}
UM.Label
{
text: manager.machineType
width: (parent.width / 3) | 0
}
}
Row
{
width: parent.width
height: childrenRect.height
UM.Label
{
text: catalog.i18nc("@action:label", manager.isPrinterGroup ? "Printer Group" : "Printer Name")
width: (parent.width / 3) | 0
}
UM.Label
{
text: manager.machineName
width: (parent.width / 3) | 0
wrapMode: Text.WordWrap
}
toggleContent();
machineSelector.machineName = machine.name
manager.setResolveStrategy("machine", "override")
manager.setMachineToOverride(machine.id)
manager.setIsAbstractMachine(machine.isAbstractMachine)
manager.setIsNetworkedMachine(machine.isNetworked)
}
}
}
Item
WorkspaceSection
{
width: parent.width
height: childrenRect.height
UM.TooltipArea
id: profileSection
title: catalog.i18nc("@action:label", "Profile settings")
iconSource: UM.Theme.getIcon("Sliders")
content: Column
{
anchors.right: parent.right
anchors.top: parent.top
width: (parent.width / 3) | 0
height: visible ? comboboxHeight : 0
id: profileSettingsValuesTable
spacing: UM.Theme.getSize("default_margin").height
leftPadding: UM.Theme.getSize("medium_button_icon").width + UM.Theme.getSize("default_margin").width
WorkspaceRow
{
leftLabelText: catalog.i18nc("@action:label", "Name")
rightLabelText: manager.qualityName
}
WorkspaceRow
{
leftLabelText: catalog.i18nc("@action:label", "Intent")
rightLabelText: manager.intentName
}
WorkspaceRow
{
leftLabelText: catalog.i18nc("@action:label", "Not in profile")
rightLabelText: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", manager.numUserSettings).arg(manager.numUserSettings)
visible: manager.numUserSettings != 0
}
WorkspaceRow
{
leftLabelText: catalog.i18nc("@action:label", "Derivative from")
rightLabelText: catalog.i18ncp("@action:label", "%1, %2 override", "%1, %2 overrides", manager.numSettingsOverridenByQualityChanges).arg(manager.qualityType).arg(manager.numSettingsOverridenByQualityChanges)
visible: manager.numSettingsOverridenByQualityChanges != 0
}
}
comboboxVisible: manager.qualityChangesConflict
combobox: Cura.ComboBox
{
id: qualityChangesResolveComboBox
model: resolveStrategiesModel
textRole: "label"
visible: manager.qualityChangesConflict
text: catalog.i18nc("@info:tooltip", "How should the conflict in the profile be resolved?")
Cura.ComboBox
{
model: resolveStrategiesModel
textRole: "label"
id: qualityChangesResolveComboBox
width: parent.width
height: UM.Theme.getSize("button").height
onActivated:
{
manager.setResolveStrategy("quality_changes", resolveStrategiesModel.get(index).key)
}
}
}
contentLeftPadding: UM.Theme.getSize("default_margin").width + UM.Theme.getSize("narrow_margin").width
textFont: UM.Theme.getFont("medium")
Column
{
width: parent.width
height: childrenRect.height
UM.Label
background: Cura.RoundedRectangle
{
text: catalog.i18nc("@action:label", "Profile settings")
font: UM.Theme.getFont("default_bold")
border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("lining")
color: qualityChangesResolveComboBox.hovered ? UM.Theme.getColor("expandable_hover") : UM.Theme.getColor("action_button")
cornerSide: Cura.RoundedRectangle.Direction.All
radius: UM.Theme.getSize("default_radius").width
}
Row
// This is a hack. This will trigger onCurrentIndexChanged and set the index when this component in loaded
currentIndex:
{
width: parent.width
height: childrenRect.height
UM.Label
{
text: catalog.i18nc("@action:label", "Name")
width: (parent.width / 3) | 0
}
UM.Label
{
text: manager.qualityName
width: (parent.width / 3) | 0
wrapMode: Text.WordWrap
}
currentIndex = 0
}
Row
onCurrentIndexChanged:
{
width: parent.width
height: childrenRect.height
UM.Label
{
text: catalog.i18nc("@action:label", "Intent")
width: (parent.width / 3) | 0
}
UM.Label
{
text: manager.intentName
width: (parent.width / 3) | 0
wrapMode: Text.WordWrap
}
}
Row
{
width: parent.width
height: childrenRect.height
UM.Label
{
text: catalog.i18nc("@action:label", "Not in profile")
visible: manager.numUserSettings != 0
width: (parent.width / 3) | 0
}
UM.Label
{
text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", manager.numUserSettings).arg(manager.numUserSettings)
visible: manager.numUserSettings != 0
width: (parent.width / 3) | 0
}
}
Row
{
width: parent.width
height: childrenRect.height
UM.Label
{
text: catalog.i18nc("@action:label", "Derivative from")
visible: manager.numSettingsOverridenByQualityChanges != 0
width: (parent.width / 3) | 0
}
UM.Label
{
text: catalog.i18ncp("@action:label", "%1, %2 override", "%1, %2 overrides", manager.numSettingsOverridenByQualityChanges).arg(manager.qualityType).arg(manager.numSettingsOverridenByQualityChanges)
width: (parent.width / 3) | 0
visible: manager.numSettingsOverridenByQualityChanges != 0
wrapMode: Text.WordWrap
}
manager.setResolveStrategy("quality_changes", resolveStrategiesModel.get(currentIndex).key)
}
}
}
Item
WorkspaceSection
{
width: parent.width
height: childrenRect.height
UM.TooltipArea
id: materialSection
title: catalog.i18nc("@action:label", "Material settings")
iconSource: UM.Theme.getIcon("Spool")
content: Column
{
id: materialResolveTooltip
anchors.right: parent.right
anchors.top: parent.top
width: (parent.width / 3) | 0
height: visible ? comboboxHeight : 0
visible: manager.materialConflict
text: catalog.i18nc("@info:tooltip", "How should the conflict in the material be resolved?")
Cura.ComboBox
{
model: resolveStrategiesModel
textRole: "label"
id: materialResolveComboBox
width: parent.width
height: UM.Theme.getSize("button").height
onActivated:
{
manager.setResolveStrategy("material", resolveStrategiesModel.get(index).key)
}
}
}
Column
{
width: parent.width
height: childrenRect.height
Row
{
height: childrenRect.height
width: parent.width
spacing: UM.Theme.getSize("narrow_margin").width
UM.Label
{
text: catalog.i18nc("@action:label", "Material settings")
font: UM.Theme.getFont("default_bold")
width: (parent.width / 3) | 0
}
}
spacing: UM.Theme.getSize("default_margin").height
leftPadding: UM.Theme.getSize("medium_button_icon").width + UM.Theme.getSize("default_margin").width
Repeater
{
model: manager.materialLabels
delegate: Row
delegate: WorkspaceRow
{
width: parent.width
height: childrenRect.height
UM.Label
{
text: catalog.i18nc("@action:label", "Name")
width: (parent.width / 3) | 0
}
UM.Label
{
text: modelData
width: (parent.width / 3) | 0
wrapMode: Text.WordWrap
}
leftLabelText: catalog.i18nc("@action:label", "Name")
rightLabelText: modelData
}
}
}
comboboxVisible: manager.materialConflict
combobox: Cura.ComboBox
{
id: materialResolveComboBox
model: resolveStrategiesModel
textRole: "label"
visible: manager.materialConflict
contentLeftPadding: UM.Theme.getSize("default_margin").width + UM.Theme.getSize("narrow_margin").width
textFont: UM.Theme.getFont("medium")
background: Cura.RoundedRectangle
{
border.width: UM.Theme.getSize("default_lining").width
border.color: UM.Theme.getColor("lining")
color: materialResolveComboBox.hovered ? UM.Theme.getColor("expandable_hover") : UM.Theme.getColor("action_button")
cornerSide: Cura.RoundedRectangle.Direction.All
radius: UM.Theme.getSize("default_radius").width
}
// This is a hack. This will trigger onCurrentIndexChanged and set the index when this component in loaded
currentIndex:
{
currentIndex = 0
}
onCurrentIndexChanged:
{
manager.setResolveStrategy("material", resolveStrategiesModel.get(currentIndex).key)
}
}
}
Column
WorkspaceSection
{
width: parent.width
height: childrenRect.height
id: visibilitySection
title: catalog.i18nc("@action:label", "Setting visibility")
iconSource: UM.Theme.getIcon("Eye")
content: Column
{
spacing: UM.Theme.getSize("default_margin").height
leftPadding: UM.Theme.getSize("medium_button_icon").width + UM.Theme.getSize("default_margin").width
bottomPadding: UM.Theme.getSize("narrow_margin").height
UM.Label
{
text: catalog.i18nc("@action:label", "Setting visibility")
font: UM.Theme.getFont("default_bold")
}
Row
{
width: parent.width
height: childrenRect.height
UM.Label
WorkspaceRow
{
text: catalog.i18nc("@action:label", "Mode")
width: (parent.width / 3) | 0
leftLabelText: catalog.i18nc("@action:label", "Mode")
rightLabelText: manager.activeMode
}
UM.Label
WorkspaceRow
{
text: manager.activeMode
width: (parent.width / 3) | 0
}
}
Row
{
width: parent.width
height: childrenRect.height
visible: manager.hasVisibleSettingsField
UM.Label
{
text: catalog.i18nc("@action:label", "Visible settings:")
width: (parent.width / 3) | 0
}
UM.Label
{
text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(manager.numVisibleSettings).arg(manager.totalNumberOfSettings)
width: (parent.width / 3) | 0
leftLabelText: catalog.i18nc("@action:label", "%1 out of %2" ).arg(manager.numVisibleSettings).arg(manager.totalNumberOfSettings)
rightLabelText: manager.activeMode
visible: manager.hasVisibleSettingsField
}
}
}
Row
{
id: clearBuildPlateWarning
width: parent.width
height: childrenRect.height
spacing: UM.Theme.getSize("default_margin").width
visible: manager.hasObjectsOnPlate
UM.ColorImage
{
width: warningLabel.height
@ -459,14 +332,18 @@ UM.Dialog
color: warning ? UM.Theme.getColor("warning") : "transparent"
anchors.bottom: parent.bottom
width: parent.width
height: childrenRect.height + 2 * base.margin
height: childrenRect.height + (warning ? 2 * workspaceDialog.margin : workspaceDialog.margin)
Column
{
height: childrenRect.height
spacing: base.margin
spacing: workspaceDialog.margin
anchors.leftMargin: workspaceDialog.margin
anchors.rightMargin: workspaceDialog.margin
anchors.bottomMargin: workspaceDialog.margin
anchors.topMargin: warning ? workspaceDialog.margin : 0
anchors.margins: base.margin
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
@ -476,7 +353,7 @@ UM.Dialog
id: warningRow
height: childrenRect.height
visible: warning
spacing: base.margin
spacing: workspaceDialog.margin
UM.ColorImage
{
width: UM.Theme.getSize("extruder_icon").width
@ -500,7 +377,7 @@ UM.Dialog
}
}
buttonSpacing: UM.Theme.getSize("default_margin").width
buttonSpacing: UM.Theme.getSize("wide_margin").width
rightButtons: [
Cura.TertiaryButton
@ -532,6 +409,19 @@ UM.Dialog
}
]
onClosing: manager.notifyClosed()
onRejected: manager.onCancelButtonClicked()
onAccepted: manager.onOkButtonClicked()
onVisibleChanged:
{
if (visible)
{
// Force relead the comboboxes
// Since this dialog is only created once the first time you open it, these comboxes need to be reloaded
// each time it is shown after the first time so that the indexes will update correctly.
materialSection.reloadValues()
profileSection.reloadValues()
printerSection.reloadValues()
}
}
}

View file

@ -0,0 +1,34 @@
// Copyright (c) 2022 Ultimaker B.V.
// 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 QtQuick.Window 2.2
import UM 1.5 as UM
import Cura 1.1 as Cura
Row
{
property alias leftLabelText: leftLabel.text
property alias rightLabelText: rightLabel.text
width: parent.width
height: visible ? childrenRect.height : 0
UM.Label
{
id: leftLabel
text: catalog.i18nc("@action:label", "Type")
width: Math.round(parent.width / 4)
wrapMode: Text.WordWrap
}
UM.Label
{
id: rightLabel
text: manager.machineType
width: Math.round(parent.width / 3)
wrapMode: Text.WordWrap
}
}

View file

@ -0,0 +1,128 @@
// Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10
import QtQuick.Controls 2.3
import UM 1.5 as UM
Item
{
property alias title: sectionTitle.text
property alias iconSource: sectionTitleIcon.source
property Component content: Item { visible: false }
property alias comboboxTitle: comboboxLabel.text
property Component combobox: Item { visible: false }
property string comboboxTooltipText: ""
property bool comboboxVisible: false
width: parent.width
height: childrenRect.height
anchors.leftMargin: UM.Theme.getSize("default_margin").width
Row
{
id: sectionTitleRow
anchors.top: parent.top
bottomPadding: UM.Theme.getSize("default_margin").height
spacing: UM.Theme.getSize("default_margin").width
UM.ColorImage
{
id: sectionTitleIcon
anchors.verticalCenter: parent.verticalCenter
source: ""
height: UM.Theme.getSize("medium_button_icon").height
color: UM.Theme.getColor("text")
width: height
}
UM.Label
{
id: sectionTitle
text: ""
anchors.verticalCenter: parent.verticalCenter
font: UM.Theme.getFont("default_bold")
}
}
Item
{
id: comboboxTooltip
width: Math.round(parent.width / 2.5)
height: visible ? UM.Theme.getSize("default_margin").height : 0
anchors.top: parent.top
anchors.right: parent.right
anchors.rightMargin: UM.Theme.getSize("default_margin").width
visible: comboboxVisible
UM.Label
{
id: comboboxLabel
anchors.top: parent.top
anchors.left: parent.left
anchors.topMargin: UM.Theme.getSize("default_margin").height
visible: comboboxVisible && text != ""
text: ""
font: UM.Theme.getFont("default_bold")
}
Loader
{
id: comboboxLoader
width: parent.width
height: UM.Theme.getSize("button").height
anchors.top: comboboxLabel.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height
anchors.left: parent.left
sourceComponent: combobox
}
MouseArea
{
id: helpIconMouseArea
anchors.right: parent.right
anchors.verticalCenter: comboboxLabel.verticalCenter
width: childrenRect.width
height: childrenRect.height
hoverEnabled: true
UM.ColorImage
{
width: UM.Theme.getSize("section_icon").width
height: width
visible: comboboxTooltipText != ""
source: UM.Theme.getIcon("Help")
color: UM.Theme.getColor("text")
UM.ToolTip
{
text: comboboxTooltipText
visible: helpIconMouseArea.containsMouse
targetPoint: Qt.point(parent.x + Math.round(parent.width / 2), parent.y)
x: 0
y: parent.y + parent.height + UM.Theme.getSize("default_margin").height
width: UM.Theme.getSize("tooltip").width
}
}
}
}
Loader
{
width: parent.width
height: content.height
anchors.top: sectionTitleRow.bottom
sourceComponent: content
}
function reloadValues()
{
comboboxLoader.sourceComponent = null
comboboxLoader.sourceComponent = combobox
}
}

View file

@ -1,4 +1,4 @@
# Copyright (c) 2021-2022 Ultimaker B.V.
# Copyright (c) 2022 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
import argparse #To run the engine in debug mode if the front-end is in debug mode.
@ -166,7 +166,7 @@ class CuraEngineBackend(QObject, Backend):
self._slicing_error_message.addAction(
action_id = "report_bug",
name = catalog.i18nc("@message:button", "Report a bug"),
description = catalog.i18nc("@message:description", "Report a bug on Ultimaker Cura's issue tracker."),
description = catalog.i18nc("@message:description", "Report a bug on UltiMaker Cura's issue tracker."),
icon = "[no_icon]"
)
self._slicing_error_message.actionTriggered.connect(self._reportBackendError)

View file

@ -32,6 +32,7 @@ class FlavorParser:
"""This parser is intended to interpret the common firmware codes among all the different flavors"""
MAX_EXTRUDER_COUNT = 16
DEFAULT_FILAMENT_DIAMETER = 2.85
def __init__(self) -> None:
CuraApplication.getInstance().hideMessageSignal.connect(self._onHideMessage)
@ -48,7 +49,7 @@ class FlavorParser:
self._is_layers_in_file = False # Does the Gcode have the layers comment?
self._extruder_offsets = {} # type: Dict[int, List[float]] # Offsets for multi extruders. key is index, value is [x-offset, y-offset]
self._current_layer_thickness = 0.2 # default
self._filament_diameter = 2.85 # default
self._current_filament_diameter = 2.85 # default
self._previous_extrusion_value = 0.0 # keep track of the filament retractions
CuraApplication.getInstance().getPreferences().addPreference("gcodereader/show_caution", True)
@ -152,7 +153,7 @@ class FlavorParser:
def _calculateLineWidth(self, current_point: Position, previous_point: Position, current_extrusion: float, previous_extrusion: float, layer_thickness: float) -> float:
# Area of the filament
Af = (self._filament_diameter / 2) ** 2 * numpy.pi
Af = (self._current_filament_diameter / 2) ** 2 * numpy.pi
# Length of the extruded filament
de = current_extrusion - previous_extrusion
# Volume of the extruded filament
@ -287,7 +288,11 @@ class FlavorParser:
def processTCode(self, global_stack, T: int, line: str, position: Position, path: List[List[Union[float, int]]]) -> Position:
self._extruder_number = T
self._filament_diameter = global_stack.extruderList[self._extruder_number].getProperty("material_diameter", "value")
try:
self._current_filament_diameter = global_stack.extruderList[self._extruder_number].getProperty("material_diameter", "value")
except IndexError:
self._current_filament_diameter = self.DEFAULT_FILAMENT_DIAMETER
if self._extruder_number + 1 > len(position.e):
self._extrusion_length_offset.extend([0] * (self._extruder_number - len(position.e) + 1))
position.e.extend([0] * (self._extruder_number - len(position.e) + 1))
@ -323,7 +328,11 @@ class FlavorParser:
if not global_stack:
return None
self._filament_diameter = global_stack.extruderList[self._extruder_number].getProperty("material_diameter", "value")
try:
self._current_filament_diameter = global_stack.extruderList[self._extruder_number].getProperty("material_diameter", "value")
except IndexError:
# There can be a mismatch between the number of extruders in the G-Code file and the number of extruders in the current machine.
self._current_filament_diameter = self.DEFAULT_FILAMENT_DIAMETER
scene_node = CuraSceneNode()

View file

@ -1,5 +1,5 @@
# Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
# Copyright (c) 2022 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
import json
from typing import List, Dict, Any, Set
@ -142,7 +142,7 @@ class CloudPackageChecker(QObject):
sync_message = Message(self._i18n_catalog.i18nc(
"@info:generic",
"Do you want to sync material and software packages with your account?"),
title = self._i18n_catalog.i18nc("@info:title", "Changes detected from your Ultimaker account", ))
title = self._i18n_catalog.i18nc("@info:title", "Changes detected from your UltiMaker account", ))
sync_message.addAction("sync",
name = self._i18n_catalog.i18nc("@action:button", "Sync"),
icon = "",

View file

@ -1,5 +1,5 @@
# Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
# Copyright (c) 2022 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
import tempfile
from typing import Dict, List, Any
@ -92,7 +92,7 @@ class DownloadPresenter:
lifetime = 0,
use_inactivity_timer = False,
progress = 0.0,
title = i18n_catalog.i18nc("@info:title", "Changes detected from your Ultimaker account"))
title = i18n_catalog.i18nc("@info:title", "Changes detected from your UltiMaker account"))
def _onFinished(self, package_id: str, reply: QNetworkReply) -> None:
self._progress[package_id]["received"] = self._progress[package_id]["total"]

View file

@ -92,7 +92,7 @@ class PackageModel(QObject):
"display_name": display_name,
"package_version": package_version,
"package_type": package_type,
"description": "The material package associated with the Cura project could not be found on the Ultimaker marketplace. Use the partial material profile definition stored in the Cura project file at your own risk."
"description": catalog.i18nc("@label:label Ultimaker Marketplace is a brand name, don't translate", "The material package associated with the Cura project could not be found on the Ultimaker Marketplace. Use the partial material profile definition stored in the Cura project file at your own risk.")
}
package_model = cls(package_data)
package_model.setIsMissingPackageInformation(True)

View file

@ -1,5 +1,6 @@
// Copyright (c) 2021 Ultimaker B.V.
// Copyright (c) 2022 UltiMaker
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
@ -12,7 +13,7 @@ Packages
bannerVisible: UM.Preferences.getValue("cura/market_place_show_manage_packages_banner");
bannerIcon: UM.Theme.getIcon("ArrowDoubleCircleRight")
bannerText: catalog.i18nc("@text", "Manage your Ultimaker Cura plugins and material profiles here. Make sure to keep your plugins up to date and backup your setup regularly.")
bannerText: catalog.i18nc("@text", "Manage your UltiMaker Cura plugins and material profiles here. Make sure to keep your plugins up to date and backup your setup regularly.")
bannerReadMoreUrl: "https://support.ultimaker.com/hc/en-us/articles/4411125921426/?utm_source=cura&utm_medium=software&utm_campaign=marketplace-learn-manage"
onRemoveBanner: function() {
UM.Preferences.setValue("cura/market_place_show_manage_packages_banner", false);

View file

@ -1,4 +1,4 @@
// Copyright (c) 2021 Ultimaker B.V.
// Copyright (c) 2022 UltiMaker
// Cura is released under the terms of the LGPLv3 or higher.
import UM 1.4 as UM
@ -9,7 +9,7 @@ Packages
bannerVisible: UM.Preferences.getValue("cura/market_place_show_material_banner")
bannerIcon: UM.Theme.getIcon("Spool")
bannerText: catalog.i18nc("@text", "Select and install material profiles optimised for your Ultimaker 3D printers.")
bannerText: catalog.i18nc("@text", "Select and install material profiles optimised for your UltiMaker 3D printers.")
bannerReadMoreUrl: "https://support.ultimaker.com/hc/en-us/articles/360011968360/?utm_source=cura&utm_medium=software&utm_campaign=marketplace-learn-materials"
onRemoveBanner: function() {
UM.Preferences.setValue("cura/market_place_show_material_banner", false);

View file

@ -45,8 +45,6 @@ Item
visible: parent.packageHasIcon
anchors.fill: parent
source: packageData.iconUrl
sourceSize.height: height
sourceSize.width: width
}
UM.ColorImage

View file

@ -1,4 +1,4 @@
// Copyright (c) 2021 Ultimaker B.V.
// Copyright (c) 2022 UltiMaker
// Cura is released under the terms of the LGPLv3 or higher.
import UM 1.4 as UM
@ -9,7 +9,7 @@ Packages
bannerVisible: UM.Preferences.getValue("cura/market_place_show_plugin_banner")
bannerIcon: UM.Theme.getIcon("Shop")
bannerText: catalog.i18nc("@text", "Streamline your workflow and customize your Ultimaker Cura experience with plugins contributed by our amazing community of users.")
bannerText: catalog.i18nc("@text", "Streamline your workflow and customize your UltiMaker Cura experience with plugins contributed by our amazing community of users.")
bannerReadMoreUrl: "https://support.ultimaker.com/hc/en-us/articles/360011968360/?utm_source=cura&utm_medium=software&utm_campaign=marketplace-learn-plugins"
onRemoveBanner: function() {
UM.Preferences.setValue("cura/market_place_show_plugin_banner", false)

View file

@ -1,4 +1,4 @@
// Copyright (c) 2021 Ultimaker B.V.
// Copyright (c) 2022 UltiMaker
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.15
@ -18,9 +18,9 @@ Control
{
switch(packageData.packageType)
{
case "plugin": return catalog.i18nc("@info", "Ultimaker Verified Plug-in");
case "material": return catalog.i18nc("@info", "Ultimaker Certified Material");
default: return catalog.i18nc("@info", "Ultimaker Verified Package");
case "plugin": return catalog.i18nc("@info", "UltiMaker Verified Plug-in");
case "material": return catalog.i18nc("@info", "UltiMaker Certified Material");
default: return catalog.i18nc("@info", "UltiMaker Verified Package");
}
}
visible: parent.hovered

View file

@ -1,4 +1,4 @@
// 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
@ -19,5 +19,15 @@ Item
width: UM.Theme.getSize("machine_selector_widget").width
height: parent.height
anchors.centerIn: parent
machineListModel: Cura.MachineListModel {}
machineManager: Cura.MachineManager
onSelectPrinter: function(machine)
{
toggleContent();
Cura.MachineManager.setActiveMachine(machine.id);
}
}
}

View file

@ -150,6 +150,7 @@ Item
width: parent.width / 2 - UM.Theme.getSize("default_margin").width
height: UM.Theme.getSize("setting_control").height
textRole: "text"
forceHighlight: base.hovered
model: ListModel
{

View file

@ -4,10 +4,12 @@
# Modified: November 16, 2018 by Joshua Pope-Lewis
# Description: This plugin shows custom messages about your print on the Status bar...
# Please look at the 3 options
# Please look at the 5 options
# - Scrolling (SCROLL_LONG_FILENAMES) if enabled in Marlin and you aren't printing a small item select this option.
# - Name: By default it will use the name generated by Cura (EG: TT_Test_Cube) - Type a custom name in here
# - Start Num: Choose which number you prefer for the initial layer, 0 or 1
# - Max Layer: Enabling this will show how many layers are in the entire print (EG: Layer 1 of 265!)
# - Add prefix 'Printing': Enabling this will add the prefix 'Printing'
from ..Script import Script
from UM.Application import Application
@ -53,23 +55,30 @@ class DisplayFilenameAndLayerOnLCD(Script):
"description": "Display how many layers are in the entire print on status bar?",
"type": "bool",
"default_value": true
},
"addPrefixPrinting":
{
"label": "Add prefix 'Printing'?",
"description": "This will add the prefix 'Printing'",
"type": "bool",
"default_value": true
}
}
}"""
def execute(self, data):
max_layer = 0
lcd_text = "M117 "
if self.getSettingValueByKey("name") != "":
name = self.getSettingValueByKey("name")
else:
name = Application.getInstance().getPrintInformation().jobName
if self.getSettingValueByKey("addPrefixPrinting"):
lcd_text += "Printing "
if not self.getSettingValueByKey("scroll"):
if self.getSettingValueByKey("maxlayer"):
lcd_text = "M117 Layer "
else:
lcd_text = "M117 Printing Layer "
lcd_text += "Layer "
else:
lcd_text = "M117 Printing " + name + " - Layer "
lcd_text += name + " - Layer "
i = self.getSettingValueByKey("startNum")
for layer in data:
display_text = lcd_text + str(i)

View file

@ -24,20 +24,29 @@ class FilamentChange(Script):
"version": 2,
"settings":
{
"enabled":
{
"label": "Enable",
"description": "Uncheck to temporarily disable this feature.",
"type": "bool",
"default_value": true
},
"layer_number":
{
"label": "Layer",
"description": "At what layer should color change occur. This will be before the layer starts printing. Specify multiple color changes with a comma.",
"unit": "",
"type": "str",
"default_value": "1"
"default_value": "1",
"enabled": "enabled"
},
"firmware_config":
{
"label": "Use Firmware Configuration",
"description": "Use the settings in your firmware, or customise the parameters of the filament change here.",
"type": "bool",
"default_value": false
"default_value": false,
"enabled": "enabled"
},
"initial_retract":
{
@ -46,7 +55,7 @@ class FilamentChange(Script):
"unit": "mm",
"type": "float",
"default_value": 30.0,
"enabled": "not firmware_config"
"enabled": "enabled and not firmware_config"
},
"later_retract":
{
@ -55,7 +64,7 @@ class FilamentChange(Script):
"unit": "mm",
"type": "float",
"default_value": 300.0,
"enabled": "not firmware_config"
"enabled": "enabled and not firmware_config"
},
"x_position":
{
@ -64,7 +73,7 @@ class FilamentChange(Script):
"unit": "mm",
"type": "float",
"default_value": 0,
"enabled": "not firmware_config"
"enabled": "enabled and not firmware_config"
},
"y_position":
{
@ -73,7 +82,7 @@ class FilamentChange(Script):
"unit": "mm",
"type": "float",
"default_value": 0,
"enabled": "not firmware_config"
"enabled": "enabled and not firmware_config"
},
"z_position":
{
@ -82,7 +91,8 @@ class FilamentChange(Script):
"unit": "mm",
"type": "float",
"default_value": 0,
"minimum_value": 0
"minimum_value": 0,
"enabled": "enabled"
},
"retract_method":
{
@ -92,7 +102,7 @@ class FilamentChange(Script):
"options": {"U": "Marlin (M600 U)", "L": "Reprap (M600 L)"},
"default_value": "U",
"value": "\\\"L\\\" if machine_gcode_flavor==\\\"RepRap (RepRap)\\\" else \\\"U\\\"",
"enabled": "not firmware_config"
"enabled": "enabled and not firmware_config"
},
"machine_gcode_flavor":
{
@ -113,6 +123,40 @@ class FilamentChange(Script):
},
"default_value": "RepRap (Marlin/Sprinter)",
"enabled": "false"
},
"enable_before_macro":
{
"label": "Enable G-code Before",
"description": "Use this to insert a custom G-code macro before the filament change happens",
"type": "bool",
"default_value": false,
"enabled": "enabled"
},
"before_macro":
{
"label": "G-code Before",
"description": "Any custom G-code to run before the filament change happens, for example, M300 S1000 P10000 for a long beep.",
"unit": "",
"type": "str",
"default_value": "M300 S1000 P10000",
"enabled": "enabled and enable_before_macro"
},
"enable_after_macro":
{
"label": "Enable G-code After",
"description": "Use this to insert a custom G-code macro after the filament change",
"type": "bool",
"default_value": false,
"enabled": "enabled"
},
"after_macro":
{
"label": "G-code After",
"description": "Any custom G-code to run after the filament has been changed right before continuing the print, for example, you can add a sequence to purge filament and wipe the nozzle.",
"unit": "",
"type": "str",
"default_value": "M300 S440 P500",
"enabled": "enabled and enable_after_macro"
}
}
}"""
@ -134,6 +178,7 @@ class FilamentChange(Script):
:param data: A list of layers of g-code.
:return: A similar list, with filament change commands inserted.
"""
enabled = self.getSettingValueByKey("enabled")
layer_nums = self.getSettingValueByKey("layer_number")
initial_retract = self.getSettingValueByKey("initial_retract")
later_retract = self.getSettingValueByKey("later_retract")
@ -141,8 +186,20 @@ class FilamentChange(Script):
y_pos = self.getSettingValueByKey("y_position")
z_pos = self.getSettingValueByKey("z_position")
firmware_config = self.getSettingValueByKey("firmware_config")
enable_before_macro = self.getSettingValueByKey("enable_before_macro")
before_macro = self.getSettingValueByKey("before_macro")
enable_after_macro = self.getSettingValueByKey("enable_after_macro")
after_macro = self.getSettingValueByKey("after_macro")
color_change = "M600"
if not enabled:
return data
color_change = ";BEGIN FilamentChange plugin\n"
if enable_before_macro:
color_change = color_change + before_macro + "\n"
color_change = color_change + "M600\n"
if not firmware_config:
if initial_retract is not None and initial_retract > 0.:
@ -163,7 +220,10 @@ class FilamentChange(Script):
if z_pos is not None and z_pos > 0.:
color_change = color_change + (" Z%.2f" % z_pos)
color_change = color_change + " ; Generated by FilamentChange plugin\n"
if enable_after_macro:
color_change = color_change + after_macro + "\n"
color_change = color_change + ";END FilamentChange plugin\n"
layer_targets = layer_nums.split(",")
if len(layer_targets) > 0:

View file

@ -1,8 +1,12 @@
# Copyright (c) 2021 Ultimaker B.V.
# Copyright (c) 2023 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
from ..Script import Script
# Revised by GregValiant 10-17-2022
# Changed "extrude" line to before the nozzle moves back to the print (if not Repetier or Griffin).
# Add M104 option for Resume temperature
from ..Script import Script
import re
from UM.Application import Application #To get the current printer's settings.
from UM.Logger import Logger
@ -26,7 +30,7 @@ class PauseAtHeight(Script):
"description": "Whether to pause at a certain height or at a certain layer.",
"type": "enum",
"options": {"height": "Height", "layer_no": "Layer Number"},
"default_value": "height"
"default_value": "layer_no"
},
"pause_height":
{
@ -42,7 +46,7 @@ class PauseAtHeight(Script):
"pause_layer":
{
"label": "Pause Layer",
"description": "At what layer should the pause occur?",
"description": "Enter the Number of the LAST layer you want to finish prior to the pause (from the Cura preview).",
"type": "int",
"value": "math.floor((pause_height - 0.27) / 0.1) + 1",
"minimum_value": "0",
@ -156,6 +160,14 @@ class PauseAtHeight(Script):
"type": "bool",
"default_value": false
},
"standby_wait_for_temperature_enabled":
{
"label": "Use M109 for standby temperature? (M104 when false)",
"description": "Wait for hot end after Resume? (If your standby temperature is lower than the Printing temperature CHECK and use M109",
"type": "bool",
"default_value": true,
"enabled": "pause_method not in [\\\"griffin\\\", \\\"repetier\\\"]"
},
"standby_temperature":
{
"label": "Standby Temperature",
@ -220,14 +232,14 @@ class PauseAtHeight(Script):
"custom_gcode_before_pause":
{
"label": "G-code Before Pause",
"description": "Any custom g-code to run before the pause, for example, M300 S440 P200 to beep.",
"description": "Custom g-code to run before the pause. EX: M300 to beep. Use a comma to separate multiple commands. EX: M400,M300,M117 Pause",
"type": "str",
"default_value": ""
},
"custom_gcode_after_pause":
{
"label": "G-code After Pause",
"description": "Any custom g-code to run after the pause, for example, M300 S440 P200 to beep.",
"description": "Custom g-code to run after the pause. Use a comma to separate multiple commands. EX: M204 X8 Y8,M106 S0,M117 Resume",
"type": "str",
"default_value": ""
}
@ -279,13 +291,14 @@ class PauseAtHeight(Script):
move_z = self.getSettingValueByKey("head_move_z")
layers_started = False
redo_layer = self.getSettingValueByKey("redo_layer")
standby_wait_for_temperature_enabled = self.getSettingValueByKey("standby_wait_for_temperature_enabled")
standby_temperature = self.getSettingValueByKey("standby_temperature")
firmware_retract = Application.getInstance().getGlobalContainerStack().getProperty("machine_firmware_retract", "value")
control_temperatures = Application.getInstance().getGlobalContainerStack().getProperty("machine_nozzle_temp_enabled", "value")
initial_layer_height = Application.getInstance().getGlobalContainerStack().getProperty("layer_height_0", "value")
display_text = self.getSettingValueByKey("display_text")
gcode_before = self.getSettingValueByKey("custom_gcode_before_pause")
gcode_after = self.getSettingValueByKey("custom_gcode_after_pause")
gcode_before = re.sub("\\s*,\\s*", "\n", self.getSettingValueByKey("custom_gcode_before_pause"))
gcode_after = re.sub("\\s*,\\s*", "\n", self.getSettingValueByKey("custom_gcode_after_pause"))
beep_at_pause = self.getSettingValueByKey("beep_at_pause")
beep_length = self.getSettingValueByKey("beep_length")
@ -477,14 +490,14 @@ class PauseAtHeight(Script):
# Set a custom GCODE section before pause
if gcode_before:
prepend_gcode += gcode_before.replace(";","\n") + "\n"
prepend_gcode += gcode_before + "\n"
# Wait till the user continues printing
prepend_gcode += pause_command + " ; Do the actual pause\n"
# Set a custom GCODE section before pause
# Set a custom GCODE section after pause
if gcode_after:
prepend_gcode += gcode_after.replace(";","\n") + "\n"
prepend_gcode += gcode_after + "\n"
if pause_method == "repetier":
#Push the filament back,
@ -530,19 +543,23 @@ class PauseAtHeight(Script):
elif pause_method != "griffin":
if control_temperatures:
# Set extruder resume temperature
prepend_gcode += self.putValue(M = 109, S = int(target_temperature.get(current_t, 0))) + " ; resume temperature\n"
if standby_wait_for_temperature_enabled:
WFT_numeric = 109
Temp_resume_Text = " ; WAIT for resume temperature\n"
else:
WFT_numeric = 104
Temp_resume_Text = " ; resume temperature\n"
prepend_gcode += self.putValue(M=WFT_numeric,
S=int(target_temperature.get(current_t, 0))) + Temp_resume_Text
if extrude_amount != 0: # Need to prime after the pause.
# Push the filament back.
if retraction_amount != 0:
prepend_gcode += self.putValue(G = 1, E = retraction_amount, F = retraction_speed * 60) + "\n"
if extrude_speed == 0:
extrude_speed = 25
# Prime the material.
prepend_gcode += self.putValue(G = 1, E = extrude_amount, F = extrude_speed * 60) + "; Extra extrude after the unpause\n"
# And retract again to make the movements back to the starting position.
if retraction_amount != 0:
prepend_gcode += self.putValue(G = 1, E = -retraction_amount, F = retraction_speed * 60) + "\n"
if extrude_amount != 0:
prepend_gcode += self.putValue(G=1, E=extrude_amount, F=extrude_speed * 60) + "\n"
# Move the head back
if park_enabled:
@ -556,8 +573,6 @@ class PauseAtHeight(Script):
retraction_count = 1 if control_temperatures else 3 #Retract more if we don't control the temperature.
for i in range(retraction_count):
prepend_gcode += self.putValue(G = 11) + "\n"
else:
prepend_gcode += self.putValue(G = 1, E = retraction_amount, F = retraction_speed * 60) + "\n"
if current_extrusion_f != 0:
prepend_gcode += self.putValue(G = 1, F = current_extrusion_f) + " ; restore extrusion feedrate\n"

View file

@ -1,15 +1,18 @@
# Copyright (c) 2019 Ultimaker B.V.
# Copyright (c) 2023 UltiMaker B.V.
# The PostProcessingPlugin is released under the terms of the AGPLv3 or higher.
import math
from ..Script import Script
from UM.Application import Application # To get current absolute/relative setting.
from UM.Math.Vector import Vector
from typing import List, Tuple
class RetractContinue(Script):
"""Continues retracting during all travel moves."""
def getSettingDataString(self):
def getSettingDataString(self) -> str:
return """{
"name": "Retract Continue",
"key": "RetractContinue",
@ -27,58 +30,90 @@ class RetractContinue(Script):
}
}"""
def execute(self, data):
current_e = 0
current_x = 0
current_y = 0
current_z = 0
def _getTravelMove(self, travel_move: str, default_pos: Vector) -> Tuple[Vector, float]:
travel = Vector(
self.getValue(travel_move, "X", default_pos.x),
self.getValue(travel_move, "Y", default_pos.y),
self.getValue(travel_move, "Z", default_pos.z)
)
f = self.getValue(travel_move, "F", -1.0)
return travel, f
def _travelMoveString(self, travel: Vector, f: float, e: float) -> str:
# Note that only G1 moves are written, since extrusion is included.
if f <= 0.0:
return f"G1 X{travel.x:.5f} Y{travel.y:.5f} Z{travel.z:.5f} E{e:.5f}"
else:
return f"G1 F{f:.5f} X{travel.x:.5f} Y{travel.y:.5f} Z{travel.z:.5f} E{e:.5f}"
def execute(self, data: List[str]) -> List[str]:
current_e = 0.0
to_compensate = 0 # Used when extrusion mode is relative.
is_active = False # Whether retract-continue is in effect.
current_pos = Vector(0.0, 0.0, 0.0)
last_pos = Vector(0.0, 0.0, 0.0)
extra_retraction_speed = self.getSettingValueByKey("extra_retraction_speed")
relative_extrusion = Application.getInstance().getGlobalContainerStack().getProperty(
"relative_extrusion", "value"
)
for layer_number, layer in enumerate(data):
lines = layer.split("\n")
for line_number, line in enumerate(lines):
if self.getValue(line, "G") in {0, 1}: # Track X,Y,Z location.
current_x = self.getValue(line, "X", current_x)
current_y = self.getValue(line, "Y", current_y)
current_z = self.getValue(line, "Z", current_z)
if self.getValue(line, "G") == 1:
if not self.getValue(line, "E"): # Either None or 0: Not a retraction then.
continue
new_e = self.getValue(line, "E")
if new_e - current_e >= -0.0001: # Not a retraction. Account for floating point rounding errors.
current_e = new_e
continue
# A retracted travel move may consist of multiple commands, due to combing.
# This continues retracting over all of these moves and only unretracts at the end.
delta_line = 1
dx = current_x # Track the difference in X for this move only to compute the length of the travel.
dy = current_y
dz = current_z
while line_number + delta_line < len(lines) and self.getValue(lines[line_number + delta_line], "G") != 1:
travel_move = lines[line_number + delta_line]
if self.getValue(travel_move, "G") != 0:
delta_line += 1
continue
travel_x = self.getValue(travel_move, "X", dx)
travel_y = self.getValue(travel_move, "Y", dy)
travel_z = self.getValue(travel_move, "Z", dz)
f = self.getValue(travel_move, "F", "no f")
length = math.sqrt((travel_x - dx) * (travel_x - dx) + (travel_y - dy) * (travel_y - dy) + (travel_z - dz) * (travel_z - dz)) # Length of the travel move.
new_e -= length * extra_retraction_speed # New retraction is by ratio of this travel move.
if f == "no f":
new_travel_move = "G1 X{travel_x} Y{travel_y} Z{travel_z} E{new_e}".format(travel_x = travel_x, travel_y = travel_y, travel_z = travel_z, new_e = new_e)
else:
new_travel_move = "G1 F{f} X{travel_x} Y{travel_y} Z{travel_z} E{new_e}".format(f = f, travel_x = travel_x, travel_y = travel_y, travel_z = travel_z, new_e = new_e)
lines[line_number + delta_line] = new_travel_move
delta_line += 1
dx = travel_x
dy = travel_y
dz = travel_z
# Focus on move-type lines.
code_g = self.getValue(line, "G")
if code_g not in [0, 1]:
continue
current_e = new_e
# Track X,Y,Z location.
last_pos = last_pos.set(current_pos.x, current_pos.y, current_pos.z)
current_pos = current_pos.set(
self.getValue(line, "X", current_pos.x),
self.getValue(line, "Y", current_pos.y),
self.getValue(line, "Z", current_pos.z)
)
# Track extrusion 'axis' position.
last_e = current_e
e_value = self.getValue(line, "E")
if e_value:
current_e = (current_e if relative_extrusion else 0) + e_value
# Handle lines: Detect retractions and compensate relative if G1, potential retract-continue if G0.
if code_g == 1:
if last_e > (current_e + 0.0001): # Account for floating point inaccuracies.
# There is a retraction, each following G0 command needs to continue the retraction.
is_active = True
continue
elif relative_extrusion and is_active:
# If 'relative', the first G1 command after the total retraction will have to compensate more.
travel, f = self._getTravelMove(lines[line_number], current_pos)
lines[line_number] = self._travelMoveString(travel, f, to_compensate + e_value)
to_compensate = 0.0
# There is no retraction (see continue in the retract-clause) and everything else has been handled.
is_active = False
elif code_g == 0:
if not is_active:
continue
# The retract-continue is active, so each G0 until the next extrusion needs to continue retraction.
travel, f = self._getTravelMove(lines[line_number], current_pos)
travel_length = (current_pos - last_pos).length()
extra_retract = travel_length * extra_retraction_speed
new_e = (0 if relative_extrusion else current_e) - extra_retract
to_compensate += extra_retract
current_e -= extra_retract
lines[line_number] = self._travelMoveString(travel, f, new_e)
new_layer = "\n".join(lines)
data[layer_number] = new_layer
return data
return data

View file

@ -55,6 +55,50 @@ Item
Layout.preferredWidth: parent.machineSelectorWidth
Layout.fillWidth: true
Layout.fillHeight: true
machineManager: Cura.MachineManager
onSelectPrinter: function(machine)
{
toggleContent();
Cura.MachineManager.setActiveMachine(machine.id);
}
machineListModel: Cura.MachineListModel {}
buttons: [
Cura.SecondaryButton
{
id: addPrinterButton
leftPadding: UM.Theme.getSize("default_margin").width
rightPadding: UM.Theme.getSize("default_margin").width
text: catalog.i18nc("@button", "Add printer")
// The maximum width of the button is half of the total space, minus the padding of the parent, the left
// padding of the component and half the spacing because of the space between buttons.
fixedWidthMode: true
width: Math.round(parent.width / 2 - leftPadding * 1.5)
onClicked:
{
machineSelection.toggleContent()
Cura.Actions.addMachine.trigger()
}
},
Cura.SecondaryButton
{
id: managePrinterButton
leftPadding: UM.Theme.getSize("default_margin").width
rightPadding: UM.Theme.getSize("default_margin").width
text: catalog.i18nc("@button", "Manage printers")
fixedWidthMode: true
// The maximum width of the button is half of the total space, minus the padding of the parent, the right
// padding of the component and half the spacing because of the space between buttons.
width: Math.round(parent.width / 2 - rightPadding * 1.5)
onClicked:
{
machineSelection.toggleContent()
Cura.Actions.configureMachines.trigger()
}
}
]
}
Cura.ConfigurationMenu

View file

@ -1,4 +1,4 @@
// Copyright (c) 2019 Ultimaker B.V.
// Copyright (c) 2022 UltiMaker
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10
@ -70,7 +70,7 @@ Window
left: parent.left
right: parent.right
}
text: catalog.i18nc("@text:window", "Ultimaker Cura collects anonymous data in order to improve the print quality and user experience. Below is an example of all the data that is shared:")
text: catalog.i18nc("@text:window", "UltiMaker Cura collects anonymous data in order to improve the print quality and user experience. Below is an example of all the data that is shared:")
wrapMode: Text.WordWrap
}

View file

@ -21,7 +21,7 @@ class UFPReader(MeshReader):
MimeTypeDatabase.addMimeType(
MimeType(
name = "application/x-ufp",
comment = "Ultimaker Format Package",
comment = "UltiMaker Format Package",
suffixes = ["ufp"]
)
)

View file

@ -1,5 +1,5 @@
#Copyright (c) 2019 Ultimaker B.V.
#Cura is released under the terms of the LGPLv3 or higher.
# Copyright (c) 2022 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
import sys
@ -19,7 +19,7 @@ def getMetaData():
{
"mime_type": "application/x-ufp",
"extension": "ufp",
"description": i18n_catalog.i18nc("@item:inlistbox", "Ultimaker Format Package")
"description": i18n_catalog.i18nc("@item:inlistbox", "UltiMaker Format Package")
}
]
}

View file

@ -1,6 +1,7 @@
# Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import json
from dataclasses import asdict
from typing import cast, List, Dict
from Charon.VirtualFile import VirtualFile # To open UFP files.
@ -40,7 +41,7 @@ class UFPWriter(MeshWriter):
MimeTypeDatabase.addMimeType(
MimeType(
name = "application/x-ufp",
comment = "Ultimaker Format Package",
comment = "UltiMaker Format Package",
suffixes = ["ufp"]
)
)
@ -225,26 +226,27 @@ class UFPWriter(MeshWriter):
"changes": {},
"all_settings": {},
},
"intent": machine_manager.activeIntentCategory,
"quality": machine_manager.activeQualityOrQualityChangesName,
"quality": asdict(machine_manager.activeQualityDisplayNameMap()),
}
def _retrieveValue(container: InstanceContainer, setting_: str):
value_ = container.getProperty(setting_, "value")
for _ in range(0, 1024): # Prevent possibly endless loop by not using a limit.
if not isinstance(value_, SettingFunction):
return value_ # Success!
value_ = value_(container)
return 0 # Fallback value after breaking possibly endless loop.
global_stack = cast(GlobalStack, Application.getInstance().getGlobalContainerStack())
# Add global user or quality changes
global_flattened_changes = InstanceContainer.createMergedInstanceContainer(global_stack.userChanges, global_stack.qualityChanges)
for setting in global_flattened_changes.getAllKeys():
value = global_flattened_changes.getProperty(setting, "value")
if isinstance(value, SettingFunction):
value = value(global_flattened_changes)
settings["global"]["changes"][setting] = value
settings["global"]["changes"][setting] = _retrieveValue(global_flattened_changes, setting)
# Get global all settings values without user or quality changes
for setting in global_stack.getAllKeys():
value = global_stack.getProperty(setting, "value")
if isinstance(value, SettingFunction):
value = value(global_stack)
settings["global"]["all_settings"][setting] = value
settings["global"]["all_settings"][setting] = _retrieveValue(global_stack, setting)
for i, extruder in enumerate(global_stack.extruderList):
# Add extruder fields to settings dictionary
@ -256,16 +258,10 @@ class UFPWriter(MeshWriter):
# Add extruder user or quality changes
extruder_flattened_changes = InstanceContainer.createMergedInstanceContainer(extruder.userChanges, extruder.qualityChanges)
for setting in extruder_flattened_changes.getAllKeys():
value = extruder_flattened_changes.getProperty(setting, "value")
if isinstance(value, SettingFunction):
value = value(extruder_flattened_changes)
settings[f"extruder_{i}"]["changes"][setting] = value
settings[f"extruder_{i}"]["changes"][setting] = _retrieveValue(extruder_flattened_changes, setting)
# Get extruder all settings values without user or quality changes
for setting in extruder.getAllKeys():
value = extruder.getProperty(setting, "value")
if isinstance(value, SettingFunction):
value = value(extruder)
settings[f"extruder_{i}"]["all_settings"][setting] = value
settings[f"extruder_{i}"]["all_settings"][setting] = _retrieveValue(extruder, setting)
return settings

View file

@ -1,5 +1,5 @@
#Copyright (c) 2018 Ultimaker B.V.
#Cura is released under the terms of the LGPLv3 or higher.
# Copyright (c) 2022 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
import sys
@ -25,7 +25,7 @@ def getMetaData():
"mime_type": "application/x-ufp",
"mode": MeshWriter.OutputMode.BinaryMode,
"extension": "ufp",
"description": i18n_catalog.i18nc("@item:inlistbox", "Ultimaker Format Package")
"description": i18n_catalog.i18nc("@item:inlistbox", "UltiMaker Format Package")
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 KiB

View file

@ -1,71 +0,0 @@
// Copyright (c) 2019 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 2.0
import UM 1.5 as UM
/**
* This component comprises a buildplate icon and the buildplate name. It is
* used by the MonitorPrinterConfiguration component along with two instances
* of MonitorExtruderConfiguration.
*
* NOTE: For most labels, a fixed height with vertical alignment is used to make
* layouts more deterministic (like the fixed-size textboxes used in original
* mock-ups). This is also a stand-in for CSS's 'line-height' property. Denoted
* with '// FIXED-LINE-HEIGHT:'.
*/
Item
{
// The buildplate name
property var buildplate: null
// Height is one 18px label/icon
height: 18 * screenScaleFactor // TODO: Theme!
width: childrenRect.width
Row
{
height: parent.height
spacing: UM.Theme.getSize("print_setup_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.
Item
{
height: parent.height
width: 32 * screenScaleFactor // Ensure the icon is centered under the extruder icon (same width)
Rectangle
{
anchors.centerIn: parent
height: parent.height
width: height
color: buildplateIcon.visible > 0 ? "transparent" : UM.Theme.getColor("monitor_skeleton_loading")
radius: Math.floor(height / 2)
}
UM.ColorImage
{
id: buildplateIcon
anchors.centerIn: parent
color: UM.Theme.getColor("monitor_icon_primary")
height: UM.Theme.getSize("medium_button_icon").width
source: UM.Theme.getIcon("Buildplate")
width: height
visible: buildplate
}
}
UM.Label
{
id: buildplateLabel
elide: Text.ElideRight
text: buildplate ? buildplate : ""
visible: text !== ""
// FIXED-LINE-HEIGHT:
height: 18 * screenScaleFactor // TODO: Theme!
}
}
}

View file

@ -102,9 +102,6 @@ UM.Dialog
case "print_core_change":
text = catalog.i18nc("@label", "Change print core %1 from %2 to %3.").arg(change.index + 1).arg(change.originName).arg(change.targetName)
break
case "buildplate_change":
text = catalog.i18nc("@label", "Change build plate to %1 (This cannot be overridden).").arg(formatBuildPlateType(change.target_name))
break
default:
text = "unknown"
}
@ -143,19 +140,4 @@ UM.Dialog
}
return true
}
function formatBuildPlateType(buildPlateType)
{
var translationText = ""
switch (buildPlateType) {
case "glass":
translationText = catalog.i18nc("@label", "Glass")
break
case "aluminum":
translationText = catalog.i18nc("@label", "Aluminum")
break
default:
translationText = null
}
return translationText
}
}

View file

@ -23,7 +23,7 @@ Item
//So compute here the visibility of the menu items, so that we can use it for the visibility of the button.
property bool sendToTopVisible:
{
if (printJob && printJob.state in ("queued", "error") && !isAssigned(printJob)) {
if (printJob && (printJob.state == "queued" || printJob.state == "error")) {
if (OutputDevice && OutputDevice.queuedPrintJobs[0] && OutputDevice.canWriteOthersPrintJobs) {
return OutputDevice.queuedPrintJobs[0].key != printJob.key;
}
@ -246,10 +246,4 @@ Item
function close() {
popUp.close()
}
function isAssigned(job) {
if (!job) {
return false;
}
return job.assignedPrinter ? true : false;
}
}

View file

@ -10,7 +10,7 @@ import Cura 1.6 as Cura
/**
* This component comprises a colored extruder icon, the material name, and the
* print core name. It is used by the MonitorPrinterConfiguration component with
* a sibling instance as well as a MonitorBuildplateConfiguration instance.
* a sibling instance.
*
* NOTE: For most labels, a fixed height with vertical alignment is used to make
* layouts more deterministic (like the fixed-size textboxes used in original

View file

@ -172,14 +172,6 @@ Item
{
id: printerConfiguration
anchors.verticalCenter: parent.verticalCenter
buildplate: {
switch (printJob.assignedPrinter.buildplate) {
case "glass":
return catalog.i18nc("@label", "Glass");
default:
return null
}
}
configurations: base.printJob ? base.printJob.configuration.extruderConfigurations : null
height: Math.round(72 * screenScaleFactor) // TODO: Theme!
}

View file

@ -1,4 +1,4 @@
// Copyright (c) 2019 Ultimaker B.V.
// Copyright (c) 2022 UltiMaker
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.3
@ -175,14 +175,7 @@ Item
{
id: printerConfiguration
anchors.verticalCenter: parent.verticalCenter
buildplate: {
switch (printer.buildplate) {
case "glass":
return catalog.i18nc("@label", "Glass");
default:
return null
}
}
configurations:
{
var configs = []
@ -284,7 +277,7 @@ Item
MonitorInfoBlurb
{
id: cameraDisabledInfo
text: catalog.i18nc("@info", "Webcam feeds for cloud printers cannot be viewed from Ultimaker Cura." +
text: catalog.i18nc("@info", "Webcam feeds for cloud printers cannot be viewed from UltiMaker Cura." +
" Click \"Manage printer\" to visit Ultimaker Digital Factory and view this webcam.")
target: cameraButton
}

View file

@ -7,17 +7,13 @@ import UM 1.3 as UM
/**
* The MonitorPrinterConfiguration accepts 2 configuration objects as input and
* applies them to a MonitorBuildplateConfiguration instance and two instances
* of MonitorExtruderConfiguration. It's used in both the MonitorPrintJobCard
* component as well as the MonitorPrinterCard component.
* applies them to two instances of MonitorExtruderConfiguration.
* It's used in both the MonitorPrintJobCard component as well as the MonitorPrinterCard component.
*/
Item
{
id: base
// Extracted buildplate configuration
property alias buildplate: buildplateConfig.buildplate
// Array of extracted extruder configurations
property var configurations: [null,null]
@ -48,11 +44,4 @@ Item
}
}
MonitorBuildplateConfiguration
{
id: buildplateConfig
anchors.bottom: parent.bottom
buildplate: null
}
}

View file

@ -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

View file

@ -1,5 +1,5 @@
# Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
# Copyright (c) 2022 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
from time import time
import os

View file

@ -1,5 +1,5 @@
# Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
# Copyright (c) 2022 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
import os
from typing import Dict, List, Optional, Set

View file

@ -1,5 +1,6 @@
# Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
# Copyright (c) 2022 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
from UM import i18nCatalog
from UM.Message import Message
from cura.CuraApplication import CuraApplication

View file

@ -9,6 +9,7 @@ from re import search
from PyQt6.QtCore import QObject, pyqtSignal
from UM.Platform import Platform
from UM.Signal import Signal, signalemitter
from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin
from UM.i18n import i18nCatalog
@ -83,7 +84,8 @@ class USBPrinterOutputDeviceManager(QObject, OutputDevicePlugin):
if container_stack.getMetaDataEntry("supports_usb_connection"):
machine_file_formats = [file_type.strip() for file_type in container_stack.getMetaDataEntry("file_formats").split(";")]
if "text/x-gcode" in machine_file_formats:
port_list = self.getSerialPortList(only_list_usb=True)
# We only limit listing usb on windows is a fix for connecting tty/cu printers on MacOS and Linux
port_list = self.getSerialPortList(only_list_usb=Platform.isWindows())
self._addRemovePorts(port_list)
time.sleep(5)

View file

@ -1,4 +1,4 @@
// Copyright (c) 2019 Ultimaker B.V.
// Copyright (c) 2022 UltiMaker
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10
@ -27,7 +27,7 @@ Cura.MachineAction
anchors.topMargin: UM.Theme.getSize("default_margin").height
width: parent.width
wrapMode: Text.WordWrap
text: catalog.i18nc("@label","Please select any upgrades made to this Ultimaker Original")
text: catalog.i18nc("@label","Please select any upgrades made to this UltiMaker Original")
font: UM.Theme.getFont("medium")
}

View file

@ -0,0 +1,372 @@
# Copyright (c) 2023 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
import configparser
from typing import Tuple, List
import io
from UM.VersionUpgrade import VersionUpgrade
_REMOVED_SETTINGS = {
"limit_support_retractions",
"material_flow_dependent_temperature",
}
_RENAMED_PROFILES = {
"um_s3_aa0.25_ABS_Normal_Quality": "um_s3_aa0.25_abs_0.1mm",
"um_s3_aa0.25_CPE_Normal_Quality": "um_s3_aa0.25_cpe_0.1mm",
"um_s3_aa0.25_Nylon_Normal_Quality": "um_s3_aa0.25_nylon_0.1mm",
"um_s3_aa0.25_PC_Normal_Quality": "um_s3_aa0.25_pc_0.1mm",
"um_s3_aa0.25_PETG_Normal_Quality": "um_s3_aa0.25_petg_0.1mm",
"um_s3_aa0.25_PLA_Normal_Quality": "um_s3_aa0.25_pla_0.1mm",
"um_s3_aa0.25_PP_Normal_Quality": "um_s3_aa0.25_pp_0.1mm",
"um_s3_aa0.25_TPLA_Normal_Quality": "um_s3_aa0.25_tough-pla_0.1mm",
"um_s3_aa0.4_ABS_Draft_Print": "um_s3_aa0.4_abs_0.2mm",
"um_s3_aa0.4_ABS_Draft_Print_Quick": "um_s3_aa0.4_abs_0.2mm_quick",
"um_s3_aa0.4_ABS_Fast_Print": "um_s3_aa0.4_abs_0.15mm",
"um_s3_aa0.4_ABS_Fast_Print_Accurate": "um_s3_aa0.4_abs_0.15mm_engineering",
"um_s3_aa0.4_ABS_Fast_Visual": "um_s3_aa0.4_abs_0.15mm_visual",
"um_s3_aa0.4_ABS_High_Quality": "um_s3_aa0.4_abs_0.06mm",
"um_s3_aa0.4_ABS_High_Visual": "um_s3_aa0.4_abs_0.06mm_visual",
"um_s3_aa0.4_ABS_Normal_Quality": "um_s3_aa0.4_abs_0.1mm",
"um_s3_aa0.4_ABS_Normal_Quality_Accurate": "um_s3_aa0.4_abs_0.1mm_engineering",
"um_s3_aa0.4_ABS_Normal_Visual": "um_s3_aa0.4_abs_0.1mm_visual",
"um_s3_aa0.4_BAM_Draft_Print": "um_s3_aa0.4_bam_0.2mm",
"um_s3_aa0.4_BAM_Fast_Print": "um_s3_aa0.4_bam_0.15mm",
"um_s3_aa0.4_BAM_Normal_Quality": "um_s3_aa0.4_bam_0.1mm",
"um_s3_aa0.4_BAM_VeryDraft_Print": "um_s3_aa0.4_bam_0.3mm",
"um_s3_aa0.4_CPE_Draft_Print": "um_s3_aa0.4_cpe_0.2mm",
"um_s3_aa0.4_CPE_Fast_Print": "um_s3_aa0.4_cpe_0.15mm",
"um_s3_aa0.4_CPE_Fast_Print_Accurate": "um_s3_aa0.4_cpe_0.15mm_engineering",
"um_s3_aa0.4_CPE_High_Quality": "um_s3_aa0.4_cpe_0.06mm",
"um_s3_aa0.4_CPE_Normal_Quality": "um_s3_aa0.4_cpe_0.1mm",
"um_s3_aa0.4_CPE_Normal_Quality_Accurate": "um_s3_aa0.4_cpe_0.1mm_engineering",
"um_s3_aa0.4_CPEP_Draft_Print": "um_s3_aa0.4_cpe-plus_0.2mm",
"um_s3_aa0.4_CPEP_Fast_Print": "um_s3_aa0.4_cpe-plus_0.15mm",
"um_s3_aa0.4_CPEP_Fast_Print_Accurate": "um_s3_aa0.4_cpe-plus_0.15mm_engineering",
"um_s3_aa0.4_CPEP_High_Quality": "um_s3_aa0.4_cpe-plus_0.06mm",
"um_s3_aa0.4_CPEP_Normal_Quality": "um_s3_aa0.4_cpe-plus_0.1mm",
"um_s3_aa0.4_CPEP_Normal_Quality_Accurate": "um_s3_aa0.4_cpe-plus_0.1mm_engineering",
"um_s3_aa0.4_Nylon_Draft_Print": "um_s3_aa0.4_nylon_0.2mm",
"um_s3_aa0.4_Nylon_Fast_Print": "um_s3_aa0.4_nylon_0.15mm",
"um_s3_aa0.4_Nylon_Fast_Print_Accurate": "um_s3_aa0.4_nylon_0.15mm_engineering",
"um_s3_aa0.4_Nylon_High_Quality": "um_s3_aa0.4_nylon_0.06mm",
"um_s3_aa0.4_Nylon_Normal_Quality": "um_s3_aa0.4_nylon_0.1mm",
"um_s3_aa0.4_Nylon_Normal_Quality_Accurate": "um_s3_aa0.4_nylon_0.1mm_engineering",
"um_s3_aa0.4_PC_Draft_Print": "um_s3_aa0.4_pc_0.2mm",
"um_s3_aa0.4_PC_Fast_Print": "um_s3_aa0.4_pc_0.15mm",
"um_s3_aa0.4_PC_Fast_Print_Accurate": "um_s3_aa0.4_pc_0.15mm_engineering",
"um_s3_aa0.4_PC_High_Quality": "um_s3_aa0.4_pc_0.06mm",
"um_s3_aa0.4_PC_Normal_Quality": "um_s3_aa0.4_pc_0.1mm",
"um_s3_aa0.4_PC_Normal_Quality_Accurate": "um_s3_aa0.4_pc_0.1mm_engineering",
"um_s3_aa0.4_PETG_Draft_Print": "um_s3_aa0.4_petg_0.2mm",
"um_s3_aa0.4_PETG_Fast_Print": "um_s3_aa0.4_petg_0.15mm",
"um_s3_aa0.4_PETG_Fast_Print_Accurate": "um_s3_aa0.4_petg_0.15mm_engineering",
"um_s3_aa0.4_PETG_High_Quality": "um_s3_aa0.4_petg_0.06mm",
"um_s3_aa0.4_PETG_Normal_Quality": "um_s3_aa0.4_petg_0.1mm",
"um_s3_aa0.4_PETG_Normal_Quality_Accurate": "um_s3_aa0.4_petg_0.1mm_engineering",
"um_s3_aa0.4_PLA_Draft_Print": "um_s3_aa0.4_pla_0.2mm",
"um_s3_aa0.4_PLA_Draft_Print_Quick": "um_s3_aa0.4_pla_0.2mm_quick",
"um_s3_aa0.4_PLA_Fast_Print": "um_s3_aa0.4_pla_0.15mm",
"um_s3_aa0.4_PLA_Fast_Print_Accurate": "um_s3_aa0.4_pla_0.15mm_engineering",
"um_s3_aa0.4_PLA_Fast_Visual": "um_s3_aa0.4_pla_0.15mm_visual",
"um_s3_aa0.4_PLA_High_Quality": "um_s3_aa0.4_pla_0.06mm",
"um_s3_aa0.4_PLA_High_Visual": "um_s3_aa0.4_pla_0.06mm_visual",
"um_s3_aa0.4_PLA_Normal_Quality": "um_s3_aa0.4_pla_0.1mm",
"um_s3_aa0.4_PLA_Normal_Quality_Accurate": "um_s3_aa0.4_pla_0.1mm_engineering",
"um_s3_aa0.4_PLA_Normal_Visual": "um_s3_aa0.4_pla_0.1mm_visual",
"um_s3_aa0.4_PLA_VeryDraft_Print": "um_s3_aa0.4_pla_0.3mm",
"um_s3_aa0.4_PLA_VeryDraft_Print_Quick": "um_s3_aa0.4_pla_0.3mm_quick",
"um_s3_aa0.4_PP_Draft_Print": "um_s3_aa0.4_pp_0.2mm",
"um_s3_aa0.4_PP_Fast_Print": "um_s3_aa0.4_pp_0.15mm",
"um_s3_aa0.4_PP_Normal_Quality": "um_s3_aa0.4_pp_0.1mm",
"um_s3_aa0.4_TPLA_Draft_Print": "um_s3_aa0.4_tough-pla_0.2mm",
"um_s3_aa0.4_TPLA_Draft_Print_Quick": "um_s3_aa0.4_tough-pla_0.2mm_quick",
"um_s3_aa0.4_TPLA_Fast_Print": "um_s3_aa0.4_tough-pla_0.15mm",
"um_s3_aa0.4_TPLA_Fast_Print_Accurate": "um_s3_aa0.4_tough-pla_0.15mm_engineering",
"um_s3_aa0.4_TPLA_Fast_Visual": "um_s3_aa0.4_tough-pla_0.15mm_visual",
"um_s3_aa0.4_TPLA_High_Quality": "um_s3_aa0.4_tough-pla_0.06mm",
"um_s3_aa0.4_TPLA_High_Visual": "um_s3_aa0.4_tough-pla_0.06mm_visual",
"um_s3_aa0.4_TPLA_Normal_Quality": "um_s3_aa0.4_tough-pla_0.1mm",
"um_s3_aa0.4_TPLA_Normal_Quality_Accurate": "um_s3_aa0.4_tough-pla_0.1mm_engineering",
"um_s3_aa0.4_TPLA_Normal_Visual": "um_s3_aa0.4_tough-pla_0.1mm_visual",
"um_s3_aa0.4_TPLA_VeryDraft_Print": "um_s3_aa0.4_tough-pla_0.3mm",
"um_s3_aa0.4_TPLA_VeryDraft_Print_Quick": "um_s3_aa0.4_tough-pla_0.3mm_quick",
"um_s3_aa0.4_TPU_Draft_Print": "um_s3_aa0.4_tpu_0.2mm",
"um_s3_aa0.4_TPU_Fast_Print": "um_s3_aa0.4_tpu_0.15mm",
"um_s3_aa0.4_TPU_Normal_Quality": "um_s3_aa0.4_tpu_0.1mm",
"um_s3_aa0.8_ABS_Draft_Print": "um_s3_aa0.8_abs_0.2mm",
"um_s3_aa0.8_ABS_Superdraft_Print": "um_s3_aa0.8_abs_0.4mm",
"um_s3_aa0.8_ABS_VeryDraft_Print": "um_s3_aa0.8_abs_0.3mm",
"um_s3_aa0.8_CPE_Draft_Print": "um_s3_aa0.8_cpe_0.2mm",
"um_s3_aa0.8_CPE_Superdraft_Print": "um_s3_aa0.8_cpe_0.4mm",
"um_s3_aa0.8_CPE_VeryDraft_Print": "um_s3_aa0.8_cpe_0.3mm",
"um_s3_aa0.8_CPEP_Fast_Print": "um_s3_aa0.8_cpe-plus_0.2mm",
"um_s3_aa0.8_CPEP_Superdraft_Print": "um_s3_aa0.8_cpe-plus_0.4mm",
"um_s3_aa0.8_CPEP_VeryDraft_Print": "um_s3_aa0.8_cpe-plus_0.3mm",
"um_s3_aa0.8_Nylon_Draft_Print": "um_s3_aa0.8_nylon_0.2mm",
"um_s3_aa0.8_Nylon_Superdraft_Print": "um_s3_aa0.8_nylon_0.4mm",
"um_s3_aa0.8_Nylon_VeryDraft_Print": "um_s3_aa0.8_nylon_0.3mm",
"um_s3_aa0.8_PC_Fast_Print": "um_s3_aa0.8_pc_0.2mm",
"um_s3_aa0.8_PC_Superdraft_Print": "um_s3_aa0.8_pc_0.4mm",
"um_s3_aa0.8_PC_VeryDraft_Print": "um_s3_aa0.8_pc_0.3mm",
"um_s3_aa0.8_PETG_Draft_Print": "um_s3_aa0.8_petg_0.2mm",
"um_s3_aa0.8_PETG_Superdraft_Print": "um_s3_aa0.8_petg_0.4mm",
"um_s3_aa0.8_PETG_VeryDraft_Print": "um_s3_aa0.8_petg_0.3mm",
"um_s3_aa0.8_PLA_Draft_Print": "um_s3_aa0.8_pla_0.2mm",
"um_s3_aa0.8_PLA_Superdraft_Print": "um_s3_aa0.8_pla_0.4mm",
"um_s3_aa0.8_PLA_VeryDraft_Print": "um_s3_aa0.8_pla_0.3mm",
"um_s3_aa0.8_PP_Draft_Print": "um_s3_aa0.8_pp_0.2mm",
"um_s3_aa0.8_PP_Superdraft_Print": "um_s3_aa0.8_pp_0.4mm",
"um_s3_aa0.8_PP_VeryDraft_Print": "um_s3_aa0.8_pp_0.3mm",
"um_s3_aa0.8_TPLA_Draft_Print": "um_s3_aa0.8_tough-pla_0.2mm",
"um_s3_aa0.8_TPLA_Superdraft_Print": "um_s3_aa0.8_tough-pla_0.4mm",
"um_s3_aa0.8_TPLA_VeryDraft_Print": "um_s3_aa0.8_tough-pla_0.3mm",
"um_s3_aa0.8_TPU_Draft_Print": "um_s3_aa0.8_tpu_0.2mm",
"um_s3_aa0.8_TPU_Superdraft_Print": "um_s3_aa0.8_tpu_0.4mm",
"um_s3_aa0.8_TPU_VeryDraft_Print": "um_s3_aa0.8_tpu_0.3mm",
"um_s3_bb0.4_PVA_Draft_Print": "um_s3_bb0.4_pva_0.2mm",
"um_s3_bb0.4_PVA_Fast_Print": "um_s3_bb0.4_pva_0.15mm",
"um_s3_bb0.4_PVA_High_Quality": "um_s3_bb0.4_pva_0.06mm",
"um_s3_bb0.4_PVA_Normal_Quality": "um_s3_bb0.4_pva_0.1mm",
"um_s3_bb0.4_PVA_VeryDraft_Print": "um_s3_bb0.4_pva_0.3mm",
"um_s3_bb0.8_PVA_Draft_Print": "um_s3_bb0.8_pva_0.2mm",
"um_s3_bb0.8_PVA_Superdraft_Print": "um_s3_bb0.8_pva_0.4mm",
"um_s3_bb0.8_PVA_VeryDraft_Print": "um_s3_bb0.8_pva_0.3mm",
"um_s3_cc0.4_CFFCPE_Draft_Print": "um_s3_cc0.4_cffcpe_0.2mm",
"um_s3_cc0.4_CFFCPE_Fast_Print": "um_s3_cc0.4_cffcpe_0.15mm",
"um_s3_cc0.4_CFFPA_Draft_Print": "um_s3_cc0.4_cffpa_0.2mm",
"um_s3_cc0.4_CFFPA_Fast_Print": "um_s3_cc0.4_cffpa_0.15mm",
"um_s3_cc0.4_GFFCPE_Draft_Print": "um_s3_cc0.4_gffcpe_0.2mm",
"um_s3_cc0.4_GFFCPE_Fast_Print": "um_s3_cc0.4_gffcpe_0.15mm",
"um_s3_cc0.4_GFFPA_Draft_Print": "um_s3_cc0.4_gffpa_0.2mm",
"um_s3_cc0.4_GFFPA_Fast_Print": "um_s3_cc0.4_gffpa_0.15mm",
"um_s3_cc0.4_PLA_Draft_Print": "um_s3_cc0.4_pla_0.2mm",
"um_s3_cc0.4_PLA_Fast_Print": "um_s3_cc0.4_pla_0.15mm",
"um_s3_cc0.6_CFFCPE_Draft_Print": "um_s3_cc0.6_cffcpe_0.2mm",
"um_s3_cc0.6_CFFPA_Draft_Print": "um_s3_cc0.6_cffpa_0.2mm",
"um_s3_cc0.6_GFFCPE_Draft_Print": "um_s3_cc0.6_gffcpe_0.2mm",
"um_s3_cc0.6_GFFPA_Draft_Print": "um_s3_cc0.6_gffpa_0.2mm",
"um_s3_cc0.6_PLA_Draft_Print": "um_s3_cc0.6_pla_0.2mm",
"um_s3_cc0.6_PLA_Fast_Print": "um_s3_cc0.6_pla_0.15mm",
"um_s5_aa0.25_ABS_Normal_Quality": "um_s5_aa0.25_abs_0.1mm",
"um_s5_aa0.25_CPE_Normal_Quality": "um_s5_aa0.25_cpe_0.1mm",
"um_s5_aa0.25_Nylon_Normal_Quality": "um_s5_aa0.25_nylon_0.1mm",
"um_s5_aa0.25_PC_Normal_Quality": "um_s5_aa0.25_pc_0.1mm",
"um_s5_aa0.25_PETG_Normal_Quality": "um_s5_aa0.25_petg_0.1mm",
"um_s5_aa0.25_PLA_Normal_Quality": "um_s5_aa0.25_pla_0.1mm",
"um_s5_aa0.25_PP_Normal_Quality": "um_s5_aa0.25_pp_0.1mm",
"um_s5_aa0.25_TPLA_Normal_Quality": "um_s5_aa0.25_tough-pla_0.1mm",
"um_s5_aa0.4_ABS_Draft_Print": "um_s5_aa0.4_abs_0.2mm",
"um_s5_aa0.4_ABS_Draft_Print_Quick": "um_s5_aa0.4_abs_0.2mm_quick",
"um_s5_aa0.4_ABS_Fast_Print": "um_s5_aa0.4_abs_0.15mm",
"um_s5_aa0.4_ABS_Fast_Print_Accurate": "um_s5_aa0.4_abs_0.15mm_engineering",
"um_s5_aa0.4_ABS_Fast_Visual": "um_s5_aa0.4_abs_0.15mm_visual",
"um_s5_aa0.4_ABS_High_Quality": "um_s5_aa0.4_abs_0.06mm",
"um_s5_aa0.4_ABS_High_Visual": "um_s5_aa0.4_abs_0.06mm_visual",
"um_s5_aa0.4_ABS_Normal_Quality": "um_s5_aa0.4_abs_0.1mm",
"um_s5_aa0.4_ABS_Normal_Quality_Accurate": "um_s5_aa0.4_abs_0.1mm_engineering",
"um_s5_aa0.4_ABS_Normal_Visual": "um_s5_aa0.4_abs_0.1mm_visual",
"um_s5_aa0.4_BAM_Draft_Print": "um_s5_aa0.4_bam_0.2mm",
"um_s5_aa0.4_BAM_Fast_Print": "um_s5_aa0.4_bam_0.15mm",
"um_s5_aa0.4_BAM_Normal_Quality": "um_s5_aa0.4_bam_0.1mm",
"um_s5_aa0.4_BAM_VeryDraft_Print": "um_s5_aa0.4_bam_0.3mm",
"um_s5_aa0.4_CPE_Draft_Print": "um_s5_aa0.4_cpe_0.2mm",
"um_s5_aa0.4_CPE_Fast_Print": "um_s5_aa0.4_cpe_0.15mm",
"um_s5_aa0.4_CPE_Fast_Print_Accurate": "um_s5_aa0.4_cpe_0.15mm_engineering",
"um_s5_aa0.4_CPE_High_Quality": "um_s5_aa0.4_cpe_0.06mm",
"um_s5_aa0.4_CPE_Normal_Quality": "um_s5_aa0.4_cpe_0.1mm",
"um_s5_aa0.4_CPE_Normal_Quality_Accurate": "um_s5_aa0.4_cpe_0.1mm_engineering",
"um_s5_aa0.4_CPEP_Draft_Print": "um_s5_aa0.4_cpe-plus_0.2mm",
"um_s5_aa0.4_CPEP_Fast_Print": "um_s5_aa0.4_cpe-plus_0.15mm",
"um_s5_aa0.4_CPEP_Fast_Print_Accurate": "um_s5_aa0.4_cpe-plus_0.15mm_engineering",
"um_s5_aa0.4_CPEP_High_Quality": "um_s5_aa0.4_cpe-plus_0.06mm",
"um_s5_aa0.4_CPEP_Normal_Quality": "um_s5_aa0.4_cpe-plus_0.1mm",
"um_s5_aa0.4_CPEP_Normal_Quality_Accurate": "um_s5_aa0.4_cpe-plus_0.1mm_engineering",
"um_s5_aa0.4_Nylon_Draft_Print": "um_s5_aa0.4_nylon_0.2mm",
"um_s5_aa0.4_Nylon_Fast_Print": "um_s5_aa0.4_nylon_0.15mm",
"um_s5_aa0.4_Nylon_Fast_Print_Accurate": "um_s5_aa0.4_nylon_0.15mm_engineering",
"um_s5_aa0.4_Nylon_High_Quality": "um_s5_aa0.4_nylon_0.06mm",
"um_s5_aa0.4_Nylon_Normal_Quality": "um_s5_aa0.4_nylon_0.1mm",
"um_s5_aa0.4_Nylon_Normal_Quality_Accurate": "um_s5_aa0.4_nylon_0.1mm_engineering",
"um_s5_aa0.4_PC_Draft_Print": "um_s5_aa0.4_pc_0.2mm",
"um_s5_aa0.4_PC_Fast_Print": "um_s5_aa0.4_pc_0.15mm",
"um_s5_aa0.4_PC_Fast_Print_Accurate": "um_s5_aa0.4_pc_0.15mm_engineering",
"um_s5_aa0.4_PC_High_Quality": "um_s5_aa0.4_pc_0.06mm",
"um_s5_aa0.4_PC_Normal_Quality": "um_s5_aa0.4_pc_0.1mm",
"um_s5_aa0.4_PC_Normal_Quality_Accurate": "um_s5_aa0.4_pc_0.1mm_engineering",
"um_s5_aa0.4_PETG_Draft_Print": "um_s5_aa0.4_petg_0.2mm",
"um_s5_aa0.4_PETG_Fast_Print": "um_s5_aa0.4_petg_0.15mm",
"um_s5_aa0.4_PETG_Fast_Print_Accurate": "um_s5_aa0.4_petg_0.15mm_engineering",
"um_s5_aa0.4_PETG_High_Quality": "um_s5_aa0.4_petg_0.06mm",
"um_s5_aa0.4_PETG_Normal_Quality": "um_s5_aa0.4_petg_0.1mm",
"um_s5_aa0.4_PETG_Normal_Quality_Accurate": "um_s5_aa0.4_petg_0.1mm_engineering",
"um_s5_aa0.4_PLA_Draft_Print": "um_s5_aa0.4_pla_0.2mm",
"um_s5_aa0.4_PLA_Draft_Print_Quick": "um_s5_aa0.4_pla_0.2mm_quick",
"um_s5_aa0.4_PLA_Fast_Print": "um_s5_aa0.4_pla_0.15mm",
"um_s5_aa0.4_PLA_Fast_Print_Accurate": "um_s5_aa0.4_pla_0.15mm_engineering",
"um_s5_aa0.4_PLA_Fast_Visual": "um_s5_aa0.4_pla_0.15mm_visual",
"um_s5_aa0.4_PLA_High_Quality": "um_s5_aa0.4_pla_0.06mm",
"um_s5_aa0.4_PLA_High_Visual": "um_s5_aa0.4_pla_0.06mm_visual",
"um_s5_aa0.4_PLA_Normal_Quality": "um_s5_aa0.4_pla_0.1mm",
"um_s5_aa0.4_PLA_Normal_Quality_Accurate": "um_s5_aa0.4_pla_0.1mm_engineering",
"um_s5_aa0.4_PLA_Normal_Visual": "um_s5_aa0.4_pla_0.1mm_visual",
"um_s5_aa0.4_PLA_VeryDraft_Print": "um_s5_aa0.4_pla_0.3mm",
"um_s5_aa0.4_PLA_VeryDraft_Print_Quick": "um_s5_aa0.4_pla_0.3mm_quick",
"um_s5_aa0.4_PP_Draft_Print": "um_s5_aa0.4_pp_0.2mm",
"um_s5_aa0.4_PP_Fast_Print": "um_s5_aa0.4_pp_0.15mm",
"um_s5_aa0.4_PP_Normal_Quality": "um_s5_aa0.4_pp_0.1mm",
"um_s5_aa0.4_TPLA_Draft_Print": "um_s5_aa0.4_tough-pla_0.2mm",
"um_s5_aa0.4_TPLA_Draft_Print_Quick": "um_s5_aa0.4_tough-pla_0.2mm_quick",
"um_s5_aa0.4_TPLA_Fast_Print": "um_s5_aa0.4_tough-pla_0.15mm",
"um_s5_aa0.4_TPLA_Fast_Print_Accurate": "um_s5_aa0.4_tough-pla_0.15mm_engineering",
"um_s5_aa0.4_TPLA_Fast_Visual": "um_s5_aa0.4_tough-pla_0.15mm_visual",
"um_s5_aa0.4_TPLA_High_Quality": "um_s5_aa0.4_tough-pla_0.06mm",
"um_s5_aa0.4_TPLA_High_Visual": "um_s5_aa0.4_tough-pla_0.06mm_visual",
"um_s5_aa0.4_TPLA_Normal_Quality": "um_s5_aa0.4_tough-pla_0.1mm",
"um_s5_aa0.4_TPLA_Normal_Quality_Accurate": "um_s5_aa0.4_tough-pla_0.1mm_engineering",
"um_s5_aa0.4_TPLA_Normal_Visual": "um_s5_aa0.4_tough-pla_0.1mm_visual",
"um_s5_aa0.4_TPLA_VeryDraft_Print": "um_s5_aa0.4_tough-pla_0.3mm",
"um_s5_aa0.4_TPLA_VeryDraft_Print_Quick": "um_s5_aa0.4_tough-pla_0.3mm_quick",
"um_s5_aa0.4_TPU_Draft_Print": "um_s5_aa0.4_tpu_0.2mm",
"um_s5_aa0.4_TPU_Fast_Print": "um_s5_aa0.4_tpu_0.15mm",
"um_s5_aa0.4_TPU_Normal_Quality": "um_s5_aa0.4_tpu_0.1mm",
"um_s5_aa0.8_ABS_Draft_Print": "um_s5_aa0.8_abs_0.2mm",
"um_s5_aa0.8_ABS_Superdraft_Print": "um_s5_aa0.8_abs_0.4mm",
"um_s5_aa0.8_ABS_VeryDraft_Print": "um_s5_aa0.8_abs_0.3mm",
"um_s5_aa0.8_CPE_Draft_Print": "um_s5_aa0.8_cpe_0.2mm",
"um_s5_aa0.8_CPE_Superdraft_Print": "um_s5_aa0.8_cpe_0.4mm",
"um_s5_aa0.8_CPE_VeryDraft_Print": "um_s5_aa0.8_cpe_0.3mm",
"um_s5_aa0.8_CPEP_Fast_Print": "um_s5_aa0.8_cpe-plus_0.2mm",
"um_s5_aa0.8_CPEP_Superdraft_Print": "um_s5_aa0.8_cpe-plus_0.4mm",
"um_s5_aa0.8_CPEP_VeryDraft_Print": "um_s5_aa0.8_cpe-plus_0.3mm",
"um_s5_aa0.8_Nylon_Draft_Print": "um_s5_aa0.8_nylon_0.2mm",
"um_s5_aa0.8_Nylon_Superdraft_Print": "um_s5_aa0.8_nylon_0.4mm",
"um_s5_aa0.8_Nylon_VeryDraft_Print": "um_s5_aa0.8_nylon_0.3mm",
"um_s5_aa0.8_PC_Fast_Print": "um_s5_aa0.8_pc_0.2mm",
"um_s5_aa0.8_PC_Superdraft_Print": "um_s5_aa0.8_pc_0.4mm",
"um_s5_aa0.8_PC_VeryDraft_Print": "um_s5_aa0.8_pc_0.3mm",
"um_s5_aa0.8_PETG_Draft_Print": "um_s5_aa0.8_petg_0.2mm",
"um_s5_aa0.8_PETG_Superdraft_Print": "um_s5_aa0.8_petg_0.4mm",
"um_s5_aa0.8_PETG_VeryDraft_Print": "um_s5_aa0.8_petg_0.3mm",
"um_s5_aa0.8_PLA_Draft_Print": "um_s5_aa0.8_pla_0.2mm",
"um_s5_aa0.8_PLA_Superdraft_Print": "um_s5_aa0.8_pla_0.4mm",
"um_s5_aa0.8_PLA_VeryDraft_Print": "um_s5_aa0.8_pla_0.3mm",
"um_s5_aa0.8_PP_Draft_Print": "um_s5_aa0.8_pp_0.2mm",
"um_s5_aa0.8_PP_Superdraft_Print": "um_s5_aa0.8_pp_0.4mm",
"um_s5_aa0.8_PP_VeryDraft_Print": "um_s5_aa0.8_pp_0.3mm",
"um_s5_aa0.8_TPLA_Draft_Print": "um_s5_aa0.8_tough-pla_0.2mm",
"um_s5_aa0.8_TPLA_Superdraft_Print": "um_s5_aa0.8_tough-pla_0.4mm",
"um_s5_aa0.8_TPLA_VeryDraft_Print": "um_s5_aa0.8_tough-pla_0.3mm",
"um_s5_aa0.8_TPU_Draft_Print": "um_s5_aa0.8_tpu_0.2mm",
"um_s5_aa0.8_TPU_Superdraft_Print": "um_s5_aa0.8_tpu_0.4mm",
"um_s5_aa0.8_TPU_VeryDraft_Print": "um_s5_aa0.8_tpu_0.3mm",
"um_s5_bb0.4_PVA_Draft_Print": "um_s5_bb0.4_pva_0.2mm",
"um_s5_bb0.4_PVA_Fast_Print": "um_s5_bb0.4_pva_0.15mm",
"um_s5_bb0.4_PVA_High_Quality": "um_s5_bb0.4_pva_0.06mm",
"um_s5_bb0.4_PVA_Normal_Quality": "um_s5_bb0.4_pva_0.1mm",
"um_s5_bb0.4_PVA_VeryDraft_Print": "um_s5_bb0.4_pva_0.3mm",
"um_s5_bb0.8_PVA_Draft_Print": "um_s5_bb0.8_pva_0.2mm",
"um_s5_bb0.8_PVA_Superdraft_Print": "um_s5_bb0.8_pva_0.4mm",
"um_s5_bb0.8_PVA_VeryDraft_Print": "um_s5_bb0.8_pva_0.3mm",
"um_s5_cc0.4_CFFCPE_Draft_Print": "um_s5_cc0.4_cffcpe_0.2mm",
"um_s5_cc0.4_CFFCPE_Fast_Print": "um_s5_cc0.4_cffcpe_0.15mm",
"um_s5_cc0.4_CFFPA_Draft_Print": "um_s5_cc0.4_cffpa_0.2mm",
"um_s5_cc0.4_CFFPA_Fast_Print": "um_s5_cc0.4_cffpa_0.15mm",
"um_s5_cc0.4_GFFCPE_Draft_Print": "um_s5_cc0.4_gffcpe_0.2mm",
"um_s5_cc0.4_GFFCPE_Fast_Print": "um_s5_cc0.4_gffcpe_0.15mm",
"um_s5_cc0.4_GFFPA_Draft_Print": "um_s5_cc0.4_gffpa_0.2mm",
"um_s5_cc0.4_GFFPA_Fast_Print": "um_s5_cc0.4_gffpa_0.15mm",
"um_s5_cc0.4_PLA_Draft_Print": "um_s5_cc0.4_pla_0.2mm",
"um_s5_cc0.4_PLA_Fast_Print": "um_s5_cc0.4_pla_0.15mm",
"um_s5_cc0.6_CFFCPE_Draft_Print": "um_s5_cc0.6_cffcpe_0.2mm",
"um_s5_cc0.6_CFFPA_Draft_Print": "um_s5_cc0.6_cffpa_0.2mm",
"um_s5_cc0.6_GFFCPE_Draft_Print": "um_s5_cc0.6_gffcpe_0.2mm",
"um_s5_cc0.6_GFFPA_Draft_Print": "um_s5_cc0.6_gffpa_0.2mm",
"um_s5_cc0.6_PLA_Draft_Print": "um_s5_cc0.6_pla_0.2mm",
"um_s5_cc0.6_PLA_Fast_Print": "um_s5_cc0.6_pla_0.15mm"
}
class VersionUpgrade52to53(VersionUpgrade):
def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
"""
Upgrades preferences to remove from the visibility list the settings that were removed in this version.
It also changes the preferences to have the new version number.
This removes any settings that were removed in the new Cura version.
:param serialized: The original contents of the preferences file.
:param filename: The file name of the preferences file.
:return: A list of new file names, and a list of the new contents for
those files.
"""
parser = configparser.ConfigParser(interpolation = None)
parser.read_string(serialized)
# Update version number.
parser["metadata"]["setting_version"] = "21"
# Remove deleted settings from the visible settings list.
if "general" in parser and "visible_settings" in parser["general"]:
visible_settings = set(parser["general"]["visible_settings"].split(";"))
for removed in _REMOVED_SETTINGS:
if removed in visible_settings:
visible_settings.remove(removed)
parser["general"]["visible_settings"] = ";".join(visible_settings)
result = io.StringIO()
parser.write(result)
return [filename], [result.getvalue()]
def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
"""
Upgrades instance containers to remove the settings that were removed in this version.
It also changes the instance containers to have the new version number.
This removes any settings that were removed in the new Cura version and updates settings that need to be updated
with a new value.
:param serialized: The original contents of the instance container.
:param filename: The original file name of the instance container.
:return: A list of new file names, and a list of the new contents for
those files.
"""
parser = configparser.ConfigParser(interpolation = None, comment_prefixes = ())
parser.read_string(serialized)
# Update version number.
parser["metadata"]["setting_version"] = "21"
if "values" in parser:
# Remove deleted settings from the instance containers.
for removed in _REMOVED_SETTINGS:
if removed in parser["values"]:
del parser["values"][removed]
result = io.StringIO()
parser.write(result)
return [filename], [result.getvalue()]
def upgradeStack(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
"""
Upgrades stacks to have the new version number.
:param serialized: The original contents of the stack.
:param filename: The original file name of the stack.
:return: A list of new file names, and a list of the new contents for
those files.
"""
parser = configparser.ConfigParser(interpolation = None)
parser.read_string(serialized)
# Update version number.
if "metadata" not in parser:
parser["metadata"] = {}
parser["metadata"]["setting_version"] = "21"
for container in parser['containers']:
parser['containers'][container] = _RENAMED_PROFILES.get(parser['containers'][container], parser['containers'][container])
result = io.StringIO()
parser.write(result)
return [filename], [result.getvalue()]

View file

@ -0,0 +1,59 @@
# Copyright (c) 2023 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
from typing import Any, Dict, TYPE_CHECKING
from . import VersionUpgrade52to53
if TYPE_CHECKING:
from UM.Application import Application
upgrade = VersionUpgrade52to53.VersionUpgrade52to53()
def getMetaData() -> Dict[str, Any]:
return {
"version_upgrade": {
# From To Upgrade function
("preferences", 7000020): ("preferences", 7000021, upgrade.upgradePreferences),
("machine_stack", 5000020): ("machine_stack", 5000021, upgrade.upgradeStack),
("extruder_train", 5000020): ("extruder_train", 5000021, upgrade.upgradeStack),
("definition_changes", 4000020): ("definition_changes", 4000021, upgrade.upgradeInstanceContainer),
("quality_changes", 4000020): ("quality_changes", 4000021, upgrade.upgradeInstanceContainer),
("quality", 4000020): ("quality", 4000021, upgrade.upgradeInstanceContainer),
("user", 4000020): ("user", 4000021, upgrade.upgradeInstanceContainer),
},
"sources": {
"preferences": {
"get_version": upgrade.getCfgVersion,
"location": {"."}
},
"machine_stack": {
"get_version": upgrade.getCfgVersion,
"location": {"./machine_instances"}
},
"extruder_train": {
"get_version": upgrade.getCfgVersion,
"location": {"./extruders"}
},
"definition_changes": {
"get_version": upgrade.getCfgVersion,
"location": {"./definition_changes"}
},
"quality_changes": {
"get_version": upgrade.getCfgVersion,
"location": {"./quality_changes"}
},
"quality": {
"get_version": upgrade.getCfgVersion,
"location": {"./quality"}
},
"user": {
"get_version": upgrade.getCfgVersion,
"location": {"./user"}
}
}
}
def register(app: "Application") -> Dict[str, Any]:
return {"version_upgrade": upgrade}

View file

@ -0,0 +1,8 @@
{
"name": "Version Upgrade 5.2 to 5.3",
"author": "UltiMaker",
"version": "1.0.0",
"description": "Upgrades configurations from Cura 5.2 to Cura 5.3.",
"api": 8,
"i18n-catalog": "cura"
}

View file

@ -1125,21 +1125,28 @@ class XmlMaterialProfile(InstanceContainer):
id_list = list(id_list)
return id_list
__product_to_id_map: Optional[Dict[str, List[str]]] = None
@classmethod
def getProductIdMap(cls) -> Dict[str, List[str]]:
"""Gets a mapping from product names in the XML files to their definition IDs.
This loads the mapping from a file.
"""
if cls.__product_to_id_map is not None:
return cls.__product_to_id_map
plugin_path = cast(str, PluginRegistry.getInstance().getPluginPath("XmlMaterialProfile"))
product_to_id_file = os.path.join(plugin_path, "product_to_id.json")
with open(product_to_id_file, encoding = "utf-8") as f:
product_to_id_map = json.load(f)
product_to_id_map = {key: [value] for key, value in product_to_id_map.items()}
contents = ""
for line in f:
contents += line if "#" not in line else "".join([line.replace("#", str(n)) for n in range(1, 12)])
cls.__product_to_id_map = json.loads(contents)
cls.__product_to_id_map = {key: [value] for key, value in cls.__product_to_id_map.items()}
#This also loads "Ultimaker S5" -> "ultimaker_s5" even though that is not strictly necessary with the default to change spaces into underscores.
#However it is not always loaded with that default; this mapping is also used in serialize() without that default.
return product_to_id_map
return cls.__product_to_id_map
@staticmethod
def _parseCompatibleValue(value: str):

View file

@ -1,14 +1,11 @@
{
"Ultimaker 2": "ultimaker2",
"Ultimaker 2 Extended": "ultimaker2_extended",
"Ultimaker 2 Extended+": "ultimaker2_extended_plus",
"Ultimaker 2 Go": "ultimaker2_go",
"Ultimaker 2+": "ultimaker2_plus",
"Ultimaker 2+ Connect": "ultimaker2_plus_connect",
"Ultimaker 3": "ultimaker3",
"Ultimaker 3 Extended": "ultimaker3_extended",
"Ultimaker S3": "ultimaker_s3",
"Ultimaker S5": "ultimaker_s5",
"Ultimaker #": "ultimaker#",
"Ultimaker # Extended": "ultimaker#_extended",
"Ultimaker # Extended+": "ultimaker#_extended_plus",
"Ultimaker # Go": "ultimaker#_go",
"Ultimaker #+": "ultimaker#_plus",
"Ultimaker #+ Connect": "ultimaker#_plus_connect",
"Ultimaker S#": "ultimaker_s#",
"Ultimaker Original": "ultimaker_original",
"Ultimaker Original+": "ultimaker_original_plus",
"Ultimaker Original Dual Extrusion": "ultimaker_original_dual",

33
printer-linter/README.md Normal file
View file

@ -0,0 +1,33 @@
# Printer Linter
Printer linter is a python package that does linting on Cura definitions files.
Running this on your definition files will get them ready for a pull request.
## Running Locally
From the Cura root folder and pointing to the relative paths of the wanted definition files:
```python3 printer-linter/src/terminal.py "resources/definitions/flashforge_dreamer_nx.def.json" "resources/definitions/flashforge_base.def.json" --fix --format```
## Developing
### Printer Linter Rules
Inside ```.printer-linter``` you can find a list of rules. These are seperated into roughly three categories.
1. Checks
1. These rules are about checking if a file meets some requirements that can't be fixed by replacing its content.
2. An example of a check is ```diagnostic-mesh-file-extension``` this checks if a mesh file extension is acceptable.
2. Format
1. These rules are purely about how a file is structured, not content.
2. An example of a format rule is ```format-definition-bracket-newline``` This rule says that when assigning a dict value the bracket should go on a new line.
3. Fixes
1. These are about the content of the file.
2. An example of a fix is ```diagnostic-definition-redundant-override``` This removes settings that have already been defined by a parent definition
### Linters
Linters find issues within a file. There are separate linters for each type of file. The linter that is used is decided by the create function in factory.py. All linters implement the abstract class Linter.
A Linter class returns an iterator of Diagnostics, each diagnostic is an issue with the file. The diagnostics can also contain suggested fixes.
### Formatters
Formatters load a file reformat it and write it to disk. There are separate formatters for each file type. All formatters implement the abstract class Formatter.
Formatters should format based on the Format rules in .printer-linter

Some files were not shown because too many files have changed in this diff Show more