private async Task <IbtTelemetryFile> ParseTelemetryFile(string fileName) { var ibtFile = await _telemetryFileParser.ParseTelemetryFileAsync(fileName, IbtParseOptions.All); _trackName = ibtFile.SessionData.SessionInfo.weekendInfo["TrackDisplayShortName"].ToString(); return(ibtFile); }
public async Task <ISession> LoadSavedSessionAsync(string jsonFileName) { var json = File.ReadAllText(jsonFileName); JsonSerializerSettings settings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto }; var session = JsonConvert.DeserializeObject <TelemetrySession>(json, settings); session.FileName = jsonFileName; session.State = TelemetrySession.Serialize(session); if (!String.IsNullOrEmpty(session.SessionFileName)) { var telemetry = await _telemetryFileParser.ParseTelemetryFileAsync(session.SessionFileName, IbtParseOptions.All); session.TelemetrySessionData = telemetry.SessionData; } return(session); }