Пример #1
0
        public void AddHikvisionIsapiCamera(Camera.Hikvision.Isapi.CameraSettings device)
        {
            using (var scopedLock = configLock.WriterLock())
            {
                hikvisionIsapiCameras[device.Id] = device;

                SetValue(nameof(device.Name), device.Name, device.Id);
                SetValue(nameof(device.CameraHost), device.CameraHost, device.Id);
                SetValue(nameof(device.Login), device.Login, device.Id);
                SetValue(nameof(device.Password), HS.EncryptString(device.Password, nameof(device.Password)), device.Id);
                SetValue(nameof(device.AlarmCancelInterval), (long)device.AlarmCancelInterval.TotalSeconds, device.Id);
                SetValue(nameof(device.CameraPropertiesRefreshInterval), (long)device.CameraPropertiesRefreshInterval.TotalSeconds, device.Id);
                SetValue(nameof(device.SnapshotDownloadDirectory), device.SnapshotDownloadDirectory, device.Id);
                SetValue(nameof(device.VideoDownloadDirectory), device.VideoDownloadDirectory, device.Id);

                SetValue(HikvisionIsapiCameraIds, hikvisionIsapiCameras.Keys.Aggregate((x, y) => x + idsSeparator + y));
            }
        }