MainPage.xaml.cs
/// <summary>
/// Onlly get data, not show date
/// To get start time anf end of time
/// </summary>
Onlly get data, not show date
To get start time anf end of time
Onlly get data not show date To get start time anf end of time
public void processDataToGetInf()
        {
            if (setupReadfile)
            {
                Data.Temp = strDataFromSerialPort;
                if (Data.Temp.IndexOf('$') != -1)
                    Data.Temp = Data.Temp.Substring(Data.Temp.IndexOf('$') + 1, Data.Temp.Length - (Data.Temp.IndexOf('$') + 1));
                else
                    return;
                if (Data.Temp.IndexOf("GPG") != -1)
                {
                    Data.Temp = Data.Temp.Substring(Data.Temp.IndexOf(',') + 1, Data.Temp.Length - (Data.Temp.IndexOf(',') + 1));
                    double dTemp_Time = 0;
                    string temp_time = Data.Temp.Substring(0, Data.Temp.IndexOf(','));
                    if (temp_time != "")
                    {
                        dTemp_Time = (Convert.ToDouble(temp_time) + 70000.00);
                        if (dTemp_Time >= 240000.00) dTemp_Time -= 240000.00;
                        Data.Time = dTemp_Time.ToString();
                    }
                }
            }
        }
public void processDataToGetInf ( ) { if ( setupReadfile ) { Data . Temp = strDataFromSerialPort ; if ( Data . Temp . IndexOf ( ' ' ) != - 1 ) Data . Temp = Data . Temp . Substring ( Data . Temp . IndexOf ( ' ' ) + 1 , Data . Temp . Length - ( Data . Temp . IndexOf ( ' ' ) + 1 ) ) ; else return ; if ( Data . Temp . IndexOf ( " " ) != - 1 ) { Data . Temp = Data . Temp . Substring ( Data . Temp . IndexOf ( ' ' ) + 1 , Data . Temp . Length - ( Data . Temp . IndexOf ( ' ' ) + 1 ) ) ; double dTemp_Time = 0 ; string temp_time = Data . Temp . Substring ( 0 , Data . Temp . IndexOf ( ' ' ) ) ; if ( temp_time != " " ) { dTemp_Time = ( Convert . ToDouble ( temp_time ) + 70000.00 ) ; if ( dTemp_Time >= 240000.00 ) dTemp_Time -= 240000.00 ; Data . Time = dTemp_Time . ToString ( ) ; } } } }
Onlly get data, not show date
To get start time anf end of time
Onlly get data not show date To get start time anf end of time
//xu ly voi com //cắt bỏ ký tự '$' //cut bỏ Data đến dấu phẩy đầu tiên lấy sau dấu phẩy đầu tiên //Data.Temp = "024004.900,1043.4006,N,10641.3309,E,1,4,2.67,7.8,M,2.5,M,,*67 "; ////tbOutputText.Text += "DataSauCut: " + Data.Temp + '\n'; //tách lấy giờ, thời gian GPS chậm hơn thời gian thực 7h nên phải cộng 7 //Nếu time >= 240000.00 thì phải trừ đi 240000.00