Browse Source

Merge branch 'master' into fix_version_upgrade_returning_none

Aleksei S 6 years ago
parent
commit
c765615f1a

+ 1 - 0
CMakeLists.txt

@@ -17,6 +17,7 @@ if(CURA_DEBUGMODE)
     set(_cura_debugmode "ON")
 endif()
 
+set(CURA_APP_DISPLAY_NAME "Ultimaker Cura" CACHE STRING "Display name of Cura")
 set(CURA_VERSION "master" CACHE STRING "Version name of Cura")
 set(CURA_BUILDTYPE "" CACHE STRING "Build type of Cura, eg. 'PPA'")
 set(CURA_SDK_VERSION "" CACHE STRING "SDK version of Cura")

+ 2 - 41
Jenkinsfile

@@ -38,20 +38,9 @@ parallel_nodes(['linux && cura', 'windows && cura'])
                 {
                     if (isUnix())
                     {
-                        // For Linux to show everything
-                        def branch = env.BRANCH_NAME
-                        if(!fileExists("${env.CURA_ENVIRONMENT_PATH}/${branch}"))
-                        {
-                            branch = "master"
-                        }
-                        def uranium_dir = get_workspace_dir("Ultimaker/Uranium/${branch}")
-
+                        // For Linux
                         try {
-                            sh """
-                                cd ..
-                                export PYTHONPATH=.:"${uranium_dir}"
-                                ${env.CURA_ENVIRONMENT_PATH}/${branch}/bin/pytest -x --verbose --full-trace --capture=no ./tests
-                            """
+                            sh 'make CTEST_OUTPUT_ON_FAILURE=TRUE test'
                         } catch(e)
                         {
                             currentBuild.result = "UNSTABLE"
@@ -70,34 +59,6 @@ parallel_nodes(['linux && cura', 'windows && cura'])
                         }
                     }
                 }
-
-                stage('Code Style')
-                {
-                    if (isUnix())
-                    {
-                        // For Linux to show everything.
-                        // CMake also runs this test, but if it fails then the test just shows "failed" without details of what exactly failed.
-                        def branch = env.BRANCH_NAME
-                        if(!fileExists("${env.CURA_ENVIRONMENT_PATH}/${branch}"))
-                        {
-                            branch = "master"
-                        }
-                        def uranium_dir = get_workspace_dir("Ultimaker/Uranium/${branch}")
-
-                        try
-                        {
-                            sh """
-                                cd ..
-                                export PYTHONPATH=.:"${uranium_dir}"
-                                ${env.CURA_ENVIRONMENT_PATH}/${branch}/bin/python3 run_mypy.py
-                            """
-                        }
-                        catch(e)
-                        {
-                            currentBuild.result = "UNSTABLE"
-                        }
-                    }
-                }
             }
         }
 

+ 2 - 0
cmake/CuraTests.cmake

@@ -6,6 +6,8 @@ include(CMakeParseArguments)
 
 find_package(PythonInterp 3.5.0 REQUIRED)
 
+add_custom_target(test-verbose COMMAND ${CMAKE_CTEST_COMMAND} --verbose)
+
 function(cura_add_test)
     set(_single_args NAME DIRECTORY PYTHONPATH)
     cmake_parse_arguments("" "" "${_single_args}" "" ${ARGN})

+ 0 - 4
cura/API/Interface/__init__.py

@@ -3,7 +3,6 @@
 
 from typing import TYPE_CHECKING
 
-from UM.PluginRegistry import PluginRegistry
 from cura.API.Interface.Settings import Settings
 
 if TYPE_CHECKING:
@@ -23,9 +22,6 @@ if TYPE_CHECKING:
 
 class Interface:
 
-    # For now we use the same API version to be consistent.
-    VERSION = PluginRegistry.APIVersion
-
     def __init__(self, application: "CuraApplication") -> None:
         # API methods specific to the settings portion of the UI
         self.settings = Settings(application)

+ 1 - 3
cura/API/__init__.py

@@ -4,7 +4,6 @@ from typing import Optional, TYPE_CHECKING
 
 from PyQt5.QtCore import QObject, pyqtProperty
 
-from UM.PluginRegistry import PluginRegistry
 from cura.API.Backups import Backups
 from cura.API.Interface import Interface
 from cura.API.Account import Account
@@ -22,7 +21,6 @@ if TYPE_CHECKING:
 class CuraAPI(QObject):
 
     # For now we use the same API version to be consistent.
-    VERSION = PluginRegistry.APIVersion
     __instance = None  # type: "CuraAPI"
     _application = None  # type: CuraApplication
 
@@ -62,4 +60,4 @@ class CuraAPI(QObject):
 
     @property
     def interface(self) -> "Interface":
-        return self._interface
+        return self._interface

+ 3 - 1
cura/BuildVolume.py

@@ -489,7 +489,9 @@ class BuildVolume(SceneNode):
 
     def _updateRaftThickness(self):
         old_raft_thickness = self._raft_thickness
-        self._adhesion_type = self._global_container_stack.getProperty("adhesion_type", "value")
+        if self._global_container_stack.extruders:
+            # This might be called before the extruder stacks have initialised, in which case getting the adhesion_type fails
+            self._adhesion_type = self._global_container_stack.getProperty("adhesion_type", "value")
         self._raft_thickness = 0.0
         if self._adhesion_type == "raft":
             self._raft_thickness = (

+ 23 - 24
cura/CuraApplication.py

@@ -128,12 +128,13 @@ if TYPE_CHECKING:
 numpy.seterr(all = "ignore")
 
 try:
-    from cura.CuraVersion import CuraVersion, CuraBuildType, CuraDebugMode, CuraSDKVersion  # type: ignore
+    from cura.CuraVersion import CuraAppDisplayName, CuraVersion, CuraBuildType, CuraDebugMode, CuraSDKVersion  # type: ignore
 except ImportError:
+    CuraAppDisplayName = "Ultimaker Cura"
     CuraVersion = "master"  # [CodeStyle: Reflecting imported value]
     CuraBuildType = ""
     CuraDebugMode = False
-    CuraSDKVersion = ""
+    CuraSDKVersion = "5.0.0"
 
 
 class CuraApplication(QtApplication):
@@ -161,7 +162,9 @@ class CuraApplication(QtApplication):
 
     def __init__(self, *args, **kwargs):
         super().__init__(name = "cura",
+                         app_display_name = CuraAppDisplayName,
                          version = CuraVersion,
+                         api_version = CuraSDKVersion,
                          buildtype = CuraBuildType,
                          is_debug_mode = CuraDebugMode,
                          tray_icon_name = "cura-icon-32.png",
@@ -429,34 +432,30 @@ class CuraApplication(QtApplication):
 
         self.setRequiredPlugins([
             # Misc.:
-            "ConsoleLogger",
-            "CuraEngineBackend",
-            "UserAgreement",
-            "FileLogger",
-            "XmlMaterialProfile",
-            "Toolbox",
-            "PrepareStage",
-            "MonitorStage",
-            "LocalFileOutputDevice",
-            "LocalContainerProvider",
+            "ConsoleLogger", #You want to be able to read the log if something goes wrong.
+            "CuraEngineBackend", #Cura is useless without this one since you can't slice.
+            "UserAgreement", #Our lawyers want every user to see this at least once.
+            "FileLogger", #You want to be able to read the log if something goes wrong.
+            "XmlMaterialProfile", #Cura crashes without this one.
+            "Toolbox", #This contains the interface to enable/disable plug-ins, so if you disable it you can't enable it back.
+            "PrepareStage", #Cura is useless without this one since you can't load models.
+            "MonitorStage", #Major part of Cura's functionality.
+            "LocalFileOutputDevice", #Major part of Cura's functionality.
+            "LocalContainerProvider", #Cura is useless without any profiles or setting definitions.
 
             # Views:
-            "SimpleView",
-            "SimulationView",
-            "SolidView",
+            "SimpleView", #Dependency of SolidView.
+            "SolidView", #Displays models. Cura is useless without it.
 
             # Readers & Writers:
-            "GCodeWriter",
-            "STLReader",
-            "3MFWriter",
+            "GCodeWriter", #Cura is useless if it can't write its output.
+            "STLReader", #Most common model format, so disabling this makes Cura 90% useless.
+            "3MFWriter", #Required for writing project files.
 
             # Tools:
-            "CameraTool",
-            "MirrorTool",
-            "RotateTool",
-            "ScaleTool",
-            "SelectionTool",
-            "TranslateTool",
+            "CameraTool", #Needed to see the scene. Cura is useless without it.
+            "SelectionTool", #Dependency of the rest of the tools.
+            "TranslateTool", #You'll need this for almost every print.
         ])
         self._i18n_catalog = i18nCatalog("cura")
 

+ 2 - 1
cura/CuraVersion.py.in

@@ -1,6 +1,7 @@
-# Copyright (c) 2015 Ultimaker B.V.
+# Copyright (c) 2018 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 
+CuraAppDisplayName = "@CURA_APP_DISPLAY_NAME@"
 CuraVersion = "@CURA_VERSION@"
 CuraBuildType = "@CURA_BUILDTYPE@"
 CuraDebugMode = True if "@_cura_debugmode@" == "ON" else False

+ 4 - 1
cura/Machines/MaterialManager.py

@@ -644,8 +644,11 @@ class MaterialManager(QObject):
         machine_manager = self._application.getMachineManager()
         extruder_stack = machine_manager.activeStack
 
+        machine_definition = self._application.getGlobalContainerStack().definition
+        preferred_material = machine_definition.getMetaDataEntry("preferred_material")
+
         approximate_diameter = str(extruder_stack.approximateMaterialDiameter)
-        root_material_id = "generic_pla"
+        root_material_id = preferred_material if preferred_material else "generic_pla"
         root_material_id = self.getRootMaterialIDForDiameter(root_material_id, approximate_diameter)
         material_group = self.getMaterialGroup(root_material_id)
 

+ 2 - 2
cura/Machines/QualityManager.py

@@ -16,7 +16,7 @@ from .QualityGroup import QualityGroup
 from .QualityNode import QualityNode
 
 if TYPE_CHECKING:
-    from UM.Settings.DefinitionContainer import DefinitionContainer
+    from UM.Settings.Interfaces import DefinitionContainerInterface
     from cura.Settings.GlobalStack import GlobalStack
     from .QualityChangesGroup import QualityChangesGroup
     from cura.CuraApplication import CuraApplication
@@ -538,7 +538,7 @@ class QualityManager(QObject):
 #      Example: for an Ultimaker 3 Extended, it has "quality_definition = ultimaker3". This means Ultimaker 3 Extended
 #               shares the same set of qualities profiles as Ultimaker 3.
 #
-def getMachineDefinitionIDForQualitySearch(machine_definition: "DefinitionContainer",
+def getMachineDefinitionIDForQualitySearch(machine_definition: "DefinitionContainerInterface",
                                            default_definition_id: str = "fdmprinter") -> str:
     machine_definition_id = default_definition_id
     if parseBool(machine_definition.getMetaDataEntry("has_machine_quality", False)):

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