Ignore:
Timestamp:
01/10/14 20:42:19 (8 years ago)
Author:
Steve Castellotti <sc@…>
Branches:
master, Servo
Children:
a2742af
Parents:
2246ba0
Message:
File:
1 edited

Legend:

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

    r2246ba0 rfc960da  
    44// 
    55//  Copyright (c) 2013 Puzzlebox Productions, LLC. All rights reserved. 
    6 //  Originally created by Steve Castellotti. 
    76// 
    87//  With thanks to Ray Wenderlich 
    98//  http://www.raywenderlich.com/13271/how-to-draw-graphs-with-core-plot-part-2 
    109// 
    11 // 
    1210//  This code is released under the GNU Public License (GPL) version 2 
    1311//  For more information please refer to http://www.gnu.org/copyleft/gpl.html 
     
    1614#import "StatisticsViewController.h" 
    1715#import "AppDelegate.h" 
     16 
     17#import "SignalConverter.h" 
     18 
     19#import "HistoryAppDataObject.h" 
     20#import "AppDelegateProtocol.h" 
    1821 
    1922@implementation StatisticsViewController 
     
    2730//} 
    2831 
     32//#pragma mark - 
     33//#pragma mark instance methods 
     34 
     35- (HistoryAppDataObject*) theAppDataObject; 
     36{ 
     37        id<AppDelegateProtocol> theDelegate = (id<AppDelegateProtocol>) [UIApplication sharedApplication].delegate; 
     38        HistoryAppDataObject* theDataObject; 
     39        theDataObject = (HistoryAppDataObject*) theDelegate.theAppDataObject; 
     40        return theDataObject; 
     41} 
     42 
    2943- (void)didReceiveMemoryWarning 
    3044{ 
     
    3852   [self initPlot]; 
    3953} 
     54 
     55//- (void)viewWillAppear:(BOOL)animated 
     56//{ 
     57////    HistoryAppDataObject* theDataObject = [self theAppDataObject]; 
     58////    theInputView.text = theDataObject.string1; 
     59////    theSlider.value = theDataObject.float1; 
     60//} 
    4061 
    4162#pragma mark - Chart behavior 
     
    4667   [self configureAxes]; 
    4768   // Block for .5 seconds 
    48 //   [NSThread sleepForTimeInterval:5]; 
    49 //   [self reloadData]; 
     69   //   [NSThread sleepForTimeInterval:.5]; 
     70   //   [self reloadData]; 
    5071} 
    5172 
     
    376397        NSInteger valueCount = [[self secondsInHistory] count]; 
    377398    
     399   HistoryAppDataObject* theDataObject = [self theAppDataObject]; 
     400    
    378401        switch (fieldEnum) { 
    379402                case CPTScatterPlotFieldX: 
     
    385408                case CPTScatterPlotFieldY: 
    386409         if (index < valueCount) { 
    387             //         return [NSDecimalNumber one]; 
    388             //                          return [NSNumber numberWithUnsignedInteger:index]; 
    389             return [[NSNumber alloc]initWithInt:(random() % 100)]; 
     410             
     411//            return [[NSNumber alloc]initWithInt:(random() % 100)]; 
     412             
     413            NSNumber *value = [[NSNumber alloc]initWithInt:(random() % 100)]; 
     414            NSLog(@"Random: %d", (int) value); 
     415            NSLog(@"lastAttention: %d", theDataObject.lastAttention); 
     416            return value; 
     417             
    390418         } 
    391419          
Note: See TracChangeset for help on using the changeset viewer.