non active parser enabled
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user