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:
@@ -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()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user