public void AddTrackLeftEventFor(TrackData td, IFileOutput logger) { TrackLeftEvent tle = new TrackLeftEvent(td.TimeStamp, td, true, td.ConsoleOutput, logger); events.Add(tle); logger.Write(tle.FormatData()); }
public void Encode(IFileInput input) { // Initialization and encoding the tree _buffer = new byte[BUFFER_LENGTH + 1]; WriteEncodingHeader(); WriteTree(_tree); _output.Write(new byte[8], 0, 8); CreatePaths(_tree, new byte[0], 0); int c; while ((c = input.ReadByte()) != -1) { EncodeByte((byte)c); } }
public void AddSeperationEventFor(TrackData td1, TrackData td2, IFileOutput logger) { List <TrackData> tracks = new List <TrackData>() { td1, td2 }; SeperationEvent se = new SeperationEvent(td1.TimeStamp, tracks, true, td1.ConsoleOutput, logger); events.Add(se); logger.Write(se.FormatData()); }
public void Log() { outputFile.Write(FormatData()); }
/* * public void LogActiveSeparationEvent(SeperationEvent seperationEvent) * { * string timeOfOccurence = seperationEvent._occurrenceTime.ToString(); * TrackData track1 = seperationEvent._InvolvedTracks[0]; * TrackData track2 = seperationEvent._InvolvedTracks[1]; * * //Creating instance of StreamWriter * System.IO.StreamWriter streamWriter = System.IO.File.AppendText(startupPath + fileName); * * string lineToLog = "Timestamp: " + timeOfOccurence + " " + "Flight 1: " + track1._Tag + " | " + "Flight 2: " + track2._Tag + " | " + "SeperationEvent status: " + seperationEventActive; * //Perhaps it should be WriteLineAsync in order to keep up with the system * streamWriter.WriteLine(lineToLog); * * //Closing streamWriter instance and file * streamWriter.Close(); * * } * * public void LogInactiveSeparationEvent(SeperationEvent seperationEvent) * { * string timeOfOccurence = seperationEvent._occurrenceTime.ToString(); * TrackData track1 = seperationEvent._InvolvedTracks[0]; * TrackData track2 = seperationEvent._InvolvedTracks[1]; * * //Creating instance of StreamWriter * System.IO.StreamWriter streamWriter = System.IO.File.AppendText(startupPath + fileName); * * string lineToLog = "Timestamp: " + timeOfOccurence + " " + "Flight 1: " + track1._Tag + " | " + "Flight 2: " + track2._Tag + " | " + "SeperationEvent status: " + seperationEventInactive; * //Perhaps it should be WriteLineAsync in order to keep up with the system * streamWriter.Write(lineToLog); * * //Closing streamWriter instance and file * streamWriter.Close(); * * } */ public void LogActiveEvent(Event Event) { _fileOutput.Write(Event.FormatData()); }