Commit 3c8b84a5 authored by MarkG's avatar MarkG Committed by TIGERs GitLab
Browse files

Resolve "Do not loop recordings and vision logs"

Closes #1690

See merge request main/Sumatra!1456

sumatra-commit: 19d6a8c400efcd07f7e436188414f3dd20c6355c
parent fb1cc249
Pipeline #17116 passed with stage
in 4 minutes and 14 seconds
......@@ -210,16 +210,12 @@ public class LogfileVisionCam extends ACam implements Runnable
@Override
public void run()
{
SSLGameLogReader currentLog = null;
while (!Thread.interrupted())
{
// take new logfile if we have one
if (newLogfile != null)
{
currentLog = newLogfile;
newLogfile = null;
}
SSLGameLogReader currentLog = newLogfile;
newLogfile = null;
// no log to play? nothing to do!
if (currentLog == null)
......@@ -232,16 +228,12 @@ public class LogfileVisionCam extends ACam implements Runnable
Thread.currentThread().interrupt();
return;
}
continue;
} else
{
playLog(currentLog);
log.info("Replay finished");
notifyVisionLost();
}
// play the logfile
playLog(currentLog);
log.info("Replay finished");
notifyVisionLost();
}
}
......
/*
* Copyright (c) 2009 - 2020, DHBW Mannheim - TIGERs Mannheim
* Copyright (c) 2009 - 2021, DHBW Mannheim - TIGERs Mannheim
*/
package edu.tigers.sumatra.presenter.replay;
......@@ -284,6 +284,7 @@ public class ReplayPresenter extends AMainPresenter
snapshotController.onCopySnapshot();
}
/**
* This thread will update the field periodically according to the speed
*
......@@ -331,10 +332,14 @@ public class ReplayPresenter extends AMainPresenter
if (playing)
{
replayCurTime += ((System.nanoTime() - replayLastTime) * speed);
if ((getCurrentTime() > recEndTime) || (replayCurTime < 0))
if (replayCurTime < 0)
{
replayCurTime = 0;
}
if (getCurrentTime() > recEndTime)
{
replayCurTime = recEndTime;
}
}
replayLastTime = System.nanoTime();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment