Skip to content

Commit 27d8636

Browse files
committed
1.5 Pre-Release: External data import, fall computation changed
1 parent 88c9f3a commit 27d8636

14 files changed

+348
-17
lines changed

AppDelegate.h

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ BOOL reconectarOn;
2727
- (IBAction)losmedio:(id)sender;
2828
- (IBAction)losflojo:(id)sender;
2929
- (IBAction)itemexit:(id)sender;
30+
- (IBAction)externalData:(id)sender;
31+
32+
@property NSWindowController *myWindowControllerA;
33+
3034

3135
@end
3236

AppDelegate.m

+10
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ @interface AppDelegate ()
1515

1616
@implementation AppDelegate
1717

18+
@synthesize myWindowControllerA;
19+
20+
1821
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
1922
// Insert code here to initialize your application
2023

@@ -144,6 +147,13 @@ - (IBAction)itemexit:(id)sender{
144147
object:nil];
145148
}
146149

150+
- (IBAction)externalData:(id)sender {
151+
152+
NSStoryboard *storyBoard = [NSStoryboard storyboardWithName:@"Main" bundle:nil]; // get a reference to the storyboard
153+
myWindowControllerA = [storyBoard instantiateControllerWithIdentifier:@"SextaVentana"]; // instantiate your window controller
154+
[myWindowControllerA showWindow:self];
155+
}
156+
147157

148158

149159
@end

Base.lproj/Main.storyboard

+166-2
Large diffs are not rendered by default.

FivethViewController.h

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
@interface FivethViewController : NSViewController
1212
{
1313
float A1,A2,A3,A4;
14+
bool isRealPostur;
1415
}
1516
@property NSMutableArray *datos;
1617
@property NSMutableArray *datosCondicion1;

FivethViewController.m

+21-5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ @interface FivethViewController ()
2525
@property (weak) IBOutlet NSView *areaReport;
2626
@property (weak) IBOutlet NSTextField *globalScoreValue;
2727
@property (weak) IBOutlet NSTextField *betaInfo;
28+
@property (weak) IBOutlet NSTextField *externalData;
2829

2930
@end
3031

@@ -203,10 +204,10 @@ -(NSArray *)getScores:(float)area1 :(float)area2 :(float)area3 :(float)area4{
203204
float scoreTres = ((179.33-(area3-19.18))/(179.33));
204205
float scoreCuatro = ((743.22-(area4-39.11))/(743.22));
205206
//Falls & Negative Counting
206-
if (_buttonCondition1.state == TRUE) {scoreUno = 0;}
207-
if (_buttonCondition2.state == TRUE) {scoreDos = 0;}
208-
if (_buttonCondition3.state == TRUE) {scoreTres = 0;}
209-
if (_buttonCondition4.state == TRUE) {scoreCuatro = 0;}
207+
if (_buttonCondition1.state == TRUE) {scoreUno = -4;}
208+
if (_buttonCondition2.state == TRUE) {scoreDos = -4;}
209+
if (_buttonCondition3.state == TRUE) {scoreTres = -4;}
210+
if (_buttonCondition4.state == TRUE) {scoreCuatro = -4;}
210211
//Global score
211212
float ScoreGlobal = ((scoreUno+scoreDos+scoreTres+scoreCuatro)/4);
212213
float ScoreVestibular = scoreCuatro;
@@ -452,7 +453,11 @@ -(float)limiteSomatosensorial:(int)ageGroup :(int)heightGroup{
452453
}
453454

454455
-(void)analiza:(NSNotification*)notificacion{
455-
456+
NSString *isReal = [notificacion.userInfo objectForKey:@"isReal"];
457+
if ([isReal isEqual: @"true"]){
458+
// se ejecuta si viene de posturografía
459+
isRealPostur = true;
460+
[self.externalData setHidden:true];
456461
//Metodo para cargar los datos en esta clase
457462
datos = (NSMutableArray *)notificacion.object;
458463
datosCondicion1 = [NSMutableArray array];
@@ -514,6 +519,17 @@ -(void)analiza:(NSNotification*)notificacion{
514519
if ([datosCondicion4 count]){
515520
[self AreaCuatro];
516521
}
522+
}
523+
else {
524+
isRealPostur = false;
525+
[self.externalData setHidden:false];
526+
NSArray *importedAreas = (NSArray *)notificacion.object;
527+
A1 = [[importedAreas objectAtIndex:0]floatValue];
528+
A2 = [[importedAreas objectAtIndex:1]floatValue];
529+
A3 = [[importedAreas objectAtIndex:2]floatValue];
530+
A4 = [[importedAreas objectAtIndex:3]floatValue];
531+
}
532+
517533
if(A1+A2+A3+A4>0){
518534
NSLog(@"Areas: %0.2f %0.2f %0.2f %0.2f", A1, A2, A3, A4);
519535
}

Info.plist

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.4</string>
18+
<string>1.5</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>03</string>
22+
<string>01</string>
2323
<key>LSApplicationCategoryType</key>
2424
<string>public.app-category.medical</string>
2525
<key>LSMinimumSystemVersion</key>

RombergLab.xcodeproj/project.pbxproj

+12
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
CFC285BF1C1116DA0017601E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CFC285BE1C1116DA0017601E /* QuartzCore.framework */; };
3232
CFCE00C31F5D414D00195E89 /* FivethWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = CFCE00C21F5D414D00195E89 /* FivethWindowController.m */; };
3333
CFCE00D41F5D417700195E89 /* FivethViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CFCE00D21F5D417700195E89 /* FivethViewController.m */; };
34+
CFFA5D4922A1C7D30040CDB9 /* sixthWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = CFFA5D4822A1C7D30040CDB9 /* sixthWindowController.m */; };
35+
CFFA5D4C22A1C8340040CDB9 /* sixthViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CFFA5D4B22A1C8340040CDB9 /* sixthViewController.m */; };
3436
CFFDE6CE1C0B822500E08C64 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CFFDE6CB1C0B822500E08C64 /* AppDelegate.m */; };
3537
CFFDE6CF1C0B822500E08C64 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CFFDE6CD1C0B822500E08C64 /* ViewController.m */; };
3638
/* End PBXBuildFile section */
@@ -153,6 +155,10 @@
153155
CFCE00C21F5D414D00195E89 /* FivethWindowController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FivethWindowController.m; sourceTree = "<group>"; };
154156
CFCE00D11F5D417700195E89 /* FivethViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FivethViewController.h; sourceTree = "<group>"; };
155157
CFCE00D21F5D417700195E89 /* FivethViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FivethViewController.m; sourceTree = "<group>"; };
158+
CFFA5D4722A1C7D30040CDB9 /* sixthWindowController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = sixthWindowController.h; sourceTree = "<group>"; };
159+
CFFA5D4822A1C7D30040CDB9 /* sixthWindowController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = sixthWindowController.m; sourceTree = "<group>"; };
160+
CFFA5D4A22A1C8340040CDB9 /* sixthViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = sixthViewController.h; sourceTree = "<group>"; };
161+
CFFA5D4B22A1C8340040CDB9 /* sixthViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = sixthViewController.m; sourceTree = "<group>"; };
156162
CFFDE6CA1C0B822500E08C64 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
157163
CFFDE6CB1C0B822500E08C64 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
158164
CFFDE6CC1C0B822500E08C64 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
@@ -303,6 +309,8 @@
303309
CF4173531C10FE0100A27AB0 /* ThirdViewController.m */,
304310
CF4173551C10FE2900A27AB0 /* FourthViewController.h */,
305311
CF4173561C10FE2900A27AB0 /* FourthViewController.m */,
312+
CFFA5D4A22A1C8340040CDB9 /* sixthViewController.h */,
313+
CFFA5D4B22A1C8340040CDB9 /* sixthViewController.m */,
306314
);
307315
name = ViewControllers;
308316
sourceTree = "<group>";
@@ -318,6 +326,8 @@
318326
CF41734B1C10FD9800A27AB0 /* ThirdWindowController.m */,
319327
CF41734F1C10FDC300A27AB0 /* FourthWindowController.h */,
320328
CF4173501C10FDC300A27AB0 /* FourthWindowController.m */,
329+
CFFA5D4722A1C7D30040CDB9 /* sixthWindowController.h */,
330+
CFFA5D4822A1C7D30040CDB9 /* sixthWindowController.m */,
321331
);
322332
name = Windows;
323333
sourceTree = "<group>";
@@ -477,8 +487,10 @@
477487
files = (
478488
CF41733E1C10F9EE00A27AB0 /* SecondViewController.m in Sources */,
479489
CF4173511C10FDC300A27AB0 /* FourthWindowController.m in Sources */,
490+
CFFA5D4C22A1C8340040CDB9 /* sixthViewController.m in Sources */,
480491
CF41734D1C10FD9800A27AB0 /* ThirdWindowController.m in Sources */,
481492
CF4173481C10FB9500A27AB0 /* SecondWindowController.m in Sources */,
493+
CFFA5D4922A1C7D30040CDB9 /* sixthWindowController.m in Sources */,
482494
CFFDE6CE1C0B822500E08C64 /* AppDelegate.m in Sources */,
483495
CF4173571C10FE2900A27AB0 /* FourthViewController.m in Sources */,
484496
8D11072D0486CEB800E47090 /* main.m in Sources */,

ThirdViewController.m

+3-2
Original file line numberDiff line numberDiff line change
@@ -1169,10 +1169,11 @@ - (IBAction)verInforme:(id)sender {
11691169
NSStoryboard *storyBoard = [NSStoryboard storyboardWithName:@"Main" bundle:nil]; // get a reference to the storyboard
11701170
myWindowController4 = [storyBoard instantiateControllerWithIdentifier:@"QuintaVentana"]; // instantiate your window controller
11711171
[myWindowController4 showWindow:self];
1172-
1172+
NSDictionary *isRealPosturography = @{@"isReal":@"true"};
11731173
[[NSNotificationCenter defaultCenter]
11741174
postNotificationName:@"InformePosturografia"
1175-
object:datos];
1175+
object:datos
1176+
userInfo:isRealPosturography];
11761177
}
11771178

11781179
- (IBAction)guardarfoto:(id)sender {

es.lproj/Main.strings

+5-6
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,8 @@
496496

497497
"sJg-tA-W02.title" = "Somático:";
498498

499+
"jHo-5h-czD.title" = "LOS DATOS ANALIZADOS NO SON REALES";
500+
499501
/* Class = "NSMenuItem"; title = "About RombergLab"; ObjectID = "5kV-Vb-QxS"; */
500502
"Wfz-p6-NsX.title" = "Estudios Publicados";
501503

@@ -505,11 +507,8 @@
505507
/* Class = "NSMenuItem"; title = "About RombergLab"; ObjectID = "5kV-Vb-QxS"; */
506508
"vk6-eG-mIm.title" = "Normalización de puntuaciones";
507509

510+
"P86-MO-MXB.title" = "INTRODUZCA DATOS OBTENIDOS";
508511

512+
"Ceo-xn-EKd.title" = "Analizar datos...";
509513

510-
511-
512-
513-
514-
515-
514+
"buf-yF-xVf.title" = "Analizar datos previos...";

sixthViewController.h

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// sixthViewController.h
3+
// RombergLab
4+
//
5+
// Created by Jorge on 31/05/2019.
6+
// Copyright © 2019 ARK. All rights reserved.
7+
//
8+
9+
#import <Cocoa/Cocoa.h>
10+
11+
NS_ASSUME_NONNULL_BEGIN
12+
13+
@interface sixthViewController : NSViewController
14+
15+
@property NSArray *areas;
16+
@property NSWindowController *myWindowController6;
17+
18+
@end
19+
20+
NS_ASSUME_NONNULL_END

sixthViewController.m

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
//
2+
// sixthViewController.m
3+
// RombergLab
4+
//
5+
// Created by Jorge on 31/05/2019.
6+
// Copyright © 2019 ARK. All rights reserved.
7+
//
8+
9+
#import "sixthViewController.h"
10+
11+
@interface sixthViewController ()
12+
@property (weak) IBOutlet NSTextField *area1Field;
13+
@property (weak) IBOutlet NSTextField *area2Field;
14+
@property (weak) IBOutlet NSTextField *area3Field;
15+
@property (weak) IBOutlet NSTextField *area4Field;
16+
17+
@end
18+
19+
@implementation sixthViewController
20+
@synthesize myWindowController6;
21+
@synthesize areas;
22+
23+
- (void)viewDidLoad {
24+
[super viewDidLoad];
25+
// Do view setup here.
26+
}
27+
- (IBAction)analizeData:(id)sender {
28+
29+
//get data
30+
float area1 = [self.area1Field.stringValue floatValue];
31+
float area2 = [self.area2Field.stringValue floatValue];
32+
float area3 = [self.area3Field.stringValue floatValue];
33+
float area4 = [self.area4Field.stringValue floatValue];
34+
35+
//validation
36+
if (area1 > 0 && area2 > 0 && area3 > 0 && area4 > 0) {
37+
if (area1 < 1500 && area2 < 1500 && area3 < 1500 && area4 < 1500) {
38+
areas = [NSArray arrayWithObjects:[NSNumber numberWithFloat:area1],[NSNumber numberWithFloat:area2],[NSNumber numberWithFloat:area3],[NSNumber numberWithFloat:area4], nil];
39+
NSStoryboard *storyBoard = [NSStoryboard storyboardWithName:@"Main" bundle:nil]; // get a reference to the storyboard
40+
myWindowController6 = [storyBoard instantiateControllerWithIdentifier:@"QuintaVentana"]; // instantiate your window controller
41+
[myWindowController6 showWindow:self];
42+
NSDictionary *isRealPosturography = @{@"isReal":@"false"};
43+
[[NSNotificationCenter defaultCenter]
44+
postNotificationName:@"InformePosturografia"
45+
object:areas
46+
userInfo:isRealPosturography];
47+
}
48+
}
49+
50+
}
51+
52+
@end

sixthWindowController.h

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// sixthWindowController.h
3+
// RombergLab
4+
//
5+
// Created by Jorge on 31/05/2019.
6+
// Copyright © 2019 ARK. All rights reserved.
7+
//
8+
9+
#import <Cocoa/Cocoa.h>
10+
11+
NS_ASSUME_NONNULL_BEGIN
12+
13+
@interface sixthWindowController : NSWindowController
14+
15+
@property (weak) IBOutlet NSWindow *sextaVentana;
16+
17+
@end
18+
19+
NS_ASSUME_NONNULL_END

sixthWindowController.m

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// sixthWindowController.m
3+
// RombergLab
4+
//
5+
// Created by Jorge on 31/05/2019.
6+
// Copyright © 2019 ARK. All rights reserved.
7+
//
8+
9+
#import "sixthWindowController.h"
10+
11+
@interface sixthWindowController ()
12+
13+
@end
14+
15+
@implementation sixthWindowController
16+
@synthesize sextaVentana;
17+
18+
- (void)windowDidLoad {
19+
[super windowDidLoad];
20+
21+
// Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
22+
23+
NSString *userLocale = [[NSLocale currentLocale] localeIdentifier];
24+
NSString *userLanguage = [userLocale substringToIndex:2];
25+
if([userLanguage isEqualToString:@"es"]){
26+
[sextaVentana setTitle:@"Anlálisis externo"];
27+
}
28+
else {
29+
[sextaVentana setTitle:@"External analysis"];
30+
}
31+
}
32+
33+
@end

0 commit comments

Comments
 (0)