Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author14bitVoid <14bitvoid@protonmail.com>2017-05-05 02:34:09 +0300
committer14bitVoid <14bitvoid@protonmail.com>2017-05-05 02:34:09 +0300
commit69a95e37a5ec05ca63321abe8acf53283ea49350 (patch)
treeec21adf2b8bffb4e661a1b04173ccbd6081a6e36 /cura/PrintInformation.py
parentf15aa667510bb6ffe472fa7fd1801d060555b142 (diff)
Show time estimates per feature in tooltip
Diffstat (limited to 'cura/PrintInformation.py')
-rw-r--r--cura/PrintInformation.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py
index cd1a194254..c6412e2f6f 100644
--- a/cura/PrintInformation.py
+++ b/cura/PrintInformation.py
@@ -52,6 +52,19 @@ class PrintInformation(QObject):
super().__init__(parent)
self._current_print_time = Duration(None, self)
+ self._print_times_per_feature = {
+ "none": Duration(None, self),
+ "inset_0": Duration(None, self),
+ "inset_x": Duration(None, self),
+ "skin": Duration(None, self),
+ "support": Duration(None, self),
+ "skirt": Duration(None, self),
+ "infill": Duration(None, self),
+ "support_infill": Duration(None, self),
+ "travel": Duration(None, self),
+ "retract": Duration(None, self),
+ "support_interface": Duration(None, self)
+ }
self._material_lengths = []
self._material_weights = []
@@ -93,6 +106,10 @@ class PrintInformation(QObject):
def currentPrintTime(self):
return self._current_print_time
+ @pyqtProperty("QVariantMap", notify = currentPrintTimeChanged)
+ def printTimesPerFeature(self):
+ return self._print_times_per_feature
+
materialLengthsChanged = pyqtSignal()
@pyqtProperty("QVariantList", notify = materialLengthsChanged)
@@ -115,9 +132,11 @@ class PrintInformation(QObject):
total_time = 0
for feature, time in time_per_feature.items():
if time != time: # Check for NaN. Engine can sometimes give us weird values.
+ self._print_times_per_feature[feature].setDuration(0)
Logger.log("w", "Received NaN for print duration message")
continue
total_time += time
+ self._print_times_per_feature[feature].setDuration(time)
self._current_print_time.setDuration(total_time)
self.currentPrintTimeChanged.emit()