private IObservable <BlockingCollection <IOverlayEntry> > SetOverlayEntryDefaults()
        {
            var overlayEntries = OverlayUtils.GetOverlayEntryDefaults()
                                 .Select(item => item as IOverlayEntry).ToBlockingCollection();

            // Sensor data
            return(_sensorService.OnDictionaryUpdated
                   .Take(1)
                   .Select(sensorOverlayEntries =>
            {
                sensorOverlayEntries.ForEach(sensor => overlayEntries.TryAdd(sensor));
                return overlayEntries;
            }));
        }
Esempio n. 2
0
        private async Task <BlockingCollection <IOverlayEntry> > GetOverlayEntryDefaults()
        {
            var overlayEntries = OverlayUtils.GetOverlayEntryDefaults()
                                 .Select(item => (item as IOverlayEntry).Clone()).ToBlockingCollection();

            //log hardware configs
            _logger.LogInformation("Set overlay defaults");
            _logger.LogInformation("CPU detected: {cpuName}.", _sensorService.GetCpuName());
            _logger.LogInformation("CPU threads detected: {threadCount}.", Environment.ProcessorCount);
            _logger.LogInformation("GPU detected: {gpuName}.", _sensorService.GetGpuName());

            await _overlayEntryCore.OverlayEntryCoreCompletionSource.Task;

            // Sensor data
            _overlayEntryCore.OverlayEntryDict.Values.ForEach(sensor => overlayEntries.TryAdd(sensor.Clone()));
            return(await Task.FromResult(overlayEntries));
        }
Esempio n. 3
0
        private IObservable <BlockingCollection <IOverlayEntry> > GetOverlayEntryDefaults()
        {
            var overlayEntries = OverlayUtils.GetOverlayEntryDefaults()
                                 .Select(item => (item as IOverlayEntry).Clone()).ToBlockingCollection();

            //log hardware configs
            _logger.LogInformation("Set overlay defaults");
            _logger.LogInformation("CPU detected: {cpuName}.", _sensorService.GetCpuName());
            _logger.LogInformation("CPU threads detected: {threadCount}.", Environment.ProcessorCount);
            _logger.LogInformation("GPU detected: {gpuName}.", _sensorService.GetGpuName());

            // Sensor data
            return(_onDictionaryUpdatedBuffered
                   .Take(1)
                   .Select(sensorOverlayEntries =>
            {
                sensorOverlayEntries.ForEach(sensor => overlayEntries.TryAdd(sensor.Clone()));
                return overlayEntries;
            }));
        }