Example #1
0
        private void ParseDataLine(string line, ScanDirection direction)
        {
            if (string.IsNullOrWhiteSpace(line))
            {
                return;
            }
            char[]   charSeparators = { ';' }; // fields are separated by semicolons
            string[] tokens         = line.Split(charSeparators, StringSplitOptions.RemoveEmptyEntries);
            if (tokens.Length != 5)
            {
                return;
            }
            DataMask = long.Parse(tokens[2]);   // the data mask is hopefully always the same
            int      scanLineLength = int.Parse(tokens[1]);
            DateTime timeStamp      = ParseTimeToken(tokens[0]);

            if (direction == ScanDirection.Forward)
            {
                ForwardProfileLengths.Add(scanLineLength);
                forwardTimeStamps.Add(timeStamp);
            }
            if (direction == ScanDirection.Backward)
            {
                BackwardProfileLengths.Add(scanLineLength);
                backwardTimeStamps.Add(timeStamp);
            }
        }
Example #2
0
 private void FindShortProfiles(int nominalProfileLength)
 {
     if (ForwardProfileLengths.Count() > 0)
     {
         ProfilsDefectsForward = new int[ForwardProfileLengths.Count()];
         for (int i = 0; i < ForwardProfileLengths.Count(); i++)
         {
             ProfilsDefectsForward[i] = nominalProfileLength - ForwardProfileLengths[i];
         }
     }
     if (BackwardProfileLengths.Count() > 0)
     {
         ProfilsDefectsBackward = new int[BackwardProfileLengths.Count()];
         for (int i = 0; i < BackwardProfileLengths.Count(); i++)
         {
             ProfilsDefectsBackward[i] = nominalProfileLength - BackwardProfileLengths[i];
         }
     }
 }
Example #3
0
        }                                                  // the number of sporious data lines in the backward scan file

        private void DetermineNominalDataPointNumber()
        {
            NominalDataPoints = 0;
            DataPointsGlitch  = 0;
            if (ScanStatus == ScanDirectionStatus.NoData)
            {
                return;
            }
            if (ScanStatus == ScanDirectionStatus.Unknown)
            {
                return;
            }
            if (NumberOfProfiles < 1)
            {
                return;
            }
            NominalDataPoints = ForwardProfileLengths.Max();
            DataPointsGlitch  = NominalDataPoints - ForwardProfileLengths.Min();
            if (ScanStatus == ScanDirectionStatus.ForwardAndBackward || ScanStatus == ScanDirectionStatus.ForwardAndBackwardJustified)
            {
                NominalDataPoints = Math.Max(NominalDataPoints, BackwardProfileLengths.Max());
                DataPointsGlitch  = Math.Max(DataPointsGlitch, NominalDataPoints - BackwardProfileLengths.Min());
            }
        }