mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-31 22:35:11 +00:00
Added a minimal control interface to allow manual fan control and implemented the interface for ATI GPUs.
This commit is contained in:
@@ -461,6 +461,34 @@ namespace OpenHardwareMonitor.GUI {
|
||||
};
|
||||
sensorContextMenu.MenuItems.Add(item);
|
||||
}
|
||||
if (node.Sensor.Control != null) {
|
||||
IControl control = node.Sensor.Control;
|
||||
MenuItem controlItem = new MenuItem("Control");
|
||||
MenuItem defaultItem = new MenuItem("Default");
|
||||
defaultItem.Checked = control.ControlMode == ControlMode.Default;
|
||||
controlItem.MenuItems.Add(defaultItem);
|
||||
defaultItem.Click += delegate(object obj, EventArgs args) {
|
||||
control.SetDefault();
|
||||
};
|
||||
MenuItem manualItem = new MenuItem("Manual");
|
||||
controlItem.MenuItems.Add(manualItem);
|
||||
manualItem.Checked = control.ControlMode == ControlMode.Software;
|
||||
for (int i = 0; i <= 100; i += 5) {
|
||||
if (i <= control.MaxSoftwareValue &&
|
||||
i >= control.MinSoftwareValue)
|
||||
{
|
||||
MenuItem item = new MenuItem(i + " %");
|
||||
manualItem.MenuItems.Add(item);
|
||||
item.Checked = control.ControlMode == ControlMode.Software &&
|
||||
Math.Round(control.SoftwareValue) == i;
|
||||
int softwareValue = i;
|
||||
item.Click += delegate(object obj, EventArgs args) {
|
||||
control.SetSoftware(softwareValue);
|
||||
};
|
||||
}
|
||||
}
|
||||
sensorContextMenu.MenuItems.Add(controlItem);
|
||||
}
|
||||
|
||||
sensorContextMenu.Show(treeView, new Point(m.X, m.Y));
|
||||
}
|
||||
|
Reference in New Issue
Block a user