Notebook FanControl custom use

A user called Grantig on computerbase.de created the tool Notebook FanControl. It is written in C# and uses WCF for communication with a backend service. Using JustDecompile and the information from the config I managed to build my own front-end.

Image courtesy of bplanet
Image courtesy of bplanet / FreeDigitalPhotos.net

The Fancontrol client uses a DispatcherTimer for interval updates. A DispatcherTimer is close related to WPF and needs some extra work for unittesting and other non-WPF programs. So I’m using polling.

// simplified code
var model = new NbfcServiceClient.ViewModels.MainWindowViewModel();
model.PropertyChanged += (s, e) => 
    Console.WriteLine(model.CpuTemperature);
var client = new NbfcServiceClient.FanControlClient(model, 10);
client.StartFanControl();

// polling (done recursive)
Task.Factory.StartNew(() => {
    client.UpdateViewModel();
    Thread.Sleep(10000);
};

References

How to Test a Class Which Uses DispatcherTimer by Josh Smith.
My sources on Github

About erictummers

My work as a recruited developer changes almost every month. I like challenges and sharing the solutions with others. On my blog I’ll mostly post about my work, but expect an occasional home project, productivity tip and tooling review.
This entry was posted in Development and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s