Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
minoskt committed Jul 19, 2015
2 parents 20dcf03 + 4412111 commit 45f88bc
Show file tree
Hide file tree
Showing 24 changed files with 235 additions and 284 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Changelog

### 0.1.1
- Support csv format in sensor data
- Fix crash when deregistering multiple sensors modules

### 0.1.0
- Initial Release
14 changes: 0 additions & 14 deletions SensingKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
CFBB416719B928C2002AE1A9 /* SKBattery.m in Sources */ = {isa = PBXBuildFile; fileRef = CFBB416019B928C2002AE1A9 /* SKBattery.m */; };
CFBB416819B928C2002AE1A9 /* SKProximity.m in Sources */ = {isa = PBXBuildFile; fileRef = CFBB416219B928C2002AE1A9 /* SKProximity.m */; };
CFBB416919B928C2002AE1A9 /* SKLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = CFBB416419B928C2002AE1A9 /* SKLocation.m */; };
CFBB416E19B92902002AE1A9 /* NSString+SKSensing.m in Sources */ = {isa = PBXBuildFile; fileRef = CFBB416D19B92902002AE1A9 /* NSString+SKSensing.m */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -166,8 +165,6 @@
CFBB416219B928C2002AE1A9 /* SKProximity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKProximity.m; sourceTree = "<group>"; };
CFBB416319B928C2002AE1A9 /* SKLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKLocation.h; sourceTree = "<group>"; };
CFBB416419B928C2002AE1A9 /* SKLocation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKLocation.m; sourceTree = "<group>"; };
CFBB416C19B92902002AE1A9 /* NSString+SKSensing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+SKSensing.h"; sourceTree = "<group>"; };
CFBB416D19B92902002AE1A9 /* NSString+SKSensing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+SKSensing.m"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -256,7 +253,6 @@
CFBB413B19B92514002AE1A9 /* SensingKit */ = {
isa = PBXGroup;
children = (
CFBB416F19B92906002AE1A9 /* Categories */,
CFBB416B19B928CF002AE1A9 /* SensorModules */,
CF11F8B41B2F4A910094C9DF /* SensorData */,
CF11F87F1B2C688B0094C9DF /* SKSensorModuleType.h */,
Expand Down Expand Up @@ -323,15 +319,6 @@
name = SensorModules;
sourceTree = "<group>";
};
CFBB416F19B92906002AE1A9 /* Categories */ = {
isa = PBXGroup;
children = (
CFBB416C19B92902002AE1A9 /* NSString+SKSensing.h */,
CFBB416D19B92902002AE1A9 /* NSString+SKSensing.m */,
);
name = Categories;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -466,7 +453,6 @@
CFB0D93A1B4FF7E000A7982B /* SKMotionManager.m in Sources */,
CF11F8B91B2F4B0E0094C9DF /* SKBatteryData.m in Sources */,
CF11F8821B2C6D7D0094C9DF /* SKSensorModuleManager.m in Sources */,
CFBB416E19B92902002AE1A9 /* NSString+SKSensing.m in Sources */,
CFBB414119B92514002AE1A9 /* SensingKitLib.m in Sources */,
CF11F8881B2D8D370094C9DF /* SKSensorData.m in Sources */,
CFB0D9581B5269BD00A7982B /* SKActivity.m in Sources */,
Expand Down
70 changes: 0 additions & 70 deletions SensingKit/NSString+SKSensing.h

This file was deleted.

199 changes: 0 additions & 199 deletions SensingKit/NSString+SKSensing.m

This file was deleted.

2 changes: 2 additions & 0 deletions SensingKit/SKAccelerometerData.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@

- (instancetype)initWithAcceleration:(CMAcceleration)acceleration;

- (NSString *)csvString;

@end
9 changes: 9 additions & 0 deletions SensingKit/SKAccelerometerData.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,13 @@ - (instancetype)initWithAcceleration:(CMAcceleration)acceleration
return self;
}

- (NSString *)csvString
{
return [NSString stringWithFormat:@"%f,%f,%f,%f",
[self timestampEpoch],
_acceleration.x,
_acceleration.y,
_acceleration.z];
}

@end
2 changes: 2 additions & 0 deletions SensingKit/SKActivityData.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@

- (instancetype)initWithActivity:(CMMotionActivity *)activity;

- (NSString *)csvString;

@end
31 changes: 31 additions & 0 deletions SensingKit/SKActivityData.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,35 @@ - (instancetype)initWithActivity:(CMMotionActivity *)activity
return self;
}

- (NSString *)confidenceString
{
switch (_activity.confidence) {
case CMMotionActivityConfidenceHigh:
return @"High";

case CMMotionActivityConfidenceMedium:
return @"Medium";

case CMMotionActivityConfidenceLow:
return @"Low";

default:
NSLog(@"Warning: Unknown confidence: %d", (int)_activity.confidence);
return @"Unknown";
}
}

- (NSString *)csvString
{
return [NSString stringWithFormat:@"%f,%f,%d,%d,%d,%d,%d,%@",
[self timestampEpoch],
_activity.timestamp,
_activity.stationary,
_activity.walking,
_activity.running,
_activity.automotive,
_activity.unknown,
[self confidenceString]];
}

@end
Loading

0 comments on commit 45f88bc

Please sign in to comment.