Fixes saving the sensor values on program exit and the displayed fan control values for NVIDIA GPUs.. (#575)

* Fixes saving the sensor values on program exit.

* Fixes the displayed fan control values for NVIDIA GPUs.

* Update NvidiaGpu.cs

Check cooler id.

Co-authored-by: PhyxionNL <7643972+PhyxionNL@users.noreply.github.com>
This commit is contained in:
JoeBroesele
2021-10-18 22:11:56 +02:00
committed by GitHub
co-authored by PhyxionNL
parent 3cf5fe92fd
commit 6b86ec9253
2 changed files with 19 additions and 16 deletions
+12 -11
View File
@@ -189,19 +189,20 @@ namespace LibreHardwareMonitor.Hardware
using MemoryStream memoryStream = new();
using GZipStream gZipStream = new(memoryStream, CompressionMode.Compress);
using BufferedStream outputStream = new(gZipStream, 65536);
using BinaryWriter binaryWriter = new(outputStream);
long t = 0;
foreach (SensorValue sensorValue in _values)
using (BinaryWriter binaryWriter = new(outputStream))
{
long v = sensorValue.Time.ToBinary();
binaryWriter.Write(v - t);
t = v;
binaryWriter.Write(sensorValue.Value);
}
long t = 0;
binaryWriter.Flush();
foreach (SensorValue sensorValue in _values)
{
long v = sensorValue.Time.ToBinary();
binaryWriter.Write(v - t);
t = v;
binaryWriter.Write(sensorValue.Value);
}
binaryWriter.Flush();
}
_settings.SetValue(new Identifier(Identifier, "values").ToString(), Convert.ToBase64String(memoryStream.ToArray()));
}