Changeset 2246ba0 in orbit
- Timestamp:
- 01/02/14 09:22:48 (6 years ago)
- Branches:
- master, Servo
- Children:
- fc960da
- Parents:
- c1a500d
- Location:
- iOS/Orbit/Orbit
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
iOS/Orbit/Orbit/SignalConverter.h
rb094d6c r2246ba0 32 32 } 33 33 34 //@property (nonatomic, retain) [NSArray arrayWithObjects:[NSNumber numberWithFloat:6.9]] *rawEEG; 35 //Number[] rawEEG = new Number[512]; 36 37 //@property (nonatomic, retain) [NSArray arrayWithObjects:[NSNumber numberWithFloat:6.9]] *historyAttention; 38 39 //@property (nonatomic, retain) NSArray *rawEEG; 40 //@property (nonatomic, retain) NSArray *historyAttention; 41 //@property (nonatomic, retain) NSArray *historyMeditation; 42 43 //@property (nonatomic, retain) int historyAttention[30]; 44 //@property (nonatomic, retain) historyMeditation; 45 34 46 @property (weak) id <SignalConverterDelegate> delegate; 35 47 @property (nonatomic) float attentionThreshold; -
iOS/Orbit/Orbit/SignalConverter.m
r16249e0 r2246ba0 31 31 int signalStrength, attentionLevel, meditationLevel; // the latest readings from the headset 32 32 int yaw, throttle, pitch; 33 34 int historyAttention[30]; 35 int historyAttentionIndex; 36 int historyMeditation[30]; 37 int historyMeditationIndex; 38 39 // _historyAttention = [NSArray arrayWithObjects:[NSNumber numberWithFloat:6.9]]; 40 41 42 33 43 } 34 44 … … 51 61 pitch = 31; 52 62 63 historyAttentionIndex = 0; 64 historyMeditationIndex = 0; 65 53 66 // initialise the audio session - this should only be done once 54 67 AudioSessionInitialize(NULL, NULL, NULL, NULL); 55 68 AudioSessionSetActive(YES); 69 70 // NSArray *tempFood = [[NSArray alloc] initWithArray:[self returnOtherArray]]; 71 // NSArray *tempFood = [[NSArray alloc] arrayWithObjects:[NSNumber numberWithFloat:6.9]]]; 72 73 // _historyAttention = tempFood; 56 74 57 75 #if USE_AUDIO_GENERATOR … … 110 128 [self setAttentionLevel:(NSNumber *)[data valueForKey:ATTENTION_KEY]]; 111 129 [self setMeditationLevel:(NSNumber *)[data valueForKey:MEDITATION_KEY]]; 130 131 historyAttention[historyAttentionIndex] = attentionLevel; 132 historyMeditation[historyMeditationIndex] = meditationLevel; 133 134 historyAttentionIndex = historyAttentionIndex + 1; 135 historyMeditationIndex = historyMeditationIndex + 1; 136 137 if (historyAttentionIndex == 30) { 138 NSLog(@"Attention Array Full"); 139 historyAttentionIndex = 0; 140 historyMeditationIndex = 0; 141 142 for (int i=0; i<30; i++){ 143 NSLog(@"%d: %d", i, historyAttention[i]); 144 } 145 146 } 147 112 148 } 113 149 -
iOS/Orbit/Orbit/controllers/FlightViewController.m
rc6dde93 r2246ba0 15 15 #import "SignalConverter.h" 16 16 17 #import "StatisticsViewController.h" 18 17 19 #define STATUS_DEFAULT 0 18 20 #define STATUS_CONNECTING 1 … … 187 189 188 190 // NSLog(@"Available fonts: %@", [UIFont familyNames]); 191 192 // StatisticsViewController *statisticsViewController=[[StatisticsViewController alloc] init]; 193 // [statisticsViewController.graphBottom reloadData]; 189 194 190 195 [signalConverter isAudioJackPlugged]; -
iOS/Orbit/Orbit/controllers/StatisticsViewController.h
rc1a500d r2246ba0 22 22 @property (nonatomic, strong) CPTGraphHostingView *hostViewBottom; 23 23 24 @property CPTGraph *graphTop; 25 @property CPTGraph *graphBottom; 26 27 28 //-(void)reloadData; 29 24 30 - (NSArray *)secondsInHistory; 25 31 -
iOS/Orbit/Orbit/controllers/StatisticsViewController.m
rc1a500d r2246ba0 45 45 [self configurePlots]; 46 46 [self configureAxes]; 47 // Block for .5 seconds 48 // [NSThread sleepForTimeInterval:5]; 49 // [self reloadData]; 47 50 } 48 51 … … 76 79 self.hostView.hostedGraph = graphTop; 77 80 78 81 79 82 // Bottom graph 80 83 CPTGraph *graphBottom = [[CPTXYGraph alloc] initWithFrame:self.hostViewBottom.bounds]; … … 216 219 CPTMutableLineStyle *powerSymbolLineStyle = [CPTMutableLineStyle lineStyle]; 217 220 powerSymbolLineStyle.lineColor = powerColor; 218 // CPTPlotSymbol *powerSymbol = [CPTPlotSymbol ellipsePlotSymbol];219 // powerSymbol.fill = [CPTFill fillWithColor:powerColor];220 // powerSymbol.lineStyle = powerSymbolLineStyle;221 // powerSymbol.size = CGSizeMake(3.0f, 3.0f);222 // powerPlot.plotSymbol = powerSymbol;221 // CPTPlotSymbol *powerSymbol = [CPTPlotSymbol ellipsePlotSymbol]; 222 // powerSymbol.fill = [CPTFill fillWithColor:powerColor]; 223 // powerSymbol.lineStyle = powerSymbolLineStyle; 224 // powerSymbol.size = CGSizeMake(3.0f, 3.0f); 225 // powerPlot.plotSymbol = powerSymbol; 223 226 224 227 } … … 335 338 NSInteger majorIncrement = 100; 336 339 NSInteger minorIncrement = 50; 337 CGFloat yMax = 700.0f; // should determine dynamically based on max price340 CGFloat yMax = 700.0f; // should determine dynamically based on max value 338 341 NSMutableSet *yLabels = [NSMutableSet set]; 339 342 NSMutableSet *yMajorLocations = [NSMutableSet set]; … … 381 384 382 385 case CPTScatterPlotFieldY: 383 // return [NSDecimalNumber one];384 386 if (index < valueCount) { 385 return [NSNumber numberWithUnsignedInteger:index]; 387 // return [NSDecimalNumber one]; 388 // return [NSNumber numberWithUnsignedInteger:index]; 389 return [[NSNumber alloc]initWithInt:(random() % 100)]; 386 390 } 387 391 … … 389 393 } 390 394 return [NSDecimalNumber zero]; 395 } 396 397 -(void)reloadData 398 { 399 [self.graphTop reloadData]; 400 [self.graphBottom reloadData]; 391 401 } 392 402
Note: See TracChangeset
for help on using the changeset viewer.