Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Working on mavContoller

  • Loading branch information...
commit c7044a791bb388118757b8aae8d8452fa0540dd2 1 parent d252e20
@HalfdanJ authored
View
6 ViljensTriumf.xcodeproj/project.pbxproj
@@ -29,6 +29,7 @@
DD4CC1ED161DEA13000E459D /* deinterlace.vert in Sources */ = {isa = PBXBuildFile; fileRef = DD4CC1E7161DEA13000E459D /* deinterlace.vert */; };
DD4CC1EF161DF194000E459D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD4CC1EE161DF194000E459D /* QuartzCore.framework */; };
DDB9D53C1624611000FFE6A4 /* ChromaFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = DDB9D53B1624611000FFE6A4 /* ChromaFilter.m */; };
+ DDB9D5401624750800FFE6A4 /* MavController.mm in Sources */ = {isa = PBXBuildFile; fileRef = DDB9D53F1624750800FFE6A4 /* MavController.mm */; };
DDD38D511623464D00C24ABA /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DDD38D501623464D00C24ABA /* QTKit.framework */; };
DDD38D5416234D9500C24ABA /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DDD38D5316234D9500C24ABA /* Quartz.framework */; };
DDD38D5B16234E9400C24ABA /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DDD38D5A16234E9400C24ABA /* QuickTime.framework */; };
@@ -84,6 +85,8 @@
DD4CC1EE161DF194000E459D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
DDB9D53A1624611000FFE6A4 /* ChromaFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChromaFilter.h; sourceTree = "<group>"; };
DDB9D53B1624611000FFE6A4 /* ChromaFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChromaFilter.m; sourceTree = "<group>"; };
+ DDB9D53E1624750800FFE6A4 /* MavController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MavController.h; sourceTree = "<group>"; };
+ DDB9D53F1624750800FFE6A4 /* MavController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MavController.mm; sourceTree = "<group>"; };
DDD38D501623464D00C24ABA /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = System/Library/Frameworks/QTKit.framework; sourceTree = SDKROOT; };
DDD38D5316234D9500C24ABA /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = System/Library/Frameworks/Quartz.framework; sourceTree = SDKROOT; };
DDD38D5A16234E9400C24ABA /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = System/Library/Frameworks/QuickTime.framework; sourceTree = SDKROOT; };
@@ -226,6 +229,8 @@
DD039735161C591400D0D629 /* DecklinkCallback.h */,
DD039736161C591400D0D629 /* DecklinkCallback.mm */,
8429C0DC156A7943000ADD56 /* BlackMagic.xib */,
+ DDB9D53E1624750800FFE6A4 /* MavController.h */,
+ DDB9D53F1624750800FFE6A4 /* MavController.mm */,
DD039738161C948C00D0D629 /* shaders */,
);
name = BlackMagic;
@@ -347,6 +352,7 @@
DD4CC1ED161DEA13000E459D /* deinterlace.vert in Sources */,
DDDCF65F161EBC0700E8E368 /* DeinterlaceFilter.m in Sources */,
DDB9D53C1624611000FFE6A4 /* ChromaFilter.m in Sources */,
+ DDB9D5401624750800FFE6A4 /* MavController.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
4 ViljensTriumf/Plugins/BlackMagic.h
@@ -7,6 +7,7 @@
#import <QTKit/QTKit.h>
+#import "MavController.h"
class DeckLinkController;
@interface BlackMagic : ofPlugin {
@@ -21,7 +22,6 @@ class DeckLinkController;
int millisAtLastFrameRecord;
- ofSerial serial;
/* ofxShader * bwShader;
*/
@@ -42,6 +42,8 @@ class DeckLinkController;
CVOpenGLTextureRef movieCurrentFrame;
NSImage * recordImage;
+
+ MavController * mavController;
}
View
5 ViljensTriumf/Plugins/BlackMagic.mm
@@ -104,6 +104,8 @@ -(void)initPlugin{
}];
+ mavController = [[MavController alloc] init];
+
}
//
@@ -112,7 +114,6 @@ -(void)initPlugin{
-(void)setup{
- serial.setup("/dev/tty.usbserial-FT5CHURVA", 9600);
glewInit();
//
@@ -180,6 +181,8 @@ -(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NS
-(void)update:(NSDictionary *)drawingInformation{
+ [mavController update];
+
//Set camera active flag
for(int i=0;i<3;i++){
DecklinkCallback * callback = [blackMagicController callbacks:i];
View
21 ViljensTriumf/Plugins/MavController.h
@@ -0,0 +1,21 @@
+//
+// MavController.h
+// ViljensTriumf
+//
+// Created by Jonas on 10/9/12.
+//
+//
+
+#import <ofxCocoaPlugins/Plugin.h>
+
+@interface MavController : NSObject
+{
+ ofSerial serial;
+
+
+ char incommingBytes[100];
+ int incommingBytesIndex;
+}
+
+-(void) update;
+@end
View
46 ViljensTriumf/Plugins/MavController.mm
@@ -0,0 +1,46 @@
+//
+// MavController.m
+// ViljensTriumf
+//
+// Created by Jonas on 10/9/12.
+//
+//
+
+#import "MavController.h"
+
+@implementation MavController
+
+- (id)init
+{
+ self = [super init];
+ if (self) {
+ serial.setup("/dev/tty.usbserial-FT5CHURVA", 9600);
+
+ }
+ return self;
+}
+
+-(void) update {
+ while(serial.available()){
+ incommingBytes[incommingBytesIndex++] = serial.readByte();
+ if(incommingBytes[incommingBytesIndex-1] == '\n'){
+ incommingBytesIndex = 0;
+ NSLog(@"Got msg");
+ int cmp = strcmp(incommingBytes, "RECONFIG");
+ NSLog(@"%i",cmp);
+ if(cmp > 0){
+ NSLog(@"Reconfig");
+
+ serial.writeByte('v');
+ serial.writeByte('1');
+ serial.writeByte('%');
+ } else {
+ NSLog(@"%s",incommingBytes);
+ }
+
+ memset(incommingBytes,0,sizeof(incommingBytes));
+ }
+ }
+}
+
+@end
Please sign in to comment.
Something went wrong with that request. Please try again.