/*************************************************************************************************************************/ public void read_throttle_values() { string temp_string; Log.PushStackInfo("FMRS_THL.read_throttle_values", "FMRS_THL_Rep: entering read_throttle_values()"); Log.dbg("FMRS_THL_Rep: read throttle values"); for (int i = 0; i < 1000; i++) { temp_string = reader.ReadLine(); if (temp_string.Contains("EOF")) { EOF = true; Log.dbg("FMRS_THL_Rep: EOF"); break; } else if (temp_string.Contains("#")) { continue; } Throttle_Replay.Enqueue(new entry(temp_string)); } Log.dbg("FMRS_THL_Rep: buffer size = {0}" + Throttle_Replay.Count); Log.PopStackInfo("FMRS_THL_Rep: leave read_throttle_values()"); }
/*************************************************************************************************************************/ public void EndLog() { Log.PushStackInfo("FMRS_THL.EndLog", "FMRS_THL_Log: entering EndLog()"); Log.dbg("FMRS_THL_Log: End Log"); if (!started) { return; } started = false; write_record_file(); Log.PopStackInfo("FMRS_THL_Log: leave EndLog()"); }
/*************************************************************************************************************************/ public void flush_record_file() { Log.PushStackInfo("FMRS_THL.flush_record_file", "FMRS_THL_Log: entering flush_record_file()"); Log.dbg("FMRS_THL_Log: flush record file"); IO.TextWriter writer = IO.File.CreateText(FMRS.FILES.RECORD_TXT); writer.Flush(); writer.Close(); Throttle_Log_Buffer.Clear(); temp_buffer.Clear(); Log.PopStackInfo("FMRS_THL_Log: leave flush_record_file()"); }
/*************************************************************************************************************************/ public void EndReplay() { Log.PushStackInfo("FMRS_THL.EndReply", "FMRS_THL_Rep: entering end_replay()"); if (!replay) { return; } Log.dbg("FMRS_THL_Rep: End Replay"); try { reader.Close(); } catch (Exception) {} replay = false; debug_message = "replay ended"; Log.PopStackInfo("FMRS_THL_Rep: leave end_replay()"); }
/*************************************************************************************************************************/ public void init() { Log.PushStackInfo("FMRS_THL.init", "FMRS_THL_Log: entering linit()"); Log.dbg("FMRS_THL_Log: init"); if (init_done) { return; } if (!IO.File.Exists(FMRS.FILES.RECORD_TXT)) { IO.TextWriter file = IO.File.CreateText(FMRS.FILES.RECORD_TXT); file.Close(); } init_done = true; Log.PopStackInfo("FMRS_THL_Log: leave linit()"); }