Merge remote-tracking branch 'origin/CURA-9157_msi_installer' into CURA-9157_msi_installer

This commit is contained in:
Casper Lamboo 2023-01-02 22:34:07 +01:00
commit a5b0542f8a
110 changed files with 1874 additions and 123 deletions

View File

@ -3,7 +3,11 @@ name: printer-linter-format
on: on:
push: push:
paths: paths:
- 'resources/**' - 'resources/definitions/**'
- 'resources/extruders/**'
- 'resources/intent/**'
- 'resources/quality/**'
- 'resources/variants/**'
jobs: jobs:
printer-linter-format: printer-linter-format:

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 # 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: # 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` # `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(r"{{ 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(r"{{ 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("*.dylib")])
block_cipher = None block_cipher = None

View File

@ -27,7 +27,6 @@
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)"> <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish> <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control> </Control>
<Control Id="DesktopShortcutCheckBox" Type="CheckBox" X="20" Y="160" Width="290" Height="17" Property="PREVIOUS_VERSIONS_INSTALLED" CheckBoxValue="0" Text="Uninstall previous Cura versions." />
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.CustomizeDlgBannerBitmap)" /> <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.CustomizeDlgBannerBitmap)" />
<Control Id="Text" Type="Text" X="25" Y="55" Width="320" Height="20" Text="!(loc.CustomizeDlgText)" /> <Control Id="Text" Type="Text" X="25" Y="55" Width="320" Height="20" Text="!(loc.CustomizeDlgText)" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" /> <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
@ -41,6 +40,7 @@
<Control Id="ItemSize" Type="Text" X="215" Y="140" Width="131" Height="50" Text="!(loc.CustomizeDlgItemSize)"> <Control Id="ItemSize" Type="Text" X="215" Y="140" Width="131" Height="50" Text="!(loc.CustomizeDlgItemSize)">
<Subscribe Event="SelectionSize" Attribute="Text" /> <Subscribe Event="SelectionSize" Attribute="Text" />
</Control> </Control>
<Control Id="UninstallPreviousCheckBox" Type="CheckBox" X="10" Y="210" Width="290" Height="17" Property="PREVIOUS_VERSIONS_INSTALLED" CheckBoxValue="0" Text="Uninstall previous Cura versions." />
<Control Id="Location" Type="Text" X="90" Y="210" Width="200" Height="20" Text="!(loc.CustomizeDlgLocation)"> <Control Id="Location" Type="Text" X="90" Y="210" Width="200" Height="20" Text="!(loc.CustomizeDlgLocation)">
<Subscribe Event="SelectionPath" Attribute="Text" /> <Subscribe Event="SelectionPath" Attribute="Text" />
<Subscribe Event="SelectionPathOn" Attribute="Visible" /> <Subscribe Event="SelectionPathOn" Attribute="Visible" />

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

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:fw="http://schemas.microsoft.com/wix/FirewallExtension">
<Product <Product
Id="*" Id="*"
Name="{{ app_name }}" Name="{{ app_name }}"
@ -14,7 +14,7 @@
Manufacturer="{{ company }}" Manufacturer="{{ company }}"
Description="UltiMaker Cura the most popular 3D printing slicer" Description="UltiMaker Cura the most popular 3D printing slicer"
Keywords="UltiMaker,Cura,3D,printing,slicer" Keywords="UltiMaker,Cura,3D,printing,slicer"
Comments="Copyright (c) {{ year }} UltiMaker" /> Comments="Copyright (c) {{ year }} UltiMaker B.V." />
<InstallExecuteSequence> <InstallExecuteSequence>
<RemoveExistingProducts Before="InstallInitialize" /> <RemoveExistingProducts Before="InstallInitialize" />
@ -28,6 +28,8 @@
IncludeMinimum="no" IncludeMaximum="no" IncludeMinimum="no" IncludeMaximum="no"
/> />
</Upgrade> </Upgrade>
<!--TODO: handle copy of configuration of previous version-->
<!--TODO: handle removal of old configuration once previous version is uninstalled-->
{% if "Enterpise" in app_name %} {% if "Enterpise" in app_name %}
<Property Id="PREVIOUS_413_INSTALLED" Secure="yes" /> <Property Id="PREVIOUS_413_INSTALLED" Secure="yes" />
@ -84,13 +86,51 @@
<Property Id="ApplicationFolderName" Value="{{ app_name }} {{ version }}" /> <Property Id="ApplicationFolderName" Value="{{ app_name }} {{ version }}" />
<Property Id="WixAppFolder" Value="WixPerMachineFolder" /> <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 }}"/>
<!--Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\PackageRepository\Extensions\windows.fileTypeAssociation\.3mf-->
<RegistryValue Root="HKLM" Key="SOFTWARE\{{ app_name }}\Capabilities\FileAssociations" Name=".3mf" Value="PRG_UltiMaker_Cura.3MF" Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\{{ app_name }}\Capabilities\FileAssociations" Name=".stl" Value="PRG_UltiMaker_Cura.STL" Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\{{ app_name }}\Capabilities\MIMEAssociations" Name="application/3mf" Value="PRG_UltiMaker_Cura.3MF" Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\{{ app_name }}\Capabilities\MIMEAssociations" Name="application/stl" Value="PRG_UltiMaker_Cura.STL" Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\{{ app_name }}\Capabilities\shell\Open\command" Value='"[APPLICATIONFOLDER]\{{ main_app }}" "%1"' Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\RegisteredApplications" Name="{{ app_name }}" Value="SOFTWARE\MyApp\Capabilities" Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\Classes\Applications\{{ main_app }}\SupportedTypes" Name=".3mf" Value="" Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\Classes\Applications\{{ main_app }}\SupportedTypes" Name=".stl" Value="" Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\Classes\Applications\{{ main_app }}\shell\open" Name="{{ app_name }}" Value="{{ main_app }}" Type="string" />
<ProgId Id="PRG_UltiMaker_Cura.STL" Description="{{ app_name }}" Icon="FILE_UltiMaker_Cura_exe">
<Extension Id="STL">
<Verb Id='edit' TargetFile="FILE_UltiMaker_Cura_exe" Argument='"%1"' />
<MIME ContentType="application/stl" Default="yes" />
</Extension>
</ProgId>
<ProgId Id="PRG_UltiMaker_Cura.3MF" Description="{{ app_name }}" Icon="FILE_UltiMaker_Cura_exe">
<Extension Id="3MF">
<Verb Id='edit' TargetFile="FILE_UltiMaker_Cura_exe" Argument='"%1"' />
<MIME ContentType="application/3mf" Default="yes" />
</Extension>
</ProgId>
<!-- Current Cura versions are not supported on XP or Server 2003. Even so, add 'ignorefailure=yes'. After all, worst that can happen is the user gets asked, like before. -->
<fw:FirewallException Id="FirewallExceptLocalFrontend" Name="Cura (Frontend) Connection (LocalHost)" File="FILE_CuraEngine_exe" Port="127.0.0.1" IgnoreFailure="yes" Scope="localSubnet" />
</Component>
<Component Id="CMP_CuraEngine_exe" Directory="APPLICATIONFOLDER" Guid="*">
<File Id="FILE_CuraEngine_exe" KeyPath="yes" Source="$(var.CuraDir)\CuraEngine.exe" />
<!-- Current Cura versions are not supported on XP or Server 2003. Even so, add 'ignorefailure=yes'. After all, worst that can happen is the user gets asked, like before. -->
<fw:FirewallException Id="FirewallExceptLocalEngine" Name="CuraEngine (Backend) Connection (LocalHost)" File="FILE_CuraEngine_exe" Port="127.0.0.1" IgnoreFailure="yes" Scope="localSubnet" />
</Component>
<!--Shortcuts--> <!--Shortcuts-->
<DirectoryRef Id="ShortCutDir"> <DirectoryRef Id="ShortCutDir">
<Component Id="CMP_Shortcuts" Guid="{{ shortcut_uuid }}"> <Component Id="CMP_Shortcuts" Guid="{{ shortcut_uuid }}">
<Shortcut Id="SHRT_Cura" <Shortcut Id="SHRT_Cura"
Name="{{ app_name }} {{ version }}" Name="{{ app_name }} {{ version }}"
Description="{{ app_name }} {{ version }}" Description="{{ app_name }} {{ version }}"
Target="[MyProgramDir]{{ main_app }}" Target="[APPLICATIONFOLDER]\{{ main_app }}"
Icon="ICO_Cura" /> Icon="ICO_Cura" />
<Shortcut Id="SHRT_UninstallShortcut" <Shortcut Id="SHRT_UninstallShortcut"
Name="Uninstall {{ app_name }} {{ version }}" Name="Uninstall {{ app_name }} {{ version }}"
@ -109,6 +149,8 @@
</DirectoryRef> </DirectoryRef>
<Feature Id="ProductFeature" Title="{{ app_name }}" Level="1"> <Feature Id="ProductFeature" Title="{{ app_name }}" Level="1">
<ComponentRef Id="CMP_UltiMaker_Cura_exe" />
<ComponentRef Id="CMP_CuraEngine_exe" />
<ComponentGroupRef Id="NewFilesGroup" /> <ComponentGroupRef Id="NewFilesGroup" />
<ComponentRef Id="CMP_Shortcuts" /> <ComponentRef Id="CMP_Shortcuts" />
</Feature> </Feature>

View File

@ -57,26 +57,47 @@ def generate_wxs(source_path: Path, dist_path: Path, filename: Path, app_name: s
except shutil.SameFileError: except shutil.SameFileError:
pass pass
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: str): def build(dist_path: Path, filename: str):
dist_loc = Path(os.getcwd(), dist_path) dist_loc = Path(os.getcwd(), dist_path)
work_loc = work_path(filename) work_loc = work_path(filename)
wxs_loc = work_loc.joinpath("UltiMaker-Cura.wxs") wxs_loc = work_loc.joinpath("UltiMaker-Cura.wxs")
heat_loc = work_loc.joinpath("HeatFile.wxs") heat_loc = work_loc.joinpath("HeatFile.wxs")
exclude_components_loc = work_loc.joinpath("ExcludeComponents.xslt")
manageoldcuradlg_loc = work_loc.joinpath("CustomizeCuraDlg.wxs") manageoldcuradlg_loc = work_loc.joinpath("CustomizeCuraDlg.wxs")
build_loc = work_loc.joinpath("build_msi") build_loc = work_loc.joinpath("build_msi")
heat_command = ["heat", "dir", f"{dist_loc.as_posix()}\\", "-dr", "APPLICATIONFOLDER", "-cg", "NewFilesGroup", heat_command = ["heat", "dir", f"{dist_loc.as_posix()}\\", "-dr", "APPLICATIONFOLDER", "-cg", "NewFilesGroup",
"-gg", "-g1", "-sf", "-srd", "-var", "var.CuraDir", "-out", f"{heat_loc.as_posix()}"] "-gg", "-g1", "-sf", "-srd", "-var", "var.CuraDir", "-t", f"{exclude_components_loc.as_posix()}",
"-out", f"{heat_loc.as_posix()}"]
subprocess.call(heat_command) subprocess.call(heat_command)
build_command = ["candle", "-arch", "x64", f"-dCuraDir={dist_loc}\\", "-out", f"{build_loc.as_posix()}\\", 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()}", f"{manageoldcuradlg_loc.as_posix()}"] f"{wxs_loc.as_posix()}", f"{heat_loc.as_posix()}", f"{manageoldcuradlg_loc.as_posix()}"]
subprocess.call(build_command) subprocess.call(build_command)
link_command = ["light", f"{build_loc.joinpath(wxs_loc.name).with_suffix('.wixobj')}", link_command = ["light", f"{build_loc.joinpath(wxs_loc.name).with_suffix('.wixobj')}",
f"{build_loc.joinpath(heat_loc.name).with_suffix('.wixobj')}", f"{build_loc.joinpath(heat_loc.name).with_suffix('.wixobj')}",
f"{build_loc.joinpath(manageoldcuradlg_loc.name).with_suffix('.wixobj')}", "-ext", "WixUIExtension", f"{build_loc.joinpath(manageoldcuradlg_loc.name).with_suffix('.wixobj')}",
"-ext", "WixUIExtension",
"-ext", "WixFirewallExtension",
"-out", f"{work_loc.joinpath(filename.name)}"] "-out", f"{work_loc.joinpath(filename.name)}"]
subprocess.call(link_command) subprocess.call(link_command)
@ -89,5 +110,6 @@ if __name__ == "__main__":
help="Filename of the exe (e.g. 'UltiMaker-Cura-5.1.0-beta-Windows-X64.msi')") 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')") parser.add_argument("name", type=str, help="App name (e.g. 'UltiMaker Cura')")
args = parser.parse_args() args = parser.parse_args()
generate_wxs(args.source_path, args.dist_path, args.filename, args.name) generate_wxs(args.source_path.resolve(), args.dist_path.resolve(), args.filename.resolve(), args.name)
build(args.dist_path, args.filename) cleanup_artifacts(args.dist_path.resolve())
build(args.dist_path.resolve(), args.filename)

View File

@ -24,20 +24,29 @@ class FilamentChange(Script):
"version": 2, "version": 2,
"settings": "settings":
{ {
"enabled":
{
"label": "Enable",
"description": "Uncheck to temporarily disable this feature.",
"type": "bool",
"default_value": true
},
"layer_number": "layer_number":
{ {
"label": "Layer", "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.", "description": "At what layer should color change occur. This will be before the layer starts printing. Specify multiple color changes with a comma.",
"unit": "", "unit": "",
"type": "str", "type": "str",
"default_value": "1" "default_value": "1",
"enabled": "enabled"
}, },
"firmware_config": "firmware_config":
{ {
"label": "Use Firmware Configuration", "label": "Use Firmware Configuration",
"description": "Use the settings in your firmware, or customise the parameters of the filament change here.", "description": "Use the settings in your firmware, or customise the parameters of the filament change here.",
"type": "bool", "type": "bool",
"default_value": false "default_value": false,
"enabled": "enabled"
}, },
"initial_retract": "initial_retract":
{ {
@ -46,7 +55,7 @@ class FilamentChange(Script):
"unit": "mm", "unit": "mm",
"type": "float", "type": "float",
"default_value": 30.0, "default_value": 30.0,
"enabled": "not firmware_config" "enabled": "enabled and not firmware_config"
}, },
"later_retract": "later_retract":
{ {
@ -55,7 +64,7 @@ class FilamentChange(Script):
"unit": "mm", "unit": "mm",
"type": "float", "type": "float",
"default_value": 300.0, "default_value": 300.0,
"enabled": "not firmware_config" "enabled": "enabled and not firmware_config"
}, },
"x_position": "x_position":
{ {
@ -64,7 +73,7 @@ class FilamentChange(Script):
"unit": "mm", "unit": "mm",
"type": "float", "type": "float",
"default_value": 0, "default_value": 0,
"enabled": "not firmware_config" "enabled": "enabled and not firmware_config"
}, },
"y_position": "y_position":
{ {
@ -73,7 +82,7 @@ class FilamentChange(Script):
"unit": "mm", "unit": "mm",
"type": "float", "type": "float",
"default_value": 0, "default_value": 0,
"enabled": "not firmware_config" "enabled": "enabled and not firmware_config"
}, },
"z_position": "z_position":
{ {
@ -82,7 +91,8 @@ class FilamentChange(Script):
"unit": "mm", "unit": "mm",
"type": "float", "type": "float",
"default_value": 0, "default_value": 0,
"minimum_value": 0 "minimum_value": 0,
"enabled": "enabled"
}, },
"retract_method": "retract_method":
{ {
@ -92,7 +102,7 @@ class FilamentChange(Script):
"options": {"U": "Marlin (M600 U)", "L": "Reprap (M600 L)"}, "options": {"U": "Marlin (M600 U)", "L": "Reprap (M600 L)"},
"default_value": "U", "default_value": "U",
"value": "\\\"L\\\" if machine_gcode_flavor==\\\"RepRap (RepRap)\\\" else \\\"U\\\"", "value": "\\\"L\\\" if machine_gcode_flavor==\\\"RepRap (RepRap)\\\" else \\\"U\\\"",
"enabled": "not firmware_config" "enabled": "enabled and not firmware_config"
}, },
"machine_gcode_flavor": "machine_gcode_flavor":
{ {
@ -113,6 +123,40 @@ class FilamentChange(Script):
}, },
"default_value": "RepRap (Marlin/Sprinter)", "default_value": "RepRap (Marlin/Sprinter)",
"enabled": "false" "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. :param data: A list of layers of g-code.
:return: A similar list, with filament change commands inserted. :return: A similar list, with filament change commands inserted.
""" """
enabled = self.getSettingValueByKey("enabled")
layer_nums = self.getSettingValueByKey("layer_number") layer_nums = self.getSettingValueByKey("layer_number")
initial_retract = self.getSettingValueByKey("initial_retract") initial_retract = self.getSettingValueByKey("initial_retract")
later_retract = self.getSettingValueByKey("later_retract") later_retract = self.getSettingValueByKey("later_retract")
@ -141,8 +186,20 @@ class FilamentChange(Script):
y_pos = self.getSettingValueByKey("y_position") y_pos = self.getSettingValueByKey("y_position")
z_pos = self.getSettingValueByKey("z_position") z_pos = self.getSettingValueByKey("z_position")
firmware_config = self.getSettingValueByKey("firmware_config") 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 not firmware_config:
if initial_retract is not None and initial_retract > 0.: 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.: if z_pos is not None and z_pos > 0.:
color_change = color_change + (" Z%.2f" % z_pos) 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(",") layer_targets = layer_nums.split(",")
if len(layer_targets) > 0: if len(layer_targets) > 0:

View File

@ -1,5 +1,5 @@
pytest pytest
pyinstaller pyinstaller==5.6.2
pyinstaller-hooks-contrib pyinstaller-hooks-contrib
pyyaml pyyaml
sip==6.5.1 sip==6.5.1

View File

@ -0,0 +1,88 @@
{
"version": 2,
"name": "Modix Base Printer",
"inherits": "fdmprinter",
"metadata":
{
"author": "Modix",
"manufacturer": "Modix",
"file_formats": "text/x-gcode",
"has_variants": true,
"machine_extruder_trains":
{
"0": "modix_v3_extruder_0",
"1": "modix_v3_extruder_1"
},
"preferred_variant_name": "0.4 mm Nozzle",
"variants_name": "Nozzle Size"
},
"overrides":
{
"adhesion_type": { "default_value": "skirt" },
"cool_fan_full_at_height": { "value": "layer_height_0 + 2 * layer_height" },
"fill_outline_gaps": { "value": false },
"gantry_height": { "value": "90.0" },
"infill_before_walls": { "value": false },
"infill_overlap": { "value": 30.0 },
"infill_pattern": { "value": "'cubic'" },
"infill_sparse_density": { "value": "15" },
"layer_height_0": { "value": "round(machine_nozzle_size / 2, 1)" },
"line_width": { "value": "machine_nozzle_size * 1.05" },
"machine_end_gcode": { "default_value": "M83 ; extruder relative moves \nG1 E-5 F2700 ;retract a bit \nG10 P0 S0 R0 ; turn off extruder 0 \nG10 P1 S0 R0 ; turn off extruder 1 \nM106 S0 ; turn off fans \nT-1 P0 ; deselect any tools \nG4 P1 ; dwell 1ms \nG91 ;relative positioning \nG1 Z2 F500 ; Move print head up 2mm \nG90 ; absolute positioning \nG1 X{move.axes[0].min+2} Y{move.axes[1].max-2} F6000 ; move to the back left \nM84 ; disable motors" },
"machine_gcode_flavor": { "default_value": "RepRap (RepRap)" },
"machine_head_with_fans_polygon":
{
"default_value": [
[-100, 30],
[-100, 65],
[30, -105],
[-31, -100]
]
},
"machine_name": { "default_value": "Modix Base Printer" },
"machine_start_gcode": { "default_value": "G28 ; home all axes" },
"material_diameter": { "default_value": 1.75 },
"material_final_print_temperature": { "value": "material_print_temperature" },
"material_initial_print_temperature": { "value": "material_print_temperature" },
"minimum_interface_area": { "value": 10 },
"minimum_support_area": { "value": 2 },
"optimize_wall_printing_order": { "value": "True" },
"retraction_amount": { "value": 1 },
"retraction_combing": { "value": "'off' if retraction_hop_enabled else 'infill'" },
"retraction_combing_max_distance": { "value": 5 },
"retraction_count_max": { "value": 50 },
"retraction_extrusion_window": { "value": 1 },
"retraction_hop": { "value": "layer_height*4" },
"retraction_hop_enabled": { "value": "support_enable" },
"retraction_prime_speed": { "value": 40 },
"retraction_retract_speed": { "value": 40 },
"retraction_speed": { "default_value": 40 },
"skin_overlap": { "value": 10.0 },
"skirt_brim_minimal_length": { "default_value": 200 },
"skirt_gap": { "value": 5.0 },
"skirt_line_count": { "value": 3 },
"speed_layer_0": { "value": 20.0 },
"speed_prime_tower": { "value": "speed_topbottom" },
"speed_support": { "value": "speed_wall_0" },
"speed_support_interface": { "value": "speed_topbottom" },
"speed_travel": { "value": 110.0 },
"speed_wall_x": { "value": "speed_wall" },
"speed_z_hop": { "value": 5 },
"support_angle": { "value": 55 },
"support_brim_enable": { "value": true },
"support_brim_width": { "value": 5 },
"support_infill_rate": { "value": "0 if support_enable and support_structure == 'tree' else 15" },
"support_interface_density": { "value": 40 },
"support_interface_enable": { "value": true },
"support_interface_height": { "value": "layer_height * 3" },
"support_use_towers": { "value": false },
"support_xy_distance": { "value": "wall_line_width_0 * 2" },
"support_xy_distance_overhang": { "value": "wall_line_width_0" },
"support_z_distance": { "value": "layer_height if layer_height >= 0.2 else layer_height * 2" },
"top_bottom_thickness": { "value": "layer_height_0 + layer_height * 3" },
"travel_avoid_supports": { "value": true },
"travel_retract_before_outer_wall": { "value": true },
"wall_thickness": { "value": "line_width * 2" },
"z_seam_corner": { "value": "z_seam_corner_weighted" }
}
}

View File

@ -0,0 +1,13 @@
{
"version": 2,
"name": "Modix V3 BIG-120X",
"inherits": "modix_v3_base",
"metadata": { "visible": true },
"overrides":
{
"machine_depth": { "default_value": 600 },
"machine_height": { "default_value": 640 },
"machine_name": { "default_value": "Modix BIG-120X V3" },
"machine_width": { "default_value": 1200 }
}
}

View File

@ -0,0 +1,13 @@
{
"version": 2,
"name": "Modix V3 BIG-120Z",
"inherits": "modix_v3_base",
"metadata": { "visible": true },
"overrides":
{
"machine_depth": { "default_value": 600 },
"machine_height": { "default_value": 1200 },
"machine_name": { "default_value": "Modix BIG-120Z V3" },
"machine_width": { "default_value": 600 }
}
}

View File

@ -0,0 +1,13 @@
{
"version": 2,
"name": "Modix V3 BIG-180X",
"inherits": "modix_v3_base",
"metadata": { "visible": true },
"overrides":
{
"machine_depth": { "default_value": 600 },
"machine_height": { "default_value": 600 },
"machine_name": { "default_value": "Modix BIG-180X V3" },
"machine_width": { "default_value": 1800 }
}
}

View File

@ -0,0 +1,13 @@
{
"version": 2,
"name": "Modix V3 BIG-40",
"inherits": "modix_v3_base",
"metadata": { "visible": true },
"overrides":
{
"machine_depth": { "default_value": 400 },
"machine_height": { "default_value": 800 },
"machine_name": { "default_value": "Modix BIG-40 V3" },
"machine_width": { "default_value": 400 }
}
}

View File

@ -0,0 +1,13 @@
{
"version": 2,
"name": "Modix V3 BIG-60",
"inherits": "modix_v3_base",
"metadata": { "visible": true },
"overrides":
{
"machine_depth": { "default_value": 600 },
"machine_height": { "default_value": 660 },
"machine_name": { "default_value": "Modix BIG-60 V3" },
"machine_width": { "default_value": 600 }
}
}

View File

@ -0,0 +1,13 @@
{
"version": 2,
"name": "Modix V3 BIG-Meter",
"inherits": "modix_v3_base",
"metadata": { "visible": true },
"overrides":
{
"machine_depth": { "default_value": 1000 },
"machine_height": { "default_value": 1000 },
"machine_name": { "default_value": "Modix BIG-METER V3" },
"machine_width": { "default_value": 1000 }
}
}

View File

@ -0,0 +1,88 @@
{
"version": 2,
"name": "Modix Base Printer",
"inherits": "fdmprinter",
"metadata":
{
"author": "Modix",
"manufacturer": "Modix",
"file_formats": "text/x-gcode",
"has_variants": true,
"machine_extruder_trains":
{
"0": "modix_v4_extruder_0",
"1": "modix_v4_extruder_1"
},
"preferred_variant_name": "0.4 mm Nozzle",
"variants_name": "Nozzle Size"
},
"overrides":
{
"adhesion_type": { "default_value": "skirt" },
"cool_fan_full_at_height": { "value": "layer_height_0 + 2 * layer_height" },
"fill_outline_gaps": { "value": false },
"gantry_height": { "value": "90.0" },
"infill_before_walls": { "value": false },
"infill_overlap": { "value": 30.0 },
"infill_pattern": { "value": "'cubic'" },
"infill_sparse_density": { "value": "15" },
"layer_height_0": { "value": "round(machine_nozzle_size / 2, 1)" },
"line_width": { "value": "machine_nozzle_size * 1.05" },
"machine_end_gcode": { "default_value": "M83 ; extruder relative moves \nG1 E-5 F2700 ;retract a bit \nG10 P0 S0 R0 ; turn off extruder 0 \nM106 S0 ; turn off fans \nT-1 P0 ; deselect any tools \nG4 P1 ; dwell 1ms \nG91 ;relative positioning \nG1 Z2 F500 ; Move print head up 2mm \nG90 ; absolute positioning \nG1 X{move.axes[0].min+2} Y{move.axes[1].max-2} F6000 ; move to the back left \nM84 ; disable motors" },
"machine_gcode_flavor": { "default_value": "RepRap (RepRap)" },
"machine_head_with_fans_polygon":
{
"default_value": [
[-100, 30],
[-100, 65],
[30, -105],
[-31, -100]
]
},
"machine_name": { "default_value": "Modix Base Printer" },
"machine_start_gcode": { "default_value": "G28 ; home all axes" },
"material_diameter": { "default_value": 1.75 },
"material_final_print_temperature": { "value": "material_print_temperature" },
"material_initial_print_temperature": { "value": "material_print_temperature" },
"minimum_interface_area": { "value": 10 },
"minimum_support_area": { "value": 2 },
"optimize_wall_printing_order": { "value": "True" },
"retraction_amount": { "value": 1 },
"retraction_combing": { "value": "'off' if retraction_hop_enabled else 'infill'" },
"retraction_combing_max_distance": { "value": 5 },
"retraction_count_max": { "value": 50 },
"retraction_extrusion_window": { "value": 1 },
"retraction_hop": { "value": 2 },
"retraction_hop_enabled": { "value": "support_enable" },
"retraction_prime_speed": { "value": 40 },
"retraction_retract_speed": { "value": 40 },
"retraction_speed": { "default_value": 40 },
"skin_overlap": { "value": 10.0 },
"skirt_brim_minimal_length": { "default_value": 200 },
"skirt_gap": { "value": 5.0 },
"skirt_line_count": { "value": 3 },
"speed_layer_0": { "value": 20.0 },
"speed_prime_tower": { "value": "speed_topbottom" },
"speed_support": { "value": "speed_wall_0" },
"speed_support_interface": { "value": "speed_topbottom" },
"speed_travel": { "value": 250.0 },
"speed_wall_x": { "value": "speed_wall" },
"speed_z_hop": { "value": 5 },
"support_angle": { "value": 55 },
"support_brim_enable": { "value": true },
"support_brim_width": { "value": 5 },
"support_infill_rate": { "value": "0 if support_enable and support_structure == 'tree' else 15" },
"support_interface_density": { "value": 40 },
"support_interface_enable": { "value": true },
"support_interface_height": { "value": "layer_height * 3" },
"support_use_towers": { "value": false },
"support_xy_distance": { "value": "wall_line_width_0 * 2" },
"support_xy_distance_overhang": { "value": "wall_line_width_0" },
"support_z_distance": { "value": "layer_height if layer_height >= 0.2 else layer_height * 2" },
"top_bottom_thickness": { "value": "layer_height_0 + layer_height * 3" },
"travel_avoid_supports": { "value": true },
"travel_retract_before_outer_wall": { "value": true },
"wall_thickness": { "value": "line_width * 2" },
"z_seam_corner": { "value": "z_seam_corner_weighted" }
}
}

View File

@ -0,0 +1,13 @@
{
"version": 2,
"name": "Modix V4 BIG-120X",
"inherits": "modix_v4_base",
"metadata": { "visible": true },
"overrides":
{
"machine_depth": { "default_value": 600 },
"machine_height": { "default_value": 640 },
"machine_name": { "default_value": "Modix BIG-120X V4" },
"machine_width": { "default_value": 1200 }
}
}

View File

@ -0,0 +1,13 @@
{
"version": 2,
"name": "Modix V4 BIG-120Z",
"inherits": "modix_v4_base",
"metadata": { "visible": true },
"overrides":
{
"machine_depth": { "default_value": 600 },
"machine_height": { "default_value": 1200 },
"machine_name": { "default_value": "Modix BIG-120Z V4" },
"machine_width": { "default_value": 600 }
}
}

View File

@ -0,0 +1,13 @@
{
"version": 2,
"name": "Modix V4 BIG-180X",
"inherits": "modix_v4_base",
"metadata": { "visible": true },
"overrides":
{
"machine_depth": { "default_value": 600 },
"machine_height": { "default_value": 600 },
"machine_name": { "default_value": "Modix BIG-180X V4" },
"machine_width": { "default_value": 1800 }
}
}

View File

@ -0,0 +1,13 @@
{
"version": 2,
"name": "Modix V4 BIG-60",
"inherits": "modix_v4_base",
"metadata": { "visible": true },
"overrides":
{
"machine_depth": { "default_value": 600 },
"machine_height": { "default_value": 660 },
"machine_name": { "default_value": "Modix BIG-60 V4" },
"machine_width": { "default_value": 600 }
}
}

View File

@ -0,0 +1,13 @@
{
"version": 2,
"name": "Modix V4 BIG-Meter",
"inherits": "modix_v4_base",
"metadata": { "visible": true },
"overrides":
{
"machine_depth": { "default_value": 1000 },
"machine_height": { "default_value": 1000 },
"machine_name": { "default_value": "Modix BIG-METER V4" },
"machine_width": { "default_value": 1000 }
}
}

View File

@ -0,0 +1,19 @@
{
"version": 2,
"name": "Left Extruder",
"inherits": "fdmextruder",
"metadata":
{
"machine": "modix_v3_base",
"position": "0"
},
"overrides":
{
"extruder_nr":
{
"default_value": 0,
"maximum_value": "1"
},
"material_diameter": { "default_value": 1.75 }
}
}

View File

@ -0,0 +1,19 @@
{
"version": 2,
"name": "Right Extruder",
"inherits": "fdmextruder",
"metadata":
{
"machine": "modix_v3_base",
"position": "1"
},
"overrides":
{
"extruder_nr":
{
"default_value": 1,
"maximum_value": "1"
},
"material_diameter": { "default_value": 1.75 }
}
}

View File

@ -0,0 +1,19 @@
{
"version": 2,
"name": "Left Extruder",
"inherits": "fdmextruder",
"metadata":
{
"machine": "modix_v4_base",
"position": "0"
},
"overrides":
{
"extruder_nr":
{
"default_value": 0,
"maximum_value": "1"
},
"material_diameter": { "default_value": 1.75 }
}
}

View File

@ -0,0 +1,19 @@
{
"version": 2,
"name": "Right Extruder",
"inherits": "fdmextruder",
"metadata":
{
"machine": "modix_v4_base",
"position": "1"
},
"overrides":
{
"extruder_nr":
{
"default_value": 1,
"maximum_value": "1"
},
"material_diameter": { "default_value": 1.75 }
}
}

View File

@ -17,6 +17,12 @@ UM.MainWindow
{ {
id: base id: base
Item
{
id: mainWindow
anchors.fill: parent
}
// Cura application window title // Cura application window title
title: title:
{ {

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. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.11 import QtQuick 2.11
@ -12,7 +12,7 @@ Item
property color materialColor property color materialColor
property alias textColor: extruderNumberText.color property alias textColor: extruderNumberText.color
property bool extruderEnabled: true property bool extruderEnabled: true
property var iconSize: UM.Theme.getSize("extruder_icon").width property int iconSize: UM.Theme.getSize("extruder_icon").width
property string iconVariant: "medium" property string iconVariant: "medium"
property alias font: extruderNumberText.font property alias font: extruderNumberText.font
@ -36,7 +36,6 @@ Item
} }
UM.ColorImage UM.ColorImage
{ {
id: mainIcon
anchors.fill: parent anchors.fill: parent
width: iconSize width: iconSize
height: iconSize height: iconSize
@ -48,12 +47,14 @@ Item
UM.Label UM.Label
{ {
id: extruderNumberText id: extruderNumberText
anchors.centerIn: parent
text: index + 1
font: UM.Theme.getFont("small_emphasis")
width: contentWidth width: contentWidth
height: contentHeight height: contentHeight
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.right: parent.right
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: (index + 1).toString()
font: UM.Theme.getFont("small_emphasis")
} }
} }
} }

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. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7 import QtQuick 2.7
@ -36,6 +36,7 @@ Cura.MenuItem
UM.Label UM.Label
{ {
id: brandLabelText
text: replaceText(materialBrandMenu.text) text: replaceText(materialBrandMenu.text)
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight:true Layout.fillHeight:true
@ -84,33 +85,15 @@ Cura.MenuItem
onTriggered: menuPopup.close() onTriggered: menuPopup.close()
} }
Popup MaterialBrandSubMenu
{ {
id: menuPopup id: menuPopup
width: materialTypesList.width + padding * 2
height: materialTypesList.height + padding * 2
property var flipped: false
x: parent.width - UM.Theme.getSize("default_lining").width
y: {
// Checks if popup is more than halfway down the screen AND further than 400 down (this avoids popup going off the top of screen)
// If it is then the popup will push up instead of down
// This fixes the popups appearing bellow the bottom of the screen.
if (materialBrandMenu.parent.height / 2 < parent.y && parent.y > 400) {
flipped = true
return -UM.Theme.getSize("default_lining").width - height + UM.Theme.getSize("menu").height
}
flipped = false
return -UM.Theme.getSize("default_lining").width
}
padding: background.border.width
// Nasty hack to ensure that we can keep track if the popup contains the mouse. // Nasty hack to ensure that we can keep track if the popup contains the mouse.
// Since we also want a hover for the sub items (and these events are sent async) // Since we also want a hover for the sub items (and these events are sent async)
// We have to keep a count of itemHovered (instead of just a bool) // We have to keep a count of itemHovered (instead of just a bool)
property int itemHovered: 0 property int itemHovered: 0
MouseArea MouseArea
{ {
id: submenuArea id: submenuArea
@ -120,16 +103,11 @@ Cura.MenuItem
onEntered: hideTimer.restartTimer() onEntered: hideTimer.restartTimer()
} }
background: Rectangle
{
color: UM.Theme.getColor("main_background")
border.color: UM.Theme.getColor("lining")
border.width: UM.Theme.getSize("default_lining").width
}
Column Column
{ {
id: materialTypesList id: materialTypesList
width: UM.Theme.getSize("menu").width
height: childrenRect.height
spacing: 0 spacing: 0
property var brandMaterials: materialTypesModel.material_types property var brandMaterials: materialTypesModel.material_types
@ -146,9 +124,7 @@ Cura.MenuItem
height: UM.Theme.getSize("menu").height height: UM.Theme.getSize("menu").height
width: UM.Theme.getSize("menu").width width: UM.Theme.getSize("menu").width
color: materialTypeButton.containsMouse ? UM.Theme.getColor("background_2") : UM.Theme.getColor("background_1") color: materialTypeButton.containsMouse ? UM.Theme.getColor("background_2") : "transparent"
property var isFlipped: menuPopup.flipped
RowLayout RowLayout
{ {
@ -236,34 +212,17 @@ Cura.MenuItem
onTriggered: colorPopup.close() onTriggered: colorPopup.close()
} }
Popup MaterialBrandSubMenu
{ {
id: colorPopup id: colorPopup
width: materialColorsList.width + padding * 2
height: materialColorsList.height + padding * 2
x: parent.width
y: {
// If flipped the popup should push up rather than down from the parent
if (brandMaterialBase.isFlipped) {
return -height + UM.Theme.getSize("menu").height + UM.Theme.getSize("default_lining").width
}
return -UM.Theme.getSize("default_lining").width
}
property int itemHovered: 0 property int itemHovered: 0
padding: background.border.width
background: Rectangle
{
color: UM.Theme.getColor("main_background")
border.color: UM.Theme.getColor("lining")
border.width: UM.Theme.getSize("default_lining").width
}
Column Column
{ {
id: materialColorsList id: materialColorsList
property var brandColors: model.colors property var brandColors: model.colors
width: UM.Theme.getSize("menu").width
height: childrenRect.height
spacing: 0 spacing: 0
Repeater Repeater
@ -273,12 +232,38 @@ Cura.MenuItem
delegate: Rectangle delegate: Rectangle
{ {
height: UM.Theme.getSize("menu").height height: UM.Theme.getSize("menu").height
width: UM.Theme.getSize("menu").width width: parent.width
color: materialColorButton.containsMouse ? UM.Theme.getColor("background_2") : UM.Theme.getColor("background_1") color: materialColorButton.containsMouse ? UM.Theme.getColor("background_2") : UM.Theme.getColor("main_background")
MouseArea
{
id: materialColorButton
anchors.fill: parent
hoverEnabled: true
onClicked:
{
Cura.MachineManager.setMaterial(extruderIndex, model.container_node);
menuPopup.close();
colorPopup.close();
materialMenu.close();
}
onEntered:
{
menuPopup.itemHovered += 1;
colorPopup.itemHovered += 1;
}
onExited:
{
menuPopup.itemHovered -= 1;
colorPopup.itemHovered -= 1;
}
}
Item Item
{ {
height: parent.height
width: parent.width
opacity: materialBrandMenu.enabled ? 1 : 0.5 opacity: materialBrandMenu.enabled ? 1 : 0.5
anchors.fill: parent anchors.fill: parent
@ -309,31 +294,6 @@ Cura.MenuItem
wrapMode: Text.NoWrap wrapMode: Text.NoWrap
} }
} }
MouseArea
{
id: materialColorButton
anchors.fill: parent
hoverEnabled: true
onClicked:
{
Cura.MachineManager.setMaterial(extruderIndex, model.container_node);
menuPopup.close();
colorPopup.close();
materialMenu.close();
}
onEntered:
{
menuPopup.itemHovered += 1;
colorPopup.itemHovered += 1;
}
onExited:
{
menuPopup.itemHovered -= 1;
colorPopup.itemHovered -= 1;
}
}
} }
} }
} }

View File

@ -0,0 +1,118 @@
// Copyright (c) 2022 UltiMaker
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7
import QtQuick.Controls 2.4
import QtQuick.Layouts 2.7
import UM 1.5 as UM
import Cura 1.7 as Cura
Popup
{
id: materialBrandSubMenu
bottomPadding: UM.Theme.getSize("thin_margin").height
topPadding: UM.Theme.getSize("thin_margin").height
implicitWidth: scrollViewContent.width + scrollbar.width + leftPadding + rightPadding
implicitHeight: scrollViewContent.height + bottomPadding + topPadding
// offset position relative to the parent
property int implicitX: parent.width
property int implicitY: -UM.Theme.getSize("thin_margin").height
default property alias contents: scrollViewContent.children
x: implicitX
y: implicitY
// needed for the `mapToItem` function to work; apparently a Popup is not an Item
Item
{
id: materialBrandSubMenuItem
anchors.fill: parent
}
onOpened:
{
// we want to make sure here that the popup never goes out side the window so we adjust the x and y position
// based on the width/height of the mainWindow/popup. QML is a bit weird here though, as the globalPosition
// is in absolute coordinates relative to the origin of the mainWindow while setting the x and y coordinates
// of the popup only changes the position relative to the parent.
// reset position, the remainder of the function asumes this position and size
materialBrandSubMenu.x = implicitX;
materialBrandSubMenu.y = implicitY;
materialBrandSubMenu.width = implicitWidth;
materialBrandSubMenu.height = implicitHeight;
const globalPosition = materialBrandSubMenuItem.mapToItem(null, 0, 0);
if (globalPosition.y > mainWindow.height - materialBrandSubMenu.height)
{
if (mainWindow.height > materialBrandSubMenu.height)
{
const targetY = mainWindow.height - materialBrandSubMenu.height;
const deltaY = globalPosition.y - targetY;
materialBrandSubMenu.y = implicitY - deltaY;
}
else
{
// if popup is taller then the the component, limit
// the components height and set the position to
// y = 0 (in absolute coordinates)
materialBrandSubMenu.y = implicitY - globalPosition.y;
materialBrandSubMenu.height = mainWindow.height;
}
}
if (globalPosition.x > mainWindow.width - materialBrandSubMenu.width)
{
if (mainWindow.width > materialBrandSubMenu.width)
{
const targetX = mainWindow.width - materialBrandSubMenu.width;
const deltaX = globalPosition.x - targetX;
materialBrandSubMenu.x = implicitX - deltaX;
}
else
{
materialBrandSubMenu.x = implicitX - globalPosition.x;
materialBrandSubMenu.width = mainWindow.width;
}
}
}
padding: background.border.width
background: Rectangle
{
color: UM.Theme.getColor("main_background")
border.color: UM.Theme.getColor("lining")
border.width: UM.Theme.getSize("default_lining").width
}
ScrollView
{
id: scrollView
anchors.fill: parent
contentHeight: scrollViewContent.height
clip: true
ScrollBar.vertical: UM.ScrollBar
{
id: scrollbar
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
}
Rectangle
{
id: scrollViewContent
width: childrenRect.width
height: childrenRect.height
color: UM.Theme.getColor("main_background")
}
}
}

View File

@ -67,6 +67,11 @@ Item
top: parent.top top: parent.top
} }
visible: currentModeIndex == PrintSetupSelectorContents.Mode.Recommended visible: currentModeIndex == PrintSetupSelectorContents.Mode.Recommended
height: {
const height = base.height - (customPrintSetup.mapToItem(null, 0, 0).y + buttonRow.height + UM.Theme.getSize("default_margin").height);
const maxHeight = UM.Preferences.getValue("view/settings_list_height");
return Math.min(implicitHeight, height, maxHeight);
}
function onModeChanged() function onModeChanged()
{ {

View File

@ -2,34 +2,41 @@
//Cura is released under the terms of the LGPLv3 or higher. //Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import UM 1.6 as UM import UM 1.6 as UM
import Cura 1.6 as Cura import Cura 1.6 as Cura
import ".." import ".."
Item ScrollView
{ {
id: recommendedPrintSetup id: recommendedPrintSetup
height: childrenRect.height + 2 * padding implicitHeight: settingsColumn.height + 2 * padding
property bool settingsEnabled: Cura.ExtruderManager.activeExtruderStackId || extrudersEnabledCount.properties.value == 1 property bool settingsEnabled: Cura.ExtruderManager.activeExtruderStackId || extrudersEnabledCount.properties.value == 1
property real padding: UM.Theme.getSize("default_margin").width
padding: UM.Theme.getSize("default_margin").width
function onModeChanged() {} function onModeChanged() {}
Column ScrollBar.vertical: UM.ScrollBar {
{ id: scroll
spacing: UM.Theme.getSize("default_margin").height
anchors anchors
{ {
left: parent.left
right: parent.right
top: parent.top top: parent.top
margins: parent.padding right: parent.right
bottom: parent.bottom
} }
}
Column
{
id: settingsColumn
spacing: UM.Theme.getSize("default_margin").height
width: recommendedPrintSetup.width - 2 * recommendedPrintSetup.padding - (scroll.visible ? scroll.width : 0)
// TODO // TODO
property real firstColumnWidth: Math.round(width / 3) property real firstColumnWidth: Math.round(width / 3)

View File

@ -87,15 +87,17 @@ UM.TextField
function parseValueUpdateSetting() function parseValueUpdateSetting()
{ {
if (propertyProvider.properties.value === text || (parseFloat(propertyProvider.properties.value) === parseFloat(text))) // User convenience. We use dots for decimal values
const modified_text = text.replace(",", ".");
if (propertyProvider.properties.value === modified_text || (parseFloat(propertyProvider.properties.value) === parseFloat(modified_text)))
{ {
// Don't set the property value from the control. It already has the same value // Don't set the property value from the control. It already has the same value
return return
} }
if (propertyProvider && text !== propertyProvider.properties.value) if (propertyProvider && modified_text !== propertyProvider.properties.value)
{ {
updateSetting(text); updateSetting(modified_text);
} }
} }

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_base
name = 0.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.4

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_base
name = 0.6 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.6

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_base
name = 0.8 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.8

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_base
name = 1.0 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.0
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_base
name = 1.2 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.2
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_base
name = 1.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.4
support_angle = 45

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_big120x
name = 0.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.4

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_big120x
name = 0.6 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.6

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_big120x
name = 0.8 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.8

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_big120x
name = 1.0 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.0
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_big120x
name = 1.2 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.2
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_big120x
name = 1.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.4
support_angle = 45

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_big120Z
name = 0.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.4

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_big120Z
name = 0.6 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.6

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_big120Z
name = 0.8 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.8

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_big120Z
name = 1.0 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.0
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_big120Z
name = 1.2 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.2
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_big120Z
name = 1.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.4
support_angle = 45

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_big180X
name = 0.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.4

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_big180X
name = 0.6 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.6

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_big180X
name = 0.8 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.8

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_big180X
name = 1.0 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.0
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_big180X
name = 1.2 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.2
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_big180X
name = 1.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.4
support_angle = 45

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_big40
name = 0.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.4

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_big40
name = 0.6 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.6

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_big40
name = 0.8 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.8

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_big40
name = 1.0 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.0
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_big40
name = 1.2 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.2
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_big40
name = 1.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.4
support_angle = 45

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_big60
name = 0.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.4

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_big60
name = 0.6 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.6

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_big60
name = 0.8 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.8

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_big60
name = 1.0 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.0
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_big60
name = 1.2 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.2
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_big60
name = 1.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.4
support_angle = 45

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_big_meter
name = 0.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.4

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_big_meter
name = 0.6 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.6

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v3_big_meter
name = 0.8 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.8

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_big_meter
name = 1.0 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.0
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_big_meter
name = 1.2 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.2
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v3_big_meter
name = 1.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.4
support_angle = 45

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v4_base
name = 0.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.4

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v4_base
name = 0.6 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.6

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v4_base
name = 0.8 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.8

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v4_base
name = 1.0 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.0
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v4_base
name = 1.2 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.2
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v4_base
name = 1.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.4
support_angle = 45

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v4_big120x
name = 0.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.4

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v4_big120x
name = 0.6 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.6

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v4_big120x
name = 0.8 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.8

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v4_big120x
name = 1.0 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.0
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v4_big120x
name = 1.2 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.2
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v4_big120x
name = 1.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.4
support_angle = 45

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v4_big120Z
name = 0.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.4

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v4_big120Z
name = 0.6 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.6

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v4_big120Z
name = 0.8 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.8

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v4_big120Z
name = 1.0 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.0
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v4_big120Z
name = 1.2 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.2
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v4_big120Z
name = 1.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.4
support_angle = 45

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v4_big180X
name = 0.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.4

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v4_big180X
name = 0.6 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.6

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v4_big180X
name = 0.8 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.8

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v4_big180X
name = 1.0 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.0
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v4_big180X
name = 1.2 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.2
support_angle = 45

View File

@ -0,0 +1,15 @@
[general]
definition = modix_v4_big180X
name = 1.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
infill_pattern = lines
machine_nozzle_size = 1.4
support_angle = 45

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v4_big60
name = 0.4 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.4

View File

@ -0,0 +1,13 @@
[general]
definition = modix_v4_big60
name = 0.6 mm Nozzle
version = 4
[metadata]
hardware_type = nozzle
setting_version = 19
type = variant
[values]
machine_nozzle_size = 0.6

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