mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Solved merge conflicts. CURA-3214
This commit is contained in:
commit
057dc2fd7d
27 changed files with 50293 additions and 588 deletions
|
@ -241,7 +241,6 @@ class CuraApplication(QtApplication):
|
||||||
Preferences.getInstance().addPreference("mesh/scale_tiny_meshes", True)
|
Preferences.getInstance().addPreference("mesh/scale_tiny_meshes", True)
|
||||||
Preferences.getInstance().addPreference("cura/dialog_on_project_save", True)
|
Preferences.getInstance().addPreference("cura/dialog_on_project_save", True)
|
||||||
Preferences.getInstance().addPreference("cura/asked_dialog_on_project_save", False)
|
Preferences.getInstance().addPreference("cura/asked_dialog_on_project_save", False)
|
||||||
Preferences.getInstance().addPreference("view/force_layer_view_compatibility_mode", False)
|
|
||||||
|
|
||||||
Preferences.getInstance().addPreference("cura/currency", "€")
|
Preferences.getInstance().addPreference("cura/currency", "€")
|
||||||
Preferences.getInstance().addPreference("cura/material_settings", "{}")
|
Preferences.getInstance().addPreference("cura/material_settings", "{}")
|
||||||
|
@ -712,7 +711,7 @@ class CuraApplication(QtApplication):
|
||||||
sceneBoundingBoxChanged = pyqtSignal()
|
sceneBoundingBoxChanged = pyqtSignal()
|
||||||
|
|
||||||
@pyqtProperty(bool, notify = activityChanged)
|
@pyqtProperty(bool, notify = activityChanged)
|
||||||
def getPlatformActivity(self):
|
def platformActivity(self):
|
||||||
return self._platform_activity
|
return self._platform_activity
|
||||||
|
|
||||||
@pyqtProperty(str, notify = sceneBoundingBoxChanged)
|
@pyqtProperty(str, notify = sceneBoundingBoxChanged)
|
||||||
|
|
|
@ -63,7 +63,7 @@ class LayerDataBuilder(MeshBuilder):
|
||||||
line_dimensions = numpy.empty((vertex_count, 2), numpy.float32)
|
line_dimensions = numpy.empty((vertex_count, 2), numpy.float32)
|
||||||
colors = numpy.empty((vertex_count, 4), numpy.float32)
|
colors = numpy.empty((vertex_count, 4), numpy.float32)
|
||||||
indices = numpy.empty((index_count, 2), numpy.int32)
|
indices = numpy.empty((index_count, 2), numpy.int32)
|
||||||
extruders = numpy.empty((vertex_count), numpy.float32)
|
extruders = numpy.empty((vertex_count), numpy.int32) # Only usable for newer OpenGL versions
|
||||||
line_types = numpy.empty((vertex_count), numpy.float32)
|
line_types = numpy.empty((vertex_count), numpy.float32)
|
||||||
|
|
||||||
vertex_offset = 0
|
vertex_offset = 0
|
||||||
|
@ -95,7 +95,7 @@ class LayerDataBuilder(MeshBuilder):
|
||||||
"extruders": {
|
"extruders": {
|
||||||
"value": extruders,
|
"value": extruders,
|
||||||
"opengl_name": "a_extruder",
|
"opengl_name": "a_extruder",
|
||||||
"opengl_type": "float"
|
"opengl_type": "float" # Strangely enough, the type has to be float while it is actually an int.
|
||||||
},
|
},
|
||||||
"colors": {
|
"colors": {
|
||||||
"value": material_colors,
|
"value": material_colors,
|
||||||
|
|
|
@ -3,12 +3,11 @@
|
||||||
|
|
||||||
from UM.i18n import i18nCatalog
|
from UM.i18n import i18nCatalog
|
||||||
from UM.OutputDevice.OutputDevice import OutputDevice
|
from UM.OutputDevice.OutputDevice import OutputDevice
|
||||||
from PyQt5.QtCore import pyqtProperty, pyqtSignal, pyqtSlot, QObject
|
from PyQt5.QtCore import pyqtProperty, pyqtSignal, pyqtSlot, QObject, QTimer
|
||||||
from PyQt5.QtWidgets import QMessageBox
|
from PyQt5.QtWidgets import QMessageBox
|
||||||
|
from enum import IntEnum # For the connection state tracking.
|
||||||
|
|
||||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||||
|
|
||||||
from enum import IntEnum # For the connection state tracking.
|
|
||||||
from UM.Logger import Logger
|
from UM.Logger import Logger
|
||||||
from UM.Signal import signalemitter
|
from UM.Signal import signalemitter
|
||||||
|
|
||||||
|
@ -49,6 +48,9 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||||
self._error_text = ""
|
self._error_text = ""
|
||||||
self._accepts_commands = True
|
self._accepts_commands = True
|
||||||
self._preheat_bed_timeout = 900 #Default time-out for pre-heating the bed, in seconds.
|
self._preheat_bed_timeout = 900 #Default time-out for pre-heating the bed, in seconds.
|
||||||
|
self._preheat_bed_timer = QTimer() #Timer that tracks how long to preheat still.
|
||||||
|
self._preheat_bed_timer.setSingleShot(True)
|
||||||
|
self._preheat_bed_timer.timeout.connect(self.cancelPreheatBed)
|
||||||
|
|
||||||
self._printer_state = ""
|
self._printer_state = ""
|
||||||
self._printer_type = "unknown"
|
self._printer_type = "unknown"
|
||||||
|
@ -106,6 +108,9 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||||
|
|
||||||
printerTypeChanged = pyqtSignal()
|
printerTypeChanged = pyqtSignal()
|
||||||
|
|
||||||
|
# Signal to be emitted when some drastic change occurs in the remaining time (not when the time just passes on normally).
|
||||||
|
preheatBedRemainingTimeChanged = pyqtSignal()
|
||||||
|
|
||||||
@pyqtProperty(str, notify=printerTypeChanged)
|
@pyqtProperty(str, notify=printerTypeChanged)
|
||||||
def printerType(self):
|
def printerType(self):
|
||||||
return self._printer_type
|
return self._printer_type
|
||||||
|
@ -214,13 +219,26 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||||
self._target_bed_temperature = temperature
|
self._target_bed_temperature = temperature
|
||||||
self.targetBedTemperatureChanged.emit()
|
self.targetBedTemperatureChanged.emit()
|
||||||
|
|
||||||
## The duration of the time-out to pre-heat the bed, in seconds.
|
## The total duration of the time-out to pre-heat the bed, in seconds.
|
||||||
#
|
#
|
||||||
# \return The duration of the time-out to pre-heat the bed, in seconds.
|
# \return The duration of the time-out to pre-heat the bed, in seconds.
|
||||||
@pyqtProperty(int)
|
@pyqtProperty(int, constant = True)
|
||||||
def preheatBedTimeout(self):
|
def preheatBedTimeout(self):
|
||||||
return self._preheat_bed_timeout
|
return self._preheat_bed_timeout
|
||||||
|
|
||||||
|
## The remaining duration of the pre-heating of the bed.
|
||||||
|
#
|
||||||
|
# This is formatted in M:SS format.
|
||||||
|
# \return The duration of the time-out to pre-heat the bed, formatted.
|
||||||
|
@pyqtProperty(str, notify = preheatBedRemainingTimeChanged)
|
||||||
|
def preheatBedRemainingTime(self):
|
||||||
|
period = self._preheat_bed_timer.remainingTime()
|
||||||
|
if period <= 0:
|
||||||
|
return ""
|
||||||
|
minutes, period = divmod(period, 60000) #60000 milliseconds in a minute.
|
||||||
|
seconds, _ = divmod(period, 1000) #1000 milliseconds in a second.
|
||||||
|
return "%d:%02d" % (minutes, seconds)
|
||||||
|
|
||||||
## Time the print has been printing.
|
## Time the print has been printing.
|
||||||
# Note that timeTotal - timeElapsed should give time remaining.
|
# Note that timeTotal - timeElapsed should give time remaining.
|
||||||
@pyqtProperty(float, notify = timeElapsedChanged)
|
@pyqtProperty(float, notify = timeElapsedChanged)
|
||||||
|
@ -400,10 +418,14 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
||||||
# /param index Index of the extruder
|
# /param index Index of the extruder
|
||||||
# /param hotend_id id of the hotend
|
# /param hotend_id id of the hotend
|
||||||
def _setHotendId(self, index, hotend_id):
|
def _setHotendId(self, index, hotend_id):
|
||||||
if hotend_id and hotend_id != "" and hotend_id != self._hotend_ids[index]:
|
if hotend_id and hotend_id != self._hotend_ids[index]:
|
||||||
Logger.log("d", "Setting hotend id of hotend %d to %s" % (index, hotend_id))
|
Logger.log("d", "Setting hotend id of hotend %d to %s" % (index, hotend_id))
|
||||||
self._hotend_ids[index] = hotend_id
|
self._hotend_ids[index] = hotend_id
|
||||||
self.hotendIdChanged.emit(index, hotend_id)
|
self.hotendIdChanged.emit(index, hotend_id)
|
||||||
|
elif not hotend_id:
|
||||||
|
Logger.log("d", "Removing hotend id of hotend %d.", index)
|
||||||
|
self._hotend_ids[index] = None
|
||||||
|
self.hotendIdChanged.emit(index, None)
|
||||||
|
|
||||||
## Let the user decide if the hotends and/or material should be synced with the printer
|
## Let the user decide if the hotends and/or material should be synced with the printer
|
||||||
# NB: the UX needs to be implemented by the plugin
|
# NB: the UX needs to be implemented by the plugin
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
# Copyright (c) 2016 Ultimaker B.V.
|
# Copyright (c) 2017 Ultimaker B.V.
|
||||||
# Uranium is released under the terms of the AGPLv3 or higher.
|
# Uranium is released under the terms of the AGPLv3 or higher.
|
||||||
|
|
||||||
from UM.Settings.Models.SettingVisibilityHandler import SettingVisibilityHandler
|
import UM.Settings.Models.SettingVisibilityHandler
|
||||||
|
|
||||||
class MaterialSettingsVisibilityHandler(SettingVisibilityHandler):
|
class MaterialSettingsVisibilityHandler(UM.Settings.Models.SettingVisibilityHandler.SettingVisibilityHandler):
|
||||||
def __init__(self, parent = None, *args, **kwargs):
|
def __init__(self, parent = None, *args, **kwargs):
|
||||||
super().__init__(parent = parent, *args, **kwargs)
|
super().__init__(parent = parent, *args, **kwargs)
|
||||||
|
|
||||||
material_settings = set([
|
material_settings = {
|
||||||
"default_material_print_temperature",
|
"default_material_print_temperature",
|
||||||
"material_bed_temperature",
|
"material_bed_temperature",
|
||||||
"material_standby_temperature",
|
"material_standby_temperature",
|
||||||
"cool_fan_speed",
|
"cool_fan_speed",
|
||||||
"retraction_amount",
|
"retraction_amount",
|
||||||
"retraction_speed",
|
"retraction_speed",
|
||||||
])
|
}
|
||||||
|
|
||||||
self.setVisible(material_settings)
|
self.setVisible(material_settings)
|
||||||
|
|
|
@ -182,7 +182,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
self._dialog.setMachineType(machine_type)
|
self._dialog.setMachineType(machine_type)
|
||||||
self._dialog.setExtruders(extruders)
|
self._dialog.setExtruders(extruders)
|
||||||
self._dialog.setVariantType(variant_type_name)
|
self._dialog.setVariantType(variant_type_name)
|
||||||
self._dialog.setHasObjectsOnPlate(Application.getInstance().getPlatformActivity)
|
self._dialog.setHasObjectsOnPlate(Application.getInstance().platformActivity)
|
||||||
self._dialog.show()
|
self._dialog.show()
|
||||||
|
|
||||||
# Block until the dialog is closed.
|
# Block until the dialog is closed.
|
||||||
|
|
|
@ -177,7 +177,7 @@ class ThreeMFWriter(MeshWriter):
|
||||||
transformation_matrix._data[2, 1] = 1
|
transformation_matrix._data[2, 1] = 1
|
||||||
transformation_matrix._data[2, 2] = 0
|
transformation_matrix._data[2, 2] = 0
|
||||||
|
|
||||||
global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
|
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||||
# Second step: 3MF defines the left corner of the machine as center, whereas cura uses the center of the
|
# Second step: 3MF defines the left corner of the machine as center, whereas cura uses the center of the
|
||||||
# build volume.
|
# build volume.
|
||||||
if global_container_stack:
|
if global_container_stack:
|
||||||
|
|
|
@ -253,7 +253,7 @@ class CuraEngineBackend(QObject, Backend):
|
||||||
return
|
return
|
||||||
|
|
||||||
if job.getResult() == StartSliceJob.StartJobResult.MaterialIncompatible:
|
if job.getResult() == StartSliceJob.StartJobResult.MaterialIncompatible:
|
||||||
if Application.getInstance().getPlatformActivity:
|
if Application.getInstance().platformActivity:
|
||||||
self._error_message = Message(catalog.i18nc("@info:status",
|
self._error_message = Message(catalog.i18nc("@info:status",
|
||||||
"The selected material is incompatible with the selected machine or configuration."))
|
"The selected material is incompatible with the selected machine or configuration."))
|
||||||
self._error_message.show()
|
self._error_message.show()
|
||||||
|
@ -263,7 +263,7 @@ class CuraEngineBackend(QObject, Backend):
|
||||||
return
|
return
|
||||||
|
|
||||||
if job.getResult() == StartSliceJob.StartJobResult.SettingError:
|
if job.getResult() == StartSliceJob.StartJobResult.SettingError:
|
||||||
if Application.getInstance().getPlatformActivity:
|
if Application.getInstance().platformActivity:
|
||||||
extruders = list(ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId()))
|
extruders = list(ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId()))
|
||||||
error_keys = []
|
error_keys = []
|
||||||
for extruder in extruders:
|
for extruder in extruders:
|
||||||
|
@ -284,7 +284,7 @@ class CuraEngineBackend(QObject, Backend):
|
||||||
return
|
return
|
||||||
|
|
||||||
if job.getResult() == StartSliceJob.StartJobResult.BuildPlateError:
|
if job.getResult() == StartSliceJob.StartJobResult.BuildPlateError:
|
||||||
if Application.getInstance().getPlatformActivity:
|
if Application.getInstance().platformActivity:
|
||||||
self._error_message = Message(catalog.i18nc("@info:status", "Unable to slice because the prime tower or prime position(s) are invalid."))
|
self._error_message = Message(catalog.i18nc("@info:status", "Unable to slice because the prime tower or prime position(s) are invalid."))
|
||||||
self._error_message.show()
|
self._error_message.show()
|
||||||
self.backendStateChange.emit(BackendState.Error)
|
self.backendStateChange.emit(BackendState.Error)
|
||||||
|
@ -292,7 +292,7 @@ class CuraEngineBackend(QObject, Backend):
|
||||||
self.backendStateChange.emit(BackendState.NotStarted)
|
self.backendStateChange.emit(BackendState.NotStarted)
|
||||||
|
|
||||||
if job.getResult() == StartSliceJob.StartJobResult.NothingToSlice:
|
if job.getResult() == StartSliceJob.StartJobResult.NothingToSlice:
|
||||||
if Application.getInstance().getPlatformActivity:
|
if Application.getInstance().platformActivity:
|
||||||
self._error_message = Message(catalog.i18nc("@info:status", "Nothing to slice because none of the models fit the build volume. Please scale or rotate models to fit."))
|
self._error_message = Message(catalog.i18nc("@info:status", "Nothing to slice because none of the models fit the build volume. Please scale or rotate models to fit."))
|
||||||
self._error_message.show()
|
self._error_message.show()
|
||||||
self.backendStateChange.emit(BackendState.Error)
|
self.backendStateChange.emit(BackendState.Error)
|
||||||
|
|
|
@ -48,8 +48,7 @@ class LayerPass(RenderPass):
|
||||||
self._layer_shader.setUniformValue("u_layer_view_type", self._layer_view.getLayerViewType())
|
self._layer_shader.setUniformValue("u_layer_view_type", self._layer_view.getLayerViewType())
|
||||||
self._layer_shader.setUniformValue("u_extruder_opacity", self._layer_view.getExtruderOpacities())
|
self._layer_shader.setUniformValue("u_extruder_opacity", self._layer_view.getExtruderOpacities())
|
||||||
self._layer_shader.setUniformValue("u_show_travel_moves", self._layer_view.getShowTravelMoves())
|
self._layer_shader.setUniformValue("u_show_travel_moves", self._layer_view.getShowTravelMoves())
|
||||||
self._layer_shader.setUniformValue("u_show_support", self._layer_view.getShowSupport())
|
self._layer_shader.setUniformValue("u_show_helpers", self._layer_view.getShowHelpers())
|
||||||
self._layer_shader.setUniformValue("u_show_adhesion", self._layer_view.getShowAdhesion())
|
|
||||||
self._layer_shader.setUniformValue("u_show_skin", self._layer_view.getShowSkin())
|
self._layer_shader.setUniformValue("u_show_skin", self._layer_view.getShowSkin())
|
||||||
self._layer_shader.setUniformValue("u_show_infill", self._layer_view.getShowInfill())
|
self._layer_shader.setUniformValue("u_show_infill", self._layer_view.getShowInfill())
|
||||||
else:
|
else:
|
||||||
|
@ -57,8 +56,7 @@ class LayerPass(RenderPass):
|
||||||
self._layer_shader.setUniformValue("u_layer_view_type", 1)
|
self._layer_shader.setUniformValue("u_layer_view_type", 1)
|
||||||
self._layer_shader.setUniformValue("u_extruder_opacity", [1, 1, 1, 1])
|
self._layer_shader.setUniformValue("u_extruder_opacity", [1, 1, 1, 1])
|
||||||
self._layer_shader.setUniformValue("u_show_travel_moves", 0)
|
self._layer_shader.setUniformValue("u_show_travel_moves", 0)
|
||||||
self._layer_shader.setUniformValue("u_show_support", 1)
|
self._layer_shader.setUniformValue("u_show_helpers", 1)
|
||||||
self._layer_shader.setUniformValue("u_show_adhesion", 1)
|
|
||||||
self._layer_shader.setUniformValue("u_show_skin", 1)
|
self._layer_shader.setUniformValue("u_show_skin", 1)
|
||||||
self._layer_shader.setUniformValue("u_show_infill", 1)
|
self._layer_shader.setUniformValue("u_show_infill", 1)
|
||||||
|
|
||||||
|
|
|
@ -70,8 +70,21 @@ class LayerView(View):
|
||||||
|
|
||||||
Preferences.getInstance().addPreference("view/top_layer_count", 5)
|
Preferences.getInstance().addPreference("view/top_layer_count", 5)
|
||||||
Preferences.getInstance().addPreference("view/only_show_top_layers", False)
|
Preferences.getInstance().addPreference("view/only_show_top_layers", False)
|
||||||
|
Preferences.getInstance().addPreference("view/force_layer_view_compatibility_mode", False)
|
||||||
|
|
||||||
|
Preferences.getInstance().addPreference("layerview/layer_view_type", 0)
|
||||||
|
Preferences.getInstance().addPreference("layerview/extruder0_opacity", 1.0)
|
||||||
|
Preferences.getInstance().addPreference("layerview/extruder1_opacity", 1.0)
|
||||||
|
Preferences.getInstance().addPreference("layerview/extruder2_opacity", 1.0)
|
||||||
|
Preferences.getInstance().addPreference("layerview/extruder3_opacity", 1.0)
|
||||||
|
|
||||||
|
Preferences.getInstance().addPreference("layerview/show_travel_moves", False)
|
||||||
|
Preferences.getInstance().addPreference("layerview/show_helpers", True)
|
||||||
|
Preferences.getInstance().addPreference("layerview/show_skin", True)
|
||||||
|
Preferences.getInstance().addPreference("layerview/show_infill", True)
|
||||||
|
|
||||||
Preferences.getInstance().preferenceChanged.connect(self._onPreferencesChanged)
|
Preferences.getInstance().preferenceChanged.connect(self._onPreferencesChanged)
|
||||||
|
self._updateWithPreferences()
|
||||||
|
|
||||||
self._solid_layers = int(Preferences.getInstance().getValue("view/top_layer_count"))
|
self._solid_layers = int(Preferences.getInstance().getValue("view/top_layer_count"))
|
||||||
self._only_show_top_layers = bool(Preferences.getInstance().getValue("view/only_show_top_layers"))
|
self._only_show_top_layers = bool(Preferences.getInstance().getValue("view/only_show_top_layers"))
|
||||||
|
@ -84,8 +97,7 @@ class LayerView(View):
|
||||||
self._extruder_count = 0
|
self._extruder_count = 0
|
||||||
self._extruder_opacity = [1.0, 1.0, 1.0, 1.0]
|
self._extruder_opacity = [1.0, 1.0, 1.0, 1.0]
|
||||||
self._show_travel_moves = 0
|
self._show_travel_moves = 0
|
||||||
self._show_support = 1
|
self._show_helpers = 1
|
||||||
self._show_adhesion = 1
|
|
||||||
self._show_skin = 1
|
self._show_skin = 1
|
||||||
self._show_infill = 1
|
self._show_infill = 1
|
||||||
|
|
||||||
|
@ -197,19 +209,12 @@ class LayerView(View):
|
||||||
def getShowTravelMoves(self):
|
def getShowTravelMoves(self):
|
||||||
return self._show_travel_moves
|
return self._show_travel_moves
|
||||||
|
|
||||||
def setShowSupport(self, show):
|
def setShowHelpers(self, show):
|
||||||
self._show_support = show
|
self._show_helpers = show
|
||||||
self.currentLayerNumChanged.emit()
|
self.currentLayerNumChanged.emit()
|
||||||
|
|
||||||
def getShowSupport(self):
|
def getShowHelpers(self):
|
||||||
return self._show_support
|
return self._show_helpers
|
||||||
|
|
||||||
def setShowAdhesion(self, show):
|
|
||||||
self._show_adhesion = show
|
|
||||||
self.currentLayerNumChanged.emit()
|
|
||||||
|
|
||||||
def getShowAdhesion(self):
|
|
||||||
return self._show_adhesion
|
|
||||||
|
|
||||||
def setShowSkin(self, show):
|
def setShowSkin(self, show):
|
||||||
self._show_skin = show
|
self._show_skin = show
|
||||||
|
@ -311,7 +316,7 @@ class LayerView(View):
|
||||||
self._old_composite_shader = self._composite_pass.getCompositeShader()
|
self._old_composite_shader = self._composite_pass.getCompositeShader()
|
||||||
self._composite_pass.setCompositeShader(self._layerview_composite_shader)
|
self._composite_pass.setCompositeShader(self._layerview_composite_shader)
|
||||||
|
|
||||||
if self.getLayerViewType() == self.LAYER_VIEW_TYPE_LINE_TYPE:
|
if self.getLayerViewType() == self.LAYER_VIEW_TYPE_LINE_TYPE or self._compatibility_mode:
|
||||||
self.enableLegend()
|
self.enableLegend()
|
||||||
|
|
||||||
elif event.type == Event.ViewDeactivateEvent:
|
elif event.type == Event.ViewDeactivateEvent:
|
||||||
|
@ -370,18 +375,46 @@ class LayerView(View):
|
||||||
|
|
||||||
self._top_layers_job = None
|
self._top_layers_job = None
|
||||||
|
|
||||||
def _onPreferencesChanged(self, preference):
|
def _updateWithPreferences(self):
|
||||||
if preference not in {"view/top_layer_count", "view/only_show_top_layers", "view/force_layer_view_compatibility_mode"}:
|
|
||||||
return
|
|
||||||
|
|
||||||
self._solid_layers = int(Preferences.getInstance().getValue("view/top_layer_count"))
|
self._solid_layers = int(Preferences.getInstance().getValue("view/top_layer_count"))
|
||||||
self._only_show_top_layers = bool(Preferences.getInstance().getValue("view/only_show_top_layers"))
|
self._only_show_top_layers = bool(Preferences.getInstance().getValue("view/only_show_top_layers"))
|
||||||
self._compatibility_mode = OpenGLContext.isLegacyOpenGL() or bool(
|
self._compatibility_mode = OpenGLContext.isLegacyOpenGL() or bool(
|
||||||
Preferences.getInstance().getValue("view/force_layer_view_compatibility_mode"))
|
Preferences.getInstance().getValue("view/force_layer_view_compatibility_mode"))
|
||||||
|
|
||||||
|
self.setLayerViewType(int(float(Preferences.getInstance().getValue("layerview/layer_view_type"))));
|
||||||
|
|
||||||
|
self.setExtruderOpacity(0, float(Preferences.getInstance().getValue("layerview/extruder0_opacity")))
|
||||||
|
self.setExtruderOpacity(1, float(Preferences.getInstance().getValue("layerview/extruder1_opacity")))
|
||||||
|
self.setExtruderOpacity(2, float(Preferences.getInstance().getValue("layerview/extruder2_opacity")))
|
||||||
|
self.setExtruderOpacity(3, float(Preferences.getInstance().getValue("layerview/extruder3_opacity")))
|
||||||
|
|
||||||
|
self.setShowTravelMoves(bool(Preferences.getInstance().getValue("layerview/show_travel_moves")))
|
||||||
|
self.setShowHelpers(bool(Preferences.getInstance().getValue("layerview/show_helpers")))
|
||||||
|
self.setShowSkin(bool(Preferences.getInstance().getValue("layerview/show_skin")))
|
||||||
|
self.setShowInfill(bool(Preferences.getInstance().getValue("layerview/show_infill")))
|
||||||
|
|
||||||
self._startUpdateTopLayers()
|
self._startUpdateTopLayers()
|
||||||
self.preferencesChanged.emit()
|
self.preferencesChanged.emit()
|
||||||
|
|
||||||
|
def _onPreferencesChanged(self, preference):
|
||||||
|
if preference not in {
|
||||||
|
"view/top_layer_count",
|
||||||
|
"view/only_show_top_layers",
|
||||||
|
"view/force_layer_view_compatibility_mode",
|
||||||
|
"layerview/layer_view_type",
|
||||||
|
"layerview/extruder0_opacity",
|
||||||
|
"layerview/extruder1_opacity",
|
||||||
|
"layerview/extruder2_opacity",
|
||||||
|
"layerview/extruder3_opacity",
|
||||||
|
"layerview/show_travel_moves",
|
||||||
|
"layerview/show_helpers",
|
||||||
|
"layerview/show_skin",
|
||||||
|
"layerview/show_infill",
|
||||||
|
}:
|
||||||
|
return
|
||||||
|
|
||||||
|
self._updateWithPreferences()
|
||||||
|
|
||||||
def _getLegendItems(self):
|
def _getLegendItems(self):
|
||||||
if self._legend_items is None:
|
if self._legend_items is None:
|
||||||
theme = Application.getInstance().getTheme()
|
theme = Application.getInstance().getTheme()
|
||||||
|
|
|
@ -75,7 +75,7 @@ Item
|
||||||
border.color: UM.Theme.getColor("slider_groove_border")
|
border.color: UM.Theme.getColor("slider_groove_border")
|
||||||
color: UM.Theme.getColor("tool_panel_background")
|
color: UM.Theme.getColor("tool_panel_background")
|
||||||
|
|
||||||
visible: UM.LayerView.getLayerActivity && Printer.getPlatformActivity ? true : false
|
visible: UM.LayerView.layerActivity && Printer.platformActivity ? true : false
|
||||||
|
|
||||||
TextField
|
TextField
|
||||||
{
|
{
|
||||||
|
@ -161,11 +161,11 @@ Item
|
||||||
{
|
{
|
||||||
id: layerViewTypes
|
id: layerViewTypes
|
||||||
ListElement {
|
ListElement {
|
||||||
text: "Material color"
|
text: "Material Color"
|
||||||
type_id: 0
|
type_id: 0
|
||||||
}
|
}
|
||||||
ListElement {
|
ListElement {
|
||||||
text: "Line type"
|
text: "Line Type"
|
||||||
type_id: 1 // these ids match the switching in the shader
|
type_id: 1 // these ids match the switching in the shader
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -177,19 +177,27 @@ Item
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
model: layerViewTypes
|
model: layerViewTypes
|
||||||
visible: !UM.LayerView.compatibilityMode
|
visible: !UM.LayerView.compatibilityMode
|
||||||
|
property int layer_view_type: UM.Preferences.getValue("layerview/layer_view_type")
|
||||||
|
currentIndex: layer_view_type // index matches type_id
|
||||||
onActivated: {
|
onActivated: {
|
||||||
|
// Combobox selection
|
||||||
var type_id = layerViewTypes.get(index).type_id;
|
var type_id = layerViewTypes.get(index).type_id;
|
||||||
UM.LayerView.setLayerViewType(type_id);
|
UM.Preferences.setValue("layerview/layer_view_type", type_id);
|
||||||
if (type_id == 1) {
|
updateLegend();
|
||||||
|
}
|
||||||
|
onModelChanged: {
|
||||||
|
updateLegend();
|
||||||
|
}
|
||||||
|
// Update visibility of legend.
|
||||||
|
function updateLegend() {
|
||||||
|
var type_id = layerViewTypes.get(currentIndex).type_id;
|
||||||
|
if (UM.LayerView.compatibilityMode || (type_id == 1)) {
|
||||||
// Line type
|
// Line type
|
||||||
UM.LayerView.enableLegend();
|
UM.LayerView.enableLegend();
|
||||||
} else {
|
} else {
|
||||||
UM.LayerView.disableLegend();
|
UM.LayerView.disableLegend();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onModelChanged: {
|
|
||||||
currentIndex = UM.LayerView.getLayerViewType();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Label
|
Label
|
||||||
|
@ -197,86 +205,106 @@ Item
|
||||||
id: compatibilityModeLabel
|
id: compatibilityModeLabel
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
text: catalog.i18nc("@label","Compatibility mode")
|
text: catalog.i18nc("@label","Compatibility Mode")
|
||||||
visible: UM.LayerView.compatibilityMode
|
visible: UM.LayerView.compatibilityMode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: UM.Preferences
|
||||||
|
onPreferenceChanged:
|
||||||
|
{
|
||||||
|
layerTypeCombobox.layer_view_type = UM.Preferences.getValue("layerview/layer_view_type");
|
||||||
|
view_settings.extruder0_checked = UM.Preferences.getValue("layerview/extruder0_opacity") > 0.5;
|
||||||
|
view_settings.extruder1_checked = UM.Preferences.getValue("layerview/extruder1_opacity") > 0.5;
|
||||||
|
view_settings.extruder2_checked = UM.Preferences.getValue("layerview/extruder2_opacity") > 0.5;
|
||||||
|
view_settings.extruder3_checked = UM.Preferences.getValue("layerview/extruder3_opacity") > 0.5;
|
||||||
|
view_settings.show_travel_moves = UM.Preferences.getValue("layerview/show_travel_moves");
|
||||||
|
view_settings.show_helpers = UM.Preferences.getValue("layerview/show_helpers");
|
||||||
|
view_settings.show_skin = UM.Preferences.getValue("layerview/show_skin");
|
||||||
|
view_settings.show_infill = UM.Preferences.getValue("layerview/show_infill");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: view_settings
|
id: view_settings
|
||||||
|
|
||||||
|
property bool extruder0_checked: UM.Preferences.getValue("layerview/extruder0_opacity") > 0.5
|
||||||
|
property bool extruder1_checked: UM.Preferences.getValue("layerview/extruder1_opacity") > 0.5
|
||||||
|
property bool extruder2_checked: UM.Preferences.getValue("layerview/extruder2_opacity") > 0.5
|
||||||
|
property bool extruder3_checked: UM.Preferences.getValue("layerview/extruder3_opacity") > 0.5
|
||||||
|
property bool show_travel_moves: UM.Preferences.getValue("layerview/show_travel_moves")
|
||||||
|
property bool show_helpers: UM.Preferences.getValue("layerview/show_helpers")
|
||||||
|
property bool show_skin: UM.Preferences.getValue("layerview/show_skin")
|
||||||
|
property bool show_infill: UM.Preferences.getValue("layerview/show_infill")
|
||||||
|
|
||||||
anchors.top: UM.LayerView.compatibilityMode ? compatibilityModeLabel.bottom : layerTypeCombobox.bottom
|
anchors.top: UM.LayerView.compatibilityMode ? compatibilityModeLabel.bottom : layerTypeCombobox.bottom
|
||||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
CheckBox {
|
CheckBox {
|
||||||
checked: true
|
checked: view_settings.extruder0_checked
|
||||||
onClicked: {
|
onClicked: {
|
||||||
UM.LayerView.setExtruderOpacity(0, checked ? 1.0 : 0.0);
|
UM.Preferences.setValue("layerview/extruder0_opacity", checked ? 1.0 : 0.0);
|
||||||
}
|
}
|
||||||
text: "Extruder 1"
|
text: "Extruder 1"
|
||||||
visible: !UM.LayerView.compatibilityMode && (UM.LayerView.getExtruderCount >= 1)
|
visible: !UM.LayerView.compatibilityMode && (UM.LayerView.extruderCount >= 1)
|
||||||
}
|
}
|
||||||
CheckBox {
|
CheckBox {
|
||||||
checked: true
|
checked: view_settings.extruder1_checked
|
||||||
onClicked: {
|
onClicked: {
|
||||||
UM.LayerView.setExtruderOpacity(1, checked ? 1.0 : 0.0);
|
UM.Preferences.setValue("layerview/extruder1_opacity", checked ? 1.0 : 0.0);
|
||||||
}
|
}
|
||||||
text: "Extruder 2"
|
text: "Extruder 2"
|
||||||
visible: !UM.LayerView.compatibilityMode && (UM.LayerView.getExtruderCount >= 2)
|
visible: !UM.LayerView.compatibilityMode && (UM.LayerView.extruderCount >= 2)
|
||||||
}
|
}
|
||||||
CheckBox {
|
CheckBox {
|
||||||
checked: true
|
checked: view_settings.extruder2_checked
|
||||||
onClicked: {
|
onClicked: {
|
||||||
UM.LayerView.setExtruderOpacity(2, checked ? 1.0 : 0.0);
|
UM.Preferences.setValue("layerview/extruder2_opacity", checked ? 1.0 : 0.0);
|
||||||
}
|
}
|
||||||
text: "Extruder 3"
|
text: "Extruder 3"
|
||||||
visible: !UM.LayerView.compatibilityMode && (UM.LayerView.getExtruderCount >= 3)
|
visible: !UM.LayerView.compatibilityMode && (UM.LayerView.etruderCount >= 3)
|
||||||
}
|
}
|
||||||
CheckBox {
|
CheckBox {
|
||||||
checked: true
|
checked: view_settings.extruder3_checked
|
||||||
onClicked: {
|
onClicked: {
|
||||||
UM.LayerView.setExtruderOpacity(3, checked ? 1.0 : 0.0);
|
UM.Preferences.setValue("layerview/extruder3_opacity", checked ? 1.0 : 0.0);
|
||||||
}
|
}
|
||||||
text: "Extruder 4"
|
text: "Extruder 4"
|
||||||
visible: !UM.LayerView.compatibilityMode && (UM.LayerView.getExtruderCount >= 4)
|
visible: !UM.LayerView.compatibilityMode && (UM.LayerView.extruderCount >= 4)
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
text: "Other extruders always visible"
|
text: "Other extruders always visible"
|
||||||
visible: !UM.LayerView.compatibilityMode && (UM.LayerView.getExtruderCount >= 5)
|
visible: !UM.LayerView.compatibilityMode && (UM.LayerView.extruderCount >= 5)
|
||||||
}
|
}
|
||||||
CheckBox {
|
CheckBox {
|
||||||
|
checked: view_settings.show_travel_moves
|
||||||
onClicked: {
|
onClicked: {
|
||||||
UM.LayerView.setShowTravelMoves(checked ? 1 : 0);
|
UM.Preferences.setValue("layerview/show_travel_moves", checked);
|
||||||
}
|
}
|
||||||
text: "Show travel moves"
|
text: catalog.i18nc("@label", "Show Travel Moves")
|
||||||
}
|
}
|
||||||
CheckBox {
|
CheckBox {
|
||||||
checked: true
|
checked: view_settings.show_helpers
|
||||||
onClicked: {
|
onClicked: {
|
||||||
UM.LayerView.setShowSupport(checked ? 1 : 0);
|
UM.Preferences.setValue("layerview/show_helpers", checked);
|
||||||
}
|
}
|
||||||
text: "Show support"
|
text: catalog.i18nc("@label", "Show Helpers")
|
||||||
}
|
}
|
||||||
CheckBox {
|
CheckBox {
|
||||||
checked: true
|
checked: view_settings.show_skin
|
||||||
onClicked: {
|
onClicked: {
|
||||||
UM.LayerView.setShowAdhesion(checked ? 1 : 0);
|
UM.Preferences.setValue("layerview/show_skin", checked);
|
||||||
}
|
}
|
||||||
text: "Show adhesion"
|
text: catalog.i18nc("@label", "Show Shell")
|
||||||
}
|
}
|
||||||
CheckBox {
|
CheckBox {
|
||||||
checked: true
|
checked: view_settings.show_infill
|
||||||
onClicked: {
|
onClicked: {
|
||||||
UM.LayerView.setShowSkin(checked ? 1 : 0);
|
UM.Preferences.setValue("layerview/show_infill", checked);
|
||||||
}
|
}
|
||||||
text: "Show skin"
|
text: catalog.i18nc("@label", "Show Infill")
|
||||||
}
|
|
||||||
CheckBox {
|
|
||||||
checked: true
|
|
||||||
onClicked: {
|
|
||||||
UM.LayerView.setShowInfill(checked ? 1 : 0);
|
|
||||||
}
|
|
||||||
text: "Show infill"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ class LayerViewProxy(QObject):
|
||||||
preferencesChanged = pyqtSignal()
|
preferencesChanged = pyqtSignal()
|
||||||
|
|
||||||
@pyqtProperty(bool, notify = activityChanged)
|
@pyqtProperty(bool, notify = activityChanged)
|
||||||
def getLayerActivity(self):
|
def layerActivity(self):
|
||||||
active_view = self._controller.getActiveView()
|
active_view = self._controller.getActiveView()
|
||||||
if type(active_view) == LayerView.LayerView.LayerView:
|
if type(active_view) == LayerView.LayerView.LayerView:
|
||||||
return active_view.getActivity()
|
return active_view.getActivity()
|
||||||
|
@ -79,7 +79,7 @@ class LayerViewProxy(QObject):
|
||||||
if type(active_view) == LayerView.LayerView.LayerView:
|
if type(active_view) == LayerView.LayerView.LayerView:
|
||||||
active_view.setLayerViewType(layer_view_type)
|
active_view.setLayerViewType(layer_view_type)
|
||||||
|
|
||||||
@pyqtProperty(bool)
|
@pyqtSlot(result = int)
|
||||||
def getLayerViewType(self):
|
def getLayerViewType(self):
|
||||||
active_view = self._controller.getActiveView()
|
active_view = self._controller.getActiveView()
|
||||||
if type(active_view) == LayerView.LayerView.LayerView:
|
if type(active_view) == LayerView.LayerView.LayerView:
|
||||||
|
@ -100,16 +100,10 @@ class LayerViewProxy(QObject):
|
||||||
active_view.setShowTravelMoves(show)
|
active_view.setShowTravelMoves(show)
|
||||||
|
|
||||||
@pyqtSlot(int)
|
@pyqtSlot(int)
|
||||||
def setShowSupport(self, show):
|
def setShowHelpers(self, show):
|
||||||
active_view = self._controller.getActiveView()
|
active_view = self._controller.getActiveView()
|
||||||
if type(active_view) == LayerView.LayerView.LayerView:
|
if type(active_view) == LayerView.LayerView.LayerView:
|
||||||
active_view.setShowSupport(show)
|
active_view.setShowHelpers(show)
|
||||||
|
|
||||||
@pyqtSlot(int)
|
|
||||||
def setShowAdhesion(self, show):
|
|
||||||
active_view = self._controller.getActiveView()
|
|
||||||
if type(active_view) == LayerView.LayerView.LayerView:
|
|
||||||
active_view.setShowAdhesion(show)
|
|
||||||
|
|
||||||
@pyqtSlot(int)
|
@pyqtSlot(int)
|
||||||
def setShowSkin(self, show):
|
def setShowSkin(self, show):
|
||||||
|
@ -124,7 +118,7 @@ class LayerViewProxy(QObject):
|
||||||
active_view.setShowInfill(show)
|
active_view.setShowInfill(show)
|
||||||
|
|
||||||
@pyqtProperty(int, notify = globalStackChanged)
|
@pyqtProperty(int, notify = globalStackChanged)
|
||||||
def getExtruderCount(self):
|
def extruderCount(self):
|
||||||
active_view = self._controller.getActiveView()
|
active_view = self._controller.getActiveView()
|
||||||
if type(active_view) == LayerView.LayerView.LayerView:
|
if type(active_view) == LayerView.LayerView.LayerView:
|
||||||
return active_view.getExtruderCount()
|
return active_view.getExtruderCount()
|
||||||
|
|
|
@ -32,8 +32,7 @@ fragment =
|
||||||
varying float v_line_type;
|
varying float v_line_type;
|
||||||
|
|
||||||
uniform int u_show_travel_moves;
|
uniform int u_show_travel_moves;
|
||||||
uniform int u_show_support;
|
uniform int u_show_helpers;
|
||||||
uniform int u_show_adhesion;
|
|
||||||
uniform int u_show_skin;
|
uniform int u_show_skin;
|
||||||
uniform int u_show_infill;
|
uniform int u_show_infill;
|
||||||
|
|
||||||
|
@ -43,11 +42,12 @@ fragment =
|
||||||
// discard movements
|
// discard movements
|
||||||
discard;
|
discard;
|
||||||
}
|
}
|
||||||
// support: 4, 7, 10
|
// support: 4, 5, 7, 10
|
||||||
if ((u_show_support == 0) && (
|
if ((u_show_helpers == 0) && (
|
||||||
((v_line_type >= 3.5) && (v_line_type <= 4.5)) ||
|
((v_line_type >= 3.5) && (v_line_type <= 4.5)) ||
|
||||||
((v_line_type >= 6.5) && (v_line_type <= 7.5)) ||
|
((v_line_type >= 6.5) && (v_line_type <= 7.5)) ||
|
||||||
((v_line_type >= 9.5) && (v_line_type <= 10.5))
|
((v_line_type >= 9.5) && (v_line_type <= 10.5)) ||
|
||||||
|
((v_line_type >= 4.5) && (v_line_type <= 5.5))
|
||||||
)) {
|
)) {
|
||||||
discard;
|
discard;
|
||||||
}
|
}
|
||||||
|
@ -57,11 +57,6 @@ fragment =
|
||||||
)) {
|
)) {
|
||||||
discard;
|
discard;
|
||||||
}
|
}
|
||||||
// adhesion:
|
|
||||||
if ((u_show_adhesion == 0) && (v_line_type >= 4.5) && (v_line_type <= 5.5)) {
|
|
||||||
// discard movements
|
|
||||||
discard;
|
|
||||||
}
|
|
||||||
// infill:
|
// infill:
|
||||||
if ((u_show_infill == 0) && (v_line_type >= 5.5) && (v_line_type <= 6.5)) {
|
if ((u_show_infill == 0) && (v_line_type >= 5.5) && (v_line_type <= 6.5)) {
|
||||||
// discard movements
|
// discard movements
|
||||||
|
@ -105,8 +100,7 @@ fragment41core =
|
||||||
out vec4 frag_color;
|
out vec4 frag_color;
|
||||||
|
|
||||||
uniform int u_show_travel_moves;
|
uniform int u_show_travel_moves;
|
||||||
uniform int u_show_support;
|
uniform int u_show_helpers;
|
||||||
uniform int u_show_adhesion;
|
|
||||||
uniform int u_show_skin;
|
uniform int u_show_skin;
|
||||||
uniform int u_show_infill;
|
uniform int u_show_infill;
|
||||||
|
|
||||||
|
@ -116,11 +110,12 @@ fragment41core =
|
||||||
// discard movements
|
// discard movements
|
||||||
discard;
|
discard;
|
||||||
}
|
}
|
||||||
// support: 4, 7, 10
|
// helpers: 4, 5, 7, 10
|
||||||
if ((u_show_support == 0) && (
|
if ((u_show_helpers == 0) && (
|
||||||
((v_line_type >= 3.5) && (v_line_type <= 4.5)) ||
|
((v_line_type >= 3.5) && (v_line_type <= 4.5)) ||
|
||||||
((v_line_type >= 6.5) && (v_line_type <= 7.5)) ||
|
((v_line_type >= 6.5) && (v_line_type <= 7.5)) ||
|
||||||
((v_line_type >= 9.5) && (v_line_type <= 10.5))
|
((v_line_type >= 9.5) && (v_line_type <= 10.5)) ||
|
||||||
|
((v_line_type >= 4.5) && (v_line_type <= 5.5))
|
||||||
)) {
|
)) {
|
||||||
discard;
|
discard;
|
||||||
}
|
}
|
||||||
|
@ -130,11 +125,6 @@ fragment41core =
|
||||||
)) {
|
)) {
|
||||||
discard;
|
discard;
|
||||||
}
|
}
|
||||||
// adhesion:
|
|
||||||
if ((u_show_adhesion == 0) && (v_line_type >= 4.5) && (v_line_type <= 5.5)) {
|
|
||||||
// discard movements
|
|
||||||
discard;
|
|
||||||
}
|
|
||||||
// infill:
|
// infill:
|
||||||
if ((u_show_infill == 0) && (v_line_type >= 5.5) && (v_line_type <= 6.5)) {
|
if ((u_show_infill == 0) && (v_line_type >= 5.5) && (v_line_type <= 6.5)) {
|
||||||
// discard movements
|
// discard movements
|
||||||
|
@ -151,8 +141,7 @@ u_layer_view_type = 0
|
||||||
u_extruder_opacity = [1.0, 1.0, 1.0, 1.0]
|
u_extruder_opacity = [1.0, 1.0, 1.0, 1.0]
|
||||||
|
|
||||||
u_show_travel_moves = 0
|
u_show_travel_moves = 0
|
||||||
u_show_support = 1
|
u_show_helpers = 1
|
||||||
u_show_adhesion = 1
|
|
||||||
u_show_skin = 1
|
u_show_skin = 1
|
||||||
u_show_infill = 1
|
u_show_infill = 1
|
||||||
|
|
||||||
|
|
|
@ -68,8 +68,7 @@ geometry41core =
|
||||||
|
|
||||||
uniform highp mat4 u_viewProjectionMatrix;
|
uniform highp mat4 u_viewProjectionMatrix;
|
||||||
uniform int u_show_travel_moves;
|
uniform int u_show_travel_moves;
|
||||||
uniform int u_show_support;
|
uniform int u_show_helpers;
|
||||||
uniform int u_show_adhesion;
|
|
||||||
uniform int u_show_skin;
|
uniform int u_show_skin;
|
||||||
uniform int u_show_infill;
|
uniform int u_show_infill;
|
||||||
|
|
||||||
|
@ -117,10 +116,7 @@ geometry41core =
|
||||||
if ((u_show_travel_moves == 0) && ((v_line_type[0] == 8) || (v_line_type[0] == 9))) {
|
if ((u_show_travel_moves == 0) && ((v_line_type[0] == 8) || (v_line_type[0] == 9))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((u_show_support == 0) && ((v_line_type[0] == 4) || (v_line_type[0] == 7) || (v_line_type[0] == 10))) {
|
if ((u_show_helpers == 0) && ((v_line_type[0] == 4) || (v_line_type[0] == 5) || (v_line_type[0] == 7) || (v_line_type[0] == 10))) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ((u_show_adhesion == 0) && (v_line_type[0] == 5)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((u_show_skin == 0) && ((v_line_type[0] == 1) || (v_line_type[0] == 2) || (v_line_type[0] == 3))) {
|
if ((u_show_skin == 0) && ((v_line_type[0] == 1) || (v_line_type[0] == 2) || (v_line_type[0] == 3))) {
|
||||||
|
@ -132,12 +128,11 @@ geometry41core =
|
||||||
|
|
||||||
if ((v_line_type[0] == 8) || (v_line_type[0] == 9)) {
|
if ((v_line_type[0] == 8) || (v_line_type[0] == 9)) {
|
||||||
// fixed size for movements
|
// fixed size for movements
|
||||||
size_x = 0.1;
|
size_x = 0.2;
|
||||||
size_y = 0.1;
|
|
||||||
} else {
|
} else {
|
||||||
size_x = v_line_dim[0].x / 2 + 0.01; // radius, and make it nicely overlapping
|
size_x = v_line_dim[0].x / 2 + 0.01; // radius, and make it nicely overlapping
|
||||||
size_y = v_line_dim[0].y / 2 + 0.01;
|
|
||||||
}
|
}
|
||||||
|
size_y = v_line_dim[0].y / 2 + 0.01;
|
||||||
|
|
||||||
g_vertex_delta = gl_in[1].gl_Position - gl_in[0].gl_Position;
|
g_vertex_delta = gl_in[1].gl_Position - gl_in[0].gl_Position;
|
||||||
g_vertex_normal_horz_head = normalize(vec3(-g_vertex_delta.x, -g_vertex_delta.y, -g_vertex_delta.z));
|
g_vertex_normal_horz_head = normalize(vec3(-g_vertex_delta.x, -g_vertex_delta.y, -g_vertex_delta.z));
|
||||||
|
@ -149,6 +144,19 @@ geometry41core =
|
||||||
g_vertex_normal_vert = vec3(0.0, 1.0, 0.0);
|
g_vertex_normal_vert = vec3(0.0, 1.0, 0.0);
|
||||||
g_vertex_offset_vert = vec4(g_vertex_normal_vert * size_y, 0.0);
|
g_vertex_offset_vert = vec4(g_vertex_normal_vert * size_y, 0.0);
|
||||||
|
|
||||||
|
if ((v_line_type[0] == 8) || (v_line_type[0] == 9)) {
|
||||||
|
// Travels: flat plane with pointy ends
|
||||||
|
myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz + g_vertex_offset_vert));
|
||||||
|
myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz_head + g_vertex_offset_vert));
|
||||||
|
myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position - g_vertex_offset_horz + g_vertex_offset_vert));
|
||||||
|
myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz + g_vertex_offset_vert));
|
||||||
|
myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_horz + g_vertex_offset_vert));
|
||||||
|
myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[1].gl_Position + g_vertex_offset_horz + g_vertex_offset_vert));
|
||||||
|
myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_horz_head + g_vertex_offset_vert));
|
||||||
|
|
||||||
|
EndPrimitive();
|
||||||
|
} else {
|
||||||
|
// All normal lines are rendered as 3d tubes.
|
||||||
myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz));
|
myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz));
|
||||||
myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[1].gl_Position + g_vertex_offset_horz));
|
myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[1].gl_Position + g_vertex_offset_horz));
|
||||||
myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_vert));
|
myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_vert));
|
||||||
|
@ -192,6 +200,7 @@ geometry41core =
|
||||||
|
|
||||||
EndPrimitive();
|
EndPrimitive();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fragment41core =
|
fragment41core =
|
||||||
#version 410
|
#version 410
|
||||||
|
@ -234,8 +243,7 @@ u_diffuseColor = [1.0, 0.79, 0.14, 1.0]
|
||||||
u_shininess = 20.0
|
u_shininess = 20.0
|
||||||
|
|
||||||
u_show_travel_moves = 0
|
u_show_travel_moves = 0
|
||||||
u_show_support = 1
|
u_show_helpers = 1
|
||||||
u_show_adhesion = 1
|
|
||||||
u_show_skin = 1
|
u_show_skin = 1
|
||||||
u_show_infill = 1
|
u_show_infill = 1
|
||||||
|
|
||||||
|
|
|
@ -259,16 +259,23 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
||||||
data = """{"temperature": "%i", "timeout": "%i"}""" % (temperature, duration)
|
data = """{"temperature": "%i", "timeout": "%i"}""" % (temperature, duration)
|
||||||
else:
|
else:
|
||||||
data = """{"temperature": "%i"}""" % temperature
|
data = """{"temperature": "%i"}""" % temperature
|
||||||
|
Logger.log("i", "Pre-heating bed to %i degrees.", temperature)
|
||||||
put_request = QNetworkRequest(url)
|
put_request = QNetworkRequest(url)
|
||||||
put_request.setHeader(QNetworkRequest.ContentTypeHeader, "application/json")
|
put_request.setHeader(QNetworkRequest.ContentTypeHeader, "application/json")
|
||||||
self._manager.put(put_request, data.encode())
|
self._manager.put(put_request, data.encode())
|
||||||
|
self._preheat_bed_timer.start(self._preheat_bed_timeout * 1000) #Times 1000 because it needs to be provided as milliseconds.
|
||||||
|
self.preheatBedRemainingTimeChanged.emit()
|
||||||
|
|
||||||
## Cancels pre-heating the heated bed of the printer.
|
## Cancels pre-heating the heated bed of the printer.
|
||||||
#
|
#
|
||||||
# If the bed is not pre-heated, nothing happens.
|
# If the bed is not pre-heated, nothing happens.
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def cancelPreheatBed(self):
|
def cancelPreheatBed(self):
|
||||||
|
Logger.log("i", "Cancelling pre-heating of the bed.")
|
||||||
self.preheatBed(temperature = 0, duration = 0)
|
self.preheatBed(temperature = 0, duration = 0)
|
||||||
|
self._preheat_bed_timer.stop()
|
||||||
|
self._preheat_bed_timer.setInterval(0)
|
||||||
|
self.preheatBedRemainingTimeChanged.emit()
|
||||||
|
|
||||||
## Changes the target bed temperature on the printer.
|
## Changes the target bed temperature on the printer.
|
||||||
#
|
#
|
||||||
|
@ -616,7 +623,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
||||||
warnings.append(i18n_catalog.i18nc("@label", "Not enough material for spool {0}.").format(index+1))
|
warnings.append(i18n_catalog.i18nc("@label", "Not enough material for spool {0}.").format(index+1))
|
||||||
|
|
||||||
# Check if the right cartridges are loaded. Any failure in these results in a warning.
|
# Check if the right cartridges are loaded. Any failure in these results in a warning.
|
||||||
extruder_manager = cura.Settings.ExtruderManager.getInstance()
|
extruder_manager = cura.Settings.ExtruderManager.ExtruderManager.getInstance()
|
||||||
if print_information.materialLengths[index] != 0:
|
if print_information.materialLengths[index] != 0:
|
||||||
variant = extruder_manager.getExtruderStack(index).findContainer({"type": "variant"})
|
variant = extruder_manager.getExtruderStack(index).findContainer({"type": "variant"})
|
||||||
core_name = self._json_printer_state["heads"][0]["extruders"][index]["hotend"]["id"]
|
core_name = self._json_printer_state["heads"][0]["extruders"][index]["hotend"]["id"]
|
||||||
|
@ -811,7 +818,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
||||||
|
|
||||||
## Check if the authentication request was allowed by the printer.
|
## Check if the authentication request was allowed by the printer.
|
||||||
def _checkAuthentication(self):
|
def _checkAuthentication(self):
|
||||||
Logger.log("d", "Checking if authentication is correct for id %", self._authentication_id)
|
Logger.log("d", "Checking if authentication is correct for id %s", self._authentication_id)
|
||||||
self._manager.get(QNetworkRequest(QUrl("http://" + self._address + self._api_prefix + "auth/check/" + str(self._authentication_id))))
|
self._manager.get(QNetworkRequest(QUrl("http://" + self._address + self._api_prefix + "auth/check/" + str(self._authentication_id))))
|
||||||
|
|
||||||
## Request a authentication key from the printer so we can be authenticated
|
## Request a authentication key from the printer so we can be authenticated
|
||||||
|
|
|
@ -650,11 +650,15 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
||||||
# ignored because there is no g-code to set this.
|
# ignored because there is no g-code to set this.
|
||||||
@pyqtSlot(float, float)
|
@pyqtSlot(float, float)
|
||||||
def preheatBed(self, temperature, duration):
|
def preheatBed(self, temperature, duration):
|
||||||
|
Logger.log("i", "Pre-heating the bed to %i degrees.", temperature)
|
||||||
self._setTargetBedTemperature(temperature)
|
self._setTargetBedTemperature(temperature)
|
||||||
|
self.preheatBedRemainingTimeChanged.emit()
|
||||||
|
|
||||||
## Cancels pre-heating the heated bed of the printer.
|
## Cancels pre-heating the heated bed of the printer.
|
||||||
#
|
#
|
||||||
# If the bed is not pre-heated, nothing happens.
|
# If the bed is not pre-heated, nothing happens.
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def cancelPreheatBed(self):
|
def cancelPreheatBed(self):
|
||||||
|
Logger.log("i", "Cancelling pre-heating of the bed.")
|
||||||
self._setTargetBedTemperature(0)
|
self._setTargetBedTemperature(0)
|
||||||
|
self.preheatBedRemainingTimeChanged.emit()
|
|
@ -1278,7 +1278,7 @@
|
||||||
"material_print_temperature":
|
"material_print_temperature":
|
||||||
{
|
{
|
||||||
"label": "Printing Temperature",
|
"label": "Printing Temperature",
|
||||||
"description": "The temperature used for printing. Set at 0 to pre-heat the printer manually.",
|
"description": "The temperature used for printing. If this is 0, the extruder will not heat up for this print.",
|
||||||
"unit": "°C",
|
"unit": "°C",
|
||||||
"type": "float",
|
"type": "float",
|
||||||
"default_value": 210,
|
"default_value": 210,
|
||||||
|
@ -1365,7 +1365,7 @@
|
||||||
"material_bed_temperature":
|
"material_bed_temperature":
|
||||||
{
|
{
|
||||||
"label": "Build Plate Temperature",
|
"label": "Build Plate Temperature",
|
||||||
"description": "The temperature used for the heated build plate. Set at 0 to pre-heat the printer manually.",
|
"description": "The temperature used for the heated build plate. If this is 0, the bed will not heat up for this print.",
|
||||||
"unit": "°C",
|
"unit": "°C",
|
||||||
"type": "float",
|
"type": "float",
|
||||||
"resolve": "max(extruderValues('material_bed_temperature'))",
|
"resolve": "max(extruderValues('material_bed_temperature'))",
|
||||||
|
|
28
resources/definitions/folgertech_FT-5.def.json
Normal file
28
resources/definitions/folgertech_FT-5.def.json
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
"version": 2,
|
||||||
|
"name": "Folger Tech FT-5",
|
||||||
|
"inherits": "fdmprinter",
|
||||||
|
"metadata": {
|
||||||
|
"visible": true,
|
||||||
|
"author": "Jaime van Kessel & Paul Bussiere",
|
||||||
|
"manufacturer": "Folger Tech",
|
||||||
|
"category": "Other",
|
||||||
|
"file_formats": "text/x-gcode",
|
||||||
|
"platform": "FT-5_build_plate.stl"
|
||||||
|
},
|
||||||
|
"overrides": {
|
||||||
|
"machine_heated_bed": { "default_value": true },
|
||||||
|
"machine_width": { "default_value": 300 },
|
||||||
|
"machine_height": { "default_value": 400 },
|
||||||
|
"machine_depth": { "default_value": 300 },
|
||||||
|
"material_diameter": { "default_value": 1.75 },
|
||||||
|
"gantry_height": { "default_value": 55 },
|
||||||
|
|
||||||
|
"machine_start_gcode": {
|
||||||
|
"default_value": "G21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nG1 Z15.0 F9000 ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E3 ;extrude 3mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F9000\n;Put printing message on LCD screen\nM117 Printing..."
|
||||||
|
},
|
||||||
|
"machine_end_gcode": {
|
||||||
|
"default_value": "M104 S0 ;extruder heater off\nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+0.5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nM84 ;steppers off\nG90 ;absolute positioning"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
50
resources/definitions/helloBEEprusa.def.json
Normal file
50
resources/definitions/helloBEEprusa.def.json
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
{
|
||||||
|
"id": "BEEVERYCREATIVE-helloBEEprusa",
|
||||||
|
"version": 2,
|
||||||
|
"name": "Hello BEE Prusa",
|
||||||
|
"inherits": "fdmprinter",
|
||||||
|
"metadata": {
|
||||||
|
"visible": true,
|
||||||
|
"author": "BEEVERYCREATIVE",
|
||||||
|
"manufacturer": "BEEVERYCREATIVE",
|
||||||
|
"category": "Other",
|
||||||
|
"platform": "BEEVERYCREATIVE-helloBEEprusa.stl",
|
||||||
|
"platform_offset": [-226, -75, -196],
|
||||||
|
"file_formats": "text/x-gcode"
|
||||||
|
},
|
||||||
|
|
||||||
|
"overrides": {
|
||||||
|
"machine_name": { "default_value": "hello BEE prusa" },
|
||||||
|
"machine_start_gcode": { "default_value": "; -- START GCODE --\nG21 ;set units to millimetres\nG90 ;set to absolute positioning\nM107 ;set fan speed to zero (turned off)\nG28 X0 Y0 ;move to the X/Y origin (Home)\nG28 Z0 ;move to the Z origin (Home)\nG92 E0 ;zero the extruded length\nG1 F3600 ;set feedrate to 60 mm/sec\n; -- end of START GCODE --" },
|
||||||
|
"machine_end_gcode": { "default_value": "; -- END GCODE --\nM104 S0 ;set extruder temperature to zero (turned off)\nM140 S0 ;set bed temperature to zero (turned off)\nG28 X0 Y0 ;move to the X/Y origin (Home)\nM84 ;turn off steppers\n; -- end of END GCODE --" },
|
||||||
|
"machine_width": { "default_value": 185 },
|
||||||
|
"machine_depth": { "default_value": 200 },
|
||||||
|
"machine_height": { "default_value": 190 },
|
||||||
|
"machine_heated_bed": { "default_value": true },
|
||||||
|
"machine_center_is_zero": { "default_value": false },
|
||||||
|
"material_print_temperature": { "default_value": 220 },
|
||||||
|
"material_bed_temperature": { "default_value": 60 },
|
||||||
|
"material_diameter": { "default_value": 1.75 },
|
||||||
|
"layer_height": { "default_value": 0.2 },
|
||||||
|
"layer_height_0": { "default_value": 0.2 },
|
||||||
|
"wall_line_count": { "default_value": 3 },
|
||||||
|
"wall_thickness": { "default_value": 1.2 },
|
||||||
|
"top_bottom_thickness": { "default_value": 1.2 },
|
||||||
|
"infill_sparse_density": { "default_value": 20 },
|
||||||
|
"infill_overlap": { "default_value": 15 },
|
||||||
|
"speed_print": { "default_value": 60 },
|
||||||
|
"speed_travel": { "default_value": 160 },
|
||||||
|
"speed_layer_0": { "default_value": 30 },
|
||||||
|
"speed_wall_x": { "default_value": 35 },
|
||||||
|
"speed_wall_0": { "default_value": 30 },
|
||||||
|
"speed_infill": { "default_value": 60 },
|
||||||
|
"speed_topbottom": { "default_value": 20 },
|
||||||
|
"skirt_brim_speed": { "default_value": 35 },
|
||||||
|
"skirt_line_count": { "default_value": 4 },
|
||||||
|
"skirt_brim_minimal_length": { "default_value": 30 },
|
||||||
|
"skirt_gap": { "default_value": 6 },
|
||||||
|
"cool_fan_full_at_height": { "default_value": 0.4 },
|
||||||
|
"retraction_speed": { "default_value": 50.0},
|
||||||
|
"retraction_amount": { "default_value": 5.2}
|
||||||
|
}
|
||||||
|
}
|
BIN
resources/meshes/BEEVERYCREATIVE-helloBEEprusa.stl
Executable file
BIN
resources/meshes/BEEVERYCREATIVE-helloBEEprusa.stl
Executable file
Binary file not shown.
49394
resources/meshes/FT-5_build_plate.stl
Normal file
49394
resources/meshes/FT-5_build_plate.stl
Normal file
File diff suppressed because it is too large
Load diff
|
@ -73,22 +73,26 @@ UM.Dialog
|
||||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ScrollView
|
||||||
|
{
|
||||||
|
anchors.top: creditsNotes.bottom
|
||||||
|
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||||
|
|
||||||
|
width: parent.width
|
||||||
|
height: base.height - y - (2 * UM.Theme.getSize("default_margin").height + closeButton.height)
|
||||||
|
|
||||||
ListView
|
ListView
|
||||||
{
|
{
|
||||||
id: projectsList
|
id: projectsList
|
||||||
|
|
||||||
anchors.top: creditsNotes.bottom
|
|
||||||
anchors.topMargin: 10
|
|
||||||
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: childrenRect.height
|
|
||||||
|
|
||||||
delegate: Row
|
delegate: Row
|
||||||
{
|
{
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: "<a href='%1' title='%2'>%2</a>".arg(model.url).arg(model.name)
|
text: "<a href='%1' title='%2'>%2</a>".arg(model.url).arg(model.name)
|
||||||
width: projectsList.width * 0.25
|
width: (projectsList.width * 0.25) | 0
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
onLinkActivated: Qt.openUrlExternally(link)
|
onLinkActivated: Qt.openUrlExternally(link)
|
||||||
}
|
}
|
||||||
|
@ -96,13 +100,13 @@ UM.Dialog
|
||||||
{
|
{
|
||||||
text: model.description
|
text: model.description
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
width: projectsList.width * 0.6
|
width: (projectsList.width * 0.6) | 0
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: model.license
|
text: model.license
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
width: projectsList.width * 0.15
|
width: (projectsList.width * 0.15) | 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
model: ListModel
|
model: ListModel
|
||||||
|
@ -124,17 +128,21 @@ UM.Dialog
|
||||||
projectsModel.append({ name:"SciPy", description: catalog.i18nc("@label", "Support library for scientific computing "), license: "BSD-new", url: "https://www.scipy.org/" });
|
projectsModel.append({ name:"SciPy", description: catalog.i18nc("@label", "Support library for scientific computing "), license: "BSD-new", url: "https://www.scipy.org/" });
|
||||||
projectsModel.append({ name:"NumPy", description: catalog.i18nc("@label", "Support library for faster math"), license: "BSD", url: "http://www.numpy.org/" });
|
projectsModel.append({ name:"NumPy", description: catalog.i18nc("@label", "Support library for faster math"), license: "BSD", url: "http://www.numpy.org/" });
|
||||||
projectsModel.append({ name:"NumPy-STL", description: catalog.i18nc("@label", "Support library for handling STL files"), license: "BSD", url: "https://github.com/WoLpH/numpy-stl" });
|
projectsModel.append({ name:"NumPy-STL", description: catalog.i18nc("@label", "Support library for handling STL files"), license: "BSD", url: "https://github.com/WoLpH/numpy-stl" });
|
||||||
|
projectsModel.append({ name:"libSavitar", description: catalog.i18nc("@label", "Support library for handling 3MF files"), license: "AGPLv3", url: "https://github.com/ultimaker/libsavitar" });
|
||||||
projectsModel.append({ name:"PySerial", description: catalog.i18nc("@label", "Serial communication library"), license: "Python", url: "http://pyserial.sourceforge.net/" });
|
projectsModel.append({ name:"PySerial", description: catalog.i18nc("@label", "Serial communication library"), license: "Python", url: "http://pyserial.sourceforge.net/" });
|
||||||
projectsModel.append({ name:"python-zeroconf", description: catalog.i18nc("@label", "ZeroConf discovery library"), license: "LGPL", url: "https://github.com/jstasiak/python-zeroconf" });
|
projectsModel.append({ name:"python-zeroconf", description: catalog.i18nc("@label", "ZeroConf discovery library"), license: "LGPL", url: "https://github.com/jstasiak/python-zeroconf" });
|
||||||
projectsModel.append({ name:"Clipper", description: catalog.i18nc("@label", "Polygon clipping library"), license: "Boost", url: "http://www.angusj.com/delphi/clipper.php" });
|
projectsModel.append({ name:"Clipper", description: catalog.i18nc("@label", "Polygon clipping library"), license: "Boost", url: "http://www.angusj.com/delphi/clipper.php" });
|
||||||
|
|
||||||
projectsModel.append({ name:"Open Sans", description: catalog.i18nc("@label", "Font"), license: "Apache 2.0", url: "https://fonts.google.com/specimen/Open+Sans" });
|
projectsModel.append({ name:"Open Sans", description: catalog.i18nc("@label", "Font"), license: "Apache 2.0", url: "https://fonts.google.com/specimen/Open+Sans" });
|
||||||
projectsModel.append({ name:"Font-Awesome-SVG-PNG", description: catalog.i18nc("@label", "SVG icons"), license: "SIL OFL 1.1", url: "https://github.com/encharm/Font-Awesome-SVG-PNG" });
|
projectsModel.append({ name:"Font-Awesome-SVG-PNG", description: catalog.i18nc("@label", "SVG icons"), license: "SIL OFL 1.1", url: "https://github.com/encharm/Font-Awesome-SVG-PNG" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rightButtons: Button
|
rightButtons: Button
|
||||||
{
|
{
|
||||||
//: Close about dialog button
|
//: Close about dialog button
|
||||||
|
id: closeButton
|
||||||
text: catalog.i18nc("@action:button","Close");
|
text: catalog.i18nc("@action:button","Close");
|
||||||
|
|
||||||
onClicked: base.visible = false;
|
onClicked: base.visible = false;
|
||||||
|
|
|
@ -12,7 +12,7 @@ import Cura 1.0 as Cura
|
||||||
Item {
|
Item {
|
||||||
id: base
|
id: base
|
||||||
|
|
||||||
property bool activity: Printer.getPlatformActivity
|
property bool activity: Printer.platformActivity
|
||||||
property string fileBaseName
|
property string fileBaseName
|
||||||
property variant activeMachineName: Cura.MachineManager.activeMachineName
|
property variant activeMachineName: Cura.MachineManager.activeMachineName
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ Item
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
property bool activity: Printer.getPlatformActivity;
|
property bool activity: Printer.platformActivity;
|
||||||
property int totalHeight: childrenRect.height + UM.Theme.getSize("default_margin").height
|
property int totalHeight: childrenRect.height + UM.Theme.getSize("default_margin").height
|
||||||
property string fileBaseName
|
property string fileBaseName
|
||||||
property string statusText:
|
property string statusText:
|
||||||
|
|
|
@ -58,6 +58,11 @@ UM.PreferencesPage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ScrollView
|
||||||
|
{
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height
|
||||||
|
|
||||||
Column
|
Column
|
||||||
{
|
{
|
||||||
//: Model used to check if a plugin exists
|
//: Model used to check if a plugin exists
|
||||||
|
@ -417,4 +422,5 @@ UM.PreferencesPage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,12 +96,35 @@ Column
|
||||||
}
|
}
|
||||||
Label //Temperature indication.
|
Label //Temperature indication.
|
||||||
{
|
{
|
||||||
text: (connectedPrinter != null && connectedPrinter.hotendTemperatures[index] != null) ? Math.round(connectedPrinter.hotendTemperatures[index]) + "°C" : ""
|
id: extruderTemperature
|
||||||
|
text: (connectedPrinter != null && connectedPrinter.hotendIds[index] != null && connectedPrinter.hotendTemperatures[index] != null) ? Math.round(connectedPrinter.hotendTemperatures[index]) + "°C" : ""
|
||||||
color: UM.Theme.getColor("text")
|
color: UM.Theme.getColor("text")
|
||||||
font: UM.Theme.getFont("large")
|
font: UM.Theme.getFont("large")
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
|
MouseArea //For tooltip.
|
||||||
|
{
|
||||||
|
id: extruderTemperatureTooltipArea
|
||||||
|
hoverEnabled: true
|
||||||
|
anchors.fill: parent
|
||||||
|
onHoveredChanged:
|
||||||
|
{
|
||||||
|
if (containsMouse)
|
||||||
|
{
|
||||||
|
base.showTooltip(
|
||||||
|
base,
|
||||||
|
{x: 0, y: parent.mapToItem(base, 0, -parent.height / 4).y},
|
||||||
|
catalog.i18nc("@tooltip", "The current temperature of this extruder.")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
base.hideTooltip();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Rectangle //Material colour indication.
|
Rectangle //Material colour indication.
|
||||||
{
|
{
|
||||||
|
@ -115,6 +138,28 @@ Column
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||||
anchors.verticalCenter: materialName.verticalCenter
|
anchors.verticalCenter: materialName.verticalCenter
|
||||||
|
|
||||||
|
MouseArea //For tooltip.
|
||||||
|
{
|
||||||
|
id: materialColorTooltipArea
|
||||||
|
hoverEnabled: true
|
||||||
|
anchors.fill: parent
|
||||||
|
onHoveredChanged:
|
||||||
|
{
|
||||||
|
if (containsMouse)
|
||||||
|
{
|
||||||
|
base.showTooltip(
|
||||||
|
base,
|
||||||
|
{x: 0, y: parent.mapToItem(base, 0, -parent.height / 2).y},
|
||||||
|
catalog.i18nc("@tooltip", "The colour of the material in this extruder.")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
base.hideTooltip();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Label //Material name.
|
Label //Material name.
|
||||||
{
|
{
|
||||||
|
@ -125,15 +170,60 @@ Column
|
||||||
anchors.left: materialColor.right
|
anchors.left: materialColor.right
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
|
MouseArea //For tooltip.
|
||||||
|
{
|
||||||
|
id: materialNameTooltipArea
|
||||||
|
hoverEnabled: true
|
||||||
|
anchors.fill: parent
|
||||||
|
onHoveredChanged:
|
||||||
|
{
|
||||||
|
if (containsMouse)
|
||||||
|
{
|
||||||
|
base.showTooltip(
|
||||||
|
base,
|
||||||
|
{x: 0, y: parent.mapToItem(base, 0, 0).y},
|
||||||
|
catalog.i18nc("@tooltip", "The material in this extruder.")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
base.hideTooltip();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Label //Variant name.
|
Label //Variant name.
|
||||||
{
|
{
|
||||||
|
id: variantName
|
||||||
text: (connectedPrinter != null && connectedPrinter.hotendIds[index] != null) ? connectedPrinter.hotendIds[index] : ""
|
text: (connectedPrinter != null && connectedPrinter.hotendIds[index] != null) ? connectedPrinter.hotendIds[index] : ""
|
||||||
font: UM.Theme.getFont("default")
|
font: UM.Theme.getFont("default")
|
||||||
color: UM.Theme.getColor("text")
|
color: UM.Theme.getColor("text")
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
|
MouseArea //For tooltip.
|
||||||
|
{
|
||||||
|
id: variantNameTooltipArea
|
||||||
|
hoverEnabled: true
|
||||||
|
anchors.fill: parent
|
||||||
|
onHoveredChanged:
|
||||||
|
{
|
||||||
|
if (containsMouse)
|
||||||
|
{
|
||||||
|
base.showTooltip(
|
||||||
|
base,
|
||||||
|
{x: 0, y: parent.mapToItem(base, 0, -parent.height / 4).y},
|
||||||
|
catalog.i18nc("@tooltip", "The nozzle inserted in this extruder.")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
base.hideTooltip();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -172,6 +262,28 @@ Column
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||||
anchors.bottom: bedCurrentTemperature.bottom
|
anchors.bottom: bedCurrentTemperature.bottom
|
||||||
|
|
||||||
|
MouseArea //For tooltip.
|
||||||
|
{
|
||||||
|
id: bedTargetTemperatureTooltipArea
|
||||||
|
hoverEnabled: true
|
||||||
|
anchors.fill: parent
|
||||||
|
onHoveredChanged:
|
||||||
|
{
|
||||||
|
if (containsMouse)
|
||||||
|
{
|
||||||
|
base.showTooltip(
|
||||||
|
base,
|
||||||
|
{x: 0, y: bedTargetTemperature.mapToItem(base, 0, -parent.height / 4).y},
|
||||||
|
catalog.i18nc("@tooltip", "The target temperature of the heated bed. The bed will heat up or cool down towards this temperature. If this is 0, the bed heating is turned off.")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
base.hideTooltip();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Label //Current temperature.
|
Label //Current temperature.
|
||||||
{
|
{
|
||||||
|
@ -182,13 +294,51 @@ Column
|
||||||
anchors.right: bedTargetTemperature.left
|
anchors.right: bedTargetTemperature.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
|
MouseArea //For tooltip.
|
||||||
|
{
|
||||||
|
id: bedTemperatureTooltipArea
|
||||||
|
hoverEnabled: true
|
||||||
|
anchors.fill: parent
|
||||||
|
onHoveredChanged:
|
||||||
|
{
|
||||||
|
if (containsMouse)
|
||||||
|
{
|
||||||
|
base.showTooltip(
|
||||||
|
base,
|
||||||
|
{x: 0, y: bedCurrentTemperature.mapToItem(base, 0, -parent.height / 4).y},
|
||||||
|
catalog.i18nc("@tooltip", "The current temperature of the heated bed.")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
base.hideTooltip();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Rectangle //Input field for pre-heat temperature.
|
Rectangle //Input field for pre-heat temperature.
|
||||||
{
|
{
|
||||||
id: preheatTemperatureControl
|
id: preheatTemperatureControl
|
||||||
color: UM.Theme.getColor("setting_validation_ok")
|
color: !enabled ? UM.Theme.getColor("setting_control_disabled") : UM.Theme.getColor("setting_validation_ok")
|
||||||
|
enabled:
|
||||||
|
{
|
||||||
|
if (connectedPrinter == null)
|
||||||
|
{
|
||||||
|
return false; //Can't preheat if not connected.
|
||||||
|
}
|
||||||
|
if (!connectedPrinter.acceptsCommands)
|
||||||
|
{
|
||||||
|
return false; //Not allowed to do anything.
|
||||||
|
}
|
||||||
|
if (connectedPrinter.jobState == "printing" || connectedPrinter.jobState == "pre_print" || connectedPrinter.jobState == "resuming" || connectedPrinter.jobState == "pausing" || connectedPrinter.jobState == "paused" || connectedPrinter.jobState == "error" || connectedPrinter.jobState == "offline")
|
||||||
|
{
|
||||||
|
return false; //Printer is in a state where it can't react to pre-heating.
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
border.width: UM.Theme.getSize("default_lining").width
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
border.color: mouseArea.containsMouse ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border")
|
border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : preheatTemperatureInputMouseArea.containsMouse ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border")
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
|
@ -214,52 +364,55 @@ Column
|
||||||
}
|
}
|
||||||
MouseArea //Change cursor on hovering.
|
MouseArea //Change cursor on hovering.
|
||||||
{
|
{
|
||||||
id: mouseArea
|
id: preheatTemperatureInputMouseArea
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
cursorShape: Qt.IBeamCursor
|
cursorShape: Qt.IBeamCursor
|
||||||
|
|
||||||
|
onHoveredChanged:
|
||||||
|
{
|
||||||
|
if (containsMouse)
|
||||||
|
{
|
||||||
|
base.showTooltip(
|
||||||
|
base,
|
||||||
|
{x: 0, y: preheatTemperatureInputMouseArea.mapToItem(base, 0, 0).y},
|
||||||
|
catalog.i18nc("@tooltip of temperature input", "The temperature to pre-heat the bed to.")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
base.hideTooltip();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
TextInput
|
TextInput
|
||||||
{
|
{
|
||||||
id: preheatTemperatureInput
|
id: preheatTemperatureInput
|
||||||
font: UM.Theme.getFont("default")
|
font: UM.Theme.getFont("default")
|
||||||
color: UM.Theme.getColor("setting_control_text")
|
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text")
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
maximumLength: 10
|
maximumLength: 10
|
||||||
|
enabled: parent.enabled
|
||||||
validator: RegExpValidator { regExp: /^-?[0-9]{0,9}[.,]?[0-9]{0,10}$/ } //Floating point regex.
|
validator: RegExpValidator { regExp: /^-?[0-9]{0,9}[.,]?[0-9]{0,10}$/ } //Floating point regex.
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width
|
anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
Binding
|
Component.onCompleted:
|
||||||
{
|
{
|
||||||
target: preheatTemperatureInput
|
|
||||||
property: "text"
|
|
||||||
value:
|
|
||||||
{
|
|
||||||
// Stacklevels
|
|
||||||
// 0: user -> unsaved change
|
|
||||||
// 1: quality changes -> saved change
|
|
||||||
// 2: quality
|
|
||||||
// 3: material -> user changed material in materialspage
|
|
||||||
// 4: variant
|
|
||||||
// 5: machine_changes
|
|
||||||
// 6: machine
|
|
||||||
if ((bedTemperature.resolve != "None" && bedTemperature.resolve) && (bedTemperature.stackLevels[0] != 0) && (bedTemperature.stackLevels[0] != 1))
|
if ((bedTemperature.resolve != "None" && bedTemperature.resolve) && (bedTemperature.stackLevels[0] != 0) && (bedTemperature.stackLevels[0] != 1))
|
||||||
{
|
{
|
||||||
// We have a resolve function. Indicates that the setting is not settable per extruder and that
|
// We have a resolve function. Indicates that the setting is not settable per extruder and that
|
||||||
// we have to choose between the resolved value (default) and the global value
|
// we have to choose between the resolved value (default) and the global value
|
||||||
// (if user has explicitly set this).
|
// (if user has explicitly set this).
|
||||||
return bedTemperature.resolve;
|
text = bedTemperature.resolve;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return bedTemperature.properties.value;
|
text = bedTemperature.properties.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
when: !preheatTemperatureInput.activeFocus
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,39 +433,30 @@ Column
|
||||||
|
|
||||||
Timer
|
Timer
|
||||||
{
|
{
|
||||||
id: preheatCountdownTimer
|
id: preheatUpdateTimer
|
||||||
interval: 100 //Update every 100ms. You want to update every 1s, but then you have one timer for the updating running out of sync with the actual date timer and you might skip seconds.
|
interval: 100 //Update every 100ms. You want to update every 1s, but then you have one timer for the updating running out of sync with the actual date timer and you might skip seconds.
|
||||||
running: false
|
running: connectedPrinter != null && connectedPrinter.preheatBedRemainingTime != ""
|
||||||
repeat: true
|
repeat: true
|
||||||
onTriggered: update()
|
onTriggered: update()
|
||||||
property var endTime: new Date() //Set initial endTime to be the current date, so that the endTime has initially already passed and the timer text becomes invisible if you were to update.
|
property var endTime: new Date() //Set initial endTime to be the current date, so that the endTime has initially already passed and the timer text becomes invisible if you were to update.
|
||||||
function update()
|
function update()
|
||||||
{
|
{
|
||||||
var now = new Date();
|
preheatCountdown.text = ""
|
||||||
if (now.getTime() < endTime.getTime())
|
|
||||||
{
|
|
||||||
var remaining = endTime - now; //This is in milliseconds.
|
|
||||||
var minutes = Math.floor(remaining / 60 / 1000);
|
|
||||||
var seconds = Math.floor((remaining / 1000) % 60);
|
|
||||||
preheatCountdown.text = minutes + ":" + (seconds < 10 ? "0" + seconds : seconds);
|
|
||||||
preheatCountdown.visible = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
preheatCountdown.visible = false;
|
|
||||||
running = false;
|
|
||||||
if (connectedPrinter != null)
|
if (connectedPrinter != null)
|
||||||
{
|
{
|
||||||
connectedPrinter.cancelPreheatBed()
|
preheatCountdown.text = connectedPrinter.preheatBedRemainingTime;
|
||||||
}
|
}
|
||||||
|
if (preheatCountdown.text == "") //Either time elapsed or not connected.
|
||||||
|
{
|
||||||
|
stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
id: preheatCountdown
|
id: preheatCountdown
|
||||||
text: "0:00"
|
text: connectedPrinter != null ? connectedPrinter.preheatBedRemainingTime : ""
|
||||||
visible: false //It only becomes visible when the timer is running.
|
visible: text != "" //Has no direct effect, but just so that we can link visibility of clock icon to visibility of the countdown text.
|
||||||
font: UM.Theme.getFont("default")
|
font: UM.Theme.getFont("default")
|
||||||
color: UM.Theme.getColor("text")
|
color: UM.Theme.getColor("text")
|
||||||
anchors.right: preheatButton.left
|
anchors.right: preheatButton.left
|
||||||
|
@ -326,19 +470,11 @@ Column
|
||||||
height: UM.Theme.getSize("setting_control").height
|
height: UM.Theme.getSize("setting_control").height
|
||||||
enabled:
|
enabled:
|
||||||
{
|
{
|
||||||
if (connectedPrinter == null)
|
if (!preheatTemperatureControl.enabled)
|
||||||
{
|
{
|
||||||
return false; //Can't preheat if not connected.
|
return false; //Not connected, not authenticated or printer is busy.
|
||||||
}
|
}
|
||||||
if (!connectedPrinter.acceptsCommands)
|
if (preheatUpdateTimer.running)
|
||||||
{
|
|
||||||
return false; //Not allowed to do anything.
|
|
||||||
}
|
|
||||||
if (connectedPrinter.jobState == "printing" || connectedPrinter.jobState == "pre_print" || connectedPrinter.jobState == "resuming" || connectedPrinter.jobState == "error" || connectedPrinter.jobState == "offline")
|
|
||||||
{
|
|
||||||
return false; //Printer is in a state where it can't react to pre-heating.
|
|
||||||
}
|
|
||||||
if (preheatCountdownTimer.running)
|
|
||||||
{
|
{
|
||||||
return true; //Can always cancel if the timer is running.
|
return true; //Can always cancel if the timer is running.
|
||||||
}
|
}
|
||||||
|
@ -350,6 +486,10 @@ Column
|
||||||
{
|
{
|
||||||
return false; //Target temperature too high.
|
return false; //Target temperature too high.
|
||||||
}
|
}
|
||||||
|
if (parseInt(preheatTemperatureInput.text) == 0)
|
||||||
|
{
|
||||||
|
return false; //Setting the temperature to 0 is not allowed (since that cancels the pre-heating).
|
||||||
|
}
|
||||||
return true; //Preconditions are met.
|
return true; //Preconditions are met.
|
||||||
}
|
}
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
@ -430,28 +570,23 @@ Column
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
font: UM.Theme.getFont("action_button")
|
font: UM.Theme.getFont("action_button")
|
||||||
text: preheatCountdownTimer.running ? catalog.i18nc("@button Cancel pre-heating", "Cancel") : catalog.i18nc("@button", "Pre-heat")
|
text: preheatUpdateTimer.running ? catalog.i18nc("@button Cancel pre-heating", "Cancel") : catalog.i18nc("@button", "Pre-heat")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
if (!preheatCountdownTimer.running)
|
if (!preheatUpdateTimer.running)
|
||||||
{
|
{
|
||||||
connectedPrinter.preheatBed(preheatTemperatureInput.text, connectedPrinter.preheatBedTimeout);
|
connectedPrinter.preheatBed(preheatTemperatureInput.text, connectedPrinter.preheatBedTimeout);
|
||||||
var now = new Date();
|
preheatUpdateTimer.start();
|
||||||
var end_time = new Date();
|
preheatUpdateTimer.update(); //Update once before the first timer is triggered.
|
||||||
end_time.setTime(now.getTime() + connectedPrinter.preheatBedTimeout * 1000); //*1000 because time is in milliseconds here.
|
|
||||||
preheatCountdownTimer.endTime = end_time;
|
|
||||||
preheatCountdownTimer.start();
|
|
||||||
preheatCountdownTimer.update(); //Update once before the first timer is triggered.
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
connectedPrinter.cancelPreheatBed();
|
connectedPrinter.cancelPreheatBed();
|
||||||
preheatCountdownTimer.endTime = new Date();
|
preheatUpdateTimer.update();
|
||||||
preheatCountdownTimer.update();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,10 @@ Item {
|
||||||
|
|
||||||
property real progress: UM.Backend.progress;
|
property real progress: UM.Backend.progress;
|
||||||
property int backendState: UM.Backend.state;
|
property int backendState: UM.Backend.state;
|
||||||
|
|
||||||
property var backend: CuraApplication.getBackend();
|
property var backend: CuraApplication.getBackend();
|
||||||
property bool activity: Printer.getPlatformActivity;
|
property bool activity: Printer.platformActivity;
|
||||||
|
|
||||||
property int totalHeight: childrenRect.height + UM.Theme.getSize("default_margin").height
|
property int totalHeight: childrenRect.height + UM.Theme.getSize("default_margin").height
|
||||||
property string fileBaseName
|
property string fileBaseName
|
||||||
property string statusText:
|
property string statusText:
|
||||||
|
|
|
@ -398,7 +398,7 @@ Item
|
||||||
style: UM.Theme.styles.checkbox;
|
style: UM.Theme.styles.checkbox;
|
||||||
enabled: base.settingsEnabled
|
enabled: base.settingsEnabled
|
||||||
|
|
||||||
checked: platformAdhesionType.properties.value != "skirt"
|
checked: platformAdhesionType.properties.value != "skirt" && platformAdhesionType.properties.value != "none"
|
||||||
|
|
||||||
MouseArea
|
MouseArea
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue