Main routine for loading a CSV log file.
109 string csvPath = Path.GetDirectoryName(csvFilePath);
110 string csvFileName = Path.GetFileName(csvFilePath);
115 sr =
new StreamReader(csvFilePath);
117 catch (Exception e) {
119 Debug.LogException(e);
124 "File Load Exception!",
125 "See log for details"
136 string xmlFileName = null;
137 while ((line = sr.ReadLine()) != null) {
145 xmlFileName = line.Substring(
148 Debug.Log(
"XML filename from CSV is: " + xmlFileName);
157 if (xmlFileName == null) {
165 "XML filename not found in CSV header!",
166 header +
"\n Select environment to load?"
170 yield
return new WaitForSeconds(0.1f);
175 Debug.Log(
"Not yet implemented: browse and load environment");
185 if (
environment.name != settings.environmentName) {
191 "Load new environment and paths?",
192 "CSV log is for a different environment. Load new environment and paths instead?"
196 yield
return new WaitForSeconds(0.1f);
219 while ((line = sr.ReadLine()) != null) {
220 if (line.StartsWith(
Log.
Parameters.SimulationTime.ToString())) {
226 int robotPositionIndex;
228 for(robotPositionIndex = 0; robotPositionIndex < row.Length; robotPositionIndex++) {
229 if (row[robotPositionIndex] ==
Log.
Parameters.RobotPosition.ToString())
238 while((line = sr.ReadLine()) != null) {
240 if (robotPositionIndex > row.Length) {
241 Debug.LogWarning(
"LogLoader: row length too short?");
249 float time =
float.Parse(row[0].Substring(1,row[0].Length-2));
BotPath displays information about a recorded path taken or calculated.
string csvName
Gets or sets the name of the csv.
static bool loading
Gets a value indicating whether this LogLoader is loading from CSV.
const string csvXmlCommentTag
The csv xml comment tag identifies which line the associated XML settings file name is stored...
static Vector3 ParseVector3(string strv)
Parses the vector3 object from a string like "(1.0,2.0,3.0)"
const char csvDelimiter
The csv delimiter character. Avoid using comma because some data is serialized to include commas...
static void AddPath(BotPath path)
Adds a path to paths list.
static List< BotPath > paths
The BotPaths loaded from file.
static void LoadEnvironment(string name)
Loads the environment.
Controls the camera orientation and render modes according to ViewMode in viewModeList user input...
void AddNode(Vector3 node, float time)
Adds a node to the path.
This is a manager class used to overlook the running of a simulation.
const string csvComment
The csv comment character denotes lines which are not CSV data.
A utility class for strings used in this project.
static bool _waitingForResponse
Bool indicating whether waiting for user response to prompt
Provides data logging capabilities. Data is logged in CSV format.
static void UpdatePathColors()
Updates the path colors with evenly spaced hues.
Object serializer utility class.
static GameObject environment
Gets the environment game object.
static bool _response
The UI_Prompt response from the user.
static void PromptResponse(bool response)
UI_Prompt.Response callback function
IWindowFunction class that prompts the user for action.
static void ClearAreaList()
Clears the area list.