Skip to content

Interactive 2D wave optics simulator. Turn any image into a refractive scene, add sources, watch waves refract, diffract and interfere. Probes, intensity maps, video export.

C#

ProbeMeasurement: Intensity and IntegratedIntensity renamed to Value and IntegratedValue

Alexander Graef0b7f78e21c01
diff --git a/CLAUDE.md b/CLAUDE.md
index b3b3835..45e6b0b 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -705,8 +705,10 @@ Thirteen points on a sneak peek of the WPF app; status as of 2026-10-12:
(`Simulation.Wavelength`: λ = c / f, the author's `UpdateLambdaLabel` formula; "(nominal)" with the
9-point stencil, which disperses; the Properties pane got a `Project` DP for it); (8) the probe
measurement combo offers only what the layer allows (`Probe.MeasurementsFor`, the layer setter
- coerces) and the intensity measurements read "Value" / "Integrated value" (`[Description]` on the
- enum members, honoured by `EnumNameConverter`); (9) the four random amounts of an array sit under
+ coerces) and the intensity measurements read "Value" / "Integrated value" (the enum members are
+ `ProbeMeasurement.Value` / `IntegratedValue` since 2026-10-14, renamed from Intensity / IntegratedIntensity
+ while the format could still change; the string tables name them, `EnumNameConverter` falls back to a
+ `[Description]`); (9) the four random amounts of an array sit under
their own header "Random offsets, added per emitter"; (2) the in/out tooltips say "export range".
- Done 2026-10-13: (1) a Run button (ring with a triangle, F5) left of Play, (4) two toggles left of
the split radios show or hide each picture (bound to the layer's `Preview`, so hiding the intensity
diff --git a/WaveDude.WPF/Converters/EnumNameConverter.cs b/WaveDude.WPF/Converters/EnumNameConverter.cs
index f3488f9..123f521 100644
--- a/WaveDude.WPF/Converters/EnumNameConverter.cs
+++ b/WaveDude.WPF/Converters/EnumNameConverter.cs
@@ -22,7 +22,7 @@ public sealed partial class EnumNameConverter : IValueConverter
}
if (value is Enum member)
{
- // the string table ("Enum.Type.Member") first, then a [Description] on the member (ProbeMeasurement.Intensity reads "Value")
+ // the string table ("Enum.Type.Member") first, then a [Description] on the member (ProbeMeasurement.IntegratedValue reads "Integrated value")
if (Application.Current?.TryFindResource($"Enum.{member.GetType().Name}.{member}") is string localized)
{
return localized;
diff --git a/WaveDude.WPF/Strings/Strings.DE.xaml b/WaveDude.WPF/Strings/Strings.DE.xaml
index 12cb1b1..b4d43ff 100644
--- a/WaveDude.WPF/Strings/Strings.DE.xaml
+++ b/WaveDude.WPF/Strings/Strings.DE.xaml
@@ -346,8 +346,8 @@
<s:String x:Key="Enum.ProbeLayer.Field">Feld</s:String>
<s:String x:Key="Enum.ProbeLayer.Intensity">Intensität</s:String>
<s:String x:Key="Enum.ProbeMeasurement.Amplitude">Amplitude</s:String>
- <s:String x:Key="Enum.ProbeMeasurement.Intensity">Wert</s:String>
- <s:String x:Key="Enum.ProbeMeasurement.IntegratedIntensity">Integrierter Wert</s:String>
+ <s:String x:Key="Enum.ProbeMeasurement.Value">Wert</s:String>
+ <s:String x:Key="Enum.ProbeMeasurement.IntegratedValue">Integrierter Wert</s:String>
<s:String x:Key="Enum.ProbeKind.Point">Punkt</s:String>
<s:String x:Key="Enum.ProbeKind.Line">Linie</s:String>
<s:String x:Key="Enum.ProbeBoxSize.Tiny">Winzig</s:String>
diff --git a/WaveDude.WPF/Strings/Strings.EN.xaml b/WaveDude.WPF/Strings/Strings.EN.xaml
index e0509c8..baaf386 100644
--- a/WaveDude.WPF/Strings/Strings.EN.xaml
+++ b/WaveDude.WPF/Strings/Strings.EN.xaml
@@ -346,8 +346,8 @@
<s:String x:Key="Enum.ProbeLayer.Field">Field</s:String>
<s:String x:Key="Enum.ProbeLayer.Intensity">Intensity</s:String>
<s:String x:Key="Enum.ProbeMeasurement.Amplitude">Amplitude</s:String>
- <s:String x:Key="Enum.ProbeMeasurement.Intensity">Value</s:String>
- <s:String x:Key="Enum.ProbeMeasurement.IntegratedIntensity">Integrated value</s:String>
+ <s:String x:Key="Enum.ProbeMeasurement.Value">Value</s:String>
+ <s:String x:Key="Enum.ProbeMeasurement.IntegratedValue">Integrated value</s:String>
<s:String x:Key="Enum.ProbeKind.Point">Point</s:String>
<s:String x:Key="Enum.ProbeKind.Line">Line</s:String>
<s:String x:Key="Enum.ProbeBoxSize.Tiny">Tiny</s:String>
diff --git a/WaveDude.WPF/Strings/Strings.FR.xaml b/WaveDude.WPF/Strings/Strings.FR.xaml
index 3e8d843..74cd80d 100644
--- a/WaveDude.WPF/Strings/Strings.FR.xaml
+++ b/WaveDude.WPF/Strings/Strings.FR.xaml
@@ -346,8 +346,8 @@
<s:String x:Key="Enum.ProbeLayer.Field">Champ</s:String>
<s:String x:Key="Enum.ProbeLayer.Intensity">Intensité</s:String>
<s:String x:Key="Enum.ProbeMeasurement.Amplitude">Amplitude</s:String>
- <s:String x:Key="Enum.ProbeMeasurement.Intensity">Valeur</s:String>
- <s:String x:Key="Enum.ProbeMeasurement.IntegratedIntensity">Valeur intégrée</s:String>
+ <s:String x:Key="Enum.ProbeMeasurement.Value">Valeur</s:String>
+ <s:String x:Key="Enum.ProbeMeasurement.IntegratedValue">Valeur intégrée</s:String>
<s:String x:Key="Enum.ProbeKind.Point">Point</s:String>
<s:String x:Key="Enum.ProbeKind.Line">Ligne</s:String>
<s:String x:Key="Enum.ProbeBoxSize.Tiny">Minuscule</s:String>
diff --git a/WaveDude.WPF/Strings/Strings.NL.xaml b/WaveDude.WPF/Strings/Strings.NL.xaml
index 0a73411..d29b153 100644
--- a/WaveDude.WPF/Strings/Strings.NL.xaml
+++ b/WaveDude.WPF/Strings/Strings.NL.xaml
@@ -346,8 +346,8 @@
<s:String x:Key="Enum.ProbeLayer.Field">Veld</s:String>
<s:String x:Key="Enum.ProbeLayer.Intensity">Intensiteit</s:String>
<s:String x:Key="Enum.ProbeMeasurement.Amplitude">Amplitude</s:String>
- <s:String x:Key="Enum.ProbeMeasurement.Intensity">Waarde</s:String>
- <s:String x:Key="Enum.ProbeMeasurement.IntegratedIntensity">Geïntegreerde waarde</s:String>
+ <s:String x:Key="Enum.ProbeMeasurement.Value">Waarde</s:String>
+ <s:String x:Key="Enum.ProbeMeasurement.IntegratedValue">Geïntegreerde waarde</s:String>
<s:String x:Key="Enum.ProbeKind.Point">Punt</s:String>
<s:String x:Key="Enum.ProbeKind.Line">Lijn</s:String>
<s:String x:Key="Enum.ProbeBoxSize.Tiny">Piepklein</s:String>
diff --git a/WaveDude/Model/LegacyProject.cs b/WaveDude/Model/LegacyProject.cs
index 31931f5..39efc88 100644
--- a/WaveDude/Model/LegacyProject.cs
+++ b/WaveDude/Model/LegacyProject.cs
@@ -236,8 +236,8 @@ public static class LegacyProject
// the measurement after the layer, which coerces it
probe.Measurement = Text(item, "measurement", "amplitude") switch
{
- "intensity" => ProbeMeasurement.Intensity,
- "integrated_intensity" => ProbeMeasurement.IntegratedIntensity,
+ "intensity" => ProbeMeasurement.Value,
+ "integrated_intensity" => ProbeMeasurement.IntegratedValue,
_ => ProbeMeasurement.Amplitude,
};
// the box position last: setting A first would drag a box that happens to share its position along
diff --git a/WaveDude/Model/Probe.cs b/WaveDude/Model/Probe.cs
index a38bc4f..df219e8 100644
--- a/WaveDude/Model/Probe.cs
+++ b/WaveDude/Model/Probe.cs
@@ -17,12 +17,11 @@ public enum ProbeMeasurement
{
/// <summary>Field value at the probe; field layer only.</summary>
Amplitude,
- /// <summary>Averaged intensity at the probe; intensity layer only. Shown as "Value" (the layer already says intensity).</summary>
- [Description("Value")]
- Intensity,
+ /// <summary>Averaged intensity at the probe; intensity layer only (the layer already says intensity, so the member is just "Value"; renamed from Intensity on the author's point 8, 2026-10-14, before the format shipped).</summary>
+ Value,
/// <summary>Intensity summed over the run so far; intensity layer only. Shown as "Integrated value".</summary>
[Description("Integrated value")]
- IntegratedIntensity,
+ IntegratedValue,
}
/// <summary>Point probe (position A) or line probe (A to B).</summary>
@@ -405,7 +404,7 @@ public sealed class Probe : ObservableObject
/// <summary>The measurements a probe on <paramref name="layer"/> can record (the editor offers only these).</summary>
public static ProbeMeasurement[] MeasurementsFor(ProbeLayer layer) =>
- layer == ProbeLayer.Field ? [ProbeMeasurement.Amplitude] : [ProbeMeasurement.Intensity, ProbeMeasurement.IntegratedIntensity];
+ layer == ProbeLayer.Field ? [ProbeMeasurement.Amplitude] : [ProbeMeasurement.Value, ProbeMeasurement.IntegratedValue];
/// <summary>
/// Forces a consistent state: the field only allows <see cref="ProbeMeasurement.Amplitude"/>,
@@ -421,7 +420,7 @@ public sealed class Probe : ObservableObject
}
else if (Measurement == ProbeMeasurement.Amplitude)
{
- Measurement = ProbeMeasurement.Intensity;
+ Measurement = ProbeMeasurement.Value;
}
if (YMax <= YMin)
{
diff --git a/WaveDude/Probes/ProbeCollector.cs b/WaveDude/Probes/ProbeCollector.cs
index 7f436df..32b7138 100644
--- a/WaveDude/Probes/ProbeCollector.cs
+++ b/WaveDude/Probes/ProbeCollector.cs
@@ -31,7 +31,7 @@ public sealed class ProbeCollector
/// <summary>
/// Drains the engine's buffered point-probe samples (<see cref="IWaveEngine.TakeProbeSamples"/>, one value
/// per step since the previous call) into the series traces and the pending UI batch. For cumulative
- /// probes (point + IntegratedIntensity) the per-step intensities are replaced in place by their running
+ /// probes (point + IntegratedValue) the per-step intensities are replaced in place by their running
/// sum, which stays at 0 for steps before the probe's start step. Does nothing when there are no point
/// probes.
/// </summary>
diff --git a/WaveDude/Probes/ProbeSampler.cs b/WaveDude/Probes/ProbeSampler.cs
index 69dd908..1c91025 100644
--- a/WaveDude/Probes/ProbeSampler.cs
+++ b/WaveDude/Probes/ProbeSampler.cs
@@ -73,7 +73,7 @@ public sealed class ProbeSampler
ProbeSpec probe = probes[i];
int ax = Clamp(probe.AX, w - 1);
int ay = Clamp(probe.AY, h - 1);
- bool isIntegrated = probe.Measurement == ProbeMeasurement.IntegratedIntensity;
+ bool isIntegrated = probe.Measurement == ProbeMeasurement.IntegratedValue;
if (probe.Kind == ProbeKind.Line)
{
int bx = Clamp(probe.BX, w - 1);
@@ -90,7 +90,7 @@ public sealed class ProbeSampler
pixels[i] = new int[] { (ay + 1) * stride + ax + 1 };
cumulative[i] = isIntegrated;
}
- // Intensity and IntegratedIntensity both read the intensity buffer.
+ // Value and IntegratedValue both read the intensity buffer.
useIntensity[i] = probe.Measurement != ProbeMeasurement.Amplitude;
useStartAfterStep[i] = probe.StartAfter > 0;
startAfterStep[i] = probe.StartAfter;
@@ -166,13 +166,13 @@ public sealed class ProbeSampler
/// <summary>Per probe: true for line probes (which deliver a profile), false for point probes (which deliver a time series).</summary>
public bool[] IsProfile { get; }
- /// <summary>Per probe: true when the measurement is Intensity or IntegratedIntensity, i.e. the intensity buffer is sampled instead of the field.</summary>
+ /// <summary>Per probe: true when the measurement is Value or IntegratedValue, i.e. the intensity buffer is sampled instead of the field.</summary>
public bool[] UseIntensity { get; }
- /// <summary>Per probe: point probe with IntegratedIntensity; <see cref="ProbeCollector.Collect"/> turns its per-step intensity samples into a running sum.</summary>
+ /// <summary>Per probe: point probe with IntegratedValue; <see cref="ProbeCollector.Collect"/> turns its per-step intensity samples into a running sum.</summary>
public bool[] Cumulative { get; }
- /// <summary>Per probe: line probe with IntegratedIntensity; the engine accumulates per-pixel intensity totals over the steps.</summary>
+ /// <summary>Per probe: line probe with IntegratedValue; the engine accumulates per-pixel intensity totals over the steps.</summary>
public bool[] Integrate { get; }
/// <summary>Per probe: Euclidean length of the (clamped) probe line in canvas pixels; 0 for point probes.</summary>
diff --git a/_tools/library_check/Program.cs b/_tools/library_check/Program.cs
index e6760e0..a1677c9 100644
--- a/_tools/library_check/Program.cs
+++ b/_tools/library_check/Program.cs
@@ -86,8 +86,8 @@ internal static class Program
private static ProbeSampler Probes(int w, int h) => ProbeSampler.Build(
[
new ProbeSpec("A", ProbeKind.Point, ProbeMeasurement.Amplitude, 20, 24, 0, 0, 0),
- new ProbeSpec("B", ProbeKind.Line, ProbeMeasurement.IntegratedIntensity, 5, 5, 40, 30, 50),
- new ProbeSpec("C", ProbeKind.Point, ProbeMeasurement.Intensity, 30, 20, 0, 0, 0),
+ new ProbeSpec("B", ProbeKind.Line, ProbeMeasurement.IntegratedValue, 5, 5, 40, 30, 50),
+ new ProbeSpec("C", ProbeKind.Point, ProbeMeasurement.Value, 30, 20, 0, 0, 0),
], w, h);
private static void Run(IWaveEngine engine, int steps)
@@ -806,7 +806,7 @@ internal static class Program
Check(Math.Abs(lopMin + 0.54) < 0.001 && Math.Abs(lopMax - 0.54) < 0.001, "lopsided data still gets a symmetric axis (" + lopMin.ToString("0.00", inv) + ".." + lopMax.ToString("0.00", inv) + ")");
ProbeGraph.ComputeRanges(point, new ProbeGraphData(new float[16], 16, null, 0, 16), 2500, out _, out _, out double zeroMin, out double zeroMax);
Check(zeroMin == -1 && zeroMax == 1, "all-zero data keeps the fixed range instead of a 1e-6 fit");
- var intensityProbe = new Probe { Name = "I", Layer = ProbeLayer.Intensity, Measurement = ProbeMeasurement.Intensity };
+ var intensityProbe = new Probe { Name = "I", Layer = ProbeLayer.Intensity, Measurement = ProbeMeasurement.Value };
float[] positive = new float[16];
positive[5] = 0.3f;
ProbeGraph.ComputeRanges(intensityProbe, new ProbeGraphData(positive, 16, null, 0, 16), 2500, out _, out _, out double intMin, out double intMax);
@@ -918,12 +918,12 @@ internal static class Program
Check(composite.Array is { SizeX: 5, SizeY: 5, SpacingX: 3, SpacingY: 3, RandomFrequency: 50, RandomPhase: 90, RandomOffWidth: 19, RandomPosition: 1 } && composite.Elements.Count == 25, "a 5 x 5 array with its random amounts, 25 emitters regenerated");
Check(composite.Mode == SourceMode.Pulsed && composite.PulseWidth == 5 && composite.OffWidth == 20 && composite.DetachAfter == 2000 && composite.Enabled && notes.Any(n => n.Contains("random offsets")), "pulsed 5 / 20 cycles, detaching after step 2000, the regeneration noted");
Check(p.Simulation.WaveSpeed == 0.563 && p.Display.Field.ColorScheme == "Orange_symmetry" && p.Display.Intensity.ColorScheme == "Purple_rain" && p.Display.Field.Brightness == 50, "c 0.563 and the chosen schemes");
- Check(p.Probes[0] is { Active: true, Kind: ProbeKind.Point, AutoScaleY: false, YMin: -0.02, YMax: 0.02, BoxSize: ProbeBoxSize.ExtraLarge, BoxX: 14, BoxY: 14 } && p.Probes[1] is { Layer: ProbeLayer.Intensity, Measurement: ProbeMeasurement.Intensity, Kind: ProbeKind.Line, StartAfter: 0, YMax: 0.0001 }, "probes: fixed value ranges, the unused start step dropped, use_probes honoured");
+ Check(p.Probes[0] is { Active: true, Kind: ProbeKind.Point, AutoScaleY: false, YMin: -0.02, YMax: 0.02, BoxSize: ProbeBoxSize.ExtraLarge, BoxX: 14, BoxY: 14 } && p.Probes[1] is { Layer: ProbeLayer.Intensity, Measurement: ProbeMeasurement.Value, Kind: ProbeKind.Line, StartAfter: 0, YMax: 0.0001 }, "probes: fixed value ranges, the unused start step dropped, use_probes honoured");
// start-after steps in use, an intensity probe, a detaching single source, the fallback decay
notes.Clear();
p = LegacyProject.Import(Path.Combine(root, "Wave_Dude_Examples", "Example3_Spherical_mirror", "configuration.json"), notes, out _);
- Check(p.Probes[0] is { StartAfter: 600, Window: 3000, Layer: ProbeLayer.Intensity, Measurement: ProbeMeasurement.Intensity } && p.Probes[1] is { StartAfter: 600, Measurement: ProbeMeasurement.IntegratedIntensity, Kind: ProbeKind.Line }, "Example 3: start-after steps kept when their flag is on, intensity measurements");
+ Check(p.Probes[0] is { StartAfter: 600, Window: 3000, Layer: ProbeLayer.Intensity, Measurement: ProbeMeasurement.Value } && p.Probes[1] is { StartAfter: 600, Measurement: ProbeMeasurement.IntegratedValue, Kind: ProbeKind.Line }, "Example 3: start-after steps kept when their flag is on, intensity measurements");
Check(p.Sources[0] is { Array: null, DetachAfter: 670, PulseWidth: 70, OffWidth: 100, Frequency: 200 } && p.Simulation.TimeDecay == 8 && p.Display.Intensity.ColorScheme == "Copper", "a single detaching source (its unused array settings ignored), decay 8, Copper");
Check(p.Scene.Mode == SceneMode.Image && p.Scene.ImageData == null && notes.Count == 1, "image mode with the image missing: one note");
@@ -970,7 +970,7 @@ internal static class Program
lineProbe.BY = 30;
Probe integrated = project.AddProbe();
integrated.Layer = ProbeLayer.Intensity;
- integrated.Measurement = ProbeMeasurement.IntegratedIntensity;
+ integrated.Measurement = ProbeMeasurement.IntegratedValue;
integrated.Kind = ProbeKind.Line;
integrated.AX = 10;
integrated.AY = 30;
diff --git a/_tools/ui_check/tiny_probes.wdproj b/_tools/ui_check/tiny_probes.wdproj
index e9af12d..3a787b6 100644
--- a/_tools/ui_check/tiny_probes.wdproj
+++ b/_tools/ui_check/tiny_probes.wdproj
@@ -12,5 +12,5 @@
<Array SizeX="3" SpacingX="10" />
</Source>
<Probe Name="Probe 1" AX="200" AY="120" BoxSize="Custom" BoxX="8" BoxY="8" BoxWidth="120" BoxHeight="60" />
- <Probe Name="Probe 2" Layer="Intensity" Measurement="Intensity" Kind="Line" AX="40" AY="200" BX="280" BY="200" BoxSize="Small" BoxX="40" BoxY="200" />
+ <Probe Name="Probe 2" Layer="Intensity" Measurement="Value" Kind="Line" AX="40" AY="200" BX="280" BY="200" BoxSize="Small" BoxX="40" BoxY="200" />
</Project>