- Timestamp:
- 08/27/13 02:28:13 (9 years ago)
- Branches:
- master, Servo, Tab_Interface, pyramid
- Children:
- ad80ed2
- Parents:
- 6bdfe8d
- Location:
- iOS/Orbit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
iOS/Orbit/Orbit/SignalConverter.m
rba2b6ff rd249b65 82 82 } 83 83 84 // Updated signal received from the EEG headset. 84 // Updated signal received from the EEG headset. 85 85 - (void) updatedSignalReceived:(id) data 86 86 { … … 90 90 { 91 91 [_delegate updatedValuesForSignal: signalStrength 92 93 94 92 attention: (float)attentionLevel / 100 93 meditation: (float)meditationLevel / 100 94 power: [self currentPowerLevel]]; 95 95 } 96 96 [self playAudio]; … … 101 101 [self setSignalStrength:(NSNumber *)[data valueForKey:POOR_SIGNAL_KEY]]; 102 102 [self setAttentionLevel:(NSNumber *)[data valueForKey:ATTENTION_KEY]]; 103 [self setMeditationLevel:(NSNumber *)[data valueForKey:MEDITATION_KEY]]; 103 [self setMeditationLevel:(NSNumber *)[data valueForKey:MEDITATION_KEY]]; 104 104 } 105 105 … … 107 107 { 108 108 if (value != nil) { 109 signalStrength = (200.0 - [value intValue]) / 200.0; 109 110 // NSLog(@"value: %i", [value intValue]); 111 112 if ([value intValue] == 0) { 113 signalStrength = 100; 114 } 115 116 else if ([value intValue] == 200) { 117 signalStrength = 0; 118 } 119 120 else { 121 signalStrength = [value intValue]; 122 } 123 124 // NSLog(@"signalStrength: %i", signalStrength); 125 110 126 } 111 127 } … … 162 178 // make the call to get the audio description and populate the desc dictionary 163 179 AudioSessionGetProperty(kAudioSessionProperty_AudioRouteDescription, &routeSize, &desc); 164 180 165 181 // the dictionary contains 2 keys, for input and output. Get output array 166 182 CFArrayRef outputs = CFDictionaryGetValue(desc, kAudioSession_AudioRouteKey_Outputs); … … 184 200 kAudioSessionOutputRoute_AirPlay 185 201 */ 186 202 187 203 return CFStringCompare(output, kAudioSessionOutputRoute_Headphones, 0) == kCFCompareEqualTo; 188 204 } … … 231 247 - (float) currentPowerLevel 232 248 { 233 249 234 250 float attentionScore = attentionPower[attentionLevel]; 235 251 float meditationScore = meditationPower[meditationLevel]; … … 242 258 meditationScore = 0; 243 259 } 244 260 245 261 float powerLevel = attentionScore + meditationScore; 246 262 if (powerLevel > 1) { -
iOS/Orbit/Orbit/controllers/FlightViewController.m
rba2b6ff rd249b65 85 85 power: (float)powerLevel 86 86 { 87 self.signal.progress = signalStrength; 88 self.signalPercent.text = [NSString stringWithFormat:@"%i%%", (int)(signalStrength * 100)]; 87 88 // self.signal.progress = (int)(signalStrength); 89 self.signal.progress = signalStrength / 100; 90 // NSLog(@"Setting self.signal.progress: %f", signalStrength / 100); 91 92 self.signalPercent.text = [NSString stringWithFormat:@"%i%%", (int)(signalStrength)]; 89 93 self.attention.progress = attentionLevel; 90 94 self.attentionPercent.text = [NSString stringWithFormat:@"%i%%", (int)(attentionLevel * 100)]; -
iOS/Orbit/tutorial/step06-1.html
r47ed41d rd249b65 20 20 </center> 21 21 22 <ul> 23 <li>This is how the EEG headset should look when worn properly</li> 24 </ul> 25 22 26 <a class='prev button' onclick="parent.changePage('step05-3.html');"> ← </a> 23 27 <a class='contents button' onclick="parent.changePage('contents.html');"> ↑ </a>
Note: See TracChangeset
for help on using the changeset viewer.