From f137c2070c6d0c6535910a121955fe75cac7268a Mon Sep 17 00:00:00 2001 From: Kilian Hofmann Date: Thu, 14 Apr 2016 08:30:29 +0200 Subject: [PATCH] non active parser enabled --- FMC Planner 2.xcodeproj/project.pbxproj | 1 - .../xcschemes/xcschememanagement.plist | 2 +- FMC Planner 2/NavDataParser.h | 1 + FMC Planner 2/NavDataParser.m | 6 +++++ FMC Planner 2/ViewControllerScreen.m | 15 +++++++++++-- .../xcschemes/xcschememanagement.plist | 22 +++++++++++++------ 6 files changed, 36 insertions(+), 11 deletions(-) diff --git a/FMC Planner 2.xcodeproj/project.pbxproj b/FMC Planner 2.xcodeproj/project.pbxproj index 3464290..bd1f8f0 100644 --- a/FMC Planner 2.xcodeproj/project.pbxproj +++ b/FMC Planner 2.xcodeproj/project.pbxproj @@ -373,7 +373,6 @@ TargetAttributes = { E22EE9CB1C9DB7B3001F5BC0 = { CreatedOnToolsVersion = 7.2.1; - DevelopmentTeam = 795KPDV76S; }; E22EE9E41C9DB7B4001F5BC0 = { CreatedOnToolsVersion = 7.2.1; diff --git a/FMC Planner 2.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/xcschememanagement.plist b/FMC Planner 2.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/xcschememanagement.plist index 0ba233e..e8ddb88 100644 --- a/FMC Planner 2.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/FMC Planner 2.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,7 +7,7 @@ FMC Planner 2 Release.xcscheme_^#shared#^_ orderHint - 5 + 1 FMC Planner 2.xcscheme_^#shared#^_ diff --git a/FMC Planner 2/NavDataParser.h b/FMC Planner 2/NavDataParser.h index a7216a5..fab6dc5 100644 --- a/FMC Planner 2/NavDataParser.h +++ b/FMC Planner 2/NavDataParser.h @@ -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 diff --git a/FMC Planner 2/NavDataParser.m b/FMC Planner 2/NavDataParser.m index aed2431..6e452eb 100644 --- a/FMC Planner 2/NavDataParser.m +++ b/FMC Planner 2/NavDataParser.m @@ -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; } diff --git a/FMC Planner 2/ViewControllerScreen.m b/FMC Planner 2/ViewControllerScreen.m index d3e7acd..c4b0209 100644 --- a/FMC Planner 2/ViewControllerScreen.m +++ b/FMC Planner 2/ViewControllerScreen.m @@ -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) { diff --git a/Pods/Pods.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/xcschememanagement.plist b/Pods/Pods.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/xcschememanagement.plist index 8e4fd21..d9be422 100644 --- a/Pods/Pods.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/Pods/Pods.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/xcschememanagement.plist @@ -6,24 +6,32 @@ Pods-FMC Planner 2.xcscheme - orderHint - 1 - - Pods-FMC Planner 2Tests.xcscheme - + isShown + orderHint 2 - Pods-FMC Planner 2UITests.xcscheme + Pods-FMC Planner 2Tests.xcscheme + isShown + orderHint 3 - SWTableViewCell.xcscheme + Pods-FMC Planner 2UITests.xcscheme + isShown + orderHint 4 + SWTableViewCell.xcscheme + + isShown + + orderHint + 5 + SuppressBuildableAutocreation