├── README ├── CPUBurn ├── InfoPlist.strings ├── icon.icns ├── linpack_cd64 ├── lininput ├── CPUBurn-Prefix.pch ├── main.m ├── AppDelegate.h ├── Localizable.strings ├── CPUBurn-Info.plist ├── CPUSensors.h ├── CPUSensors.m ├── AppDelegate.m └── MainMenu.xib └── CPUBurn.xcodeproj ├── project.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ └── yuri.xcuserdatad │ └── UserInterfaceState.xcuserstate ├── xcuserdata └── yuri.xcuserdatad │ └── xcschemes │ ├── xcschememanagement.plist │ └── CPUBurn.xcscheme └── project.pbxproj /README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /CPUBurn/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /CPUBurn/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kyrie1965/CPUBurn/master/CPUBurn/icon.icns -------------------------------------------------------------------------------- /CPUBurn/linpack_cd64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kyrie1965/CPUBurn/master/CPUBurn/linpack_cd64 -------------------------------------------------------------------------------- /CPUBurn/lininput: -------------------------------------------------------------------------------- 1 | CPUBurn data file 2 | Intel(R) Optimized LINPACK Benchmark data 3 | 1 4 | %lld 5 | %lld 6 | 15 7 | 4 8 | -------------------------------------------------------------------------------- /CPUBurn/CPUBurn-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'CPUBurn' target in the 'CPUBurn' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /CPUBurn.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CPUBurn.xcodeproj/project.xcworkspace/xcuserdata/yuri.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kyrie1965/CPUBurn/master/CPUBurn.xcodeproj/project.xcworkspace/xcuserdata/yuri.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /CPUBurn/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CPUBurn 4 | // 5 | // Created by Yuri Yuriev on 14.11.11. 6 | // Copyright (c) 2011 Yuri Yuriev. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **)argv); 14 | } 15 | -------------------------------------------------------------------------------- /CPUBurn.xcodeproj/xcuserdata/yuri.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | CPUBurn.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | DA18DBC914715E02008777F1 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /CPUBurn/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // CPUBurn 4 | // 5 | // Created by Yuri Yuriev on 14.11.11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CPUSensors.h" 11 | 12 | @interface AppDelegate : NSObject 13 | { 14 | CPUSensors *sensors; 15 | NSTimer *timer; 16 | 17 | NSTask *purgeTask; 18 | NSTask *burnTask; 19 | 20 | BOOL running; 21 | } 22 | 23 | @property (assign) IBOutlet NSWindow *window; 24 | @property (assign) IBOutlet NSBox *infoBox; 25 | @property (assign) IBOutlet NSBox *sensorsBox; 26 | @property (assign) IBOutlet NSTextView *infoTextView; 27 | @property (assign) IBOutlet NSTextView *sensorsTextView; 28 | @property (assign) IBOutlet NSProgressIndicator *indicator; 29 | @property (assign) IBOutlet NSTextField *statusTextField; 30 | @property (assign) IBOutlet NSButton *burnButton; 31 | 32 | - (IBAction)burnAction:(id)sender; 33 | 34 | - (void)setSensorsText; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /CPUBurn/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | CPUBurn 4 | 5 | Created by Yuri Yuriev on 14.11.11. 6 | Copyright (c) 2011 Yuri Yuriev. All rights reserved. 7 | */ 8 | 9 | "InfoBoxTitle" = "Важная информация"; 10 | "SensorsBoxTitle" = "Датчики температуры CPU"; 11 | "InfoBoxText" = "Обязательно закройте все программы перед началом \"прожига\". LINPACK Benchmark, на котором базируется программа CPUBurn, от компании Intel® для оптимальной работы (максимальной нагрузки на CPU) требует не менее 1,5 Гб свободной оперативной памяти.\n\nВы запускаете программу на свой страх и риск. Вся ответственно за действия программы лежит только на вас. Автор программы CPUBurn не несёт абсолютно никакой ответственности за результат работы программы. Нажимая кнопку \"Жги!\", вы автоматически с этим соглашаетесь."; 12 | "SensorTemperature" = "Датчик [%@]: %@ °C (максимальная %@ °C)"; 13 | "SensorsNotFound" = "Датчики температуры не обнаружены"; 14 | "BurnButtonTitle" = "Жги!"; 15 | "StopButtonTitle" = "Остановить"; 16 | "PurgeStatus" = "Освобождения неактивной памяти..."; 17 | "BurnStatus" = "Прожигание процессора..."; -------------------------------------------------------------------------------- /CPUBurn/CPUBurn-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ru 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | icon.icns 11 | CFBundleIdentifier 12 | info.yuriev.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | YYYY 23 | CFBundleVersion 24 | 1 25 | LSApplicationCategoryType 26 | public.app-category.utilities 27 | LSMinimumSystemVersion 28 | ${MACOSX_DEPLOYMENT_TARGET} 29 | NSHumanReadableCopyright 30 | Copyright © 2011 Yuri Yuriev. All rights reserved. 31 | NSMainNibFile 32 | MainMenu 33 | NSPrincipalClass 34 | NSApplication 35 | 36 | 37 | -------------------------------------------------------------------------------- /CPUBurn.xcodeproj/xcuserdata/yuri.xcuserdatad/xcschemes/CPUBurn.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 38 | 39 | 40 | 41 | 49 | 50 | 56 | 57 | 58 | 59 | 60 | 61 | 67 | 68 | 74 | 75 | 76 | 77 | 79 | 80 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /CPUBurn/CPUSensors.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPUSensors.h 3 | // CPUSensors 4 | // 5 | // Created by Yuri Yuriev on 14.11.11. 6 | // Copyright (c) 2011 Yuri Yuriev. All rights reserved. 7 | // 8 | 9 | /* 10 | * Apple System Management Control (SMC) Tool 11 | * Copyright (C) 2006 devnull 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software 25 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | */ 27 | 28 | #import 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | 36 | #define KERNEL_INDEX_SMC 2 37 | 38 | #define SMC_CMD_READ_BYTES 5 39 | #define SMC_CMD_WRITE_BYTES 6 40 | #define SMC_CMD_READ_INDEX 8 41 | #define SMC_CMD_READ_KEYINFO 9 42 | #define SMC_CMD_READ_PLIMIT 11 43 | #define SMC_CMD_READ_VERS 12 44 | 45 | #define DATATYPE_FPE2 "fpe2" 46 | #define DATATYPE_UINT8 "ui8 " 47 | #define DATATYPE_UINT16 "ui16" 48 | #define DATATYPE_UINT32 "ui32" 49 | #define DATATYPE_SP78 "sp78" 50 | 51 | typedef struct { 52 | char major; 53 | char minor; 54 | char build; 55 | char reserved[1]; 56 | UInt16 release; 57 | } SMCKeyData_vers_t; 58 | 59 | typedef struct { 60 | UInt16 version; 61 | UInt16 length; 62 | UInt32 cpuPLimit; 63 | UInt32 gpuPLimit; 64 | UInt32 memPLimit; 65 | } SMCKeyData_pLimitData_t; 66 | 67 | typedef struct { 68 | UInt32 dataSize; 69 | UInt32 dataType; 70 | char dataAttributes; 71 | } SMCKeyData_keyInfo_t; 72 | 73 | typedef char SMCBytes_t[32]; 74 | 75 | typedef struct { 76 | UInt32 key; 77 | SMCKeyData_vers_t vers; 78 | SMCKeyData_pLimitData_t pLimitData; 79 | SMCKeyData_keyInfo_t keyInfo; 80 | char result; 81 | char status; 82 | char data8; 83 | UInt32 data32; 84 | SMCBytes_t bytes; 85 | } SMCKeyData_t; 86 | 87 | typedef char UInt32Char_t[5]; 88 | 89 | typedef struct { 90 | UInt32Char_t key; 91 | UInt32 dataSize; 92 | UInt32Char_t dataType; 93 | SMCBytes_t bytes; 94 | } SMCVal_t; 95 | 96 | UInt32 _strtoul(char *str, int size, int base); 97 | void _ultostr(char *str, UInt32 val); 98 | float _strtof(char *str, int size, int e); 99 | kern_return_t SMCCall(io_connect_t conn, int index, SMCKeyData_t *inputStructure, SMCKeyData_t *outputStructure); 100 | kern_return_t SMCReadKey(io_connect_t conn, UInt32Char_t key, SMCVal_t *val); 101 | UInt32 SMCReadIndexCount(io_connect_t conn); 102 | 103 | 104 | @interface CPUSensors : NSObject 105 | { 106 | NSMutableArray *sensors; 107 | 108 | io_connect_t conn; 109 | BOOL initDone; 110 | } 111 | 112 | - (id)init; 113 | - (void)updateSensors; 114 | - (NSArray *)sensorsData; 115 | 116 | @end 117 | -------------------------------------------------------------------------------- /CPUBurn/CPUSensors.m: -------------------------------------------------------------------------------- 1 | // 2 | // CPUSensors.m 3 | // CPUSensors 4 | // 5 | // Created by Yuri Yuriev on 14.11.11. 6 | // Copyright (c) 2011 Yuri Yuriev. All rights reserved. 7 | // 8 | 9 | /* 10 | * Apple System Management Control (SMC) Tool 11 | * Copyright (C) 2006 devnull 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software 25 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | */ 27 | 28 | #import "CPUSensors.h" 29 | 30 | 31 | UInt32 _strtoul(char *str, int size, int base) 32 | { 33 | UInt32 total = 0; 34 | int i; 35 | 36 | for (i = 0; i < size; i++) 37 | { 38 | if (base == 16) 39 | total += str[i] << (size - 1 - i) * 8; 40 | else 41 | total += (unsigned char) (str[i] << (size - 1 - i) * 8); 42 | } 43 | return total; 44 | } 45 | 46 | 47 | void _ultostr(char *str, UInt32 val) 48 | { 49 | str[0] = '\0'; 50 | sprintf(str, "%c%c%c%c", 51 | (unsigned int) val >> 24, 52 | (unsigned int) val >> 16, 53 | (unsigned int) val >> 8, 54 | (unsigned int) val); 55 | } 56 | 57 | 58 | float _strtof(char *str, int size, int e) 59 | { 60 | float total = 0; 61 | int i; 62 | 63 | for (i = 0; i < size; i++) 64 | { 65 | if (i == (size - 1)) 66 | total += (str[i] & 0xff) >> e; 67 | else 68 | total += str[i] << (size - 1 - i) * (8 - e); 69 | } 70 | 71 | return total; 72 | } 73 | 74 | 75 | kern_return_t SMCCall(io_connect_t conn, int index, SMCKeyData_t *inputStructure, SMCKeyData_t *outputStructure) 76 | { 77 | IOItemCount structureInputSize; 78 | size_t structureOutputSize; 79 | 80 | structureInputSize = sizeof(SMCKeyData_t); 81 | structureOutputSize = sizeof(SMCKeyData_t); 82 | 83 | return IOConnectCallStructMethod(conn, 84 | index, 85 | inputStructure, 86 | structureInputSize, 87 | outputStructure, 88 | &structureOutputSize 89 | ); 90 | } 91 | 92 | 93 | kern_return_t SMCReadKey(io_connect_t conn, UInt32Char_t key, SMCVal_t *val) 94 | { 95 | kern_return_t result; 96 | SMCKeyData_t inputStructure; 97 | SMCKeyData_t outputStructure; 98 | 99 | memset(&inputStructure, 0, sizeof(SMCKeyData_t)); 100 | memset(&outputStructure, 0, sizeof(SMCKeyData_t)); 101 | memset(val, 0, sizeof(SMCVal_t)); 102 | 103 | 104 | inputStructure.key = _strtoul(key, 4, 16); 105 | sprintf(val->key, "%s", key); 106 | inputStructure.data8 = SMC_CMD_READ_KEYINFO; 107 | 108 | result = SMCCall(conn, KERNEL_INDEX_SMC, &inputStructure, &outputStructure); 109 | if (result != kIOReturnSuccess) 110 | return result; 111 | 112 | val->dataSize = outputStructure.keyInfo.dataSize; 113 | _ultostr(val->dataType, outputStructure.keyInfo.dataType); 114 | inputStructure.keyInfo.dataSize = val->dataSize; 115 | inputStructure.data8 = SMC_CMD_READ_BYTES; 116 | 117 | result = SMCCall(conn, KERNEL_INDEX_SMC, &inputStructure, &outputStructure); 118 | if (result != kIOReturnSuccess) 119 | return result; 120 | 121 | memcpy(val->bytes, outputStructure.bytes, sizeof(outputStructure.bytes)); 122 | 123 | return kIOReturnSuccess; 124 | } 125 | 126 | 127 | UInt32 SMCReadIndexCount(io_connect_t conn) 128 | { 129 | SMCVal_t val; 130 | 131 | if ((SMCReadKey(conn, "#KEY", &val) == kIOReturnSuccess) && (strcmp(val.dataType, DATATYPE_UINT32) == 0)) 132 | { 133 | UInt32 l = 0; 134 | l |= val.bytes[0] & 0xFF; 135 | l <<= 8; 136 | l |= val.bytes[1] & 0xFF; 137 | l <<= 8; 138 | l |= val.bytes[2] & 0xFF; 139 | l <<= 8; 140 | l |= val.bytes[3] & 0xFF; 141 | 142 | return l; 143 | } 144 | 145 | return 0; 146 | } 147 | 148 | 149 | @implementation CPUSensors 150 | 151 | 152 | - (id)init 153 | { 154 | self = [super init]; 155 | 156 | initDone = NO; 157 | sensors = [[NSMutableArray alloc] initWithCapacity:10]; 158 | 159 | kern_return_t result; 160 | mach_port_t masterPort; 161 | io_iterator_t iterator; 162 | io_object_t device; 163 | 164 | result = IOMasterPort(MACH_PORT_NULL, &masterPort); 165 | 166 | CFMutableDictionaryRef matchingDictionary = IOServiceMatching("AppleSMC"); 167 | result = IOServiceGetMatchingServices(masterPort, matchingDictionary, &iterator); 168 | if (result != kIOReturnSuccess) 169 | { 170 | return self; 171 | } 172 | 173 | device = IOIteratorNext(iterator); 174 | IOObjectRelease(iterator); 175 | if (device == 0) 176 | { 177 | return self; 178 | } 179 | 180 | result = IOServiceOpen(device, mach_task_self(), 0, &conn); 181 | IOObjectRelease(device); 182 | if (result != kIOReturnSuccess) 183 | { 184 | return self; 185 | } 186 | 187 | 188 | initDone = YES; 189 | 190 | SMCKeyData_t inputStructure; 191 | SMCKeyData_t outputStructure; 192 | 193 | int totalKeys, i; 194 | UInt32Char_t key; 195 | SMCVal_t val; 196 | 197 | totalKeys = SMCReadIndexCount(conn); 198 | 199 | for (i = 0; i < totalKeys; i++) 200 | { 201 | memset(&inputStructure, 0, sizeof(SMCKeyData_t)); 202 | memset(&outputStructure, 0, sizeof(SMCKeyData_t)); 203 | memset(&val, 0, sizeof(SMCVal_t)); 204 | 205 | inputStructure.data8 = SMC_CMD_READ_INDEX; 206 | inputStructure.data32 = i; 207 | 208 | result = SMCCall(conn, KERNEL_INDEX_SMC, &inputStructure, &outputStructure); 209 | 210 | if (result != kIOReturnSuccess) continue; 211 | 212 | _ultostr(key, outputStructure.key); 213 | 214 | result = SMCReadKey(conn, key, &val); 215 | 216 | if (result != kIOReturnSuccess) continue; 217 | 218 | NSString *keyStr = [NSString stringWithFormat:@"%-4s", val.key]; 219 | 220 | if ([keyStr hasPrefix:@"TC"] && (val.dataSize > 0) && (strcmp(val.dataType, DATATYPE_SP78) == 0)) 221 | { 222 | int intValue = (val.bytes[0] * 256 + val.bytes[1]) >> 2; 223 | double temperature = intValue / 64.0; 224 | 225 | if (temperature > 0) 226 | { 227 | NSMutableDictionary *tmpDict = [NSMutableDictionary dictionaryWithCapacity:3]; 228 | [tmpDict setObject:keyStr forKey:@"key"]; 229 | [tmpDict setObject:[NSNumber numberWithDouble:temperature] forKey:@"currentTemperature"]; 230 | [tmpDict setObject:[NSNumber numberWithDouble:temperature] forKey:@"maxTemperature"]; 231 | 232 | [sensors addObject:tmpDict]; 233 | } 234 | } 235 | } 236 | 237 | return self;; 238 | } 239 | 240 | - (void)dealloc 241 | { 242 | if (initDone) IOServiceClose(conn); 243 | [sensors release]; 244 | 245 | [super dealloc]; 246 | } 247 | 248 | - (void)updateSensors 249 | { 250 | if (!initDone) return; 251 | 252 | for (int i = 0; i < [sensors count]; i++) 253 | { 254 | SMCVal_t val; 255 | kern_return_t result; 256 | UInt32Char_t key; 257 | sprintf(key, "%s", [[[sensors objectAtIndex:i] objectForKey:@"key"] cStringUsingEncoding:NSASCIIStringEncoding]); 258 | 259 | result = SMCReadKey(conn, key, &val); 260 | if (result == kIOReturnSuccess) 261 | { 262 | if (val.dataSize > 0) 263 | { 264 | if (strcmp(val.dataType, DATATYPE_SP78) == 0) 265 | { 266 | int intValue = (val.bytes[0] * 256 + val.bytes[1]) >> 2; 267 | double temperature = intValue / 64.0; 268 | 269 | if (temperature > 0) 270 | { 271 | NSMutableDictionary *tmpDict = [sensors objectAtIndex:i]; 272 | [tmpDict setObject:[NSNumber numberWithDouble:temperature] forKey:@"currentTemperature"]; 273 | 274 | if ([[tmpDict objectForKey:@"maxTemperature"] doubleValue] < temperature) 275 | { 276 | [tmpDict setObject:[NSNumber numberWithDouble:temperature] forKey:@"maxTemperature"]; 277 | } 278 | } 279 | 280 | } 281 | } 282 | } 283 | } 284 | } 285 | 286 | - (NSArray *)sensorsData 287 | { 288 | return [NSArray arrayWithArray:sensors]; 289 | } 290 | 291 | @end 292 | -------------------------------------------------------------------------------- /CPUBurn/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // CPUBurn 4 | // 5 | // Created by Yuri Yuriev on 14.11.11. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | @implementation AppDelegate 18 | 19 | @synthesize window = _window; 20 | @synthesize infoBox = _infoBox; 21 | @synthesize sensorsBox = _sensorsBox; 22 | @synthesize infoTextView = _infoTextView; 23 | @synthesize sensorsTextView = _sensorsTextView; 24 | @synthesize indicator = _indicator; 25 | @synthesize statusTextField = _statusTextField; 26 | @synthesize burnButton = _burnButton; 27 | 28 | - (void)dealloc 29 | { 30 | if (timer) 31 | { 32 | [timer invalidate]; 33 | [timer release]; 34 | } 35 | 36 | if (purgeTask) [purgeTask release]; 37 | if (burnTask) [burnTask release]; 38 | 39 | if (sensors) [sensors release]; 40 | 41 | [super dealloc]; 42 | } 43 | 44 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification 45 | { 46 | [[NSProcessInfo processInfo] disableSuddenTermination]; 47 | 48 | [[NSNotificationCenter defaultCenter] addObserver:self 49 | selector:@selector(terminateNotification:) 50 | name:NSTaskDidTerminateNotification 51 | object:nil]; 52 | } 53 | 54 | - (void)awakeFromNib 55 | { 56 | running = NO; 57 | 58 | sensors = [[CPUSensors alloc] init]; 59 | 60 | [self.window center]; 61 | [self.window setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces]; 62 | [self.window setLevel:NSScreenSaverWindowLevel]; 63 | 64 | [self.infoBox setTitle:NSLocalizedString(@"InfoBoxTitle", @"")]; 65 | [self.sensorsBox setTitle:NSLocalizedString(@"SensorsBoxTitle", @"")]; 66 | 67 | [[self.infoTextView enclosingScrollView] setBorderType:NSNoBorder]; 68 | [[self.infoTextView enclosingScrollView] setDrawsBackground:NO]; 69 | [self.infoTextView setDrawsBackground:NO]; 70 | 71 | [[self.sensorsTextView enclosingScrollView] setBorderType:NSNoBorder]; 72 | [[self.sensorsTextView enclosingScrollView] setDrawsBackground:NO]; 73 | [self.sensorsTextView setDrawsBackground:NO]; 74 | 75 | NSMutableDictionary *attributes = [[NSMutableDictionary alloc] initWithCapacity:2]; 76 | [attributes setObject:[NSFont systemFontOfSize:10] forKey:NSFontAttributeName]; 77 | [attributes setObject:[NSColor redColor] forKey:NSForegroundColorAttributeName]; 78 | NSAttributedString *aStr = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"InfoBoxText", @"") attributes:attributes]; 79 | [[self.infoTextView textStorage] setAttributedString:aStr]; 80 | [aStr release]; 81 | [attributes release]; 82 | 83 | [self setSensorsText]; 84 | 85 | [self.indicator setDisplayedWhenStopped:NO]; 86 | [self.statusTextField setStringValue:@""]; 87 | [self.burnButton setTitle:NSLocalizedString(@"BurnButtonTitle", @"")]; 88 | 89 | timer = [[NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timerAction:) userInfo:nil repeats:YES] retain]; 90 | } 91 | 92 | - (IBAction)burnAction:(id)sender 93 | { 94 | if (running) 95 | { 96 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 97 | 98 | if (purgeTask) 99 | { 100 | if ([purgeTask isRunning])[purgeTask terminate]; 101 | [purgeTask release]; 102 | purgeTask = nil; 103 | } 104 | 105 | if (burnTask) 106 | { 107 | if ([burnTask isRunning])[burnTask terminate]; 108 | [burnTask release]; 109 | burnTask = nil; 110 | } 111 | 112 | [self.statusTextField setStringValue:@""]; 113 | [self.burnButton setTitle:NSLocalizedString(@"BurnButtonTitle", @"")]; 114 | [self.indicator stopAnimation:self]; 115 | running = NO; 116 | 117 | [[NSNotificationCenter defaultCenter] addObserver:self 118 | selector:@selector(terminateNotification:) 119 | name:NSTaskDidTerminateNotification 120 | object:nil]; 121 | } 122 | else 123 | { 124 | purgeTask = [[NSTask alloc] init]; 125 | [purgeTask setLaunchPath:@"/usr/bin/purge"]; 126 | 127 | [self.burnButton setTitle:NSLocalizedString(@"StopButtonTitle", @"")]; 128 | [self.indicator startAnimation:self]; 129 | [self.statusTextField setStringValue:NSLocalizedString(@"PurgeStatus", @"")]; 130 | running = YES; 131 | 132 | @try 133 | { 134 | [purgeTask launch]; 135 | } 136 | @catch (NSException *e) 137 | { 138 | [[NSNotificationCenter defaultCenter] postNotificationName:NSTaskDidTerminateNotification object:purgeTask]; 139 | } 140 | } 141 | } 142 | 143 | - (void)setSensorsText 144 | { 145 | NSArray *sensorsData = [sensors sensorsData]; 146 | 147 | if ([sensorsData count] == 0) 148 | { 149 | NSMutableDictionary *attributes = [[NSMutableDictionary alloc] initWithCapacity:2]; 150 | [attributes setObject:[NSFont systemFontOfSize:14] forKey:NSFontAttributeName]; 151 | [attributes setObject:[NSColor blackColor] forKey:NSForegroundColorAttributeName]; 152 | NSAttributedString *aStr = [[NSAttributedString alloc] initWithString:NSLocalizedString(@"SensorsNotFound", @"") attributes:attributes]; 153 | [[self.sensorsTextView textStorage] setAttributedString:aStr]; 154 | [aStr release]; 155 | [attributes release]; 156 | 157 | return; 158 | } 159 | 160 | NSMutableString *str = [NSMutableString string]; 161 | 162 | NSNumberFormatter *formater = [[NSNumberFormatter alloc] init]; 163 | [formater setNumberStyle:NSNumberFormatterDecimalStyle]; 164 | [formater setMaximumFractionDigits:1]; 165 | 166 | for (int i = 0; i < [sensorsData count]; i++) 167 | { 168 | NSNumber *currentTemperature = [[sensorsData objectAtIndex:i] objectForKey:@"currentTemperature"]; 169 | NSString *key = [[sensorsData objectAtIndex:i] objectForKey:@"key"]; 170 | NSNumber *maxTemperature = [[sensorsData objectAtIndex:i] objectForKey:@"maxTemperature"]; 171 | 172 | NSString *tmpStr = [NSString stringWithFormat:NSLocalizedString(@"SensorTemperature", @""), key, [formater stringFromNumber:currentTemperature], [formater stringFromNumber:maxTemperature]]; 173 | [str appendString:tmpStr]; 174 | 175 | if (i != ([sensorsData count] - 1)) [str appendString:@"\n"]; 176 | } 177 | 178 | [formater release]; 179 | 180 | NSMutableDictionary *attributes = [[NSMutableDictionary alloc] initWithCapacity:2]; 181 | [attributes setObject:[NSFont systemFontOfSize:14] forKey:NSFontAttributeName]; 182 | [attributes setObject:[NSColor blackColor] forKey:NSForegroundColorAttributeName]; 183 | NSAttributedString *aStr = [[NSAttributedString alloc] initWithString:str attributes:attributes]; 184 | [[self.sensorsTextView textStorage] setAttributedString:aStr]; 185 | [aStr release]; 186 | [attributes release]; 187 | } 188 | 189 | - (void)timerAction:(NSTimer *)aTimer 190 | { 191 | [sensors updateSensors]; 192 | [self setSensorsText]; 193 | } 194 | 195 | - (void)terminateNotification:(NSNotification *)aNotification 196 | { 197 | if ([aNotification object] == purgeTask) 198 | { 199 | [purgeTask release]; 200 | purgeTask = nil; 201 | 202 | NSString *inputPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"lininput"]; 203 | NSString *inputStr = [NSString stringWithContentsOfFile:inputPath encoding:NSUTF8StringEncoding error:NULL]; 204 | 205 | size_t length; 206 | int mib[2]; 207 | int pagesize = 0; 208 | mib[0] = CTL_HW; 209 | mib[1] = HW_PAGESIZE; 210 | length = sizeof(pagesize); 211 | sysctl(mib, 2, &pagesize, &length, NULL, 0); 212 | 213 | vm_statistics_data_t vmstat; 214 | mach_msg_type_number_t count = HOST_VM_INFO_COUNT; 215 | int64_t free = 512 * 1024 * 1024; 216 | 217 | if ((host_statistics (mach_host_self(), HOST_VM_INFO, (host_info_t) &vmstat, &count) == KERN_SUCCESS) && (pagesize != 0)) 218 | { 219 | free =(int64_t)vmstat.free_count * (int64_t)pagesize * 0.8; 220 | } 221 | 222 | if (free < 512 * 1024 * 1024) free = 512 * 1024 * 1024; 223 | else if (free > 1536 * 1024 * 1024) free = 1536 * 1024 * 1024; 224 | 225 | int64_t problemSize = sqrt(free / 8); 226 | inputStr = [NSString stringWithFormat:inputStr, problemSize, problemSize]; 227 | 228 | [self.statusTextField setStringValue:NSLocalizedString(@"BurnStatus", @"")]; 229 | 230 | NSFileManager *fileManager = [NSFileManager defaultManager]; 231 | NSString *tmpInputPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"lininput_burn"]; 232 | [fileManager removeItemAtPath:tmpInputPath error:NULL]; 233 | [inputStr writeToFile:tmpInputPath atomically:YES encoding:NSUTF8StringEncoding error:NULL]; 234 | 235 | burnTask = [[NSTask alloc] init]; 236 | [burnTask setLaunchPath:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"linpack_cd64"]]; 237 | [burnTask setArguments:[NSArray arrayWithObject:tmpInputPath]]; 238 | 239 | @try 240 | { 241 | [burnTask launch]; 242 | } 243 | @catch (NSException *e) 244 | { 245 | [[NSNotificationCenter defaultCenter] postNotificationName:NSTaskDidTerminateNotification object:burnTask]; 246 | } 247 | } 248 | else if ([aNotification object] == burnTask) 249 | { 250 | [burnTask release]; 251 | burnTask = nil; 252 | 253 | [self.statusTextField setStringValue:@""]; 254 | [self.burnButton setTitle:NSLocalizedString(@"BurnButtonTitle", @"")]; 255 | [self.indicator stopAnimation:self]; 256 | running = NO; 257 | } 258 | } 259 | 260 | - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender 261 | { 262 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 263 | 264 | if (purgeTask) 265 | { 266 | if ([purgeTask isRunning])[purgeTask terminate]; 267 | [purgeTask release]; 268 | purgeTask = nil; 269 | } 270 | 271 | if (burnTask) 272 | { 273 | if ([burnTask isRunning])[burnTask terminate]; 274 | [burnTask release]; 275 | burnTask = nil; 276 | } 277 | 278 | return NSTerminateNow; 279 | } 280 | 281 | - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication 282 | { 283 | return YES; 284 | } 285 | 286 | @end 287 | -------------------------------------------------------------------------------- /CPUBurn.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | DA18DBCF14715E02008777F1 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA18DBCE14715E02008777F1 /* Cocoa.framework */; }; 11 | DA18DBDB14715E02008777F1 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DA18DBDA14715E02008777F1 /* main.m */; }; 12 | DA18DBE214715E02008777F1 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DA18DBE114715E02008777F1 /* AppDelegate.m */; }; 13 | DA18DBEC14715E27008777F1 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA18DBEB14715E27008777F1 /* IOKit.framework */; }; 14 | DA18DBEF14715E72008777F1 /* CPUSensors.m in Sources */ = {isa = PBXBuildFile; fileRef = DA18DBEE14715E72008777F1 /* CPUSensors.m */; }; 15 | DA64C58514719E2600281AE2 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = DA64C58414719E2600281AE2 /* Localizable.strings */; }; 16 | DA64C5881471ACCC00281AE2 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = DA64C5871471ACCC00281AE2 /* icon.icns */; }; 17 | DA64C5891471B07F00281AE2 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = DA64C58A1471B07F00281AE2 /* InfoPlist.strings */; }; 18 | DA64C58D1471B0AD00281AE2 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = DA64C58E1471B0AD00281AE2 /* MainMenu.xib */; }; 19 | DA64C5901471B35200281AE2 /* linpack_cd64 in Resources */ = {isa = PBXBuildFile; fileRef = DA64C58F1471B35200281AE2 /* linpack_cd64 */; }; 20 | DA64C5921471BEFD00281AE2 /* lininput in Resources */ = {isa = PBXBuildFile; fileRef = DA64C5911471BEFD00281AE2 /* lininput */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXFileReference section */ 24 | DA18DBCA14715E02008777F1 /* CPUBurn.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CPUBurn.app; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | DA18DBCE14715E02008777F1 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 26 | DA18DBD114715E02008777F1 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 27 | DA18DBD214715E02008777F1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 28 | DA18DBD314715E02008777F1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 29 | DA18DBD614715E02008777F1 /* CPUBurn-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CPUBurn-Info.plist"; sourceTree = ""; }; 30 | DA18DBDA14715E02008777F1 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 31 | DA18DBDC14715E02008777F1 /* CPUBurn-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CPUBurn-Prefix.pch"; sourceTree = ""; }; 32 | DA18DBE014715E02008777F1 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 33 | DA18DBE114715E02008777F1 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 34 | DA18DBEB14715E27008777F1 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; 35 | DA18DBED14715E72008777F1 /* CPUSensors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPUSensors.h; sourceTree = ""; }; 36 | DA18DBEE14715E72008777F1 /* CPUSensors.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPUSensors.m; sourceTree = ""; }; 37 | DA64C58414719E2600281AE2 /* Localizable.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = ""; }; 38 | DA64C5871471ACCC00281AE2 /* icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = icon.icns; sourceTree = ""; }; 39 | DA64C58A1471B07F00281AE2 /* InfoPlist.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; path = InfoPlist.strings; sourceTree = ""; }; 40 | DA64C58E1471B0AD00281AE2 /* MainMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainMenu.xib; sourceTree = ""; }; 41 | DA64C58F1471B35200281AE2 /* linpack_cd64 */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = linpack_cd64; sourceTree = ""; }; 42 | DA64C5911471BEFD00281AE2 /* lininput */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = lininput; sourceTree = ""; }; 43 | /* End PBXFileReference section */ 44 | 45 | /* Begin PBXFrameworksBuildPhase section */ 46 | DA18DBC714715E02008777F1 /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | DA18DBEC14715E27008777F1 /* IOKit.framework in Frameworks */, 51 | DA18DBCF14715E02008777F1 /* Cocoa.framework in Frameworks */, 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | DA18DBBF14715E01008777F1 = { 59 | isa = PBXGroup; 60 | children = ( 61 | DA18DBD414715E02008777F1 /* CPUBurn */, 62 | DA18DBCD14715E02008777F1 /* Frameworks */, 63 | DA18DBCB14715E02008777F1 /* Products */, 64 | ); 65 | sourceTree = ""; 66 | }; 67 | DA18DBCB14715E02008777F1 /* Products */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | DA18DBCA14715E02008777F1 /* CPUBurn.app */, 71 | ); 72 | name = Products; 73 | sourceTree = ""; 74 | }; 75 | DA18DBCD14715E02008777F1 /* Frameworks */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | DA18DBCE14715E02008777F1 /* Cocoa.framework */, 79 | DA18DBD014715E02008777F1 /* Other Frameworks */, 80 | ); 81 | name = Frameworks; 82 | sourceTree = ""; 83 | }; 84 | DA18DBD014715E02008777F1 /* Other Frameworks */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | DA18DBEB14715E27008777F1 /* IOKit.framework */, 88 | DA18DBD114715E02008777F1 /* AppKit.framework */, 89 | DA18DBD214715E02008777F1 /* CoreData.framework */, 90 | DA18DBD314715E02008777F1 /* Foundation.framework */, 91 | ); 92 | name = "Other Frameworks"; 93 | sourceTree = ""; 94 | }; 95 | DA18DBD414715E02008777F1 /* CPUBurn */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | DA18DBE014715E02008777F1 /* AppDelegate.h */, 99 | DA18DBE114715E02008777F1 /* AppDelegate.m */, 100 | DA18DBED14715E72008777F1 /* CPUSensors.h */, 101 | DA18DBEE14715E72008777F1 /* CPUSensors.m */, 102 | DA64C58E1471B0AD00281AE2 /* MainMenu.xib */, 103 | DA18DBD514715E02008777F1 /* Supporting Files */, 104 | ); 105 | path = CPUBurn; 106 | sourceTree = ""; 107 | }; 108 | DA18DBD514715E02008777F1 /* Supporting Files */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | DA64C5911471BEFD00281AE2 /* lininput */, 112 | DA64C58F1471B35200281AE2 /* linpack_cd64 */, 113 | DA64C5871471ACCC00281AE2 /* icon.icns */, 114 | DA18DBD614715E02008777F1 /* CPUBurn-Info.plist */, 115 | DA64C58A1471B07F00281AE2 /* InfoPlist.strings */, 116 | DA18DBDA14715E02008777F1 /* main.m */, 117 | DA18DBDC14715E02008777F1 /* CPUBurn-Prefix.pch */, 118 | DA64C58414719E2600281AE2 /* Localizable.strings */, 119 | ); 120 | name = "Supporting Files"; 121 | sourceTree = ""; 122 | }; 123 | /* End PBXGroup section */ 124 | 125 | /* Begin PBXNativeTarget section */ 126 | DA18DBC914715E02008777F1 /* CPUBurn */ = { 127 | isa = PBXNativeTarget; 128 | buildConfigurationList = DA18DBE814715E02008777F1 /* Build configuration list for PBXNativeTarget "CPUBurn" */; 129 | buildPhases = ( 130 | DA18DBC614715E02008777F1 /* Sources */, 131 | DA18DBC714715E02008777F1 /* Frameworks */, 132 | DA18DBC814715E02008777F1 /* Resources */, 133 | ); 134 | buildRules = ( 135 | ); 136 | dependencies = ( 137 | ); 138 | name = CPUBurn; 139 | productName = CPUBurn; 140 | productReference = DA18DBCA14715E02008777F1 /* CPUBurn.app */; 141 | productType = "com.apple.product-type.application"; 142 | }; 143 | /* End PBXNativeTarget section */ 144 | 145 | /* Begin PBXProject section */ 146 | DA18DBC114715E01008777F1 /* Project object */ = { 147 | isa = PBXProject; 148 | attributes = { 149 | LastUpgradeCheck = 0420; 150 | ORGANIZATIONNAME = "Yuri Yuriev"; 151 | }; 152 | buildConfigurationList = DA18DBC414715E01008777F1 /* Build configuration list for PBXProject "CPUBurn" */; 153 | compatibilityVersion = "Xcode 3.2"; 154 | developmentRegion = English; 155 | hasScannedForEncodings = 0; 156 | knownRegions = ( 157 | en, 158 | ); 159 | mainGroup = DA18DBBF14715E01008777F1; 160 | productRefGroup = DA18DBCB14715E02008777F1 /* Products */; 161 | projectDirPath = ""; 162 | projectRoot = ""; 163 | targets = ( 164 | DA18DBC914715E02008777F1 /* CPUBurn */, 165 | ); 166 | }; 167 | /* End PBXProject section */ 168 | 169 | /* Begin PBXResourcesBuildPhase section */ 170 | DA18DBC814715E02008777F1 /* Resources */ = { 171 | isa = PBXResourcesBuildPhase; 172 | buildActionMask = 2147483647; 173 | files = ( 174 | DA64C5891471B07F00281AE2 /* InfoPlist.strings in Resources */, 175 | DA64C58D1471B0AD00281AE2 /* MainMenu.xib in Resources */, 176 | DA64C58514719E2600281AE2 /* Localizable.strings in Resources */, 177 | DA64C5881471ACCC00281AE2 /* icon.icns in Resources */, 178 | DA64C5901471B35200281AE2 /* linpack_cd64 in Resources */, 179 | DA64C5921471BEFD00281AE2 /* lininput in Resources */, 180 | ); 181 | runOnlyForDeploymentPostprocessing = 0; 182 | }; 183 | /* End PBXResourcesBuildPhase section */ 184 | 185 | /* Begin PBXSourcesBuildPhase section */ 186 | DA18DBC614715E02008777F1 /* Sources */ = { 187 | isa = PBXSourcesBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | DA18DBDB14715E02008777F1 /* main.m in Sources */, 191 | DA18DBE214715E02008777F1 /* AppDelegate.m in Sources */, 192 | DA18DBEF14715E72008777F1 /* CPUSensors.m in Sources */, 193 | ); 194 | runOnlyForDeploymentPostprocessing = 0; 195 | }; 196 | /* End PBXSourcesBuildPhase section */ 197 | 198 | /* Begin XCBuildConfiguration section */ 199 | DA18DBE614715E02008777F1 /* Debug */ = { 200 | isa = XCBuildConfiguration; 201 | buildSettings = { 202 | ALWAYS_SEARCH_USER_PATHS = NO; 203 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 204 | COPY_PHASE_STRIP = NO; 205 | GCC_C_LANGUAGE_STANDARD = gnu99; 206 | GCC_DYNAMIC_NO_PIC = NO; 207 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 208 | GCC_OPTIMIZATION_LEVEL = 0; 209 | GCC_PREPROCESSOR_DEFINITIONS = ( 210 | "DEBUG=1", 211 | "$(inherited)", 212 | ); 213 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 214 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 215 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 216 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 217 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 218 | GCC_WARN_UNUSED_VARIABLE = YES; 219 | MACOSX_DEPLOYMENT_TARGET = 10.7; 220 | ONLY_ACTIVE_ARCH = YES; 221 | SDKROOT = macosx; 222 | }; 223 | name = Debug; 224 | }; 225 | DA18DBE714715E02008777F1 /* Release */ = { 226 | isa = XCBuildConfiguration; 227 | buildSettings = { 228 | ALWAYS_SEARCH_USER_PATHS = NO; 229 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 230 | COPY_PHASE_STRIP = YES; 231 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 232 | GCC_C_LANGUAGE_STANDARD = gnu99; 233 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 234 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 235 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 236 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 237 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 238 | GCC_WARN_UNUSED_VARIABLE = YES; 239 | MACOSX_DEPLOYMENT_TARGET = 10.7; 240 | SDKROOT = macosx; 241 | }; 242 | name = Release; 243 | }; 244 | DA18DBE914715E02008777F1 /* Debug */ = { 245 | isa = XCBuildConfiguration; 246 | buildSettings = { 247 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 248 | GCC_PREFIX_HEADER = "CPUBurn/CPUBurn-Prefix.pch"; 249 | INFOPLIST_FILE = "CPUBurn/CPUBurn-Info.plist"; 250 | MACOSX_DEPLOYMENT_TARGET = 10.7; 251 | PRODUCT_NAME = "$(TARGET_NAME)"; 252 | WRAPPER_EXTENSION = app; 253 | }; 254 | name = Debug; 255 | }; 256 | DA18DBEA14715E02008777F1 /* Release */ = { 257 | isa = XCBuildConfiguration; 258 | buildSettings = { 259 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 260 | GCC_PREFIX_HEADER = "CPUBurn/CPUBurn-Prefix.pch"; 261 | INFOPLIST_FILE = "CPUBurn/CPUBurn-Info.plist"; 262 | MACOSX_DEPLOYMENT_TARGET = 10.7; 263 | PRODUCT_NAME = "$(TARGET_NAME)"; 264 | WRAPPER_EXTENSION = app; 265 | }; 266 | name = Release; 267 | }; 268 | /* End XCBuildConfiguration section */ 269 | 270 | /* Begin XCConfigurationList section */ 271 | DA18DBC414715E01008777F1 /* Build configuration list for PBXProject "CPUBurn" */ = { 272 | isa = XCConfigurationList; 273 | buildConfigurations = ( 274 | DA18DBE614715E02008777F1 /* Debug */, 275 | DA18DBE714715E02008777F1 /* Release */, 276 | ); 277 | defaultConfigurationIsVisible = 0; 278 | defaultConfigurationName = Release; 279 | }; 280 | DA18DBE814715E02008777F1 /* Build configuration list for PBXNativeTarget "CPUBurn" */ = { 281 | isa = XCConfigurationList; 282 | buildConfigurations = ( 283 | DA18DBE914715E02008777F1 /* Debug */, 284 | DA18DBEA14715E02008777F1 /* Release */, 285 | ); 286 | defaultConfigurationIsVisible = 0; 287 | defaultConfigurationName = Release; 288 | }; 289 | /* End XCConfigurationList section */ 290 | }; 291 | rootObject = DA18DBC114715E01008777F1 /* Project object */; 292 | } 293 | -------------------------------------------------------------------------------- /CPUBurn/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1070 5 | 11C74 6 | 1938 7 | 1138.23 8 | 567.00 9 | 10 | com.apple.InterfaceBuilder.CocoaPlugin 11 | 1938 12 | 13 | 14 | NSScroller 15 | NSMenuItem 16 | NSMenu 17 | NSScrollView 18 | NSButtonCell 19 | NSButton 20 | NSBox 21 | NSProgressIndicator 22 | NSTextFieldCell 23 | NSCustomObject 24 | NSTextView 25 | NSView 26 | NSWindowTemplate 27 | NSTextField 28 | 29 | 30 | com.apple.InterfaceBuilder.CocoaPlugin 31 | 32 | 33 | PluginDependencyRecalculationVersion 34 | 35 | 36 | 37 | 38 | NSApplication 39 | 40 | 41 | FirstResponder 42 | 43 | 44 | NSApplication 45 | 46 | 47 | AMainMenu 48 | 49 | 50 | 51 | CPUBurn 52 | 53 | 1048576 54 | 2147483647 55 | 56 | NSImage 57 | NSMenuCheckmark 58 | 59 | 60 | NSImage 61 | NSMenuMixedState 62 | 63 | submenuAction: 64 | 65 | CPUBurn 66 | 67 | 68 | 69 | Завершить CPUBurn 70 | q 71 | 1048576 72 | 2147483647 73 | 74 | 75 | 76 | 77 | _NSAppleMenu 78 | 79 | 80 | 81 | 82 | Файл 83 | 84 | 1048576 85 | 2147483647 86 | 87 | 88 | submenuAction: 89 | 90 | Файл 91 | 92 | 93 | 94 | Закрыть 95 | w 96 | 1048576 97 | 2147483647 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | Правка 107 | 108 | 1048576 109 | 2147483647 110 | 111 | 112 | submenuAction: 113 | 114 | Правка 115 | 116 | 117 | 118 | Копировать 119 | c 120 | 1048576 121 | 2147483647 122 | 123 | 124 | 125 | 126 | 127 | Выбрать всё 128 | a 129 | 1048576 130 | 2147483647 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | _NSMainMenu 139 | 140 | 141 | 3 142 | 2 143 | {{335, 390}, {457, 366}} 144 | 1954022400 145 | CPUBurn 146 | NSWindow 147 | 148 | 149 | 150 | 151 | 256 152 | 153 | 154 | 155 | 12 156 | 157 | 158 | 159 | 274 160 | 161 | 162 | 163 | 256 164 | 165 | 166 | 167 | 2304 168 | 169 | 170 | 171 | 2322 172 | {393, 71} 173 | 174 | 175 | 176 | _NS:1480 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 134 189 | 190 | 191 | 192 | 393 193 | 1 194 | 195 | 196 | 2309 197 | 0 198 | 199 | 200 | 3 201 | MQA 202 | 203 | 204 | 205 | 6 206 | System 207 | selectedTextBackgroundColor 208 | 209 | 3 210 | MC42NjY2NjY2NjY3AA 211 | 212 | 213 | 214 | 6 215 | System 216 | selectedTextColor 217 | 218 | 3 219 | MAA 220 | 221 | 222 | 223 | 224 | 225 | 226 | 1 227 | MCAwIDEAA 228 | 229 | 230 | {8, -8} 231 | 13 232 | 233 | 234 | 235 | 236 | 237 | 0 238 | 239 | 6 240 | {463, 10000000} 241 | {223, 71} 242 | 243 | 244 | 245 | {{1, 1}, {393, 108}} 246 | 247 | 248 | 249 | _NS:1478 250 | 251 | 252 | 253 | {4, 5} 254 | 255 | 12582912 256 | 257 | 258 | 259 | 260 | 261 | TU0AKgAAAHCAFUqgBVKsAAAAwdVQUqwaEQeIRGJRGFlYqwWLQ+JxuOQpVRmEx2RROKwOQyOUQSPyaUym 262 | SxqWyKXyeYxyZzWbSuJTScRCbz2Nz+gRKhUOfTqeUai0OSxiWTiBQSHSGFquGwekxyAgAAAOAQAAAwAA 263 | AAEAEAAAAQEAAwAAAAEAEAAAAQIAAwAAAAIACAAIAQMAAwAAAAEABQAAAQYAAwAAAAEAAQAAAREABAAA 264 | AAEAAAAIARIAAwAAAAEAAQAAARUAAwAAAAEAAgAAARYAAwAAAAEAEAAAARcABAAAAAEAAABnARwAAwAA 265 | AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA 266 | 267 | 268 | 269 | 270 | 271 | 3 272 | MCAwAA 273 | 274 | 275 | 276 | 4 277 | 278 | 279 | 280 | -2147483392 281 | {{369, 1}, {15, 108}} 282 | 283 | 284 | 285 | _NS:1494 286 | 287 | _doScroller: 288 | 1 289 | 0.85256409645080566 290 | 291 | 292 | 293 | -2147483392 294 | {{-100, -100}, {87, 18}} 295 | 296 | 297 | 298 | _NS:1482 299 | 1 300 | 301 | _doScroller: 302 | 1 303 | 0.94565218687057495 304 | 305 | 306 | {{13, 14}, {395, 110}} 307 | 308 | 309 | 310 | _NS:940 311 | 133650 312 | 313 | 314 | 315 | 316 | 317 | {{1, 1}, {421, 134}} 318 | 319 | 320 | 321 | _NS:21 322 | 323 | 324 | {{17, 210}, {423, 150}} 325 | 326 | 327 | 328 | _NS:18 329 | {0, 0} 330 | 331 | 67239424 332 | 0 333 | <<no loc>> 334 | 335 | LucidaGrande 336 | 11 337 | 3100 338 | 339 | 340 | 6 341 | System 342 | textBackgroundColor 343 | 344 | 345 | 346 | 3 347 | MCAwLjgwMDAwMDAxMTkAA 348 | 349 | 350 | 351 | 1 352 | 0 353 | 2 354 | NO 355 | 356 | 357 | 358 | 12 359 | 360 | 361 | 362 | 274 363 | 364 | 365 | 366 | 256 367 | 368 | 369 | 370 | 2304 371 | 372 | 373 | 374 | 2322 375 | {393, 71} 376 | 377 | 378 | 379 | _NS:1480 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 134 392 | 393 | 394 | 395 | 393 396 | 1 397 | 398 | 399 | 2817 400 | 0 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 0 416 | 417 | 6 418 | {463, 10000000} 419 | {223, 71} 420 | 421 | 422 | 423 | {{1, 1}, {393, 108}} 424 | 425 | 426 | 427 | _NS:1478 428 | 429 | 430 | 431 | {4, 5} 432 | 433 | 12582912 434 | 435 | 436 | 437 | 438 | 439 | TU0AKgAAAHCAFUqgBVKsAAAAwdVQUqwaEQeIRGJRGFlYqwWLQ+JxuOQpVRmEx2RROKwOQyOUQSPyaUym 440 | SxqWyKXyeYxyZzWbSuJTScRCbz2Nz+gRKhUOfTqeUai0OSxiWTiBQSHSGFquGwekxyAgAAAOAQAAAwAA 441 | AAEAEAAAAQEAAwAAAAEAEAAAAQIAAwAAAAIACAAIAQMAAwAAAAEABQAAAQYAAwAAAAEAAQAAAREABAAA 442 | AAEAAAAIARIAAwAAAAEAAQAAARUAAwAAAAEAAgAAARYAAwAAAAEAEAAAARcABAAAAAEAAABnARwAAwAA 443 | AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 4 452 | 453 | 454 | 455 | -2147483392 456 | {{369, 1}, {15, 108}} 457 | 458 | 459 | 460 | _NS:1494 461 | 462 | _doScroller: 463 | 1 464 | 0.85256409645080566 465 | 466 | 467 | 468 | -2147483392 469 | {{-100, -100}, {87, 18}} 470 | 471 | 472 | 473 | _NS:1482 474 | 1 475 | 476 | _doScroller: 477 | 1 478 | 0.94565218687057495 479 | 480 | 481 | {{13, 14}, {395, 110}} 482 | 483 | 484 | 485 | _NS:940 486 | 133650 487 | 488 | 489 | 490 | 491 | 492 | {{1, 1}, {421, 134}} 493 | 494 | 495 | 496 | _NS:21 497 | 498 | 499 | {{17, 56}, {423, 150}} 500 | 501 | 502 | 503 | _NS:18 504 | {0, 0} 505 | 506 | 67239424 507 | 0 508 | <<no loc>> 509 | 510 | 511 | 512 | 3 513 | MCAwLjgwMDAwMDAxMTkAA 514 | 515 | 516 | 517 | 1 518 | 0 519 | 2 520 | NO 521 | 522 | 523 | 524 | 268 525 | {{318, 12}, {125, 32}} 526 | 527 | 528 | 529 | _NS:687 530 | YES 531 | 532 | 67239424 533 | 134217728 534 | <<no loc>> 535 | 536 | LucidaGrande 537 | 13 538 | 1044 539 | 540 | _NS:687 541 | 542 | -2038284033 543 | 129 544 | 545 | 546 | 200 547 | 25 548 | 549 | 550 | 551 | 552 | 1292 553 | 554 | {{20, 22}, {16, 16}} 555 | 556 | 557 | 558 | _NS:3891 559 | 20746 560 | 100 561 | 562 | 563 | 564 | 268 565 | {{41, 22}, {278, 17}} 566 | 567 | 568 | 569 | _NS:3944 570 | YES 571 | 572 | 68288064 573 | 272630784 574 | Label 575 | 576 | _NS:3944 577 | 578 | 579 | 6 580 | System 581 | controlColor 582 | 583 | 584 | 585 | 6 586 | System 587 | controlTextColor 588 | 589 | 590 | 591 | 592 | 593 | {457, 366} 594 | 595 | 596 | 597 | 598 | {{0, 0}, {1920, 1058}} 599 | {10000000000000, 10000000000000} 600 | YES 601 | 602 | 603 | AppDelegate 604 | 605 | 606 | NSFontManager 607 | 608 | 609 | 610 | 611 | 612 | 613 | terminate: 614 | 615 | 616 | 617 | 449 618 | 619 | 620 | 621 | delegate 622 | 623 | 624 | 625 | 495 626 | 627 | 628 | 629 | copy: 630 | 631 | 632 | 633 | 224 634 | 635 | 636 | 637 | selectAll: 638 | 639 | 640 | 641 | 232 642 | 643 | 644 | 645 | performClose: 646 | 647 | 648 | 649 | 193 650 | 651 | 652 | 653 | window 654 | 655 | 656 | 657 | 532 658 | 659 | 660 | 661 | infoBox 662 | 663 | 664 | 665 | 551 666 | 667 | 668 | 669 | sensorsBox 670 | 671 | 672 | 673 | 552 674 | 675 | 676 | 677 | infoTextView 678 | 679 | 680 | 681 | 553 682 | 683 | 684 | 685 | sensorsTextView 686 | 687 | 688 | 689 | 554 690 | 691 | 692 | 693 | indicator 694 | 695 | 696 | 697 | 555 698 | 699 | 700 | 701 | statusTextField 702 | 703 | 704 | 705 | 556 706 | 707 | 708 | 709 | burnButton 710 | 711 | 712 | 713 | 557 714 | 715 | 716 | 717 | burnAction: 718 | 719 | 720 | 721 | 558 722 | 723 | 724 | 725 | 726 | 727 | 0 728 | 729 | 730 | 731 | 732 | 733 | -2 734 | 735 | 736 | File's Owner 737 | 738 | 739 | -1 740 | 741 | 742 | First Responder 743 | 744 | 745 | -3 746 | 747 | 748 | Application 749 | 750 | 751 | 29 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 56 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 217 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 83 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 205 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 198 795 | 796 | 797 | 798 | 799 | 197 800 | 801 | 802 | 803 | 804 | 57 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 136 813 | 814 | 815 | 816 | 817 | 371 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 372 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 420 838 | 839 | 840 | 841 | 842 | 494 843 | 844 | 845 | 846 | 847 | 536 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 537 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 538 864 | 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 539 874 | 875 | 876 | 877 | 878 | 540 879 | 880 | 881 | 882 | 883 | 541 884 | 885 | 886 | 887 | 888 | 542 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 543 897 | 898 | 899 | 900 | 901 | 544 902 | 903 | 904 | 905 | 906 | 545 907 | 908 | 909 | 910 | 911 | 912 | 913 | 914 | 546 915 | 916 | 917 | 918 | 919 | 547 920 | 921 | 922 | 923 | 924 | 925 | 926 | 927 | 928 | 929 | 548 930 | 931 | 932 | 933 | 934 | 549 935 | 936 | 937 | 938 | 939 | 550 940 | 941 | 942 | 943 | 944 | 81 945 | 946 | 947 | 948 | 949 | 950 | 951 | 952 | 73 953 | 954 | 955 | 956 | 957 | 958 | 959 | com.apple.InterfaceBuilder.CocoaPlugin 960 | com.apple.InterfaceBuilder.CocoaPlugin 961 | com.apple.InterfaceBuilder.CocoaPlugin 962 | com.apple.InterfaceBuilder.CocoaPlugin 963 | com.apple.InterfaceBuilder.CocoaPlugin 964 | com.apple.InterfaceBuilder.CocoaPlugin 965 | com.apple.InterfaceBuilder.CocoaPlugin 966 | com.apple.InterfaceBuilder.CocoaPlugin 967 | com.apple.InterfaceBuilder.CocoaPlugin 968 | com.apple.InterfaceBuilder.CocoaPlugin 969 | {{380, 496}, {480, 360}} 970 | 971 | com.apple.InterfaceBuilder.CocoaPlugin 972 | com.apple.InterfaceBuilder.CocoaPlugin 973 | com.apple.InterfaceBuilder.CocoaPlugin 974 | com.apple.InterfaceBuilder.CocoaPlugin 975 | com.apple.InterfaceBuilder.CocoaPlugin 976 | com.apple.InterfaceBuilder.CocoaPlugin 977 | com.apple.InterfaceBuilder.CocoaPlugin 978 | com.apple.InterfaceBuilder.CocoaPlugin 979 | com.apple.InterfaceBuilder.CocoaPlugin 980 | com.apple.InterfaceBuilder.CocoaPlugin 981 | com.apple.InterfaceBuilder.CocoaPlugin 982 | com.apple.InterfaceBuilder.CocoaPlugin 983 | com.apple.InterfaceBuilder.CocoaPlugin 984 | com.apple.InterfaceBuilder.CocoaPlugin 985 | com.apple.InterfaceBuilder.CocoaPlugin 986 | com.apple.InterfaceBuilder.CocoaPlugin 987 | com.apple.InterfaceBuilder.CocoaPlugin 988 | com.apple.InterfaceBuilder.CocoaPlugin 989 | com.apple.InterfaceBuilder.CocoaPlugin 990 | com.apple.InterfaceBuilder.CocoaPlugin 991 | com.apple.InterfaceBuilder.CocoaPlugin 992 | com.apple.InterfaceBuilder.CocoaPlugin 993 | com.apple.InterfaceBuilder.CocoaPlugin 994 | 995 | 996 | 997 | 998 | 999 | 569 1000 | 1001 | 1002 | 1003 | 1004 | AppDelegate 1005 | NSObject 1006 | 1007 | burnAction: 1008 | id 1009 | 1010 | 1011 | burnAction: 1012 | 1013 | burnAction: 1014 | id 1015 | 1016 | 1017 | 1018 | NSButton 1019 | NSProgressIndicator 1020 | NSBox 1021 | NSTextView 1022 | NSBox 1023 | NSTextView 1024 | NSTextField 1025 | NSWindow 1026 | 1027 | 1028 | 1029 | burnButton 1030 | NSButton 1031 | 1032 | 1033 | indicator 1034 | NSProgressIndicator 1035 | 1036 | 1037 | infoBox 1038 | NSBox 1039 | 1040 | 1041 | infoTextView 1042 | NSTextView 1043 | 1044 | 1045 | sensorsBox 1046 | NSBox 1047 | 1048 | 1049 | sensorsTextView 1050 | NSTextView 1051 | 1052 | 1053 | statusTextField 1054 | NSTextField 1055 | 1056 | 1057 | window 1058 | NSWindow 1059 | 1060 | 1061 | 1062 | IBProjectSource 1063 | ./Classes/AppDelegate.h 1064 | 1065 | 1066 | 1067 | 1068 | 0 1069 | IBCocoaFramework 1070 | YES 1071 | 3 1072 | 1073 | {9, 8} 1074 | {7, 2} 1075 | 1076 | 1077 | 1078 | --------------------------------------------------------------------------------