示例#1
0
        public void AddReport(DateTime date, byte[] recordBuf)
        {
            SPEED_RECORD  record;
            MySpeedRecord sRecord;

            record = (SPEED_RECORD)Lib.ByteArrayToObject(recordBuf, typeof(SPEED_RECORD));
            if (record.crc == Lib.CalcCrc(recordBuf, 0, recordBuf.Length - 1))
            {
                if ((record.currentTime.hour < 24) && (record.currentTime.min < 60) && (record.currentTime.sec < 60))
                {
                    if ((record.lat >= -90) && (record.lat <= 90) &&
                        (record.lng >= -180) && (record.lng <= 180))
                    {
                        if (record.speed < 300)
                        {
                            sRecord = new MySpeedRecord(date, record);
                            speedRecords.Add(sRecord);
                        }
                    }
                }
            }
        }
示例#2
0
 public void AddReport(MySpeedRecord record)
 {
     speedRecords.Add(record);
 }