From a9aba2df748977554a454ce3e7d7b1667d152e8d Mon Sep 17 00:00:00 2001 From: "saumya.jain" Date: Tue, 12 Dec 2023 16:06:22 +0100 Subject: [PATCH] maintenence. CURA-7647 --- plugins/SimulationView/SimulationView.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/SimulationView/SimulationView.py b/plugins/SimulationView/SimulationView.py index cbf5e571fc..a659a6de97 100644 --- a/plugins/SimulationView/SimulationView.py +++ b/plugins/SimulationView/SimulationView.py @@ -402,13 +402,14 @@ class SimulationView(CuraView): def getMaxFeedrate(self) -> float: return self._max_feedrate - def getSimulationTime(self, currentIndex) -> list: + def getSimulationTime(self, currentIndex) -> float: try: - return self._lengths_of_polyline[self._current_layer_num][currentIndex] / self._current_feedrates[self._current_layer_num][currentIndex] + return (self._lengths_of_polyline[self._current_layer_num][currentIndex] / self._current_feedrates[self._current_layer_num][currentIndex])[0] + except: # In case of change in layers, currentIndex comes one more than the items in the lengths_of_polyline # We give 1 second time for layer change - return 1 + return 1.0 def getMinThickness(self) -> float: if abs(self._min_thickness - sys.float_info.max) < 10: # Some lenience due to floating point rounding.