Changeset 940
- Timestamp:
- 01/15/05 16:56:39 (4 years ago)
- Files:
-
- WiredServer/trunk/WCStatusController.m (modified) (5 diffs)
- WiredServer/trunk/WiredServer.xcode/project.pbxproj (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
WiredServer/trunk/WCStatusController.m
r935 r940 1 /* $Id: WCStatusController.m,v 1. 2 2005/01/14 15:25:52morris Exp $ */1 /* $Id: WCStatusController.m,v 1.3 2005/01/15 15:56:39 morris Exp $ */ 2 2 3 3 /* … … 284 284 285 285 // --- update users graph 286 users = [[_status objectAtIndex:1] intValue]; 287 286 288 if(_usersGraphView) { 287 users = [[_status objectAtIndex:1] intValue];288 289 [_usersData removeObjectAtIndex:0]; 289 290 [_usersData addObject:[NSNumber numberWithInt:users]]; … … 298 299 299 300 // --- update transfers graph 301 downloads = [[_status objectAtIndex:3] unsignedIntValue]; 302 uploads = [[_status objectAtIndex:5] unsignedIntValue]; 303 300 304 if(_transfersGraphView) { 301 downloads = [[_status objectAtIndex:3] unsignedIntValue];302 uploads = [[_status objectAtIndex:5] unsignedIntValue];303 305 [_downloadsData removeObjectAtIndex:0]; 304 306 [_downloadsData addObject:[NSNumber numberWithUnsignedInt:downloads]]; … … 321 323 322 324 // --- update bandwidth graph 325 inBytes = [[_status objectAtIndex:8] unsignedLongLongValue]; 326 outBytes = [[_status objectAtIndex:7] unsignedLongLongValue]; 327 inSpeed = 0; 328 outSpeed = 0; 329 330 if(_inBytes > 0 || _outBytes > 0) { 331 interval = [WCSettings doubleForKey:WCUpdateInterval]; 332 333 if(_inBytes > 0 && inBytes > _inBytes) 334 inSpeed = (inBytes - _inBytes) / interval; 335 336 if(_outBytes > 0 && outBytes > _outBytes) 337 outSpeed = (outBytes - _outBytes) / interval; 338 } 339 340 _inBytes = inBytes; 341 _outBytes = outBytes; 342 343 inSpeedString = [NSSWF:@"%@/s", [NSString humanReadableStringForSize:inSpeed]]; 344 outSpeedString = [NSSWF:@"%@/s", [NSString humanReadableStringForSize:outSpeed]]; 345 323 346 if(_bandwidthGraphView) { 324 inBytes = [[_status objectAtIndex:8] unsignedLongLongValue];325 outBytes = [[_status objectAtIndex:7] unsignedLongLongValue];326 inSpeed = 0;327 outSpeed = 0;328 329 if(_inBytes > 0 && _outBytes > 0) {330 interval = [WCSettings doubleForKey:WCUpdateInterval];331 332 if(_inBytes > 0 && inBytes > _inBytes)333 inSpeed = (inBytes - _inBytes) / interval;334 335 if(outBytes > _outBytes)336 outSpeed = (outBytes - _outBytes) / interval;337 }338 339 inSpeedString = [NSSWF:@"%@/s", [NSString humanReadableStringForSize:inSpeed]];340 outSpeedString = [NSSWF:@"%@/s", [NSString humanReadableStringForSize:outSpeed]];341 342 347 [_inData removeObjectAtIndex:0]; 343 348 [_inData addObject:[NSNumber numberWithUnsignedInt:inSpeed]]; … … 353 358 outSpeedString, 354 359 NSLS(@"out", @"Speed out")]]; 355 356 _inBytes = inBytes;357 _outBytes = outBytes;358 360 } 359 361 WiredServer/trunk/WiredServer.xcode/project.pbxproj
r939 r940 1683 1683 runOnlyForDeploymentPostprocessing = 0; 1684 1684 shellPath = /bin/sh; 1685 shellScript = "#!/bin/sh\n\n WIRED_INSTALL_PATH=\"/Library/PreferencePanes/\"\n\n$CP -rp \"$BUILD_DIR/$WRAPPER_NAME\" \"$WIRED_INSTALL_PATH\"\n";1685 shellScript = "#!/bin/sh\n\nsudo $CP -rp \"$BUILD_DIR/$WRAPPER_NAME\" \"/Library/PreferencePanes/\"\n"; 1686 1686 }; 1687 1687 A5A349A607298E1B00A16E9A = {
