public string GetGraphicCardName() { var name = _sensorService.GetGpuName(); return(name == "Unknown" ? GetGraphicCardNameFromWMI() : name); }
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)); }
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; })); }