diff --git a/Resources/Localizations/en.lproj/Localizable.strings b/Resources/Localizations/en.lproj/Localizable.strings index 4b199b2686..1f18bc43fe 100644 --- a/Resources/Localizations/en.lproj/Localizable.strings +++ b/Resources/Localizations/en.lproj/Localizable.strings @@ -1664,8 +1664,7 @@ "osm_editing_settings_descr" = "This plugin's settings are global and apply to all profiles."; "osmand_depelopment_simulate_location_section" = "Simulate"; -"osmand_depelopment_use_special_routing_hh+old" = "Use special routing (HH + old)"; -"osmand_depelopment_use_special_routing_hh_only" = "Use special routing (HH only)"; +"osmand_depelopment_use_old_routing" = "Use old routing (A*)"; "osmand_depelopment_use_discrete_autozoom" = "Discrete autozoom (old version)"; "simulate_in_progress" = "In progress"; diff --git a/Sources/Controllers/Settings/OsmandDevelopment/OAOsmandDevelopmentViewController.mm b/Sources/Controllers/Settings/OsmandDevelopment/OAOsmandDevelopmentViewController.mm index 44514620d5..a7b23797d0 100644 --- a/Sources/Controllers/Settings/OsmandDevelopment/OAOsmandDevelopmentViewController.mm +++ b/Sources/Controllers/Settings/OsmandDevelopment/OAOsmandDevelopmentViewController.mm @@ -45,8 +45,7 @@ @implementation OAOsmandDevelopmentViewController NSString *const kDisableVertexHillshade = @"kDisableVertexHillshade"; NSString *const kGenerateHillshadeKey = @"kGenerateHillshadeKey"; NSString *const kGenerateSlopeKey = @"kGenerateSlopeKey"; -NSString *const kUseHHRouting = @"kUseHHRouting"; -NSString *const kUseHHRoutingOnly = @"kUseHHRoutingOnly"; +NSString *const kUseOldRouting = @"kUseOldRouting"; NSString *const kUseV1AutoZoom = @"kUseV1AutoZoom"; #pragma mark - Initialization @@ -97,15 +96,9 @@ - (void)generateData }]; [simulationSection addRowFromDictionary:@{ kCellTypeKey : [OASwitchTableViewCell getCellIdentifier], - kCellKeyKey : kUseHHRouting, - kCellTitleKey : OALocalizedString(@"osmand_depelopment_use_special_routing_hh+old"), - @"isOn" : @([[OAAppSettings sharedManager].useHHRouting get]) - }]; - [simulationSection addRowFromDictionary:@{ - kCellTypeKey : [OASwitchTableViewCell getCellIdentifier], - kCellKeyKey : kUseHHRoutingOnly, - kCellTitleKey : OALocalizedString(@"osmand_depelopment_use_special_routing_hh_only"), - @"isOn" : @([[OAAppSettings sharedManager].useHHRoutingOnly get]) + kCellKeyKey : kUseOldRouting, + kCellTitleKey : OALocalizedString(@"osmand_depelopment_use_old_routing"), + @"isOn" : @([[OAAppSettings sharedManager].useOldRouting get]) }]; [_data addSection:simulationSection]; @@ -192,10 +185,8 @@ - (void)onSwitchPressed:(UISwitch *)sender NSIndexPath *indexPath = [NSIndexPath indexPathForRow:switchView.tag & 0x3FF inSection:switchView.tag >> 10]; OATableRowData *item = [_data itemForIndexPath:indexPath]; - if ([item.key isEqualToString:kUseHHRouting]) - [[OAAppSettings sharedManager].useHHRouting set:sender.isOn]; - else if ([item.key isEqualToString:kUseHHRoutingOnly]) - [[OAAppSettings sharedManager].useHHRoutingOnly set:sender.isOn]; + if ([item.key isEqualToString:kUseOldRouting]) + [[OAAppSettings sharedManager].useOldRouting set:sender.isOn]; else if ([item.key isEqualToString:kUseV1AutoZoom]) [[OAAppSettings sharedManager].useV1AutoZoom set:sender.isOn]; } diff --git a/Sources/Helpers/MissingMapsCalculator/MissingMapsCalculator.mm b/Sources/Helpers/MissingMapsCalculator/MissingMapsCalculator.mm index 9bab6d810c..2d65b14e45 100644 --- a/Sources/Helpers/MissingMapsCalculator/MissingMapsCalculator.mm +++ b/Sources/Helpers/MissingMapsCalculator/MissingMapsCalculator.mm @@ -63,9 +63,8 @@ - (instancetype)init - (BOOL)checkIfThereAreMissingMapsWithStart:(CLLocation *)start targets:(NSArray *)targets { - bool hhRoutingOnly = [[OAAppSettings sharedManager].useHHRoutingOnly get]; - bool hhRouting = [[OAAppSettings sharedManager].useHHRouting get]; - return [self checkIfThereAreMissingMaps:_ctx start:start targets:targets checkHHEditions:hhRoutingOnly || hhRouting]; + bool oldRouting = [[OAAppSettings sharedManager].useOldRouting get]; + return [self checkIfThereAreMissingMaps:_ctx start:start targets:targets checkHHEditions:!oldRouting]; } - (BOOL)checkIfThereAreMissingMaps:(std::shared_ptr)ctx diff --git a/Sources/Helpers/OAAppSettings.h b/Sources/Helpers/OAAppSettings.h index 124f268bf3..a863ee85ee 100644 --- a/Sources/Helpers/OAAppSettings.h +++ b/Sources/Helpers/OAAppSettings.h @@ -1261,8 +1261,7 @@ typedef NS_ENUM(NSInteger, EOARateUsState) @property (nonatomic) OACommonString *userUUID; @property (nonatomic) OACommonLong *lastUUIDChangeTimestamp; -@property (nonatomic) OACommonBoolean *useHHRouting; -@property (nonatomic) OACommonBoolean *useHHRoutingOnly; +@property (nonatomic) OACommonBoolean *useOldRouting; - (long) getLastGloblalSettingsModifiedTime; - (void) setLastGlobalModifiedTime:(long)timestamp; diff --git a/Sources/Helpers/OAAppSettings.m b/Sources/Helpers/OAAppSettings.m index c9b31adff6..5c2fd89b0a 100644 --- a/Sources/Helpers/OAAppSettings.m +++ b/Sources/Helpers/OAAppSettings.m @@ -433,8 +433,7 @@ static NSString * const topWidgetPanelOrderOldKey = @"top_widget_panel_order"; static NSString * const bottomWidgetPanelOrderKeyOld = @"bottom_widget_panel_order"; -static NSString * const useHHRoutingKey = @"useHHRoutingKey"; -static NSString * const useHHRoutingOnlyKey = @"useHHRoutingOnlyKey"; +static NSString * const useOldRoutingKey = @"useOldRoutingKey"; @implementation OACompassMode @@ -4741,10 +4740,8 @@ - (instancetype) init _mapScreenOrientation = [OACommonInteger withKey:mapScreenOrientationKey defValue:EOAScreenOrientationSystem]; [_profilePreferences setObject:_mapScreenOrientation forKey:@"map_screen_orientation"]; - _useHHRouting = [[[OACommonBoolean withKey:useHHRoutingKey defValue:NO] makeGlobal] makeShared]; - [_globalPreferences setObject:_useHHRouting forKey:@"use_hh_routing"]; - _useHHRoutingOnly = [[[OACommonBoolean withKey:useHHRoutingOnlyKey defValue:NO] makeGlobal] makeShared]; - [_globalPreferences setObject:_useHHRouting forKey:@"use_hh_routing_only"]; + _useOldRouting = [[[OACommonBoolean withKey:useOldRoutingKey defValue:NO] makeGlobal] makeShared]; + [_globalPreferences setObject:_useOldRouting forKey:@"use_old_routing"]; [self fetchImpassableRoads]; diff --git a/Sources/Router/OARouteProvider.mm b/Sources/Router/OARouteProvider.mm index cb1c4846aa..f4fb4e60a4 100644 --- a/Sources/Router/OARouteProvider.mm +++ b/Sources/Router/OARouteProvider.mm @@ -852,12 +852,11 @@ - (OARouteCalculationResult *) calcOfflineRouteImpl:(OARouteCalculationParams *) intY.push_back(get31TileNumberY(l.coordinate.latitude)); } - bool hhRoutingOnly = [[OAAppSettings sharedManager].useHHRoutingOnly get]; - bool hhRouting = [[OAAppSettings sharedManager].useHHRouting get]; - if (hhRouting || hhRoutingOnly) + bool oldRouting = [[OAAppSettings sharedManager].useOldRouting get]; + if (!oldRouting) { router->setDefaultRoutingConfig(); - router->USE_ONLY_HH_ROUTING = hhRoutingOnly; + // router->USE_ONLY_HH_ROUTING = hhRoutingOnly; // set true to debug HH routing } if (router->CALCULATE_MISSING_MAPS) @@ -867,7 +866,7 @@ - (OARouteCalculationResult *) calcOfflineRouteImpl:(OARouteCalculationParams *) _missingMapsCalculator = [MissingMapsCalculator new]; } NSArray *targets = (inters.count > 0) ? [inters arrayByAddingObject:en] : @[en]; - if ([_missingMapsCalculator checkIfThereAreMissingMaps:ctx start:st targets:targets checkHHEditions:hhRouting || hhRoutingOnly]) + if ([_missingMapsCalculator checkIfThereAreMissingMaps:ctx start:st targets:targets checkHHEditions:!oldRouting]) { OARouteCalculationResult *r = [[OARouteCalculationResult alloc] initWithErrorMessage:[_missingMapsCalculator getErrorMessage]]; r.missingMaps = _missingMapsCalculator.missingMaps;