|
Steampunk thermometer gets an executable |
|
|
|
Friday, 15 April 2011 |
|
Steampunk thermometer gets an executable...
I realised that extracting the temperatures from the Speedfan logs by
scraping the logs would be do-able but inefficient and slow. Looking at
how other widgets achieved this I found two widgets, one of which did
the extraction of temperatures the way I was originally proposing but
another that did it using a windows executable. This second method was
faster and neater and meant that the widget code would be a lot simpler.
Simply put, to extract the temperatures efficiently, I could use a
windows .exe which interfaces with the speedfan API, the trouble was
that I didn't have a clue how to create it. I asked the developer of the
second widget whether I could use the executable included in his widget
(crediting him) but he was completely unwilling to let me do so. I asked
for assistance but he wasn't willing to help in this respect. A pity.
So I did a search through the net to find out how to interface VB.NET
with the speedfan API using shared memory. The reason I did this was
that my only real programming experience is using visualbasic (6) and
even though my .net knowledge is severely limited it was still the best
bet. However, my search came back with nothing.
There was however, a solution found using C++. A kind developer had
pasted his code to do exactly what I required. All I now needed was an
environment to make code changes and compile it all in. Several
fruitless attempts at loading various C++ IDEs including some from
Microsoft, all failed for some reason or another (just couldn't get them
to work). In the end my friend Harry Whitfield came to the rescue and
provided a link to the free C++ IDE and compiler from
http://www.bloodshed.net/
This compiler created an executable first time it tried. Perfect. This
means I have a windows executable that can return the various
temperatures just as the 'other' widget does. It should run quickly. I
am pretty certain the other widget developer got his code from the same
place as me. Pity he wasn't prepared to share it. I have decided to
share my code and so I will bundle the C++ source code with the widget
as well as the executable.
So, what is the end result? Well it is positive.
I have managed to get the
widget to read all the sensor names from speedfan's sensor configuration file.
the widget is also processing the information provided by the new windows
executable and is now using these to successfully prime the two graphic
thermometers. Bu@@er me, it works...
OK, due to the fact that all computers have different hardware with a
different number of sensors it will be difficult to determine whether it works
for
all hardware combinations but I think it is time to start giving it a try.
Other changes include adding code to handle the installation of
speedfan.exe in the /Program Files (86)/ or the /Program Files/ folders.
There was a bug causing it to check both folders simultaneously causing
the non-flashing red light to display. I have added the 'about' pop-up
from the menu. Added code to c++ code for speedfan.exe to check whether
speedfan is actually running. Finally the printer bars and trunnions
have been coloured brass to match the rest of the widget. A few more
changes and the new widget will be made available for download.
|
|
Last Updated ( Sunday, 11 September 2011 )
|