Changeset d249b65 in orbit for iOS


Ignore:
Timestamp:
08/27/13 02:28:13 (6 years ago)
Author:
Steve Castellotti <sc@…>
Branches:
master, Servo, Tab_Interface, pyramid
Children:
ad80ed2
Parents:
6bdfe8d
Message:

Orbit:

  • Signal bar now updating correctly

Tutorial:

  • additional text added to step 6
Location:
iOS/Orbit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • iOS/Orbit/Orbit/SignalConverter.m

    rba2b6ff rd249b65  
    8282} 
    8383 
    84 // Updated signal received from the EEG headset.  
     84// Updated signal received from the EEG headset. 
    8585- (void) updatedSignalReceived:(id) data 
    8686{ 
     
    9090    { 
    9191        [_delegate updatedValuesForSignal: signalStrength 
    92                                     attention: (float)attentionLevel / 100 
    93                                    meditation: (float)meditationLevel / 100 
    94                                         power: [self currentPowerLevel]]; 
     92                                attention: (float)attentionLevel / 100 
     93                               meditation: (float)meditationLevel / 100 
     94                                    power: [self currentPowerLevel]]; 
    9595    } 
    9696    [self playAudio]; 
     
    101101    [self setSignalStrength:(NSNumber *)[data valueForKey:POOR_SIGNAL_KEY]]; 
    102102    [self setAttentionLevel:(NSNumber *)[data valueForKey:ATTENTION_KEY]]; 
    103     [self setMeditationLevel:(NSNumber *)[data valueForKey:MEDITATION_KEY]];     
     103    [self setMeditationLevel:(NSNumber *)[data valueForKey:MEDITATION_KEY]]; 
    104104} 
    105105 
     
    107107{ 
    108108    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         
    110126    } 
    111127} 
     
    162178    // make the call to get the audio description and populate the desc dictionary 
    163179    AudioSessionGetProperty(kAudioSessionProperty_AudioRouteDescription, &routeSize, &desc); 
    164  
     180     
    165181    // the dictionary contains 2 keys, for input and output. Get output array 
    166182    CFArrayRef outputs = CFDictionaryGetValue(desc, kAudioSession_AudioRouteKey_Outputs); 
     
    184200     kAudioSessionOutputRoute_AirPlay 
    185201     */ 
    186  
     202     
    187203    return CFStringCompare(output, kAudioSessionOutputRoute_Headphones, 0) == kCFCompareEqualTo; 
    188204} 
     
    231247- (float) currentPowerLevel 
    232248{ 
    233     
     249     
    234250    float attentionScore = attentionPower[attentionLevel]; 
    235251    float meditationScore = meditationPower[meditationLevel]; 
     
    242258        meditationScore = 0; 
    243259    } 
    244  
     260     
    245261    float powerLevel = attentionScore + meditationScore; 
    246262    if (powerLevel > 1) { 
  • iOS/Orbit/Orbit/controllers/FlightViewController.m

    rba2b6ff rd249b65  
    8585                          power: (float)powerLevel 
    8686{ 
    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)]; 
    8993    self.attention.progress = attentionLevel; 
    9094    self.attentionPercent.text = [NSString stringWithFormat:@"%i%%", (int)(attentionLevel * 100)]; 
  • iOS/Orbit/tutorial/step06-1.html

    r47ed41d rd249b65  
    2020      </center> 
    2121       
     22      <ul> 
     23         <li>This is how the EEG headset should look when worn properly</li> 
     24      </ul> 
     25       
    2226      <a class='prev button' onclick="parent.changePage('step05-3.html');">&nbsp;&nbsp; &larr; &nbsp;&nbsp;</a> 
    2327      <a class='contents button' onclick="parent.changePage('contents.html');">&nbsp;&nbsp; &uarr; &nbsp;&nbsp;</a> 
Note: See TracChangeset for help on using the changeset viewer.