Slight refactor for ARCTIC Fan Controller (#2205)
* Slight refactor * Update fan and control sensor naming format --------- Co-authored-by: PhyxionNL <7643972+PhyxionNL@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
||||
// 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.
|
||||
@@ -32,14 +32,14 @@ internal class ArcticFanController : Hardware
|
||||
private readonly System.Collections.Generic.List<Sensor> _rpmSensors = new();
|
||||
private readonly System.Collections.Generic.List<Sensor> _controlSensors = new();
|
||||
|
||||
public ArcticFanController(HidDevice dev, ISettings settings) : base("Arctic Fan Controller", new Identifier(dev), settings)
|
||||
public ArcticFanController(HidDevice dev, ISettings settings) : base("ARCTIC Fan Controller", new Identifier(dev), settings)
|
||||
{
|
||||
if (dev.TryOpen(out HidStream hidStream))
|
||||
{
|
||||
// Create fan sensors (RPM monitoring) - all 10 fans have RPM feedback
|
||||
for (int i = 1; i <= CHANNEL_COUNT; i++)
|
||||
{
|
||||
var fanSensor = new Sensor($"Arctic Controller Fan {i}", i, SensorType.Fan, this, settings);
|
||||
var fanSensor = new Sensor($"Fan #{i}", i, SensorType.Fan, this, settings);
|
||||
ActivateSensor(fanSensor);
|
||||
_rpmSensors.Add(fanSensor);
|
||||
}
|
||||
@@ -47,7 +47,7 @@ internal class ArcticFanController : Hardware
|
||||
// Create control sensors - all 10 fans can be controlled
|
||||
for (int i = 1; i <= CHANNEL_COUNT; i++)
|
||||
{
|
||||
var controlSensor = new Sensor($"Arctic Controller Fan Control {i}", i, SensorType.Control, this, settings);
|
||||
var controlSensor = new Sensor($"Control #{i}", i, SensorType.Control, this, settings);
|
||||
Control control = new(controlSensor, settings, CONTROL_VALUE_MIN, CONTROL_VALUE_MAX);
|
||||
control.ControlModeChanged += Control_ControlModeChanged;
|
||||
control.SoftwareControlValueChanged += Control_SoftwareControlValueChanged;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
||||
// 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.
|
||||
@@ -22,7 +22,7 @@ internal class ArcticGroup : IGroup
|
||||
|
||||
public ArcticGroup(ISettings settings)
|
||||
{
|
||||
_report.AppendLine("Arctic Hardware");
|
||||
_report.AppendLine("ARCTIC Hardware");
|
||||
_report.AppendLine();
|
||||
try
|
||||
{
|
||||
@@ -32,12 +32,12 @@ internal class ArcticGroup : IGroup
|
||||
if (hidDevice != null)
|
||||
{
|
||||
_hardware.Add(new ArcticFanController(hidDevice, settings));
|
||||
_report.AppendLine("Arctic Fan Controller initialized successfully");
|
||||
_report.AppendLine("ARCTIC Fan Controller initialized successfully");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_report.AppendLine($"Arctic Fan Controller Plugin initialization failed: {ex.Message}");
|
||||
_report.AppendLine($"ARCTIC Fan Controller Plugin initialization failed: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user