From f1c28498a67aa73f93ada591bfdcb01c7ec14e59 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 19 Dec 2018 11:00:00 +0100 Subject: [PATCH 1/3] Display 0 if there are no measurements for minimum values Don't display max float then. --- plugins/SimulationView/SimulationView.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/SimulationView/SimulationView.py b/plugins/SimulationView/SimulationView.py index 6a0ffc1666..ae01b7cdb0 100644 --- a/plugins/SimulationView/SimulationView.py +++ b/plugins/SimulationView/SimulationView.py @@ -342,12 +342,16 @@ class SimulationView(CuraView): return self._extruder_count def getMinFeedrate(self) -> float: + if abs(self._min_feedrate - sys.float_info.max) < 10: # Some lenience due to floating point rounding. + return 0.0 # If it's still max-float, there are no measurements. Use 0 then. return self._min_feedrate def getMaxFeedrate(self) -> float: return self._max_feedrate def getMinThickness(self) -> float: + if abs(self._min_thickness - sys.float_info.max) < 10: # Some lenience due to floating point rounding. + return 0.0 # If it's still max-float, there are no measurements. Use 0 then. return self._min_thickness def getMaxThickness(self) -> float: From 142ac56d78e2bcb91eff8fffb0341be736d3461f Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Wed, 19 Dec 2018 11:26:38 +0100 Subject: [PATCH 2/3] Add keyboard navigation for printer carousel --- .../UM3NetworkPrinting/resources/qml/MonitorCarousel.qml | 4 ++++ .../UM3NetworkPrinting/resources/qml/MonitorStage.qml | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml index a3e2517b45..eccd93c578 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml @@ -18,6 +18,10 @@ Item height: centerSection.height width: maximumWidth + + // Enable keyboard navigation + Keys.onLeftPressed: navigateTo(currentIndex - 1) + Keys.onRightPressed: navigateTo(currentIndex + 1) Item { diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml index b80c6a3661..8b1a11cb4d 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml @@ -24,6 +24,11 @@ Component } } width: maximumWidth + + // Enable keyboard navigation. NOTE: This is done here so that we can also potentially + // forward to the queue items in the future. (Deleting selected print job, etc.) + Keys.forwardTo: carousel + Component.onCompleted: forceActiveFocus() UM.I18nCatalog { @@ -59,7 +64,9 @@ Component } width: parent.width height: 264 * screenScaleFactor // TODO: Theme! - MonitorCarousel {} + MonitorCarousel { + id: carousel + } } MonitorQueue From 56d0a52faccb3cc0cd5ecd8701b342a530395ed3 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 19 Dec 2018 11:51:46 +0100 Subject: [PATCH 3/3] Documentation and code style --- plugins/SimulationView/SimulationViewMenuComponent.qml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index eec254c0dd..fe32fe9eb1 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -358,7 +358,7 @@ Cura.ExpandableComponent width: parent.width height: UM.Theme.getSize("layerview_row").height - Label + Label //Minimum value. { text: { @@ -383,9 +383,10 @@ Cura.ExpandableComponent renderType: Text.NativeRendering } - Label + Label //Unit in the middle. { - text: { + text: + { if (UM.SimulationView.layerActivity && CuraApplication.platformActivity) { // Feedrate selected @@ -407,7 +408,7 @@ Cura.ExpandableComponent font: UM.Theme.getFont("default") } - Label + Label //Maximum value. { text: { if (UM.SimulationView.layerActivity && CuraApplication.platformActivity)