add files and projects
This commit is contained in:
33
CPUGPUTempMonitorArduinoSerialSend/Program.cs
Normal file
33
CPUGPUTempMonitorArduinoSerialSend/Program.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using OpenHardwareMonitor.Hardware;
|
||||
|
||||
namespace CPUGPUTempMonitorArduinoSerialSend
|
||||
{
|
||||
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) { }
|
||||
}
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
UpdateVisitor updateVisitor = new UpdateVisitor();
|
||||
Computer computer = new Computer();
|
||||
computer.Open();
|
||||
computer.CPUEnabled = true;
|
||||
computer.Accept(updateVisitor);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user