Solved merge conflicts. CURA-3214

This commit is contained in:
Jack Ha 2017-02-21 11:01:20 +01:00
commit 057dc2fd7d
27 changed files with 50293 additions and 588 deletions

View file

@ -241,7 +241,6 @@ class CuraApplication(QtApplication):
Preferences.getInstance().addPreference("mesh/scale_tiny_meshes", True)
Preferences.getInstance().addPreference("cura/dialog_on_project_save", True)
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/material_settings", "{}")
@ -712,7 +711,7 @@ class CuraApplication(QtApplication):
sceneBoundingBoxChanged = pyqtSignal()
@pyqtProperty(bool, notify = activityChanged)
def getPlatformActivity(self):
def platformActivity(self):
return self._platform_activity
@pyqtProperty(str, notify = sceneBoundingBoxChanged)

View file

@ -63,7 +63,7 @@ class LayerDataBuilder(MeshBuilder):
line_dimensions = numpy.empty((vertex_count, 2), numpy.float32)
colors = numpy.empty((vertex_count, 4), numpy.float32)
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)
vertex_offset = 0
@ -95,7 +95,7 @@ class LayerDataBuilder(MeshBuilder):
"extruders": {
"value": extruders,
"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": {
"value": material_colors,

View file

@ -3,12 +3,11 @@
from UM.i18n import i18nCatalog
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 enum import IntEnum # For the connection state tracking.
from UM.Settings.ContainerRegistry import ContainerRegistry
from enum import IntEnum # For the connection state tracking.
from UM.Logger import Logger
from UM.Signal import signalemitter
@ -49,6 +48,9 @@ class PrinterOutputDevice(QObject, OutputDevice):
self._error_text = ""
self._accepts_commands = True
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_type = "unknown"
@ -106,6 +108,9 @@ class PrinterOutputDevice(QObject, OutputDevice):
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)
def printerType(self):
return self._printer_type
@ -214,13 +219,26 @@ class PrinterOutputDevice(QObject, OutputDevice):
self._target_bed_temperature = temperature
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.
@pyqtProperty(int)
@pyqtProperty(int, constant = True)
def preheatBedTimeout(self):
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.
# Note that timeTotal - timeElapsed should give time remaining.
@pyqtProperty(float, notify = timeElapsedChanged)
@ -400,10 +418,14 @@ class PrinterOutputDevice(QObject, OutputDevice):
# /param index Index of the extruder
# /param hotend_id id of the hotend
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))
self._hotend_ids[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
# NB: the UX needs to be implemented by the plugin

View file

@ -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.
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):
super().__init__(parent = parent, *args, **kwargs)
material_settings = set([
material_settings = {
"default_material_print_temperature",
"material_bed_temperature",
"material_standby_temperature",
"cool_fan_speed",
"retraction_amount",
"retraction_speed",
])
}
self.setVisible(material_settings)

View file

@ -182,7 +182,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
self._dialog.setMachineType(machine_type)
self._dialog.setExtruders(extruders)
self._dialog.setVariantType(variant_type_name)
self._dialog.setHasObjectsOnPlate(Application.getInstance().getPlatformActivity)
self._dialog.setHasObjectsOnPlate(Application.getInstance().platformActivity)
self._dialog.show()
# Block until the dialog is closed.

View file

@ -177,7 +177,7 @@ class ThreeMFWriter(MeshWriter):
transformation_matrix._data[2, 1] = 1
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
# build volume.
if global_container_stack:

View file

@ -253,7 +253,7 @@ class CuraEngineBackend(QObject, Backend):
return
if job.getResult() == StartSliceJob.StartJobResult.MaterialIncompatible:
if Application.getInstance().getPlatformActivity:
if Application.getInstance().platformActivity:
self._error_message = Message(catalog.i18nc("@info:status",
"The selected material is incompatible with the selected machine or configuration."))
self._error_message.show()
@ -263,7 +263,7 @@ class CuraEngineBackend(QObject, Backend):
return
if job.getResult() == StartSliceJob.StartJobResult.SettingError:
if Application.getInstance().getPlatformActivity:
if Application.getInstance().platformActivity:
extruders = list(ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId()))
error_keys = []
for extruder in extruders:
@ -284,7 +284,7 @@ class CuraEngineBackend(QObject, Backend):
return
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.show()
self.backendStateChange.emit(BackendState.Error)
@ -292,7 +292,7 @@ class CuraEngineBackend(QObject, Backend):
self.backendStateChange.emit(BackendState.NotStarted)
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.show()
self.backendStateChange.emit(BackendState.Error)

View file

@ -48,8 +48,7 @@ class LayerPass(RenderPass):
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_show_travel_moves", self._layer_view.getShowTravelMoves())
self._layer_shader.setUniformValue("u_show_support", self._layer_view.getShowSupport())
self._layer_shader.setUniformValue("u_show_adhesion", self._layer_view.getShowAdhesion())
self._layer_shader.setUniformValue("u_show_helpers", self._layer_view.getShowHelpers())
self._layer_shader.setUniformValue("u_show_skin", self._layer_view.getShowSkin())
self._layer_shader.setUniformValue("u_show_infill", self._layer_view.getShowInfill())
else:
@ -57,8 +56,7 @@ class LayerPass(RenderPass):
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_show_travel_moves", 0)
self._layer_shader.setUniformValue("u_show_support", 1)
self._layer_shader.setUniformValue("u_show_adhesion", 1)
self._layer_shader.setUniformValue("u_show_helpers", 1)
self._layer_shader.setUniformValue("u_show_skin", 1)
self._layer_shader.setUniformValue("u_show_infill", 1)

View file

@ -70,8 +70,21 @@ class LayerView(View):
Preferences.getInstance().addPreference("view/top_layer_count", 5)
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)
self._updateWithPreferences()
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"))
@ -84,8 +97,7 @@ class LayerView(View):
self._extruder_count = 0
self._extruder_opacity = [1.0, 1.0, 1.0, 1.0]
self._show_travel_moves = 0
self._show_support = 1
self._show_adhesion = 1
self._show_helpers = 1
self._show_skin = 1
self._show_infill = 1
@ -197,19 +209,12 @@ class LayerView(View):
def getShowTravelMoves(self):
return self._show_travel_moves
def setShowSupport(self, show):
self._show_support = show
def setShowHelpers(self, show):
self._show_helpers = show
self.currentLayerNumChanged.emit()
def getShowSupport(self):
return self._show_support
def setShowAdhesion(self, show):
self._show_adhesion = show
self.currentLayerNumChanged.emit()
def getShowAdhesion(self):
return self._show_adhesion
def getShowHelpers(self):
return self._show_helpers
def setShowSkin(self, show):
self._show_skin = show
@ -311,7 +316,7 @@ class LayerView(View):
self._old_composite_shader = self._composite_pass.getCompositeShader()
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()
elif event.type == Event.ViewDeactivateEvent:
@ -370,18 +375,46 @@ class LayerView(View):
self._top_layers_job = None
def _onPreferencesChanged(self, preference):
if preference not in {"view/top_layer_count", "view/only_show_top_layers", "view/force_layer_view_compatibility_mode"}:
return
def _updateWithPreferences(self):
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._compatibility_mode = OpenGLContext.isLegacyOpenGL() or bool(
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.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):
if self._legend_items is None:
theme = Application.getInstance().getTheme()

View file

@ -75,7 +75,7 @@ Item
border.color: UM.Theme.getColor("slider_groove_border")
color: UM.Theme.getColor("tool_panel_background")
visible: UM.LayerView.getLayerActivity && Printer.getPlatformActivity ? true : false
visible: UM.LayerView.layerActivity && Printer.platformActivity ? true : false
TextField
{
@ -161,11 +161,11 @@ Item
{
id: layerViewTypes
ListElement {
text: "Material color"
text: "Material Color"
type_id: 0
}
ListElement {
text: "Line type"
text: "Line Type"
type_id: 1 // these ids match the switching in the shader
}
}
@ -177,19 +177,27 @@ Item
anchors.left: parent.left
model: layerViewTypes
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: {
// Combobox selection
var type_id = layerViewTypes.get(index).type_id;
UM.LayerView.setLayerViewType(type_id);
if (type_id == 1) {
UM.Preferences.setValue("layerview/layer_view_type", type_id);
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
UM.LayerView.enableLegend();
} else {
UM.LayerView.disableLegend();
}
}
onModelChanged: {
currentIndex = UM.LayerView.getLayerViewType();
}
}
Label
@ -197,86 +205,106 @@ Item
id: compatibilityModeLabel
anchors.top: parent.top
anchors.left: parent.left
text: catalog.i18nc("@label","Compatibility mode")
text: catalog.i18nc("@label","Compatibility Mode")
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 {
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.topMargin: UM.Theme.getSize("default_margin").height
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
CheckBox {
checked: true
checked: view_settings.extruder0_checked
onClicked: {
UM.LayerView.setExtruderOpacity(0, checked ? 1.0 : 0.0);
UM.Preferences.setValue("layerview/extruder0_opacity", checked ? 1.0 : 0.0);
}
text: "Extruder 1"
visible: !UM.LayerView.compatibilityMode && (UM.LayerView.getExtruderCount >= 1)
visible: !UM.LayerView.compatibilityMode && (UM.LayerView.extruderCount >= 1)
}
CheckBox {
checked: true
checked: view_settings.extruder1_checked
onClicked: {
UM.LayerView.setExtruderOpacity(1, checked ? 1.0 : 0.0);
UM.Preferences.setValue("layerview/extruder1_opacity", checked ? 1.0 : 0.0);
}
text: "Extruder 2"
visible: !UM.LayerView.compatibilityMode && (UM.LayerView.getExtruderCount >= 2)
visible: !UM.LayerView.compatibilityMode && (UM.LayerView.extruderCount >= 2)
}
CheckBox {
checked: true
checked: view_settings.extruder2_checked
onClicked: {
UM.LayerView.setExtruderOpacity(2, checked ? 1.0 : 0.0);
UM.Preferences.setValue("layerview/extruder2_opacity", checked ? 1.0 : 0.0);
}
text: "Extruder 3"
visible: !UM.LayerView.compatibilityMode && (UM.LayerView.getExtruderCount >= 3)
visible: !UM.LayerView.compatibilityMode && (UM.LayerView.etruderCount >= 3)
}
CheckBox {
checked: true
checked: view_settings.extruder3_checked
onClicked: {
UM.LayerView.setExtruderOpacity(3, checked ? 1.0 : 0.0);
UM.Preferences.setValue("layerview/extruder3_opacity", checked ? 1.0 : 0.0);
}
text: "Extruder 4"
visible: !UM.LayerView.compatibilityMode && (UM.LayerView.getExtruderCount >= 4)
visible: !UM.LayerView.compatibilityMode && (UM.LayerView.extruderCount >= 4)
}
Label {
text: "Other extruders always visible"
visible: !UM.LayerView.compatibilityMode && (UM.LayerView.getExtruderCount >= 5)
visible: !UM.LayerView.compatibilityMode && (UM.LayerView.extruderCount >= 5)
}
CheckBox {
checked: view_settings.show_travel_moves
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 {
checked: true
checked: view_settings.show_helpers
onClicked: {
UM.LayerView.setShowSupport(checked ? 1 : 0);
UM.Preferences.setValue("layerview/show_helpers", checked);
}
text: "Show support"
text: catalog.i18nc("@label", "Show Helpers")
}
CheckBox {
checked: true
checked: view_settings.show_skin
onClicked: {
UM.LayerView.setShowAdhesion(checked ? 1 : 0);
UM.Preferences.setValue("layerview/show_skin", checked);
}
text: "Show adhesion"
text: catalog.i18nc("@label", "Show Shell")
}
CheckBox {
checked: true
checked: view_settings.show_infill
onClicked: {
UM.LayerView.setShowSkin(checked ? 1 : 0);
UM.Preferences.setValue("layerview/show_infill", checked);
}
text: "Show skin"
}
CheckBox {
checked: true
onClicked: {
UM.LayerView.setShowInfill(checked ? 1 : 0);
}
text: "Show infill"
text: catalog.i18nc("@label", "Show Infill")
}
}
}

View file

@ -20,7 +20,7 @@ class LayerViewProxy(QObject):
preferencesChanged = pyqtSignal()
@pyqtProperty(bool, notify = activityChanged)
def getLayerActivity(self):
def layerActivity(self):
active_view = self._controller.getActiveView()
if type(active_view) == LayerView.LayerView.LayerView:
return active_view.getActivity()
@ -79,7 +79,7 @@ class LayerViewProxy(QObject):
if type(active_view) == LayerView.LayerView.LayerView:
active_view.setLayerViewType(layer_view_type)
@pyqtProperty(bool)
@pyqtSlot(result = int)
def getLayerViewType(self):
active_view = self._controller.getActiveView()
if type(active_view) == LayerView.LayerView.LayerView:
@ -100,16 +100,10 @@ class LayerViewProxy(QObject):
active_view.setShowTravelMoves(show)
@pyqtSlot(int)
def setShowSupport(self, show):
def setShowHelpers(self, show):
active_view = self._controller.getActiveView()
if type(active_view) == LayerView.LayerView.LayerView:
active_view.setShowSupport(show)
@pyqtSlot(int)
def setShowAdhesion(self, show):
active_view = self._controller.getActiveView()
if type(active_view) == LayerView.LayerView.LayerView:
active_view.setShowAdhesion(show)
active_view.setShowHelpers(show)
@pyqtSlot(int)
def setShowSkin(self, show):
@ -124,7 +118,7 @@ class LayerViewProxy(QObject):
active_view.setShowInfill(show)
@pyqtProperty(int, notify = globalStackChanged)
def getExtruderCount(self):
def extruderCount(self):
active_view = self._controller.getActiveView()
if type(active_view) == LayerView.LayerView.LayerView:
return active_view.getExtruderCount()

View file

@ -32,8 +32,7 @@ fragment =
varying float v_line_type;
uniform int u_show_travel_moves;
uniform int u_show_support;
uniform int u_show_adhesion;
uniform int u_show_helpers;
uniform int u_show_skin;
uniform int u_show_infill;
@ -43,11 +42,12 @@ fragment =
// discard movements
discard;
}
// support: 4, 7, 10
if ((u_show_support == 0) && (
// support: 4, 5, 7, 10
if ((u_show_helpers == 0) && (
((v_line_type >= 3.5) && (v_line_type <= 4.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;
}
@ -57,11 +57,6 @@ fragment =
)) {
discard;
}
// adhesion:
if ((u_show_adhesion == 0) && (v_line_type >= 4.5) && (v_line_type <= 5.5)) {
// discard movements
discard;
}
// infill:
if ((u_show_infill == 0) && (v_line_type >= 5.5) && (v_line_type <= 6.5)) {
// discard movements
@ -105,8 +100,7 @@ fragment41core =
out vec4 frag_color;
uniform int u_show_travel_moves;
uniform int u_show_support;
uniform int u_show_adhesion;
uniform int u_show_helpers;
uniform int u_show_skin;
uniform int u_show_infill;
@ -116,11 +110,12 @@ fragment41core =
// discard movements
discard;
}
// support: 4, 7, 10
if ((u_show_support == 0) && (
// helpers: 4, 5, 7, 10
if ((u_show_helpers == 0) && (
((v_line_type >= 3.5) && (v_line_type <= 4.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;
}
@ -130,11 +125,6 @@ fragment41core =
)) {
discard;
}
// adhesion:
if ((u_show_adhesion == 0) && (v_line_type >= 4.5) && (v_line_type <= 5.5)) {
// discard movements
discard;
}
// infill:
if ((u_show_infill == 0) && (v_line_type >= 5.5) && (v_line_type <= 6.5)) {
// discard movements
@ -151,8 +141,7 @@ u_layer_view_type = 0
u_extruder_opacity = [1.0, 1.0, 1.0, 1.0]
u_show_travel_moves = 0
u_show_support = 1
u_show_adhesion = 1
u_show_helpers = 1
u_show_skin = 1
u_show_infill = 1

View file

@ -68,8 +68,7 @@ geometry41core =
uniform highp mat4 u_viewProjectionMatrix;
uniform int u_show_travel_moves;
uniform int u_show_support;
uniform int u_show_adhesion;
uniform int u_show_helpers;
uniform int u_show_skin;
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))) {
return;
}
if ((u_show_support == 0) && ((v_line_type[0] == 4) || (v_line_type[0] == 7) || (v_line_type[0] == 10))) {
return;
}
if ((u_show_adhesion == 0) && (v_line_type[0] == 5)) {
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_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)) {
// fixed size for movements
size_x = 0.1;
size_y = 0.1;
size_x = 0.2;
} else {
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_normal_horz_head = normalize(vec3(-g_vertex_delta.x, -g_vertex_delta.y, -g_vertex_delta.z));
@ -149,48 +144,62 @@ geometry41core =
g_vertex_normal_vert = vec3(0.0, 1.0, 0.0);
g_vertex_offset_vert = vec4(g_vertex_normal_vert * size_y, 0.0);
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[0], v_color[0], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position + 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_vert));
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[0], v_color[0], -g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position - 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_vert));
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));
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();
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[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[1], v_color[1], g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[1].gl_Position + g_vertex_offset_vert));
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[0], v_color[0], -g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position - 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_vert));
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));
// left side
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_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_vert));
myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_horz_head, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz_head));
myEmitVertex(v_vertex[0], v_color[0], -g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[0].gl_Position - g_vertex_offset_horz));
EndPrimitive();
EndPrimitive();
// left side
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_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_vert));
myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_horz_head, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz_head));
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[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_horz_head, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz_head));
myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz));
EndPrimitive();
EndPrimitive();
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_vert, u_viewProjectionMatrix * (gl_in[0].gl_Position - g_vertex_offset_vert));
myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_horz_head, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz_head));
myEmitVertex(v_vertex[0], v_color[0], g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[0].gl_Position + g_vertex_offset_horz));
// right side
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_vert, u_viewProjectionMatrix * (gl_in[1].gl_Position + g_vertex_offset_vert));
myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_horz_head, u_viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_horz_head));
myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_horz));
EndPrimitive();
EndPrimitive();
// right side
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_vert, u_viewProjectionMatrix * (gl_in[1].gl_Position + g_vertex_offset_vert));
myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_horz_head, u_viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_horz_head));
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[1], v_color[1], -g_vertex_normal_vert, u_viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_vert));
myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_horz_head, u_viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_horz_head));
myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[1].gl_Position + g_vertex_offset_horz));
EndPrimitive();
EndPrimitive();
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_vert, u_viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_vert));
myEmitVertex(v_vertex[1], v_color[1], -g_vertex_normal_horz_head, u_viewProjectionMatrix * (gl_in[1].gl_Position - g_vertex_offset_horz_head));
myEmitVertex(v_vertex[1], v_color[1], g_vertex_normal_horz, u_viewProjectionMatrix * (gl_in[1].gl_Position + g_vertex_offset_horz));
EndPrimitive();
}
}
fragment41core =
@ -234,8 +243,7 @@ u_diffuseColor = [1.0, 0.79, 0.14, 1.0]
u_shininess = 20.0
u_show_travel_moves = 0
u_show_support = 1
u_show_adhesion = 1
u_show_helpers = 1
u_show_skin = 1
u_show_infill = 1

View file

@ -259,16 +259,23 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
data = """{"temperature": "%i", "timeout": "%i"}""" % (temperature, duration)
else:
data = """{"temperature": "%i"}""" % temperature
Logger.log("i", "Pre-heating bed to %i degrees.", temperature)
put_request = QNetworkRequest(url)
put_request.setHeader(QNetworkRequest.ContentTypeHeader, "application/json")
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.
#
# If the bed is not pre-heated, nothing happens.
@pyqtSlot()
def cancelPreheatBed(self):
Logger.log("i", "Cancelling pre-heating of the bed.")
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.
#
@ -616,7 +623,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
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.
extruder_manager = cura.Settings.ExtruderManager.getInstance()
extruder_manager = cura.Settings.ExtruderManager.ExtruderManager.getInstance()
if print_information.materialLengths[index] != 0:
variant = extruder_manager.getExtruderStack(index).findContainer({"type": "variant"})
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.
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))))
## Request a authentication key from the printer so we can be authenticated

View file

@ -650,11 +650,15 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
# ignored because there is no g-code to set this.
@pyqtSlot(float, float)
def preheatBed(self, temperature, duration):
Logger.log("i", "Pre-heating the bed to %i degrees.", temperature)
self._setTargetBedTemperature(temperature)
self.preheatBedRemainingTimeChanged.emit()
## Cancels pre-heating the heated bed of the printer.
#
# If the bed is not pre-heated, nothing happens.
@pyqtSlot()
def cancelPreheatBed(self):
Logger.log("i", "Cancelling pre-heating of the bed.")
self._setTargetBedTemperature(0)
self.preheatBedRemainingTimeChanged.emit()

View file

@ -1278,7 +1278,7 @@
"material_print_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",
"type": "float",
"default_value": 210,
@ -1365,7 +1365,7 @@
"material_bed_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",
"type": "float",
"resolve": "max(extruderValues('material_bed_temperature'))",

View 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"
}
}
}

View 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}
}
}

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -73,68 +73,76 @@ UM.Dialog
anchors.topMargin: UM.Theme.getSize("default_margin").height
}
ListView
ScrollView
{
id: projectsList
anchors.top: creditsNotes.bottom
anchors.topMargin: 10
anchors.topMargin: UM.Theme.getSize("default_margin").height
width: parent.width
height: childrenRect.height
height: base.height - y - (2 * UM.Theme.getSize("default_margin").height + closeButton.height)
delegate: Row
ListView
{
Label
{
text: "<a href='%1' title='%2'>%2</a>".arg(model.url).arg(model.name)
width: projectsList.width * 0.25
elide: Text.ElideRight
onLinkActivated: Qt.openUrlExternally(link)
}
Label
{
text: model.description
elide: Text.ElideRight
width: projectsList.width * 0.6
}
Label
{
text: model.license
elide: Text.ElideRight
width: projectsList.width * 0.15
}
}
model: ListModel
{
id: projectsModel
}
Component.onCompleted:
{
projectsModel.append({ name:"Cura", description: catalog.i18nc("@label", "Graphical user interface"), license: "AGPLv3", url: "https://github.com/Ultimaker/Cura" });
projectsModel.append({ name:"Uranium", description: catalog.i18nc("@label", "Application framework"), license: "AGPLv3", url: "https://github.com/Ultimaker/Uranium" });
projectsModel.append({ name:"CuraEngine", description: catalog.i18nc("@label", "GCode generator"), license: "AGPLv3", url: "https://github.com/Ultimaker/CuraEngine" });
projectsModel.append({ name:"libArcus", description: catalog.i18nc("@label", "Interprocess communication library"), license: "AGPLv3", url: "https://github.com/Ultimaker/libArcus" });
id: projectsList
projectsModel.append({ name:"Python", description: catalog.i18nc("@label", "Programming language"), license: "Python", url: "http://python.org/" });
projectsModel.append({ name:"Qt5", description: catalog.i18nc("@label", "GUI framework"), license: "LGPLv3", url: "https://www.qt.io/" });
projectsModel.append({ name:"PyQt", description: catalog.i18nc("@label", "GUI framework bindings"), license: "GPL", url: "https://riverbankcomputing.com/software/pyqt" });
projectsModel.append({ name:"SIP", description: catalog.i18nc("@label", "C/C++ Binding library"), license: "GPL", url: "https://riverbankcomputing.com/software/sip" });
projectsModel.append({ name:"Protobuf", description: catalog.i18nc("@label", "Data interchange format"), license: "BSD", url: "https://developers.google.com/protocol-buffers" });
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-STL", description: catalog.i18nc("@label", "Support library for handling STL files"), license: "BSD", url: "https://github.com/WoLpH/numpy-stl" });
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:"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:"Font-Awesome-SVG-PNG", description: catalog.i18nc("@label", "SVG icons"), license: "SIL OFL 1.1", url: "https://github.com/encharm/Font-Awesome-SVG-PNG" });
width: parent.width
delegate: Row
{
Label
{
text: "<a href='%1' title='%2'>%2</a>".arg(model.url).arg(model.name)
width: (projectsList.width * 0.25) | 0
elide: Text.ElideRight
onLinkActivated: Qt.openUrlExternally(link)
}
Label
{
text: model.description
elide: Text.ElideRight
width: (projectsList.width * 0.6) | 0
}
Label
{
text: model.license
elide: Text.ElideRight
width: (projectsList.width * 0.15) | 0
}
}
model: ListModel
{
id: projectsModel
}
Component.onCompleted:
{
projectsModel.append({ name:"Cura", description: catalog.i18nc("@label", "Graphical user interface"), license: "AGPLv3", url: "https://github.com/Ultimaker/Cura" });
projectsModel.append({ name:"Uranium", description: catalog.i18nc("@label", "Application framework"), license: "AGPLv3", url: "https://github.com/Ultimaker/Uranium" });
projectsModel.append({ name:"CuraEngine", description: catalog.i18nc("@label", "GCode generator"), license: "AGPLv3", url: "https://github.com/Ultimaker/CuraEngine" });
projectsModel.append({ name:"libArcus", description: catalog.i18nc("@label", "Interprocess communication library"), license: "AGPLv3", url: "https://github.com/Ultimaker/libArcus" });
projectsModel.append({ name:"Python", description: catalog.i18nc("@label", "Programming language"), license: "Python", url: "http://python.org/" });
projectsModel.append({ name:"Qt5", description: catalog.i18nc("@label", "GUI framework"), license: "LGPLv3", url: "https://www.qt.io/" });
projectsModel.append({ name:"PyQt", description: catalog.i18nc("@label", "GUI framework bindings"), license: "GPL", url: "https://riverbankcomputing.com/software/pyqt" });
projectsModel.append({ name:"SIP", description: catalog.i18nc("@label", "C/C++ Binding library"), license: "GPL", url: "https://riverbankcomputing.com/software/sip" });
projectsModel.append({ name:"Protobuf", description: catalog.i18nc("@label", "Data interchange format"), license: "BSD", url: "https://developers.google.com/protocol-buffers" });
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-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:"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:"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" });
}
}
}
rightButtons: Button
{
//: Close about dialog button
id: closeButton
text: catalog.i18nc("@action:button","Close");
onClicked: base.visible = false;

View file

@ -12,7 +12,7 @@ import Cura 1.0 as Cura
Item {
id: base
property bool activity: Printer.getPlatformActivity
property bool activity: Printer.platformActivity
property string fileBaseName
property variant activeMachineName: Cura.MachineManager.activeMachineName

View file

@ -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 string fileBaseName
property string statusText:

View file

@ -58,362 +58,368 @@ UM.PreferencesPage
}
}
Column
ScrollView
{
//: Model used to check if a plugin exists
UM.PluginsModel { id: plugins }
width: parent.width
height: parent.height
//: Language selection label
UM.I18nCatalog{id: catalog; name:"cura"}
Label
Column
{
font.bold: true
text: catalog.i18nc("@label","Interface")
}
//: Model used to check if a plugin exists
UM.PluginsModel { id: plugins }
//: Language selection label
UM.I18nCatalog{id: catalog; name:"cura"}
Row
{
spacing: UM.Theme.getSize("default_margin").width
Label
{
id: languageLabel
text: catalog.i18nc("@label","Language:")
anchors.verticalCenter: languageComboBox.verticalCenter
font.bold: true
text: catalog.i18nc("@label","Interface")
}
ComboBox
Row
{
id: languageComboBox
model: ListModel
spacing: UM.Theme.getSize("default_margin").width
Label
{
id: languageList
id: languageLabel
text: catalog.i18nc("@label","Language:")
anchors.verticalCenter: languageComboBox.verticalCenter
}
Component.onCompleted: {
append({ text: "English", code: "en" })
append({ text: "Deutsch", code: "de" })
append({ text: "Español", code: "es" })
append({ text: "Suomi", code: "fi" })
append({ text: "Français", code: "fr" })
append({ text: "Italiano", code: "it" })
append({ text: "Nederlands", code: "nl" })
append({ text: "Português do Brasil", code: "ptbr" })
append({ text: "Русский", code: "ru" })
append({ text: "Türkçe", code: "tr" })
ComboBox
{
id: languageComboBox
model: ListModel
{
id: languageList
Component.onCompleted: {
append({ text: "English", code: "en" })
append({ text: "Deutsch", code: "de" })
append({ text: "Español", code: "es" })
append({ text: "Suomi", code: "fi" })
append({ text: "Français", code: "fr" })
append({ text: "Italiano", code: "it" })
append({ text: "Nederlands", code: "nl" })
append({ text: "Português do Brasil", code: "ptbr" })
append({ text: "Русский", code: "ru" })
append({ text: "Türkçe", code: "tr" })
}
}
currentIndex:
{
var code = UM.Preferences.getValue("general/language");
for(var i = 0; i < languageList.count; ++i)
{
if(model.get(i).code == code)
{
return i
}
}
}
onActivated: UM.Preferences.setValue("general/language", model.get(index).code)
Component.onCompleted:
{
// Because ListModel is stupid and does not allow using qsTr() for values.
for(var i = 0; i < languageList.count; ++i)
{
languageList.setProperty(i, "text", catalog.i18n(languageList.get(i).text));
}
// Glorious hack time. ComboBox does not update the text properly after changing the
// model. So change the indices around to force it to update.
currentIndex += 1;
currentIndex -= 1;
}
}
currentIndex:
Label
{
var code = UM.Preferences.getValue("general/language");
for(var i = 0; i < languageList.count; ++i)
id: currencyLabel
text: catalog.i18nc("@label","Currency:")
anchors.verticalCenter: languageComboBox.verticalCenter
}
TextField
{
id: currencyField
text: UM.Preferences.getValue("cura/currency")
onTextChanged: UM.Preferences.setValue("cura/currency", text)
}
}
Label
{
id: languageCaption
//: Language change warning
text: catalog.i18nc("@label", "You will need to restart the application for language changes to have effect.")
wrapMode: Text.WordWrap
font.italic: true
}
Item
{
//: Spacer
height: UM.Theme.getSize("default_margin").height
width: UM.Theme.getSize("default_margin").width
}
UM.TooltipArea
{
width: childrenRect.width;
height: childrenRect.height;
text: catalog.i18nc("@info:tooltip","Slice automatically when changing settings.")
CheckBox
{
id: autoSliceCheckbox
checked: boolCheck(UM.Preferences.getValue("general/auto_slice"))
onClicked: UM.Preferences.setValue("general/auto_slice", checked)
text: catalog.i18nc("@option:check","Slice automatically");
}
}
Item
{
//: Spacer
height: UM.Theme.getSize("default_margin").height
width: UM.Theme.getSize("default_margin").width
}
Label
{
font.bold: true
text: catalog.i18nc("@label","Viewport behavior")
}
UM.TooltipArea
{
width: childrenRect.width;
height: childrenRect.height;
text: catalog.i18nc("@info:tooltip","Highlight unsupported areas of the model in red. Without support these areas will not print properly.")
CheckBox
{
id: showOverhangCheckbox
checked: boolCheck(UM.Preferences.getValue("view/show_overhang"))
onClicked: UM.Preferences.setValue("view/show_overhang", checked)
text: catalog.i18nc("@option:check","Display overhang");
}
}
UM.TooltipArea {
width: childrenRect.width;
height: childrenRect.height;
text: catalog.i18nc("@info:tooltip","Moves the camera so the model is in the center of the view when an model is selected")
CheckBox
{
id: centerOnSelectCheckbox
text: catalog.i18nc("@action:button","Center camera when item is selected");
checked: boolCheck(UM.Preferences.getValue("view/center_on_select"))
onClicked: UM.Preferences.setValue("view/center_on_select", checked)
}
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved so that they no longer intersect?")
CheckBox
{
id: pushFreeCheckbox
text: catalog.i18nc("@option:check", "Ensure models are kept apart")
checked: boolCheck(UM.Preferences.getValue("physics/automatic_push_free"))
onCheckedChanged: UM.Preferences.setValue("physics/automatic_push_free", checked)
}
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved down to touch the build plate?")
CheckBox
{
id: dropDownCheckbox
text: catalog.i18nc("@option:check", "Automatically drop models to the build plate")
checked: boolCheck(UM.Preferences.getValue("physics/automatic_drop_down"))
onCheckedChanged: UM.Preferences.setValue("physics/automatic_drop_down", checked)
}
}
UM.TooltipArea {
width: childrenRect.width;
height: childrenRect.height;
text: catalog.i18nc("@info:tooltip","Display 5 top layers in layer view or only the top-most layer. Rendering 5 layers takes longer, but may show more information.")
CheckBox
{
id: topLayerCountCheckbox
text: catalog.i18nc("@action:button","Display five top layers in layer view compatibility mode");
checked: UM.Preferences.getValue("view/top_layer_count") == 5
onClicked:
{
if(model.get(i).code == code)
if(UM.Preferences.getValue("view/top_layer_count") == 5)
{
return i
UM.Preferences.setValue("view/top_layer_count", 1)
}
else
{
UM.Preferences.setValue("view/top_layer_count", 5)
}
}
}
onActivated: UM.Preferences.setValue("general/language", model.get(index).code)
}
Component.onCompleted:
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should only the top layers be displayed in layerview?")
CheckBox
{
// Because ListModel is stupid and does not allow using qsTr() for values.
for(var i = 0; i < languageList.count; ++i)
{
languageList.setProperty(i, "text", catalog.i18n(languageList.get(i).text));
}
// Glorious hack time. ComboBox does not update the text properly after changing the
// model. So change the indices around to force it to update.
currentIndex += 1;
currentIndex -= 1;
id: topLayersOnlyCheckbox
text: catalog.i18nc("@option:check", "Only display top layer(s) in layer view compatibility mode")
checked: boolCheck(UM.Preferences.getValue("view/only_show_top_layers"))
onCheckedChanged: UM.Preferences.setValue("view/only_show_top_layers", checked)
}
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should layer be forced into compatibility mode?")
CheckBox
{
id: forceLayerViewCompatibilityModeCheckbox
text: catalog.i18nc("@option:check", "Force layer view compatibility mode (restart required)")
checked: boolCheck(UM.Preferences.getValue("view/force_layer_view_compatibility_mode"))
onCheckedChanged: UM.Preferences.setValue("view/force_layer_view_compatibility_mode", checked)
}
}
Item
{
//: Spacer
height: UM.Theme.getSize("default_margin").height
width: UM.Theme.getSize("default_margin").height
}
Label
{
id: currencyLabel
text: catalog.i18nc("@label","Currency:")
anchors.verticalCenter: languageComboBox.verticalCenter
font.bold: true
text: catalog.i18nc("@label","Opening and saving files")
}
TextField
{
id: currencyField
text: UM.Preferences.getValue("cura/currency")
onTextChanged: UM.Preferences.setValue("cura/currency", text)
}
}
Label
{
id: languageCaption
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip","Should models be scaled to the build volume if they are too large?")
//: Language change warning
text: catalog.i18nc("@label", "You will need to restart the application for language changes to have effect.")
wrapMode: Text.WordWrap
font.italic: true
}
Item
{
//: Spacer
height: UM.Theme.getSize("default_margin").height
width: UM.Theme.getSize("default_margin").width
}
UM.TooltipArea
{
width: childrenRect.width;
height: childrenRect.height;
text: catalog.i18nc("@info:tooltip","Slice automatically when changing settings.")
CheckBox
{
id: autoSliceCheckbox
checked: boolCheck(UM.Preferences.getValue("general/auto_slice"))
onClicked: UM.Preferences.setValue("general/auto_slice", checked)
text: catalog.i18nc("@option:check","Slice automatically");
}
}
Item
{
//: Spacer
height: UM.Theme.getSize("default_margin").height
width: UM.Theme.getSize("default_margin").width
}
Label
{
font.bold: true
text: catalog.i18nc("@label","Viewport behavior")
}
UM.TooltipArea
{
width: childrenRect.width;
height: childrenRect.height;
text: catalog.i18nc("@info:tooltip","Highlight unsupported areas of the model in red. Without support these areas will not print properly.")
CheckBox
{
id: showOverhangCheckbox
checked: boolCheck(UM.Preferences.getValue("view/show_overhang"))
onClicked: UM.Preferences.setValue("view/show_overhang", checked)
text: catalog.i18nc("@option:check","Display overhang");
}
}
UM.TooltipArea {
width: childrenRect.width;
height: childrenRect.height;
text: catalog.i18nc("@info:tooltip","Moves the camera so the model is in the center of the view when an model is selected")
CheckBox
{
id: centerOnSelectCheckbox
text: catalog.i18nc("@action:button","Center camera when item is selected");
checked: boolCheck(UM.Preferences.getValue("view/center_on_select"))
onClicked: UM.Preferences.setValue("view/center_on_select", checked)
}
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved so that they no longer intersect?")
CheckBox
{
id: pushFreeCheckbox
text: catalog.i18nc("@option:check", "Ensure models are kept apart")
checked: boolCheck(UM.Preferences.getValue("physics/automatic_push_free"))
onCheckedChanged: UM.Preferences.setValue("physics/automatic_push_free", checked)
}
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved down to touch the build plate?")
CheckBox
{
id: dropDownCheckbox
text: catalog.i18nc("@option:check", "Automatically drop models to the build plate")
checked: boolCheck(UM.Preferences.getValue("physics/automatic_drop_down"))
onCheckedChanged: UM.Preferences.setValue("physics/automatic_drop_down", checked)
}
}
UM.TooltipArea {
width: childrenRect.width;
height: childrenRect.height;
text: catalog.i18nc("@info:tooltip","Display 5 top layers in layer view or only the top-most layer. Rendering 5 layers takes longer, but may show more information.")
CheckBox
{
id: topLayerCountCheckbox
text: catalog.i18nc("@action:button","Display five top layers in layer view compatibility mode");
checked: UM.Preferences.getValue("view/top_layer_count") == 5
onClicked:
CheckBox
{
if(UM.Preferences.getValue("view/top_layer_count") == 5)
{
UM.Preferences.setValue("view/top_layer_count", 1)
}
else
{
UM.Preferences.setValue("view/top_layer_count", 5)
}
id: scaleToFitCheckbox
text: catalog.i18nc("@option:check","Scale large models")
checked: boolCheck(UM.Preferences.getValue("mesh/scale_to_fit"))
onCheckedChanged: UM.Preferences.setValue("mesh/scale_to_fit", checked)
}
}
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should only the top layers be displayed in layerview?")
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip","An model may appear extremely small if its unit is for example in meters rather than millimeters. Should these models be scaled up?")
CheckBox
{
id: topLayersOnlyCheckbox
text: catalog.i18nc("@option:check", "Only display top layer(s) in layer view compatibility mode")
checked: boolCheck(UM.Preferences.getValue("view/only_show_top_layers"))
onCheckedChanged: UM.Preferences.setValue("view/only_show_top_layers", checked)
CheckBox
{
id: scaleTinyCheckbox
text: catalog.i18nc("@option:check","Scale extremely small models")
checked: boolCheck(UM.Preferences.getValue("mesh/scale_tiny_meshes"))
onCheckedChanged: UM.Preferences.setValue("mesh/scale_tiny_meshes", checked)
}
}
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should layer be forced into compatibility mode?")
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should a prefix based on the printer name be added to the print job name automatically?")
CheckBox
{
id: forceLayerViewCompatibilityModeCheckbox
text: catalog.i18nc("@option:check", "Force layer view compatibility mode (restart required)")
checked: boolCheck(UM.Preferences.getValue("view/force_layer_view_compatibility_mode"))
onCheckedChanged: UM.Preferences.setValue("view/force_layer_view_compatibility_mode", checked)
CheckBox
{
id: prefixJobNameCheckbox
text: catalog.i18nc("@option:check", "Add machine prefix to job name")
checked: boolCheck(UM.Preferences.getValue("cura/jobname_prefix"))
onCheckedChanged: UM.Preferences.setValue("cura/jobname_prefix", checked)
}
}
}
Item
{
//: Spacer
height: UM.Theme.getSize("default_margin").height
width: UM.Theme.getSize("default_margin").height
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should a summary be shown when saving a project file?")
Label
{
font.bold: true
text: catalog.i18nc("@label","Opening and saving files")
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip","Should models be scaled to the build volume if they are too large?")
CheckBox
{
id: scaleToFitCheckbox
text: catalog.i18nc("@option:check","Scale large models")
checked: boolCheck(UM.Preferences.getValue("mesh/scale_to_fit"))
onCheckedChanged: UM.Preferences.setValue("mesh/scale_to_fit", checked)
CheckBox
{
text: catalog.i18nc("@option:check", "Show summary dialog when saving project")
checked: boolCheck(UM.Preferences.getValue("cura/dialog_on_project_save"))
onCheckedChanged: UM.Preferences.setValue("cura/dialog_on_project_save", checked)
}
}
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip","An model may appear extremely small if its unit is for example in meters rather than millimeters. Should these models be scaled up?")
CheckBox
Item
{
id: scaleTinyCheckbox
text: catalog.i18nc("@option:check","Scale extremely small models")
checked: boolCheck(UM.Preferences.getValue("mesh/scale_tiny_meshes"))
onCheckedChanged: UM.Preferences.setValue("mesh/scale_tiny_meshes", checked)
//: Spacer
height: UM.Theme.getSize("default_margin").height
width: UM.Theme.getSize("default_margin").height
}
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should a prefix based on the printer name be added to the print job name automatically?")
CheckBox
Label
{
id: prefixJobNameCheckbox
text: catalog.i18nc("@option:check", "Add machine prefix to job name")
checked: boolCheck(UM.Preferences.getValue("cura/jobname_prefix"))
onCheckedChanged: UM.Preferences.setValue("cura/jobname_prefix", checked)
font.bold: true
visible: checkUpdatesCheckbox.visible || sendDataCheckbox.visible
text: catalog.i18nc("@label","Privacy")
}
}
UM.TooltipArea {
width: childrenRect.width
height: childrenRect.height
text: catalog.i18nc("@info:tooltip", "Should a summary be shown when saving a project file?")
UM.TooltipArea {
visible: plugins.find("id", "UpdateChecker") > -1
width: childrenRect.width
height: visible ? childrenRect.height : 0
text: catalog.i18nc("@info:tooltip","Should Cura check for updates when the program is started?")
CheckBox
{
text: catalog.i18nc("@option:check", "Show summary dialog when saving project")
checked: boolCheck(UM.Preferences.getValue("cura/dialog_on_project_save"))
onCheckedChanged: UM.Preferences.setValue("cura/dialog_on_project_save", checked)
CheckBox
{
id: checkUpdatesCheckbox
text: catalog.i18nc("@option:check","Check for updates on start")
checked: boolCheck(UM.Preferences.getValue("info/automatic_update_check"))
onCheckedChanged: UM.Preferences.setValue("info/automatic_update_check", checked)
}
}
}
UM.TooltipArea {
visible: plugins.find("id", "SliceInfoPlugin") > -1
width: childrenRect.width
height: visible ? childrenRect.height : 0
text: catalog.i18nc("@info:tooltip","Should anonymous data about your print be sent to Ultimaker? Note, no models, IP addresses or other personally identifiable information is sent or stored.")
Item
{
//: Spacer
height: UM.Theme.getSize("default_margin").height
width: UM.Theme.getSize("default_margin").height
}
Label
{
font.bold: true
visible: checkUpdatesCheckbox.visible || sendDataCheckbox.visible
text: catalog.i18nc("@label","Privacy")
}
UM.TooltipArea {
visible: plugins.find("id", "UpdateChecker") > -1
width: childrenRect.width
height: visible ? childrenRect.height : 0
text: catalog.i18nc("@info:tooltip","Should Cura check for updates when the program is started?")
CheckBox
{
id: checkUpdatesCheckbox
text: catalog.i18nc("@option:check","Check for updates on start")
checked: boolCheck(UM.Preferences.getValue("info/automatic_update_check"))
onCheckedChanged: UM.Preferences.setValue("info/automatic_update_check", checked)
}
}
UM.TooltipArea {
visible: plugins.find("id", "SliceInfoPlugin") > -1
width: childrenRect.width
height: visible ? childrenRect.height : 0
text: catalog.i18nc("@info:tooltip","Should anonymous data about your print be sent to Ultimaker? Note, no models, IP addresses or other personally identifiable information is sent or stored.")
CheckBox
{
id: sendDataCheckbox
text: catalog.i18nc("@option:check","Send (anonymous) print information")
checked: boolCheck(UM.Preferences.getValue("info/send_slice_info"))
onCheckedChanged: UM.Preferences.setValue("info/send_slice_info", checked)
CheckBox
{
id: sendDataCheckbox
text: catalog.i18nc("@option:check","Send (anonymous) print information")
checked: boolCheck(UM.Preferences.getValue("info/send_slice_info"))
onCheckedChanged: UM.Preferences.setValue("info/send_slice_info", checked)
}
}
}
}

View file

@ -96,12 +96,35 @@ Column
}
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")
font: UM.Theme.getFont("large")
anchors.right: parent.right
anchors.top: parent.top
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.
{
@ -115,6 +138,28 @@ Column
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
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.
{
@ -125,15 +170,60 @@ Column
anchors.left: materialColor.right
anchors.bottom: parent.bottom
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.
{
id: variantName
text: (connectedPrinter != null && connectedPrinter.hotendIds[index] != null) ? connectedPrinter.hotendIds[index] : ""
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
anchors.right: parent.right
anchors.bottom: parent.bottom
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.rightMargin: UM.Theme.getSize("default_margin").width
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.
{
@ -182,13 +294,51 @@ Column
anchors.right: bedTargetTemperature.left
anchors.top: parent.top
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.
{
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.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.leftMargin: UM.Theme.getSize("default_margin").width
anchors.bottom: parent.bottom
@ -214,51 +364,54 @@ Column
}
MouseArea //Change cursor on hovering.
{
id: mouseArea
id: preheatTemperatureInputMouseArea
hoverEnabled: true
anchors.fill: parent
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
{
id: preheatTemperatureInput
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
maximumLength: 10
enabled: parent.enabled
validator: RegExpValidator { regExp: /^-?[0-9]{0,9}[.,]?[0-9]{0,10}$/ } //Floating point regex.
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
Binding
Component.onCompleted:
{
target: preheatTemperatureInput
property: "text"
value:
if ((bedTemperature.resolve != "None" && bedTemperature.resolve) && (bedTemperature.stackLevels[0] != 0) && (bedTemperature.stackLevels[0] != 1))
{
// 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))
{
// 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
// (if user has explicitly set this).
return bedTemperature.resolve;
}
else
{
return bedTemperature.properties.value;
}
// 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
// (if user has explicitly set this).
text = bedTemperature.resolve;
}
else
{
text = bedTemperature.properties.value;
}
when: !preheatTemperatureInput.activeFocus
}
}
}
@ -280,39 +433,30 @@ Column
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.
running: false
running: connectedPrinter != null && connectedPrinter.preheatBedRemainingTime != ""
repeat: true
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.
function update()
{
var now = new Date();
if (now.getTime() < endTime.getTime())
preheatCountdown.text = ""
if (connectedPrinter != null)
{
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;
preheatCountdown.text = connectedPrinter.preheatBedRemainingTime;
}
else
if (preheatCountdown.text == "") //Either time elapsed or not connected.
{
preheatCountdown.visible = false;
running = false;
if (connectedPrinter != null)
{
connectedPrinter.cancelPreheatBed()
}
stop();
}
}
}
Label
{
id: preheatCountdown
text: "0:00"
visible: false //It only becomes visible when the timer is running.
text: connectedPrinter != null ? connectedPrinter.preheatBedRemainingTime : ""
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")
color: UM.Theme.getColor("text")
anchors.right: preheatButton.left
@ -326,19 +470,11 @@ Column
height: UM.Theme.getSize("setting_control").height
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)
{
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)
if (preheatUpdateTimer.running)
{
return true; //Can always cancel if the timer is running.
}
@ -350,6 +486,10 @@ Column
{
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.
}
anchors.right: parent.right
@ -430,28 +570,23 @@ Column
}
}
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:
{
if (!preheatCountdownTimer.running)
if (!preheatUpdateTimer.running)
{
connectedPrinter.preheatBed(preheatTemperatureInput.text, connectedPrinter.preheatBedTimeout);
var now = new Date();
var end_time = new Date();
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.
preheatUpdateTimer.start();
preheatUpdateTimer.update(); //Update once before the first timer is triggered.
}
else
{
connectedPrinter.cancelPreheatBed();
preheatCountdownTimer.endTime = new Date();
preheatCountdownTimer.update();
preheatUpdateTimer.update();
}
}

View file

@ -14,8 +14,10 @@ Item {
property real progress: UM.Backend.progress;
property int backendState: UM.Backend.state;
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 string fileBaseName
property string statusText:

View file

@ -398,7 +398,7 @@ Item
style: UM.Theme.styles.checkbox;
enabled: base.settingsEnabled
checked: platformAdhesionType.properties.value != "skirt"
checked: platformAdhesionType.properties.value != "skirt" && platformAdhesionType.properties.value != "none"
MouseArea
{