mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-07-24 08:34:27 +08:00
Merge branch '2.4'
This commit is contained in:
commit
e870dec276
@ -10,6 +10,7 @@ set(URANIUM_SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/../uranium/scripts" CACHE DIRECTORY
|
|||||||
add_custom_target(tests)
|
add_custom_target(tests)
|
||||||
add_custom_command(TARGET tests POST_BUILD COMMAND "PYTHONPATH=${CMAKE_SOURCE_DIR}/../Uranium/:${CMAKE_SOURCE_DIR}" ${PYTHON_EXECUTABLE} -m pytest -r a --junitxml=${CMAKE_BINARY_DIR}/junit.xml ${CMAKE_SOURCE_DIR} || exit 0)
|
add_custom_command(TARGET tests POST_BUILD COMMAND "PYTHONPATH=${CMAKE_SOURCE_DIR}/../Uranium/:${CMAKE_SOURCE_DIR}" ${PYTHON_EXECUTABLE} -m pytest -r a --junitxml=${CMAKE_BINARY_DIR}/junit.xml ${CMAKE_SOURCE_DIR} || exit 0)
|
||||||
|
|
||||||
|
option(CURA_DEBUGMODE "Enable debug dialog and other debug features" OFF)
|
||||||
|
|
||||||
set(CURA_VERSION "master" CACHE STRING "Version 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_BUILDTYPE "" CACHE STRING "Build type of Cura, eg. 'PPA'")
|
||||||
|
@ -285,6 +285,9 @@ class BuildVolume(SceneNode):
|
|||||||
color = Color(0.0, 0.0, 0.0, 0.15)
|
color = Color(0.0, 0.0, 0.0, 0.15)
|
||||||
for polygon in self._disallowed_areas:
|
for polygon in self._disallowed_areas:
|
||||||
points = polygon.getPoints()
|
points = polygon.getPoints()
|
||||||
|
if len(points) == 0:
|
||||||
|
continue
|
||||||
|
|
||||||
first = Vector(self._clamp(points[0][0], min_w, max_w), disallowed_area_height, self._clamp(points[0][1], min_d, max_d))
|
first = Vector(self._clamp(points[0][0], min_w, max_w), disallowed_area_height, self._clamp(points[0][1], min_d, max_d))
|
||||||
previous_point = Vector(self._clamp(points[0][0], min_w, max_w), disallowed_area_height, self._clamp(points[0][1], min_d, max_d))
|
previous_point = Vector(self._clamp(points[0][0], min_w, max_w), disallowed_area_height, self._clamp(points[0][1], min_d, max_d))
|
||||||
for point in points:
|
for point in points:
|
||||||
@ -827,4 +830,4 @@ class BuildVolume(SceneNode):
|
|||||||
_tower_settings = ["prime_tower_enable", "prime_tower_size", "prime_tower_position_x", "prime_tower_position_y"]
|
_tower_settings = ["prime_tower_enable", "prime_tower_size", "prime_tower_position_x", "prime_tower_position_y"]
|
||||||
_ooze_shield_settings = ["ooze_shield_enabled", "ooze_shield_dist"]
|
_ooze_shield_settings = ["ooze_shield_enabled", "ooze_shield_dist"]
|
||||||
_distance_settings = ["infill_wipe_dist", "travel_avoid_distance", "support_offset", "support_enable", "travel_avoid_other_parts"]
|
_distance_settings = ["infill_wipe_dist", "travel_avoid_distance", "support_offset", "support_enable", "travel_avoid_other_parts"]
|
||||||
_extruder_settings = ["support_enable", "support_interface_enable", "support_infill_extruder_nr", "support_extruder_nr_layer_0", "support_interface_extruder_nr", "brim_line_count", "adhesion_extruder_nr", "adhesion_type"] #Settings that can affect which extruders are used.
|
_extruder_settings = ["support_enable", "support_interface_enable", "support_infill_extruder_nr", "support_extruder_nr_layer_0", "support_interface_extruder_nr", "brim_line_count", "adhesion_extruder_nr", "adhesion_type"] #Settings that can affect which extruders are used.
|
||||||
|
@ -12,6 +12,11 @@ from UM.Logger import Logger
|
|||||||
from UM.i18n import i18nCatalog
|
from UM.i18n import i18nCatalog
|
||||||
catalog = i18nCatalog("cura")
|
catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
|
try:
|
||||||
|
from cura.CuraVersion import CuraDebugMode
|
||||||
|
except ImportError:
|
||||||
|
CuraDebugMode = False # [CodeStyle: Reflecting imported value]
|
||||||
|
|
||||||
# List of exceptions that should be considered "fatal" and abort the program.
|
# List of exceptions that should be considered "fatal" and abort the program.
|
||||||
# These are primarily some exception types that we simply cannot really recover from
|
# These are primarily some exception types that we simply cannot really recover from
|
||||||
# (MemoryError and SystemError) and exceptions that indicate grave errors in the
|
# (MemoryError and SystemError) and exceptions that indicate grave errors in the
|
||||||
@ -24,21 +29,18 @@ fatal_exception_types = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
def show(exception_type, value, tb):
|
def show(exception_type, value, tb):
|
||||||
debug_mode = True
|
|
||||||
|
|
||||||
Logger.log("c", "An uncaught exception has occurred!")
|
Logger.log("c", "An uncaught exception has occurred!")
|
||||||
for line in traceback.format_exception(exception_type, value, tb):
|
for line in traceback.format_exception(exception_type, value, tb):
|
||||||
for part in line.rstrip("\n").split("\n"):
|
for part in line.rstrip("\n").split("\n"):
|
||||||
Logger.log("c", part)
|
Logger.log("c", part)
|
||||||
|
|
||||||
if not debug_mode and exception_type not in fatal_exception_types:
|
if not CuraDebugMode and exception_type not in fatal_exception_types:
|
||||||
return
|
return
|
||||||
|
|
||||||
application = QCoreApplication.instance()
|
application = QCoreApplication.instance()
|
||||||
if not application:
|
if not application:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
dialog = QDialog()
|
dialog = QDialog()
|
||||||
dialog.setMinimumWidth(640)
|
dialog.setMinimumWidth(640)
|
||||||
dialog.setMinimumHeight(640)
|
dialog.setMinimumHeight(640)
|
||||||
|
@ -2,4 +2,5 @@
|
|||||||
# Cura is released under the terms of the AGPLv3 or higher.
|
# Cura is released under the terms of the AGPLv3 or higher.
|
||||||
|
|
||||||
CuraVersion = "@CURA_VERSION@"
|
CuraVersion = "@CURA_VERSION@"
|
||||||
CuraBuildType = "@CURA_BUILDTYPE@"
|
CuraBuildType = "@CURA_BUILDTYPE@"
|
||||||
|
CuraDebugMode = True if "@CURA_DEBUGMODE@" == "ON" else False
|
||||||
|
@ -815,6 +815,8 @@ class MachineManager(QObject):
|
|||||||
for stack in stacks:
|
for stack in stacks:
|
||||||
material = stack.findContainer(type="material")
|
material = stack.findContainer(type="material")
|
||||||
quality = quality_manager.findQualityByQualityType(quality_type, global_machine_definition, [material])
|
quality = quality_manager.findQualityByQualityType(quality_type, global_machine_definition, [material])
|
||||||
|
if not quality: #No quality profile is found for this quality type.
|
||||||
|
quality = self._empty_quality_container
|
||||||
result.append({"stack": stack, "quality": quality, "quality_changes": empty_quality_changes})
|
result.append({"stack": stack, "quality": quality, "quality_changes": empty_quality_changes})
|
||||||
|
|
||||||
if extruder_stacks:
|
if extruder_stacks:
|
||||||
@ -868,6 +870,8 @@ class MachineManager(QObject):
|
|||||||
|
|
||||||
material = stack.findContainer(type="material")
|
material = stack.findContainer(type="material")
|
||||||
quality = quality_manager.findQualityByQualityType(quality_type, global_machine_definition, [material])
|
quality = quality_manager.findQualityByQualityType(quality_type, global_machine_definition, [material])
|
||||||
|
if not quality: #No quality profile found for this quality type.
|
||||||
|
quality = self._empty_quality_container
|
||||||
|
|
||||||
result.append({"stack": stack, "quality": quality, "quality_changes": quality_changes})
|
result.append({"stack": stack, "quality": quality, "quality_changes": quality_changes})
|
||||||
|
|
||||||
|
@ -193,6 +193,7 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel):
|
|||||||
profile_value_source = ""
|
profile_value_source = ""
|
||||||
for container in containers:
|
for container in containers:
|
||||||
new_value = container.getProperty(definition.key, "value")
|
new_value = container.getProperty(definition.key, "value")
|
||||||
|
|
||||||
if new_value is not None:
|
if new_value is not None:
|
||||||
profile_value_source = container.getMetaDataEntry("type")
|
profile_value_source = container.getMetaDataEntry("type")
|
||||||
profile_value = new_value
|
profile_value = new_value
|
||||||
@ -200,7 +201,7 @@ class QualitySettingsModel(UM.Qt.ListModel.ListModel):
|
|||||||
# Global tab should use resolve (if there is one)
|
# Global tab should use resolve (if there is one)
|
||||||
if not self._extruder_id:
|
if not self._extruder_id:
|
||||||
resolve_value = global_container_stack.getProperty(definition.key, "resolve")
|
resolve_value = global_container_stack.getProperty(definition.key, "resolve")
|
||||||
if resolve_value is not None and profile_value is not None:
|
if resolve_value is not None and profile_value is not None and profile_value_source != "quality_changes":
|
||||||
profile_value = resolve_value
|
profile_value = resolve_value
|
||||||
|
|
||||||
user_value = None
|
user_value = None
|
||||||
|
@ -4,10 +4,16 @@
|
|||||||
from . import ThreeMFReader
|
from . import ThreeMFReader
|
||||||
from . import ThreeMFWorkspaceReader
|
from . import ThreeMFWorkspaceReader
|
||||||
from UM.i18n import i18nCatalog
|
from UM.i18n import i18nCatalog
|
||||||
|
import UM.Platform
|
||||||
catalog = i18nCatalog("cura")
|
catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
|
|
||||||
def getMetaData():
|
def getMetaData():
|
||||||
|
# Workarround for osx not supporting double file extensions correclty.
|
||||||
|
if UM.Platform.isOSX():
|
||||||
|
workspace_extension = "3mf"
|
||||||
|
else:
|
||||||
|
workspace_extension = "curaproject.3mf"
|
||||||
return {
|
return {
|
||||||
"plugin": {
|
"plugin": {
|
||||||
"name": catalog.i18nc("@label", "3MF Reader"),
|
"name": catalog.i18nc("@label", "3MF Reader"),
|
||||||
@ -25,7 +31,7 @@ def getMetaData():
|
|||||||
"workspace_reader":
|
"workspace_reader":
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"extension": "curaproject.3mf",
|
"extension": workspace_extension,
|
||||||
"description": catalog.i18nc("@item:inlistbox", "3MF File")
|
"description": catalog.i18nc("@item:inlistbox", "3MF File")
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -533,9 +533,9 @@ UM.MainWindow
|
|||||||
target: Cura.Actions.addProfile
|
target: Cura.Actions.addProfile
|
||||||
onTriggered:
|
onTriggered:
|
||||||
{
|
{
|
||||||
preferences.setPage(4);
|
|
||||||
preferences.show();
|
|
||||||
|
|
||||||
|
preferences.show();
|
||||||
|
preferences.setPage(4);
|
||||||
// Create a new profile after a very short delay so the preference page has time to initiate
|
// Create a new profile after a very short delay so the preference page has time to initiate
|
||||||
createProfileTimer.start();
|
createProfileTimer.start();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user