Merge pull request #623 from wared2003/issue-622-reset-default-routing-algo-settings

Implements Issue #622: Add ability to reset routing algorithm settings to factory defaults.
This commit is contained in:
zjs81 authored and GitHub committed 2026-11-05 23:09:19 -07:00
commit 3eeb15cbff
41 files changed
+353 -11

No files matched your search

+23 -10
View File
@@ -98,6 +98,13 @@ class AppSettings {
static const String defaultPublicIpfsGateway =
'https://ipfs.filebase.io/ipfs/';
// Routing algorithm default values
static const double defaultMaxRouteWeight = 5.0;
static const double defaultInitialRouteWeight = 3.0;
static const double defaultRouteWeightSuccessIncrement = 0.5;
static const double defaultRouteWeightFailureDecrement = 0.2;
static const int defaultMaxMessageRetries = 5;
final bool clearPathOnMaxRetry;
final bool mapShowRepeaters;
final bool mapShowChatNodes;
@@ -278,11 +285,11 @@ class AppSettings {
this.autoSendZeroHopAdvertOnGpsUpdate = false,
this.gpsIntervalSeconds = 900,
this.autoRouteRotationEnabled = true,
this.maxRouteWeight = 5.0,
this.initialRouteWeight = 3.0,
this.routeWeightSuccessIncrement = 0.5,
this.routeWeightFailureDecrement = 0.2,
this.maxMessageRetries = 5,
this.maxRouteWeight = defaultMaxRouteWeight,
this.initialRouteWeight = defaultInitialRouteWeight,
this.routeWeightSuccessIncrement = defaultRouteWeightSuccessIncrement,
this.routeWeightFailureDecrement = defaultRouteWeightFailureDecrement,
this.maxMessageRetries = defaultMaxMessageRetries,
this.channelMinHopsEnabled = false,
this.channelMinHops = 2,
this.channelMinHopsRetries = 1,
@@ -515,14 +522,20 @@ class AppSettings {
(json['gps_interval_seconds'] as num?)?.toInt() ?? 900,
autoRouteRotationEnabled:
json['auto_route_rotation_enabled'] as bool? ?? true,
maxRouteWeight: (json['max_route_weight'] as num?)?.toDouble() ?? 5.0,
maxRouteWeight:
(json['max_route_weight'] as num?)?.toDouble() ??
defaultMaxRouteWeight,
initialRouteWeight:
(json['initial_route_weight'] as num?)?.toDouble() ?? 3.0,
(json['initial_route_weight'] as num?)?.toDouble() ??
defaultInitialRouteWeight,
routeWeightSuccessIncrement:
(json['route_weight_success_increment'] as num?)?.toDouble() ?? 0.5,
(json['route_weight_success_increment'] as num?)?.toDouble() ??
defaultRouteWeightSuccessIncrement,
routeWeightFailureDecrement:
(json['route_weight_failure_decrement'] as num?)?.toDouble() ?? 0.2,
maxMessageRetries: json['max_message_retries'] as int? ?? 5,
(json['route_weight_failure_decrement'] as num?)?.toDouble() ??
defaultRouteWeightFailureDecrement,
maxMessageRetries:
json['max_message_retries'] as int? ?? defaultMaxMessageRetries,
channelMinHopsEnabled: json['channel_min_hops_enabled'] as bool? ?? false,
channelMinHops: json['channel_min_hops'] as int? ?? 2,
channelMinHopsRetries: json['channel_min_hops_retries'] as int? ?? 1,