-
Notifications
You must be signed in to change notification settings - Fork 5
/
FourthViewController.m
executable file
·66 lines (51 loc) · 2.5 KB
/
FourthViewController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//
// FourthViewController.m
// RombergLab
//
// Created by Jorge on 3/12/15.
// Copyright © 2015 ARK. All rights reserved.
//
//Escala x 0.45
#import "FourthViewController.h"
@interface FourthViewController ()
@end
@implementation FourthViewController
@synthesize datos;
- (void)viewDidLoad {
[super viewDidLoad];
// Do view setup here.
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(analiza:)
name:@"ResultadosLOS"
object:nil];
NSString *userLocale = [[NSLocale currentLocale] localeIdentifier];
NSString *userLanguage = [userLocale substringToIndex:2];
if([userLanguage isEqualToString:@"es"]){
[self.titulo setStringValue:@"Gráfico de límites de estabilidad"];
[self.leyenda setStringValue:@"Valores LOS"];
[self.izqueirdatexto setStringValue:@"Izquierda"];
[self.derechatexto setStringValue:@"Derecha"];
}
}
-(void)analiza:(NSNotification*)notificacion{
datos = (NSMutableArray *)notificacion.object;
NSMutableArray *DatosX = [NSMutableArray array];
NSMutableArray *DatosY = [NSMutableArray array];
for (int i = 0;i < [datos count];i++){
[DatosX addObject:datos[i][3]];
[DatosY addObject:datos[i][4]];
}
[self.ant setStringValue:[NSString stringWithFormat:@"%i",[[DatosY valueForKeyPath:@"@max.intValue"] intValue]]];
[self.pos setStringValue:[NSString stringWithFormat:@"%i",[[DatosY valueForKeyPath:@"@min.intValue"] intValue]]];
[self.lef setStringValue:[NSString stringWithFormat:@"%i",[[DatosX valueForKeyPath:@"@min.intValue"] intValue]]];
[self.rig setStringValue:[NSString stringWithFormat:@"%i",[[DatosX valueForKeyPath:@"@max.intValue"] intValue]]];
int ant = (([[DatosY valueForKeyPath:@"@max.intValue"] intValue]*0.45));
int pos = (([[DatosY valueForKeyPath:@"@min.intValue"] intValue]*0.45));
int lef = (([[DatosX valueForKeyPath:@"@min.intValue"] intValue]*0.45));
int rig = (([[DatosX valueForKeyPath:@"@max.intValue"] intValue]*0.45));
[self.cuadroAnt setFrame:CGRectMake((((0)+(332/2))-10), (((ant)+(190/2))-10), 20, 20)];
[self.cuadroPos setFrame:CGRectMake((((0)+(332/2))-10), (((pos)+(190/2))-10), 20, 20)];
[self.cuadroLef setFrame:CGRectMake((((lef)+(332/2))-10), ((0+(190/2))-10), 20, 20)];
[self.cuadroRig setFrame:CGRectMake((((rig)+(332/2))-10), ((0+(190/2))-10), 20, 20)];
}
@end