More flexible simulation phase log handling.

parent dcdc5d6a
......@@ -20,6 +20,7 @@ public class SceneController : MonoBehaviour
private Dictionary<string, bool> actionParticipants;
private List<string> metaLog;
string metaLogPhase = "UNDEFINED";
public bool captureVideo = true;
private FFmpegCapture videoCapture;
......@@ -133,20 +134,19 @@ public class SceneController : MonoBehaviour
{
if (metaLog != null)
{
metaLog.Add(metaLog[metaLog.Count - 1]);
metaLog.Add(metaLogPhase);
}
}
public IEnumerator ExecuteAction(string actionName, Dictionary<string, JSONObject> taskDict)
{
metaLog = new List<string>();
metaLog.Add("BEGIN_PRE");
metaLogPhase = "PRE";
// wait for the simulation to record a pre-image
yield return new WaitForSeconds(5);
yield return new WaitForSeconds(2);
metaLog.Add("END_PRE");
metaLog.Add("BEGIN_SIM");
metaLogPhase = "SIMULATION";
actionParticipants = new Dictionary<string, bool>();
......@@ -249,12 +249,12 @@ public class SceneController : MonoBehaviour
private IEnumerator StopWaiting()
{
metaLog.Add("END_SIM");
metaLog.Add("BEGIN_POST");
metaLogPhase = "POST";
yield return new WaitForSeconds(5);
yield return new WaitForSeconds(2);
metaLogPhase = "STOP";
metaLog.Add("END_POST");
string videoPath = null;
if (captureVideo)
{
......@@ -326,7 +326,7 @@ public class SceneController : MonoBehaviour
{
row.Add(log.Key, log.Value[t]);
}
row.Add("LOG_PHASE", metaLog[t]);
row.Add("LOG_PHASE", t < metaLog.Count ? metaLog[t] : "UNKNOWN");
logRows.Add(row);
}
metaLog = null;
......
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