Beispiel #1
0
        /// <summary>
        /// Safe way to add to the Pictures Collection once developed
        /// </summary>
        /// <param name="file"></param>
        public void addToPictureFiles(cPictureFile file)
        {
            bool found = pPictureFileCollection.Any(pictureFile => pictureFile.pEncryptedPicture.pEncryptedFileName == file.pEncryptedPicture.pEncryptedFileName);

            if (!found)
            {
                pPictureFileCollection.Add(file);
            }
        }
Beispiel #2
0
        public bool existsPictureFile(string encryptedFileName, out cPictureFile file)
        {
            foreach (var pictureFile in pPictureFileCollection.Where(pictureFile => pictureFile.pEncryptedPicture.pEncryptedFileName == encryptedFileName))
            {
                file = pictureFile;
                return(true);
            }

            file = null;
            return(false);
        }
Beispiel #3
0
        private static int compare(cPictureFile b, cPictureFile a)
        {
            int diff = 0;

            if (b.pOffenceDate != null && a.pOffenceDate != null)
            {
                diff = DateTime.Compare(b.pOffenceDate.Value, a.pOffenceDate.Value);
                return(diff);
            }

            diff = b.pEncryptedPicture.pEncryptedFileNumber.CompareTo(a.pEncryptedPicture.pEncryptedFileNumber);
            return(diff);
        }
Beispiel #4
0
        private static void syncStatWithFile(IStatEntry entry, cPictureFile file)
        {
            string entryDistance = entry.Distance.Replace("m", "");

            try
            {
                file.pDistance = Convert.ToDouble(entryDistance);
            }
            catch
            {
                file.pDistance = 0.0;
            }

            file.pDirection = entry.Direction;
        }
Beispiel #5
0
        /// <summary>
        /// Returns the last [VALID] picture file in the film
        /// </summary>
        /// <returns></returns>
        public cPictureFile getLastValidPictureFile()
        {
            if (pHasEncryptedPictureFiles)
            {
                int          i    = pEncryptedPictureFileCollection.Count - 1;
                cPictureFile file = getPictureFile(pEncryptedPictureFileCollection[i].pEncryptedFileName);

                while (file == null || file.pHasError)
                {
                    if (i < 0)
                    {
                        break;
                    }

                    file = getPictureFile(pEncryptedPictureFileCollection[i].pEncryptedFileName);

                    i--;
                }

                return(file);
            }

            return(null);
        }
Beispiel #6
0
 public virtual bool UpdateFileNumber(cPictureFile pictureFile, long fileNumber)
 {
     return(true);
 }
Beispiel #7
0
 public abstract bool developPicture(cPictureFile pictureFile, out List <cPicture> pictures, out string message);