non active parser enabled

This commit is contained in:
2016-04-14 08:30:29 +02:00
parent e471e3b61c
commit f137c2070c
6 changed files with 36 additions and 11 deletions
+1
View File
@@ -16,6 +16,7 @@
@property (strong, nonatomic) NSMutableDictionary *navaids;
@property (strong, nonatomic) NSMutableDictionary *airways;
@property (nonatomic) BOOL parserReady;
@property (nonatomic) BOOL notActive;
#pragma mark - Search for elements in normal route entry
+6
View File
@@ -17,6 +17,7 @@ NSString *const Navaids = @"NAVDATA/navs.txt";
- (id)init
{
self.parserReady = false;
self.notActive = false;
// Load Navaids
NSArray *temp = [[NSString
stringWithContentsOfFile:[SharedDeclerations savePathForFile:Navaids]
@@ -119,6 +120,11 @@ NSString *const Navaids = @"NAVDATA/navs.txt";
}
}
if (self.navaids == nil || self.intersections == nil ||
self.airways == nil) {
self.notActive = true;
}
self.parserReady = true;
return self;
}
+13 -2
View File
@@ -139,7 +139,14 @@ NavDataParser *parser = nil;
#warning TEST BED for NOW
if (parser.parserReady) {
NSArray *finds = [parser findWaypoint:_Scratchpad.text];
NSArray *finds = [[NSArray alloc] init];
if (tapReg.view.tag > 5) {
finds = [parser findWaypoint:_Scratchpad.text];
}
else if (tapReg.view.tag <= 5) {
finds = [parser findAirway:_Scratchpad.text];
}
if (finds.count != 0) {
((UILabel *)tapReg.view).text = _Scratchpad.text;
@@ -149,9 +156,13 @@ NavDataParser *parser = nil;
_Scratchpad.text = INVALID;
}
}
else {
else if (!parser.parserReady) {
_Scratchpad.text = NOTREADY;
}
else if (parser.notActive) {
((UILabel *)tapReg.view).text = _Scratchpad.text;
_Scratchpad.text = @"";
}
if ([((UILabel *)tapReg.view)
.restorationIdentifier isEqualToString:@"LSKR6"] &&
_numRoutePage == _maxNumRoutePages) {