Ignore:
Timestamp:
08/02/13 19:00:35 (9 years ago)
Author:
Jonathon Horsman <jonathon@…>
Branches:
master, Servo, Tab_Interface, pyramid
Children:
1472980
Parents:
ce0a7ee
Message:

Add a test button on flight tab
Add a reset button on advanced tab
Correctly detect device volume
Add more tutorial HTML

File:
1 edited

Legend:

Unmodified
Added
Removed
  • iOS/Orbit/Orbit/controllers/FlightViewController.m

    rce0a7ee rde10cbc  
    2626} 
    2727 
    28 @synthesize status, attention, meditation, signal, power, attentionThreshold, meditationThreshold, connectButton, statusImage, signalPercent, attentionPercent, meditationPercent, powerPercent; 
     28@synthesize status, attention, meditation, signal, power, attentionThreshold, meditationThreshold, connectButton, testButton, statusImage, signalPercent, attentionPercent, meditationPercent, powerPercent; 
    2929 
    3030- (void)viewDidLoad 
     
    142142        [signalConverter stopProcessing]; 
    143143        [self resetViews]; 
     144    } else if (!signalConverter.isVolumeMax) { 
     145        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Turn Up The Volume" message:@"Your device volume must be at the maximum for proper operation" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil]; 
     146        [alert show]; 
    144147    } else if (!signalConverter.isBluetoothReady) { 
    145148        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Device not found" message:@"No Bluetooth device detected. Ensure Bluetooth is on and the Mindwave headset is paired" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil]; 
    146         [alert show]; 
    147     } else if (!signalConverter.isVolumeMax) { 
    148         UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Turn Up The Volume" message:@"Your device volume must be at the maximum for proper operation" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil]; 
    149149        [alert show]; 
    150150    } else if ([signalConverter startProcessing]) { 
     
    157157} 
    158158 
     159- (IBAction) testButtonPressed:(id) sender { 
     160    if (signalConverter.running) { 
     161        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Stop test sound" message:@"Press Stop first to end the test" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil]; 
     162        [alert show]; 
     163    } else { 
     164        if (signalConverter.testing) { 
     165            testButton.title = @"Test"; 
     166            [signalConverter stopTestSound]; 
     167        } else { 
     168            testButton.title = @"Stop"; 
     169            [signalConverter playTestSound]; 
     170        } 
     171    } 
     172} 
     173 
    159174@end 
Note: See TracChangeset for help on using the changeset viewer.