No longer read unnecessary data in -readFanData

-readFanData was always reading the temperature and the speeds of all
of the fans regardless of what data was displayed in the menu bar. Now,
-readFanData only reads the data necessary to update the text in the
menubar, so, if only the temp is displayed, only the temp is read. The
updating of the fan speeds in the menu is now only done when the user
clicks on the menu. Also: cleaned up some test code and deleted an
unnecessary comment.
This commit is contained in:
Michael Wilber
2013-12-25 09:47:10 -05:00
parent c537db9fdd
commit 3328c0018f
4 changed files with 151 additions and 116 deletions

View File

@ -38,11 +38,8 @@
#define kMenuBarHeight 22
// Max number of fans supported.
#define kMaxFanRpms 100
@interface FanControl : NSObject
@interface FanControl : NSObject <NSMenuDelegate>
{
IBOutlet id currentSpeed;
@ -134,6 +131,7 @@
- (void) syncBinder:(Boolean)bind;
- (IBAction) changeMenu:(id)sender;
- (IBAction)menuSelect:(id)sender;
- (void)menuNeedsUpdate:(NSMenu*)menu;
@end