public void Initialise_capture(Device device) { this.device = device; var capturers = this.GetComponents<Capturer>(); if(capturers.Any()) { foreach(var capturer in capturers) { Destroy (capturer); } } switch(this.device) { case Device.MULTI_KINECT_WIMUS: this.capturer = this.gameObject.AddComponent<Kinect2Managing>(); this.calibrator = this.capturer is ICalibrator ? this.capturer as ICalibrator : null; this.syncer = this.capturer is ISyncer ? this.capturer as ISyncer : null; this.reconstructor = this.capturer is IReconstructor ? this.capturer as IReconstructor : null; this.recorder = CompositeRecorder.FromRecorders(this.capturer);//TODO: fusion capturer to be added here this.skeletonCapturer = new NoneSkeletonCapturer();//TODO: add fusion here break; case Device.SINGLE_KINECT_2: var k2controller = this.gameObject.AddComponent<Kinect2Controlling>(); k2controller.Streams = KinectStreams.Skeleton; k2controller.enabled = false;// re-enable k2controller.enabled = true; this.capturer = k2controller; this.exporter = GetComponent<SkeletonExporting>(); this.recorder = CompositeRecorder.FromRecorders(this.capturer); this.skeletonCapturer = FindObjectsOfType<Capturer>().First((cap) => cap is ISkeletonGenerator<SkeletonFrame>) as ISkeletonGenerator<SkeletonFrame>; break; } }
public Coordinator(IRestFulServer restFulServer, IScraperFactory scraperFactory, ISyncer syncer, ScraperConfig config, CancellationTokenSource cancellationTokenSource) { _restFulServer = restFulServer ?? throw new ArgumentNullException(nameof(restFulServer)); _scraperFactory = scraperFactory ?? throw new ArgumentNullException(nameof(scraperFactory)); _syncer = syncer ?? throw new ArgumentNullException(nameof(syncer)); _config = config ?? throw new ArgumentNullException(nameof(config)); _manualResetEvent = new AsyncManualResetEvent(true); _cancellationTokenSource = cancellationTokenSource ?? throw new ArgumentNullException(nameof(cancellationTokenSource)); }
public Syncer(Collection col, ISyncer server = null) { collection = col; this.server = server; }