private void addRecord(TransformationRecord record, ref TransformationRecords records, int maxRecordSize)
 {
     if (records.Count <= 0)
     {
         records.Add(record);
     }
     else
     {
         double distToPrevPoint = DVector2.EuclDistance(records[records.Count - 1].ArPositionAsDVector2, record.ArPositionAsDVector2);
         if (!records[records.Count - 1].ArPositionAsDVector2.Equals(record.ArPositionAsDVector2) && distToPrevPoint > minDistDataCollectionThreshold)
         {
             records.Add(record);
         }
     }
     if (records.Count > maxRecordSize)
     {
         records.RemoveAt(0);
     }
 }
        public void AddRecord(TransformationRecord record)
        {
            if (record.GpsPosition.Accuracy > minAccuracy)
            {
                return;
            }

            if ((NumberOfRecords + NumberOfTestRecords) % testRecordSelectionStep == 0 && this.records.Count > 0)
            {
                addRecord(record, ref this.testRecords, maxTestRecordSize);
            }
            else
            {
                addRecord(record, ref this.records, maxRecordSize);
            }
            //{
            //    if (testRecords.Count <= 0)
            //        testRecords.Add(record);
            //    else
            //    {
            //        double distToPrevPoint = DVector2.EuclDistance(testRecords[testRecords.Count - 1].ArPositionAsDVector2, record.ArPositionAsDVector2);
            //        if (!testRecords[testRecords.Count - 1].ArPositionAsDVector2.Equals(record.ArPositionAsDVector2) && distToPrevPoint > minDistDataCollectionThreshold)
            //            testRecords.Add(record);
            //    }
            //    if (testRecords.Count > maxTestRecordSize)
            //        testRecords.RemoveAt(0);
            //}
            //else
            //{
            //    if (records.Count <= 0)
            //        records.Add(record);
            //    else
            //    {
            //        double distToPrevPoint = DVector2.EuclDistance(records[records.Count - 1].ArPositionAsDVector2, record.ArPositionAsDVector2);
            //        if (!records[records.Count - 1].ArPositionAsDVector2.Equals(record.ArPositionAsDVector2) && distToPrevPoint > minDistDataCollectionThreshold)
            //            records.Add(record);
            //    }
            //    if (records.Count > maxRecordSize)
            //        records.RemoveAt(0);
            //}
        }