Skip to content

Commit

Permalink
Display real-time values in boxes instead of scrolling view
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Bullock committed Jun 1, 2013
1 parent e5dc7d4 commit ce56ceb
Show file tree
Hide file tree
Showing 14 changed files with 2,817 additions and 345 deletions.
Binary file removed IMU2OSC-icon.png
Binary file not shown.
12 changes: 12 additions & 0 deletions IMU2OSC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
7D44849915669E9600FB759D /* NetworkingUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7D44848D15669E9600FB759D /* NetworkingUtils.cpp */; };
7D44849A15669E9600FB759D /* UdpSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7D44848E15669E9600FB759D /* UdpSocket.cpp */; };
7D55D6E81609056500EE3BA6 /* libboost_thread-mt.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D55D6E71609056500EE3BA6 /* libboost_thread-mt.a */; };
7D55D6FC160913CF00EE3BA6 /* IMU2OSC-icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 7D55D6FB160913CF00EE3BA6 /* IMU2OSC-icon.icns */; };
7D7FB248156662AC003C03FC /* IMUOSCHandlers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7D7FB247156662AC003C03FC /* IMUOSCHandlers.cpp */; };
7DD23213155BE18D00C012B4 /* XIMU.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7DD23212155BE18D00C012B4 /* XIMU.cpp */; };
7DD23215155BF04B00C012B4 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7DD23214155BF04B00C012B4 /* IOKit.framework */; };
Expand Down Expand Up @@ -64,6 +65,7 @@
7D44848F15669E9600FB759D /* TimerListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimerListener.h; sourceTree = "<group>"; };
7D44849015669E9600FB759D /* UdpSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UdpSocket.h; sourceTree = "<group>"; };
7D55D6E71609056500EE3BA6 /* libboost_thread-mt.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libboost_thread-mt.a"; sourceTree = "<group>"; };
7D55D6FB160913CF00EE3BA6 /* IMU2OSC-icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "IMU2OSC-icon.icns"; sourceTree = "<group>"; };
7D7FB247156662AC003C03FC /* IMUOSCHandlers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IMUOSCHandlers.cpp; sourceTree = "<group>"; };
7D7FB249156662C5003C03FC /* IMUOSCHandlers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IMUOSCHandlers.h; sourceTree = "<group>"; };
7DD23211155BE17B00C012B4 /* XIMU.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XIMU.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -142,9 +144,18 @@
path = posix;
sourceTree = "<group>";
};
7D55D6F11609088300EE3BA6 /* Resources */ = {
isa = PBXGroup;
children = (
);
name = Resources;
sourceTree = "<group>";
};
7DF90D7E155976C10007A0AD = {
isa = PBXGroup;
children = (
7D55D6FB160913CF00EE3BA6 /* IMU2OSC-icon.icns */,
7D55D6F11609088300EE3BA6 /* Resources */,
7DF90D93155976C10007A0AD /* IMU2OSC */,
7DF90D8C155976C10007A0AD /* Frameworks */,
7DF90D8A155976C10007A0AD /* Products */,
Expand Down Expand Up @@ -269,6 +280,7 @@
7DF90D98155976C10007A0AD /* InfoPlist.strings in Resources */,
7DF90D9E155976C10007A0AD /* Credits.rtf in Resources */,
7DF90DA4155976C20007A0AD /* MainMenu.xib in Resources */,
7D55D6FC160913CF00EE3BA6 /* IMU2OSC-icon.icns in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key>
<true/>
<key>SnapshotAutomaticallyBeforeSignificantChanges</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "1.0">
<FileBreakpoints>
<FileBreakpoint
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "IMU2OSC/IMUController.mm"
timestampString = "391815574.511144"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "124"
endingLineNumber = "124"
landmarkName = "-serialPortSelected:"
landmarkType = "5">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "IMU2OSC/XIMU.cpp"
timestampString = "359137012.260158"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "36"
endingLineNumber = "36"
landmarkName = "XIMU::XIMU(char *filename, int level, int baudrate)"
landmarkType = "5">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "IMU2OSC/ip/posix/NetworkingUtils.cpp"
timestampString = "369662667.826537"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "30"
endingLineNumber = "30">
</FileBreakpoint>
</FileBreakpoints>
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7DF90D88155976C10007A0AD"
BuildableName = "IMU2OSC.app"
BlueprintName = "IMU2OSC"
ReferencedContainer = "container:IMU2OSC.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7DF90D88155976C10007A0AD"
BuildableName = "IMU2OSC.app"
BlueprintName = "IMU2OSC"
ReferencedContainer = "container:IMU2OSC.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7DF90D88155976C10007A0AD"
BuildableName = "IMU2OSC.app"
BlueprintName = "IMU2OSC"
ReferencedContainer = "container:IMU2OSC.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7DF90D88155976C10007A0AD"
BuildableName = "IMU2OSC.app"
BlueprintName = "IMU2OSC"
ReferencedContainer = "container:IMU2OSC.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>IMU2OSC.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>7DF90D88155976C10007A0AD</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
6 changes: 2 additions & 4 deletions IMU2OSC/IMU2OSC-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<string>IMU2OSC-icon</string>
<key>CFBundleIdentifier</key>
<string>jamiebullock.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand All @@ -17,11 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string></string>
<string>0.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.1</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
57 changes: 42 additions & 15 deletions IMU2OSC/IMUController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,21 @@ @interface IMUController() {
XIMU *ximu;

}
@end

@property (weak) IBOutlet NSTextField *euler1;
@property (weak) IBOutlet NSTextField *euler2;
@property (weak) IBOutlet NSTextField *euler3;
@property (weak) IBOutlet NSTextField *gyro1;
@property (weak) IBOutlet NSTextField *gyro2;
@property (weak) IBOutlet NSTextField *gyro3;
@property (weak) IBOutlet NSTextField *mag1;
@property (weak) IBOutlet NSTextField *mag2;
@property (weak) IBOutlet NSTextField *mag3;
@property (weak) IBOutlet NSTextField *accel1;
@property (weak) IBOutlet NSTextField *accel2;
@property (weak) IBOutlet NSTextField *accel3;

@end

@implementation IMUController

Expand Down Expand Up @@ -100,7 +112,6 @@ - (void)detectAndGetDeviceId {
NSString *msg = [[NSString alloc] initWithFormat:@"> found device with id 0x%04X\n", deviceid];
[self appendToIncomingText:msg];
}

}

// action sent when serial port selected
Expand Down Expand Up @@ -155,27 +166,43 @@ -(void) tick:(NSTimer *)timer
double *accel = data.accel;
double *mag = data.mag;

NSString *msg;
// NSString *msg;

if (euler != NULL) {
msg = [[NSString alloc] initWithFormat:@"> euler:\t%.3f\t%.3f\t%.3f\n",
euler[0], euler[1], euler[2]];
[self appendToIncomingText: msg];
[self.euler1 setStringValue:[NSNumber numberWithFloat:euler[0]].stringValue];
[self.euler2 setStringValue:[NSNumber numberWithFloat:euler[1]].stringValue];
[self.euler3 setStringValue:[NSNumber numberWithFloat:euler[2]].stringValue];

// msg = [[NSString alloc] initWithFormat:@"> euler:\t%.3f\t%.3f\t%.3f\n",
// euler[0], euler[1], euler[2]];
// [self appendToIncomingText: msg];
}
if (gyro != NULL) {
msg = [[NSString alloc] initWithFormat:@"> gyro:\t%.3f\t%.3f\t%.3f\n",
gyro[0], gyro[1], gyro[2]];
[self appendToIncomingText: msg];
[self.gyro1 setStringValue:[NSNumber numberWithFloat:gyro[0]].stringValue];
[self.gyro2 setStringValue:[NSNumber numberWithFloat:gyro[1]].stringValue];
[self.gyro3 setStringValue:[NSNumber numberWithFloat:gyro[2]].stringValue];

// msg = [[NSString alloc] initWithFormat:@"> gyro:\t%.3f\t%.3f\t%.3f\n",
// gyro[0], gyro[1], gyro[2]];
// [self appendToIncomingText: msg];
}
if (accel != NULL) {
msg = [[NSString alloc] initWithFormat:@"> accel:\t%.3f\t%.3f\t%.3f\n",
accel[0], accel[1], accel[2]];
[self appendToIncomingText: msg];
[self.accel1 setStringValue:[NSNumber numberWithFloat:accel[0]].stringValue];
[self.accel2 setStringValue:[NSNumber numberWithFloat:accel[1]].stringValue];
[self.accel3 setStringValue:[NSNumber numberWithFloat:accel[2]].stringValue];

// msg = [[NSString alloc] initWithFormat:@"> accel:\t%.3f\t%.3f\t%.3f\n",
// accel[0], accel[1], accel[2]];
// [self appendToIncomingText: msg];
}
if (mag != NULL) {
msg = [[NSString alloc] initWithFormat:@"> mag:\t%.3f\t%.3f\t%.3f\n",
mag[0], mag[1], mag[2]];
[self appendToIncomingText: msg];
[self.mag1 setStringValue:[NSNumber numberWithFloat:mag[0]].stringValue];
[self.mag2 setStringValue:[NSNumber numberWithFloat:mag[1]].stringValue];
[self.mag3 setStringValue:[NSNumber numberWithFloat:mag[2]].stringValue];

// msg = [[NSString alloc] initWithFormat:@"> mag:\t%.3f\t%.3f\t%.3f\n",
// mag[0], mag[1], mag[2]];
// [self appendToIncomingText: msg];
}

}
Expand Down
Loading

0 comments on commit ce56ceb

Please sign in to comment.