Calculating time of travel for each line segment

CURA-7647
This commit is contained in:
saumya.jain 2023-11-07 18:08:08 +05:30
parent f873a94ef8
commit 6301926885
3 changed files with 16 additions and 1 deletions

View file

@ -136,9 +136,10 @@ Item
Timer
{
id: simulationTimer
interval: 100
interval: parseFloat(UM.SimulationView.getSimulationTime[pathNumber]).toFixed(2) //10 //dont change
running: false
repeat: true
property int pathNumber : 0
onTriggered:
{
var currentPath = UM.SimulationView.currentPath
@ -153,10 +154,12 @@ Item
if (currentPath >= numPaths)
{
UM.SimulationView.setCurrentPath(0)
pathNumber =0
}
else
{
UM.SimulationView.setCurrentPath(currentPath + 1)
pathNumber = 0
}
}
// If the simulation is already playing and we reach the end of a layer, then it automatically
@ -184,6 +187,7 @@ Item
// The status must be set here instead of in the resumeSimulation function otherwise it won't work
// correctly, because part of the logic is in this trigger function.
isSimulationPlaying = true
pathNumber += 1
}
}