Files
ReLibreHardwareMonitor/LibreHardwareMonitorLib/Hardware/Gpu/PowerMonitor/WireViewPro2Sensor.cs
T
BlacktempelandPhyxionNL df9e0a5131 Add support for Thermal Grizzly WireView Pro 2. (#2171)
* Add support for Thermal Grizzly WireView Pro 2.

* Process PR comments.

* PR comments.

* Add private keyword.

* PR comments.

* Replace WMI with SetupAPI.

Some first updates according to Thermal Grizzly code.

* Add report.

* Further improve implementation according to code of Thermal Grizzly (thanks !).

* No connection check for welcome message.

* Rename class + change SerialPort to SharedSerialPort for guard - fixing mutex issues.

* PR comments.

* Remove SP_DEVINFO_DATA from NativeMethods.txt

* Update WireViewPro2.cs

* Rename hasMutex to _hasMutex for consistency

* Formatting

* Fix build

---------

Co-authored-by: PhyxionNL <7643972+PhyxionNL@users.noreply.github.com>
2026-01-27 13:20:07 +01:00

30 lines
1.0 KiB
C#

// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
// Copyright (C) LibreHardwareMonitor and Contributors.
// Partial Copyright (C) Michael Möller <mmoeller@openhardwaremonitor.org> and Contributors.
// All Rights Reserved.
using LibreHardwareMonitor.Interop.PowerMonitor;
namespace LibreHardwareMonitor.Hardware.Gpu.PowerMonitor;
internal delegate float GetWireViewPro2SensorValue(DeviceData wvp);
internal class WireViewPro2Sensor : Sensor
{
readonly GetWireViewPro2SensorValue _getValue;
public WireViewPro2Sensor(string name, int index, SensorType sensorType, Hardware hardware, ISettings settings, GetWireViewPro2SensorValue getValue)
: base(name, index, sensorType, hardware, settings)
{
_getValue = getValue;
}
internal void Update(DeviceData wvp)
{
float value = _getValue(wvp);
Value = value;
}
}