상속: SensorBase, IMotionDetector
예제 #1
0
        public IMotionDetector RegisterMotionDetector(IArea area, Enum id, IBinaryInput input)
        {
            if (area == null) throw new ArgumentNullException(nameof(area));
            if (input == null) throw new ArgumentNullException(nameof(input));

            var motionDetector = new MotionDetector(
                ComponentIdGenerator.Generate(area.Id, id),
                new PortBasedMotionDetectorEndpoint(input),
                _schedulerService,
                _settingsService);

            area.AddComponent(motionDetector);

            return motionDetector;
        }
예제 #2
0
        public static IArea WithMotionDetector(this IArea area, Enum id, IBinaryInput input)
        {
            if (area == null)
            {
                throw new ArgumentNullException(nameof(area));
            }
            if (input == null)
            {
                throw new ArgumentNullException(nameof(input));
            }

            var motionDetector = new MotionDetector(
                ComponentIdFactory.Create(area.Id, id),
                new PortBasedMotionDetectorEndpoint(input),
                area.Controller.ServiceLocator.GetService <ISchedulerService>());

            area.AddComponent(motionDetector);
            return(area);
        }