Skip to content

Commit

Permalink
Bump CoreData and make Mac remoter+slave compile again
Browse files Browse the repository at this point in the history
Gosh, ObjC looked weird in 2010!
  • Loading branch information
nevyn-lookback committed Aug 12, 2016
1 parent 04c7146 commit 4574e35
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 37 deletions.
2 changes: 1 addition & 1 deletion Controller/CorePlot
Submodule CorePlot updated 737 files
100 changes: 95 additions & 5 deletions Controller/NuRemoter.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
0550BFF91460053000BF8366 /* NRStatsCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 0550BFF71460053000BF8366 /* NRStatsCell.m */; };
0550C0221460063800BF8366 /* libCorePlot-CocoaTouch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0550C00D146005F200BF8366 /* libCorePlot-CocoaTouch.a */; };
0550C0291460079000BF8366 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0550C0281460079000BF8366 /* QuartzCore.framework */; };
0550C02B1460159000BF8366 /* NRStatsCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0550C02A1460159000BF8366 /* NRStatsCell.xib */; };
056EE44F1338DE1200FA0A60 /* ClientController.m in Sources */ = {isa = PBXBuildFile; fileRef = 056EE44D1338DE1200FA0A60 /* ClientController.m */; };
056EE4501338DE1200FA0A60 /* ClientController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 056EE44E1338DE1200FA0A60 /* ClientController.xib */; };
056EE58B1338EB0200FA0A60 /* icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 056EE58A1338EB0200FA0A60 /* icon.icns */; };
059920F61615F79C009FC7BD /* CorePlot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 059920F51615F79C009FC7BD /* CorePlot.framework */; };
05AC14E81D5D42A000A6C469 /* NRStatsCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0550C02A1460159000BF8366 /* NRStatsCell.xib */; };
05AFC26C14FD46580093BB1F /* NRTextOnlyStatsCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 05AFC26B14FD46580093BB1F /* NRTextOnlyStatsCell.m */; };
05E678AC14601B8F006E0499 /* LogViewer.m in Sources */ = {isa = PBXBuildFile; fileRef = 05E678AB14601B8F006E0499 /* LogViewer.m */; };
05E678CD14602D4D006E0499 /* CorePlot.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0511A7C4145EA3010060519A /* CorePlot.framework */; };
Expand Down Expand Up @@ -75,6 +75,48 @@
remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
remoteInfo = CorePlot;
};
05AC14DC1D5D429C00A6C469 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0511A7BA145EA3010060519A /* CorePlot.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = C38A09781A46185200D45436;
remoteInfo = "CorePlot iOS";
};
05AC14DE1D5D429C00A6C469 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0511A7BA145EA3010060519A /* CorePlot.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = C38A09821A46185300D45436;
remoteInfo = "UnitTests iOS";
};
05AC14E01D5D429C00A6C469 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0511A7BA145EA3010060519A /* CorePlot.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = C38A09BA1A4619A900D45436;
remoteInfo = "CorePlot-CocoaTouch";
};
05AC14E21D5D429C00A6C469 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0511A7BA145EA3010060519A /* CorePlot.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = C38A09C41A4619A900D45436;
remoteInfo = "CorePlot-CocoaTouchTests";
};
05AC14E41D5D429C00A6C469 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0511A7BA145EA3010060519A /* CorePlot.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = C37EA6921BC83F2A0091C8F7;
remoteInfo = "CorePlot tvOS";
};
05AC14E61D5D429C00A6C469 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0511A7BA145EA3010060519A /* CorePlot.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = C37EA6B71BC83F2D0091C8F7;
remoteInfo = "UnitTests tvOS";
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
Expand Down Expand Up @@ -198,7 +240,13 @@
isa = PBXGroup;
children = (
0511A7C4145EA3010060519A /* CorePlot.framework */,
0511A7C6145EA3010060519A /* UnitTests.octest */,
0511A7C6145EA3010060519A /* UnitTests.xctest */,
05AC14DD1D5D429C00A6C469 /* CorePlot.framework */,
05AC14DF1D5D429C00A6C469 /* UnitTests iOS.xctest */,
05AC14E11D5D429C00A6C469 /* libCorePlot-CocoaTouch.a */,
05AC14E31D5D429C00A6C469 /* CorePlot-CocoaTouchTests.xctest */,
05AC14E51D5D429C00A6C469 /* CorePlot.framework */,
05AC14E71D5D429C00A6C469 /* UnitTests tvOS.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -445,10 +493,10 @@
remoteRef = 0511A7C3145EA3010060519A /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
0511A7C6145EA3010060519A /* UnitTests.octest */ = {
0511A7C6145EA3010060519A /* UnitTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = UnitTests.octest;
path = UnitTests.xctest;
remoteRef = 0511A7C5145EA3010060519A /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
Expand All @@ -459,6 +507,48 @@
remoteRef = 0550C00C146005F200BF8366 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
05AC14DD1D5D429C00A6C469 /* CorePlot.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = CorePlot.framework;
remoteRef = 05AC14DC1D5D429C00A6C469 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
05AC14DF1D5D429C00A6C469 /* UnitTests iOS.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = "UnitTests iOS.xctest";
remoteRef = 05AC14DE1D5D429C00A6C469 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
05AC14E11D5D429C00A6C469 /* libCorePlot-CocoaTouch.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libCorePlot-CocoaTouch.a";
remoteRef = 05AC14E01D5D429C00A6C469 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
05AC14E31D5D429C00A6C469 /* CorePlot-CocoaTouchTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = "CorePlot-CocoaTouchTests.xctest";
remoteRef = 05AC14E21D5D429C00A6C469 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
05AC14E51D5D429C00A6C469 /* CorePlot.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = CorePlot.framework;
remoteRef = 05AC14E41D5D429C00A6C469 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
05AC14E71D5D429C00A6C469 /* UnitTests tvOS.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = "UnitTests tvOS.xctest";
remoteRef = 05AC14E61D5D429C00A6C469 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */

/* Begin PBXResourcesBuildPhase section */
Expand All @@ -469,6 +559,7 @@
0550BFD2145FF9D800BF8366 /* InfoPlist.strings in Resources */,
0550BFE2145FFC8700BF8366 /* NRHostFinder.xib in Resources */,
0550BFF41460030100BF8366 /* NRStatsViewer.xib in Resources */,
05AC14E81D5D42A000A6C469 /* NRStatsCell.xib in Resources */,
05E6791F14605575006E0499 /* icon.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -481,7 +572,6 @@
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */,
056EE4501338DE1200FA0A60 /* ClientController.xib in Resources */,
056EE58B1338EB0200FA0A60 /* icon.icns in Resources */,
0550C02B1460159000BF8366 /* NRStatsCell.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
10 changes: 5 additions & 5 deletions Controller/Shared/NRStatsCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ -(void)awakeFromNib;
_floatingY.labelOffset = -50.;
_floatingY.coordinate = CPTCoordinateY;
_floatingY.plotSpace = _graph.defaultPlotSpace;
_floatingY.orthogonalCoordinateDecimal = CPTDecimalFromDouble(10);
_floatingY.orthogonalPosition = @10;
NSNumberFormatter *sciFormatter = [NSNumberFormatter new];
sciFormatter.numberStyle = NSNumberFormatterScientificStyle;
_floatingY.labelFormatter = sciFormatter;
_floatingY.labelTextStyle = font;
_floatingY.labelExclusionRanges = @[[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-0.01) length:CPTDecimalFromDouble(0.02)]];
_floatingY.labelExclusionRanges = @[[CPTPlotRange plotRangeWithLocation:@-0.01 length:@0.02]];

_graph.axisSet.axes = @[x, y, _floatingY];
}
Expand Down Expand Up @@ -192,10 +192,10 @@ -(void)updateRanges;
[plotSpace scaleToFitPlots:@[dataSourceLinePlot]];

CPTMutablePlotRange *yRange = [plotSpace.yRange mutableCopy];
[yRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0) length:CPTDecimalFromDouble(0)]]; // always include 0
[yRange expandRangeByFactor:CPTDecimalFromDouble(1.5)];
[yRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@0 length:@0]]; // always include 0
[yRange expandRangeByFactor:@1.5];
plotSpace.yRange = yRange;

_floatingY.orthogonalCoordinateDecimal = plotSpace.xRange.location;
_floatingY.orthogonalPosition = plotSpace.xRange.location;
}
@end
16 changes: 11 additions & 5 deletions Examples/Mac/NuRemoting.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
objects = {

/* Begin PBXBuildFile section */
0511A74C145DD98E0060519A /* Nu.m in Sources */ = {isa = PBXBuildFile; fileRef = 0511A745145DD98E0060519A /* Nu.m */; };
0511A74C145DD98E0060519A /* Nu.m in Sources */ = {isa = PBXBuildFile; fileRef = 0511A745145DD98E0060519A /* Nu.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
0511A756145DD9970060519A /* AsyncSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 0511A750145DD9970060519A /* AsyncSocket.m */; };
0511A757145DD9970060519A /* RemotingClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 0511A752145DD9970060519A /* RemotingClient.m */; };
0511A758145DD9970060519A /* SPNuRemote.m in Sources */ = {isa = PBXBuildFile; fileRef = 0511A755145DD9970060519A /* SPNuRemote.m */; };
0511A757145DD9970060519A /* RemotingClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 0511A752145DD9970060519A /* RemotingClient.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
0511A758145DD9970060519A /* SPNuRemote.m in Sources */ = {isa = PBXBuildFile; fileRef = 0511A755145DD9970060519A /* SPNuRemote.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
0511A75A145DEF8C0060519A /* libffi.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0511A759145DEF8C0060519A /* libffi.dylib */; };
0511A75C145DEFA90060519A /* libreadline.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0511A75B145DEFA90060519A /* libreadline.dylib */; };
0511A75E145DF1440060519A /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0511A75D145DF1440060519A /* SystemConfiguration.framework */; };
Expand Down Expand Up @@ -207,6 +207,8 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NuRemoting" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
Expand Down Expand Up @@ -276,6 +278,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_DYNAMIC_NO_PIC = NO;
Expand All @@ -286,24 +289,27 @@
GCC_PREFIX_HEADER = NuRemoting_Prefix.pch;
INFOPLIST_FILE = "NuRemoting-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
MACOSX_DEPLOYMENT_TARGET = 10.9;
PRODUCT_NAME = NuRemoting;
SDKROOT = macosx10.7;
SDKROOT = macosx;
};
name = Debug;
};
C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = NuRemoting_Prefix.pch;
INFOPLIST_FILE = "NuRemoting-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
MACOSX_DEPLOYMENT_TARGET = 10.9;
PRODUCT_NAME = NuRemoting;
SDKROOT = macosx10.7;
SDKROOT = macosx;
};
name = Release;
};
Expand Down
3 changes: 1 addition & 2 deletions Examples/Mac/NuRemotingAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

@class SPNuRemote;
@interface NuRemotingAppDelegate : NSObject <NSApplicationDelegate> {
NSWindow *window;
SPNuRemote *remote;
SPNuRemote *_remote;
}

@property (assign) IBOutlet NSWindow *window;
Expand Down
8 changes: 4 additions & 4 deletions Examples/Mac/NuRemotingAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ @implementation NuRemotingAppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
remote = [SPNuRemote new];
[remote run];
_remote = [SPNuRemote new];
[_remote run];
[NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(hej) userInfo:nil repeats:YES];
[NSTimer scheduledTimerWithTimeInterval:.1 target:self selector:@selector(stats) userInfo:nil repeats:YES];
}
-(void)hej;
{
[remote writeLogLine:@"Hej!" logLevel:4];
[_remote writeLogLine:@"Hej!" logLevel:4];
}
-(void)stats;
{
double loadavg[1];
getloadavg(loadavg, 1);
[remote addDataPoint:loadavg[0] toDataSet:@"cpuload"];
[_remote addDataPoint:loadavg[0] toDataSet:@"cpuload"];
}

@end
30 changes: 15 additions & 15 deletions NuRemote/SPNuRemote.m
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ @implementation SPNuRemote

- (id)init
{
clients = [NSMutableArray new];
datasets = [NSMutableArray new];
_clients = [NSMutableArray new];
_datasets = [NSMutableArray new];

return self;
}

- (void)run
{
if(!NSClassFromString(@"Nu") || listenSocket)
if(!NSClassFromString(@"Nu") || _listenSocket)
return;

self.listenSocket = [[[AsyncSocket alloc] initWithDelegate:self] autorelease];
Expand All @@ -189,7 +189,7 @@ - (void)run
#endif

NSError *err = nil;
if(![listenSocket acceptOnPort:kNuRemotingPort error:&err]) {
if(![_listenSocket acceptOnPort:kNuRemotingPort error:&err]) {
NSLog(@"SPNuRemote listen failure: %@", err);
return;
}
Expand All @@ -202,31 +202,31 @@ - (void)dealloc
{
self.listenSocket = nil;
self.publisher = nil;
for(SPNRClient *client in clients) {
for(SPNRClient *client in _clients) {
client->parent = nil;
[client->sock disconnect];
}
[clients release];
[datasets release];
[_clients release];
[_datasets release];
[super dealloc];
}

- (void)activated
{
[self.publisher stop];
listenSocket.delegate = nil;
[listenSocket disconnect];
listenSocket.delegate = self;
_listenSocket.delegate = nil;
[_listenSocket disconnect];
_listenSocket.delegate = self;
NSError *err = nil;
if(![listenSocket acceptOnPort:kNuRemotingPort error:&err])
if(![_listenSocket acceptOnPort:kNuRemotingPort error:&err])
NSLog(@"SPNuRemote listen failure: %@", err);
else
[self publishAndAvoidCollision:NO];
}

- (void)onSocket:(AsyncSocket *)sock didAcceptNewSocket:(AsyncSocket *)newSocket
{
[clients addObject:[[[SPNRClient alloc] init:newSocket :self] autorelease]];
[_clients addObject:[[[SPNRClient alloc] init:newSocket :self] autorelease]];
}

- (void)onSocketDidDisconnect:(AsyncSocket *)sock
Expand All @@ -238,13 +238,13 @@ - (void)onSocketDidDisconnect:(AsyncSocket *)sock

- (void)writeLogLine:(NSString *)line logLevel:(int)level
{
for(SPNRClient *client in clients)
for(SPNRClient *client in _clients)
[client writeLogLine:line logLevel:level];
}

- (NRStats*)statsNamed:(NSString*)name
{
for(NRStats *stats in datasets)
for(NRStats *stats in _datasets)
if([stats.name isEqual:name]) return stats;
NRStats *stats = [[[NRStats alloc] initWithName:name] autorelease];
[[self mutableArrayValueForKey:@"datasets"] addObject:stats];
Expand All @@ -259,7 +259,7 @@ - (void)addDataPoint:(float)data toDataSet:(NSString*)setName

[stats addPoint:data atTime:now];

for(SPNRClient *client in clients)
for(SPNRClient *client in _clients)
[client addDataPoint:data atTime:now toDataSet:setName];
}

Expand Down

0 comments on commit 4574e35

Please sign in to comment.