mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-04-06 06:43:49 +00:00
Clickable help and other changes
This commit is contained in:
parent
d56d123e61
commit
52d68d4b7f
6 changed files with 24 additions and 105 deletions
|
|
@ -9,87 +9,9 @@ namespace FanControl
|
|||
{
|
||||
internal class Program
|
||||
{
|
||||
public class UpdateVisitor : IVisitor
|
||||
{
|
||||
public void VisitComputer(IComputer computer)
|
||||
{
|
||||
computer.Traverse(this);
|
||||
}
|
||||
public void VisitHardware(IHardware hardware)
|
||||
{
|
||||
hardware.Update();
|
||||
foreach (IHardware subHardware in hardware.SubHardware) subHardware.Accept(this);
|
||||
}
|
||||
public void VisitSensor(ISensor sensor) { }
|
||||
public void VisitParameter(IParameter parameter) { }
|
||||
}
|
||||
|
||||
public static void Monitor()
|
||||
{
|
||||
Computer computer = new Computer
|
||||
{
|
||||
IsCpuEnabled = true,
|
||||
IsGpuEnabled = true,
|
||||
IsMemoryEnabled = true,
|
||||
IsMotherboardEnabled = true,
|
||||
IsControllerEnabled = true,
|
||||
IsNetworkEnabled = true,
|
||||
IsStorageEnabled = true,
|
||||
IsPsuEnabled = true,
|
||||
IsBatteryEnabled = true
|
||||
};
|
||||
|
||||
computer.Open();
|
||||
//computer.Accept(new UpdateVisitor());
|
||||
|
||||
foreach (IHardware hardware in computer.Hardware)
|
||||
{
|
||||
Console.WriteLine("Hardware: {0}. Type: {1}", hardware.Name, hardware.HardwareType);
|
||||
|
||||
foreach (IHardware subhardware in hardware.SubHardware)
|
||||
{
|
||||
Console.WriteLine("\tSubhardware: {0}", subhardware.Name);
|
||||
|
||||
foreach (ISensor sensor in subhardware.Sensors)
|
||||
{
|
||||
Console.WriteLine("\t\tSensor: {0}, value: {1}, type: {2}", sensor.Name, sensor.Value, sensor.SensorType);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (ISensor sensor in hardware.Sensors)
|
||||
{
|
||||
Console.WriteLine("\tSensor: {0}, value: {1}, type: {2}", sensor.Name, sensor.Value, sensor.SensorType);
|
||||
}
|
||||
}
|
||||
|
||||
computer.Close();
|
||||
}
|
||||
static void ConsoleMain(string[] args)
|
||||
{
|
||||
Monitor();
|
||||
|
||||
while (true)
|
||||
{
|
||||
Thread.Sleep(300);
|
||||
|
||||
Vlv0100.SetFanControl(false);
|
||||
Vlv0100.SetFanDesiredRPM(6000);
|
||||
|
||||
Console.WriteLine("Fan RPM: {0}", Vlv0100.GetFanRPM());
|
||||
Console.WriteLine("Fan Desired RPM: {0}", Vlv0100.GetFanDesiredRPM());
|
||||
}
|
||||
}
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
if (Environment.UserInteractive && !Console.IsInputRedirected)
|
||||
{
|
||||
ConsoleMain(args);
|
||||
}
|
||||
else
|
||||
{
|
||||
Application.Run(new FanControlForm());
|
||||
}
|
||||
Application.Run(new FanControlForm());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue