예제 #1
0
        public CameraData(CameraData src)
        {
            if (null == src)
            {
                ArgumentNullException argumentNullException = new ArgumentNullException("src in CameraData copy constructor");
                throw argumentNullException;
            }
            else
            {
                ID           = Guid.NewGuid();
                FrameHistory = new History(300);
                CameraPrefix = src.CameraPrefix;
                Path         = src.Path;

                RegistrationX           = src.RegistrationX;
                RegistrationY           = src.RegistrationY;
                RegistrationXResolution = src.RegistrationXResolution;
                RegistrationYResolution = src.RegistrationYResolution;
                Monitoring      = src.Monitoring;
                LiveContactData = new CameraContactData(src.LiveContactData);
                AOI             = new AreasOfInterestCollection(src.AOI);
                Monitor         = null;
                NoMotionTimeout = src.NoMotionTimeout;
            }
        }
        public AreasOfInterestCollection(AreasOfInterestCollection src)
        {
            _areas = new SortedDictionary <Guid, AreaOfInterest>();

            foreach (AreaOfInterest area in src._areas.Values)
            {
                AreaOfInterest newArea = new AreaOfInterest(area); // not sure if we need a copy or a reference
                _areas.Add(newArea.ID, newArea);
            }
        }
예제 #3
0
 public CameraData(string prefix, string path)
 {
     ID              = Guid.NewGuid();
     FrameHistory    = new History(300);
     LiveContactData = new CameraContactData();
     CameraPrefix    = prefix;
     Path            = path;
     Monitoring      = true;
     AOI             = new AreasOfInterestCollection(Path, CameraPrefix);
     NoMotionTimeout = 90;
 }
예제 #4
0
 // Temporarily just mimic the old file based one.
 // TODO: Just save each area individually
 public static void SaveAllAreas(string cameraPath, string cameraPrefix, AreasOfInterestCollection areas)
 {
     using (RegistryKey cameraKey = FindCameraKey(cameraPath, cameraPrefix))
     {
         if (null != cameraKey)
         {
             foreach (AreaOfInterest area in areas)
             {
                 SaveArea(cameraKey, area);
             }
         }
     }
 }
예제 #5
0
        public AreasOfInterestCollection(AreasOfInterestCollection src)
        {
            Debug.Assert(src != null);
            if (src != null)
            {
                _cameraPath   = src._cameraPath;
                _cameraPrefix = src._cameraPrefix;
                _areas        = new SortedDictionary <Guid, AreaOfInterest>();

                foreach (AreaOfInterest area in src._areas.Values)
                {
                    AreaOfInterest newArea = new AreaOfInterest(area); // not sure if we need a copy or a reference
                    _areas.Add(newArea.ID, newArea);
                }
            }
        }
예제 #6
0
파일: Storage.cs 프로젝트: kummerr/On-Guard
        // Temporarily just mimic the old file based one.
        // TODO: Just save each area individually
        public static void SaveAllAreas(string cameraPath, string cameraPrefix, AreasOfInterestCollection areas)
        {
            if (!string.IsNullOrEmpty(cameraPath) && !string.IsNullOrEmpty(cameraPrefix) && areas != null)
            {
                using (RegistryKey cameraKey = FindCameraKey(cameraPath, cameraPrefix))
                {
                    if (null != cameraKey)
                    {
                        // First delete the areas to account for area deletion
                        foreach (string areaKeyName in cameraKey.GetSubKeyNames())
                        {
                            cameraKey.DeleteSubKeyTree(areaKeyName, false);
                        }

                        foreach (AreaOfInterest area in areas)
                        {
                            SaveArea(cameraKey, area);
                        }
                    }
                }
            }
        }
예제 #7
0
        public EditAreasOfInterest(AreasOfInterestCollection areas)
        {
            _areas = areas;

            InitializeComponent();

            foreach (var area in _areas)
            {
                string[] row = new string[5] {
                    area.AOIName,
                    area.GetRect().X.ToString(),
                    area.GetRect().Y.ToString(),
                    area.GetRect().Width.ToString(),
                    area.GetRect().Height.ToString()
                };

                ListViewItem item = new ListViewItem(row)
                {
                    Tag = area
                };

                areasListView.Items.Add(item);
            }
        }
예제 #8
0
 public FrameAnalyzer(AreasOfInterestCollection areas, List <ImageObject> imageObjects)
 {
     InterestingObjects = new List <InterestingObject>();
     _areas             = areas;
     _imageObjects      = imageObjects;
 }