MainPage.xaml.cs
/// <summary>
/// doc tai bat ky thoi diem nao, co the pause, play
/// </summary>
doc tai bat ky thoi diem nao, co the pause, play
doc tai bat ky thoi diem nao co the pause play
public void ReadAnyTime()
        {
            setupReadfile = true;
            while (null == Data.Time)
            {
                strDataFromSerialPort = streamReader.ReadLine();
                processDataToDrawTrajactory();
            }
            sStartTime = Data.Time;
            streamReader.BaseStream.Seek(-1, SeekOrigin.End);   
            streamReader.BaseStream.Seek(-2000, SeekOrigin.Current);
            while (streamReader.Peek() >= 0)
            {
                strDataFromSerialPort = streamReader.ReadLine();
                processDataToDrawTrajactory();
            }
            sStopTime = Data.Time;
            if (-1 != Data.Time.IndexOf('.'))
                tblock_End_Timer.Text = Data.Time.Substring(0, Data.Time.Length - 6) + ':'
                        + Data.Time.Substring(Data.Time.Length - 6, 2) + ':' + Data.Time.Substring(Data.Time.Length - 4, 4);
            else
                tblock_End_Timer.Text = Data.Time.Substring(0, Data.Time.Length - 4) + ':'
                        + Data.Time.Substring(Data.Time.Length - 4, 2) + ':' + Data.Time.Substring(Data.Time.Length - 2, 2);
        }
public void ReadAnyTime ( ) { setupReadfile = true ; while ( null == Data . Time ) { strDataFromSerialPort = streamReader . ReadLine ( ) ; processDataToDrawTrajactory ( ) ; } sStartTime = Data . Time ; streamReader . BaseStream . Seek ( - 1 , SeekOrigin . End ) ; streamReader . BaseStream . Seek ( - 2000 , SeekOrigin . Current ) ; while ( streamReader . Peek ( ) >= 0 ) { strDataFromSerialPort = streamReader . ReadLine ( ) ; processDataToDrawTrajactory ( ) ; } sStopTime = Data . Time ; if ( - 1 != Data . Time . IndexOf ( ' ' ) ) tblock_End_Timer . Text = Data . Time . Substring ( 0 , Data . Time . Length - 6 ) + ' ' + Data . Time . Substring ( Data . Time . Length - 6 , 2 ) + ' ' + Data . Time . Substring ( Data . Time . Length - 4 , 4 ) ; else tblock_End_Timer . Text = Data . Time . Substring ( 0 , Data . Time . Length - 4 ) + ' ' + Data . Time . Substring ( Data . Time . Length - 4 , 2 ) + ' ' + Data . Time . Substring ( Data . Time . Length - 2 , 2 ) ; }
doc tai bat ky thoi diem nao, co the pause, play
doc tai bat ky thoi diem nao co the pause play
//c2 //Int32 index = 0; //đưa con trỏ về cuối của file //double _position = streamReader.BaseStream.Position;//lấy số ký tự của file txt //dịch con trỏ từ cuối file về lui khoảng 2000 ký tự //chúng ta sẽ đọc được thời điểm bay cuối cùng //format hour:min:sec //have '.' in Data.Time 82754.7