Update plugins/SimulationView/SimulationViewProxy.py

simplified code

Co-authored-by: Casper Lamboo <c.lamboo@ultimaker.com>
This commit is contained in:
Saumya Jain 2023-12-11 14:29:33 +01:00 committed by GitHub
parent 75ff829b5f
commit a19c667106
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,9 +64,7 @@ class SimulationViewProxy(QObject):
# We multiply the time with 100 to make it to ms from s.(Should be 1000 in real time). This scaling makes the simulation time 10x faster than the real time.
simulationTimeOfpath =self._simulation_view.getSimulationTime()[0][self._simulation_view.getCurrentPath()] * 100
# Since the timer cannot process time less than 1 ms, we put a lower limit here
if simulationTimeOfpath < 1:
return 1
return int(simulationTimeOfpath)
return int(max(1, simulationTimeOfpath))
@pyqtProperty(int, notify=currentPathChanged)
def minimumPath(self):