non active parser enabled

This commit is contained in:
Kilian Hofmann 2016-04-14 08:30:29 +02:00
parent e471e3b61c
commit f137c2070c
6 changed files with 36 additions and 11 deletions

View File

@ -373,7 +373,6 @@
TargetAttributes = {
E22EE9CB1C9DB7B3001F5BC0 = {
CreatedOnToolsVersion = 7.2.1;
DevelopmentTeam = 795KPDV76S;
};
E22EE9E41C9DB7B4001F5BC0 = {
CreatedOnToolsVersion = 7.2.1;

View File

@ -7,7 +7,7 @@
<key>FMC Planner 2 Release.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>5</integer>
<integer>1</integer>
</dict>
<key>FMC Planner 2.xcscheme_^#shared#^_</key>
<dict>

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

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;
}

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) {

View File

@ -6,24 +6,32 @@
<dict>
<key>Pods-FMC Planner 2.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>Pods-FMC Planner 2Tests.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>2</integer>
</dict>
<key>Pods-FMC Planner 2UITests.xcscheme</key>
<key>Pods-FMC Planner 2Tests.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>3</integer>
</dict>
<key>SWTableViewCell.xcscheme</key>
<key>Pods-FMC Planner 2UITests.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>4</integer>
</dict>
<key>SWTableViewCell.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>5</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>