Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
805 | - | 1 | // |
2 | // OsdViewController.m |
||
3 | // iKopter |
||
4 | // |
||
5 | // Created by Frank Blumenberg on 06.07.10. |
||
6 | // Copyright 2010 de.frankblumenberg. All rights reserved. |
||
7 | // |
||
8 | |||
9 | #import "OsdViewController.h" |
||
10 | #import "OsdValue.h" |
||
11 | |||
12 | @implementation OsdViewController |
||
13 | |||
14 | @synthesize errorCode; |
||
15 | |||
16 | - (void) viewDidAppear:(BOOL)animated { |
||
17 | |||
18 | osdValue = [[OsdValue alloc] init]; |
||
19 | osdValue.delegate = self; |
||
20 | } |
||
21 | |||
22 | - (void) viewWillDisappear:(BOOL)animated { |
||
23 | [osdValue release]; |
||
24 | } |
||
25 | |||
26 | |||
27 | - (void) newValue:(NaviData_t *)data { |
||
28 | |||
29 | NSMutableString* info=[NSMutableString stringWithString:@"INFO\r\n"]; |
||
30 | |||
31 | [info appendFormat:@"SatsInUse: %d\r\n",data->SatsInUse]; |
||
32 | [info appendFormat:@"Altimeter: %d\r\n",data->Altimeter]; |
||
33 | [info appendFormat:@"Variometer: %d\r\n",data->Variometer]; |
||
34 | [info appendFormat:@"FlyingTime: %d\r\n",data->FlyingTime]; |
||
35 | [info appendFormat:@"UBat: %d\r\n",data->UBat]; |
||
36 | [info appendFormat:@"Heading: %d\r\n",data->Heading]; |
||
37 | [info appendFormat:@"CompassHeading: %d\r\n",data->CompassHeading]; |
||
38 | [info appendFormat:@"AngleNick: %d\r\n",data->AngleNick]; |
||
39 | [info appendFormat:@"AngleRoll: %d\r\n",data->AngleRoll]; |
||
40 | [info appendFormat:@"RC_Quality: %d\r\n",data->RC_Quality]; |
||
41 | [info appendFormat:@"FCFlags: %d\r\n",data->FCFlags]; |
||
42 | [info appendFormat:@"NCFlags: %d\r\n",data->NCFlags]; |
||
43 | [info appendFormat:@"Errorcode: %d\r\n",data->Errorcode]; |
||
44 | [info appendFormat:@"RC_RSSI: %d\r\n",data->RC_RSSI]; |
||
45 | [info appendFormat:@"Current: %d\r\n",data->Current]; |
||
46 | [info appendFormat:@"UsedCapacity: %d\r\n",data->UsedCapacity]; |
||
47 | |||
48 | errorCode.text = info; |
||
49 | |||
50 | rotateX = data->AngleRoll; |
||
51 | rotateY = data->AngleNick; |
||
52 | } |
||
53 | |||
54 | - (void)drawRect:(CGRect)rect { |
||
55 | |||
56 | } |
||
57 | |||
58 | |||
59 | /* |
||
60 | // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. |
||
61 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { |
||
62 | if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { |
||
63 | // Custom initialization |
||
64 | } |
||
65 | return self; |
||
66 | } |
||
67 | */ |
||
68 | |||
69 | /* |
||
70 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. |
||
71 | - (void)viewDidLoad { |
||
72 | [super viewDidLoad]; |
||
73 | } |
||
74 | */ |
||
75 | |||
76 | /* |
||
77 | // Override to allow orientations other than the default portrait orientation. |
||
78 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { |
||
79 | // Return YES for supported orientations |
||
80 | return (interfaceOrientation == UIInterfaceOrientationPortrait); |
||
81 | } |
||
82 | */ |
||
83 | |||
84 | |||
85 | |||
86 | - (void)didReceiveMemoryWarning { |
||
87 | // Releases the view if it doesn't have a superview. |
||
88 | [super didReceiveMemoryWarning]; |
||
89 | |||
90 | // Release any cached data, images, etc that aren't in use. |
||
91 | } |
||
92 | |||
93 | - (void)viewDidUnload { |
||
94 | [super viewDidUnload]; |
||
95 | // Release any retained subviews of the main view. |
||
96 | // e.g. self.myOutlet = nil; |
||
97 | } |
||
98 | |||
99 | |||
100 | - (void)dealloc { |
||
101 | [super dealloc]; |
||
102 | } |
||
103 | |||
104 | |||
105 | @end |