コード例 #1
0
        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());
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: lunakv/Skola
        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);
            }
        }
コード例 #3
0
        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());
        }
コード例 #4
0
 public void Log()
 {
     outputFile.Write(FormatData());
 }
コード例 #5
0
 /*
  * 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());
 }