Changeset 940

Show
Ignore:
Timestamp:
01/15/05 16:56:39 (4 years ago)
Author:
morris
Message:

Unbreak status

Files:

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:52 morris Exp $ */ 
     1/* $Id: WCStatusController.m,v 1.3 2005/01/15 15:56:39 morris Exp $ */ 
    22 
    33/* 
     
    284284         
    285285        // --- update users graph 
     286        users = [[_status objectAtIndex:1] intValue]; 
     287 
    286288        if(_usersGraphView) { 
    287                 users = [[_status objectAtIndex:1] intValue]; 
    288289                [_usersData removeObjectAtIndex:0]; 
    289290                [_usersData addObject:[NSNumber numberWithInt:users]]; 
     
    298299         
    299300        // --- update transfers graph 
     301        downloads = [[_status objectAtIndex:3] unsignedIntValue]; 
     302        uploads = [[_status objectAtIndex:5] unsignedIntValue]; 
     303 
    300304        if(_transfersGraphView) { 
    301                 downloads = [[_status objectAtIndex:3] unsignedIntValue]; 
    302                 uploads = [[_status objectAtIndex:5] unsignedIntValue]; 
    303305                [_downloadsData removeObjectAtIndex:0]; 
    304306                [_downloadsData addObject:[NSNumber numberWithUnsignedInt:downloads]]; 
     
    321323                 
    322324        // --- 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                 
    323346        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                  
    342347                [_inData removeObjectAtIndex:0]; 
    343348                [_inData addObject:[NSNumber numberWithUnsignedInt:inSpeed]]; 
     
    353358                        outSpeedString, 
    354359                        NSLS(@"out", @"Speed out")]]; 
    355  
    356                 _inBytes = inBytes; 
    357                 _outBytes = outBytes; 
    358360        } 
    359361 
  • WiredServer/trunk/WiredServer.xcode/project.pbxproj

    r939 r940  
    16831683                        runOnlyForDeploymentPostprocessing = 0; 
    16841684                        shellPath = /bin/sh; 
    1685                         shellScript = "#!/bin/sh\n\nWIRED_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"; 
    16861686                }; 
    16871687                A5A349A607298E1B00A16E9A = {