Skip to content

Commit

Permalink
ExtLibs: add Max/Min Alt for Propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuy authored and meee1 committed Oct 7, 2023
1 parent 3ee6619 commit 7149a47
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ExtLibs/Maps/Propagation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ public static bool ter_run
get => Settings.Instance.GetBoolean("Propagation_Termap");
set => Settings.Instance["Propagation_Termap"] = value.ToString();
}
public static bool set_alt_min_max
{
get => Settings.Instance.GetBoolean("Propagation_Setalt");
set => Settings.Instance["Propagation_Setalt"] = value.ToString();
}

//thread run
public bool ele_enabled { get; set; }
Expand Down Expand Up @@ -199,6 +204,12 @@ private async void elevation_calc()
ParallelOptions po = new ParallelOptions();
po.CancellationToken = cts.Token;

if (set_alt_min_max)
{
min_alt = Settings.Instance.GetFloat("Propagation_Minalt");
max_alt = Settings.Instance.GetFloat("Propagation_Maxalt");
}

Parallel.ForEach(
Extensions.SteppedRange(res / 2, height + extend + 1 - res, res), po, y =>
{
Expand All @@ -220,7 +231,7 @@ private async void elevation_calc()
{
alts[x, y] = altresponce.alt;

if (ter_run)
if (!set_alt_min_max && ter_run)
{
if (max_alt < altresponce.alt) max_alt = altresponce.alt;

Expand Down

0 comments on commit 7149a47

Please sign in to comment.