/// <summary> /// /// </summary> /// <returns></returns> private void AnalyseFlightLog(bool updateScore = false) { // new FlightEvent("5C", 1, "Hard Landing" , 30, 30, (t) => { return (ActualArrivalTime.VerticalSpeed <= -500D); }), foreach (FlightEvent e in activeEvents) { Events.AddRange(e.GetOccurrences(TelemetryLog.ToArray(), out int discount)); FinalScore -= discount; } if (ActualArrivalTime.VerticalSpeed <= -500.0) { Events.Add(new EventOccurrence(ActualArrivalTimeId, ActualArrivalTimeId, new FlightEvent("5C", 1, "Hard Landing", 30, 30, (t) => { return(true); }))); if (updateScore) { FinalScore -= 30; } } if (updateScore) { UpdateScore(); } }
/// <summary> /// Saves a snapshot of the current telemetry readings /// </summary> /// <returns></returns> public Telemetry ProcessTelemetry(Telemetry t) { // collect all telemetry data we need TelemetryLog.Add(t); return(t); }
public void LogFunctionality(string userName, string functionality) { //if (!CanLogTelemetryForUser(userName)) //{ // return; //} try { TelemetryLog functionalityLog = new TelemetryLog() { Date = DateTime.Now.ToUniversalTime(), UserName = userName, Action = functionality }; _loggingService.LogTelemetry(functionalityLog); } catch (Exception) { // increase locked errorFailCount Interlocked.Increment(ref _telemetryFailCount); if (_errorFailCount == 100) { // email system admin } } }
public void LogLogout(string userName, DateTime sessionDuration) { //if (!CanLogTelemetryForUser(userName)) //{ // return; //} try { TelemetryLog logoutLog = new TelemetryLog() { Date = DateTime.Now.ToUniversalTime(), UserName = userName, Action = "Logout", SessionDuration = sessionDuration }; _loggingService.LogTelemetry(logoutLog); } catch (Exception) { // increase locked errorFailCount Interlocked.Increment(ref _telemetryFailCount); if (_errorFailCount == 100) { // email system admin } } }
public void LogTelemetry(TelemetryLog telemetryLog) { _telemetryLogRepository.CreateLog(telemetryLog); }