Adding meta log to keep track of pre/post phase.

parent f2b7a435
......@@ -19,6 +19,8 @@ public class SceneController : MonoBehaviour
private Func<string, IEnumerator> replyToRequest;
private Dictionary<string, bool> actionParticipants;
private List<string> metaLog;
public bool captureVideo = true;
private FFmpegCapture videoCapture;
......@@ -127,8 +129,25 @@ public class SceneController : MonoBehaviour
}
}
void Update()
{
if (metaLog != null)
{
metaLog.Add(metaLog[metaLog.Count - 1]);
}
}
public IEnumerator ExecuteAction(string actionName, Dictionary<string, JSONObject> taskDict)
{
metaLog = new List<string>();
metaLog.Add("BEGIN_PRE");
// wait for the simulation to record a pre-image
yield return new WaitForSeconds(5);
metaLog.Add("END_PRE");
metaLog.Add("BEGIN_SIM");
actionParticipants = new Dictionary<string, bool>();
JSONObject action = taskDict[actionName];
......@@ -230,7 +249,12 @@ public class SceneController : MonoBehaviour
private IEnumerator StopWaiting()
{
metaLog.Add("END_SIM");
metaLog.Add("BEGIN_POST");
yield return new WaitForSeconds(5);
metaLog.Add("END_POST");
string videoPath = null;
if (captureVideo)
{
......@@ -302,8 +326,10 @@ public class SceneController : MonoBehaviour
{
row.Add(log.Key, log.Value[t]);
}
row.Add("LOG_PHASE", metaLog[t]);
logRows.Add(row);
}
metaLog = null;
return logRows;
}
}
......
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