fps made 15 for lower GPU load

- reinitialisation of cummulative_time for new model

CURA-7647
This commit is contained in:
saumya.jain 2023-12-21 10:32:49 +01:00
parent 113ad74e26
commit e2e94b7f6b
2 changed files with 5 additions and 4 deletions

View file

@ -98,7 +98,7 @@ class SimulationView(CuraView):
self._min_line_width = sys.float_info.max
self._min_flow_rate = sys.float_info.max
self._max_flow_rate = sys.float_info.min
self._cumulative_line_duration ={}
self._cumulative_line_duration = {}
self._global_container_stack: Optional[ContainerStack] = None
self._proxy = None
@ -253,7 +253,7 @@ class SimulationView(CuraView):
total_duration += line_duration / SimulationView.SIMULATION_FACTOR
self._cumulative_line_duration[self.getCurrentLayer()].append(total_duration)
# Calculate the total duration using numpy.sum
# total duration for a layer to simulate is the last element of the list
total_duration = (self._cumulative_line_duration[self.getCurrentLayer()][-1])
return total_duration
@ -572,6 +572,7 @@ class SimulationView(CuraView):
self._max_thickness = sys.float_info.min
self._min_flow_rate = sys.float_info.max
self._max_flow_rate = sys.float_info.min
self._cumulative_line_duration = {}
# The colour scheme is only influenced by the visible lines, so filter the lines by if they should be visible.
visible_line_types = []

View file

@ -137,12 +137,12 @@ Item
Timer
{
id: simulationTimer
interval: 1000 / 30
interval: 1000 / 15
running: false
repeat: true
onTriggered:
{
// divide by 1000 to accont for ms to s conversion
// divide by 1000 to account for ms to s conversion
const advance_time = simulationTimer.interval / 1000.0;
if (!UM.SimulationView.advanceTime(advance_time)) {
playButton.pauseSimulation();