public BiometricTelemetryService(string EventHubConnectionString) { _eventHub = new EventHubMessageSender(EventHubConnectionString); ConfigureOverSampling(); Init(); }
public KioskInteractionService(ISensorService <KinectSensor> sensorService, IDemographicsService demographicsService, IItemInteractionService itemInteractionService, IBodyTrackingService bodyTrackingService, IConfigurationProvider configurationProvider) { _currentZone = "NoTrack"; _demographicService = demographicsService; _InteractionEventHub = new EventHubMessageSender(ConfigurationManager.AppSettings["Azure.Hub.Kiosk"]); _sensorService = sensorService; SendKioskReportConfigurationToAzure(); _itemInteractionService = itemInteractionService; _itemInteractionService.ItemInteraction += _itemInteractionService_ItemInteraction; _coordinateMapper = _sensorService.Sensor.CoordinateMapper; _configurationProvider = configurationProvider; _configurationProvider.ConfigurationSettingsChanged += _configurationProvider_ConfigurationSettingsChanged; GetConfig(); _sensorService.StatusChanged += _sensorService_StatusChanged; _bodyFrameReader = _sensorService.Sensor.BodyFrameSource.OpenReader(); if (_bodyFrameReader != null) { _bodyFrameReader.FrameArrived += _bodyFrameReader_FrameArrived; } _sensorService.Open(); // Telemetry processing routine done on a seperate background thread via queues _interactionProcessingQueue = new BlockingCollection <KioskStateEventArgs>(); { IObservable <KioskStateEventArgs> ob = _interactionProcessingQueue. GetConsumingEnumerable(). ToObservable(TaskPoolScheduler.Default); ob.Subscribe(p => { // This handler will get called whenever // anything appears on myQueue in the future. this.SendIteraction(p); }); } _bodyTrackingService = bodyTrackingService; CurrentState = KioskStates.NoTrack; }
public KioskInteractionService(ISensorService<KinectSensor> sensorService, IDemographicsService demographicsService, IItemInteractionService itemInteractionService, IBodyTrackingService bodyTrackingService, IConfigurationProvider configurationProvider) { _currentZone = "NoTrack"; _demographicService = demographicsService; _eventHub = new EventHubMessageSender(ConfigurationManager.AppSettings["Azure.Hub.Kiosk"]); _sensorService = sensorService; // _telemetryService = telemetryService; _itemInteractionService = itemInteractionService; _itemInteractionService.ItemInteraction += _itemInteractionService_ItemInteraction; _coordinateMapper = _sensorService.Sensor.CoordinateMapper; _configurationProvider = configurationProvider; _configurationProvider.ConfigurationSettingsChanged += _configurationProvider_ConfigurationSettingsChanged; GetConfig(); _sensorService.StatusChanged += _sensorService_StatusChanged; _bodyFrameReader = _sensorService.Sensor.BodyFrameSource.OpenReader(); if (_bodyFrameReader != null) _bodyFrameReader.FrameArrived += _bodyFrameReader_FrameArrived; _sensorService.Open(); _interactionProcessingQueue = new BlockingCollection<KioskStateEventArgs>(); { IObservable<KioskStateEventArgs> ob = _interactionProcessingQueue. GetConsumingEnumerable(). ToObservable(TaskPoolScheduler.Default); ob.Subscribe(p => { //var temp = Thread.CurrentThread.ManagedThreadId; // This handler will get called whenever // anything appears on myQueue in the future. this.SendIteraction(p); //Debug.Write("Consuming: {0}\n", p); }); } _bodyTrackingService = bodyTrackingService; CurrentState = KioskStates.NoTrack; }
private void SendKioskReportConfigurationToAzure() { //Send the KioskConfig to Azure for reporting purposes KioskReportingConfig rptConfig; var configEventHub = new EventHubMessageSender(ConfigurationManager.AppSettings["Azure.Hub.KioskConfig"]); using (StreamReader r = new StreamReader("KioskReportingConfig.json")) { string json = r.ReadToEnd(); rptConfig = JsonConvert.DeserializeObject <KioskReportingConfig>(json); } var id = _sensorService.Sensor.UniqueKinectId; rptConfig.kinectID = id; configEventHub.SendMessageToEventHub(rptConfig); }
public SkeletalTelemetryService(string EventHubConnectionString) { _eventHub = new EventHubMessageSender(EventHubConnectionString); }