Oakrey.LDF.Converters
1.0.0
dotnet add package Oakrey.LDF.Converters --version 1.0.0
NuGet\Install-Package Oakrey.LDF.Converters -Version 1.0.0
<PackageReference Include="Oakrey.LDF.Converters" Version="1.0.0" />
<PackageVersion Include="Oakrey.LDF.Converters" Version="1.0.0" />
<PackageReference Include="Oakrey.LDF.Converters" />
paket add Oakrey.LDF.Converters --version 1.0.0
#r "nuget: Oakrey.LDF.Converters, 1.0.0"
#:package Oakrey.LDF.Converters@1.0.0
#addin nuget:?package=Oakrey.LDF.Converters&version=1.0.0
#tool nuget:?package=Oakrey.LDF.Converters&version=1.0.0
Oakrey.LDF.Converters
WPF binding converters for LIN signals from Oakrey.LDF and Oakrey.LDF.Values.
Targets net10.0-windows and requires the .NET 10 Windows Desktop runtime.
Install
dotnet add package Oakrey.LDF.Converters
Use a Windows WPF project with <UseWPF>true</UseWPF>.
Converters
| Converter | Input | Output |
|---|---|---|
| SignalLogicalValuesConverter | Signal | Dictionary mapping logical values to meanings, using encoding scale/offset |
| SignalValueEnumToStringConverter | IEnumerable<ILogicalValue> | Lines of value -> meaning, without a trailing newline |
| SignalValueConverter | MultiBinding: physical double, Signal template | Matching meaning, empty text for a physical value in range, or Undefined |
| SignalMinValueConverter / SignalMaxValueConverter | LdfSignalValue | Ordered physical or logical slider endpoints as double |
| TemplateToScaleValueConverter | Signal | Encoding scale, or zero if absent/invalid |
WPF example
The DataContext below is an Oakrey.LDF.Values.LdfSignalValue.
<StackPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ldf="clr-namespace:Oakrey.LDF.Converters;assembly=Oakrey.LDF.Converters">
<StackPanel.Resources>
<ldf:SignalValueConverter x:Key="Label" />
<ldf:SignalValueEnumToStringConverter x:Key="LogicalValues" />
<ldf:SignalMinValueConverter x:Key="Minimum" />
<ldf:SignalMaxValueConverter x:Key="Maximum" />
</StackPanel.Resources>
<ProgressBar Minimum="{Binding Converter={StaticResource Minimum}, Mode=OneWay}"
Maximum="{Binding Converter={StaticResource Maximum}, Mode=OneWay}"
Value="{Binding Value, Mode=OneWay}" />
<TextBlock Text="{Binding Template.Encoding.LogicalValues, Converter={StaticResource LogicalValues}, Mode=OneWay}" />
<TextBlock>
<TextBlock.Text>
<MultiBinding Converter="{StaticResource Label}" Mode="OneWay">
<Binding Path="Value" />
<Binding Path="Template" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</StackPanel>
Behavior and limits
- Null, wrong-type, short and unresolved multi-bindings return empty text. A valid value/template pair with no encoding, a non-finite number or an unmatched out-of-range value returns
Undefined. - With nonzero scale, logical keys use
raw * scale + offset; physical membership uses(value - offset) / scale. With zero scale, logical values are raw and offset is ignored, matching LdfSignalValue. - These converters follow the scalar Scale/Offset/Min/Max view used by LdfSignalValue. They do not select among multiple PhysicalValues segments or decode ASCII/BCD.
- Enum formatting accepts the model's IReadOnlyList as well as observable collections, arrays and other generic enumerables. It uses the binding culture and returns null for empty/invalid input.
- Dictionaries ignore null entries and non-finite keys. Duplicate keys keep the first meaning, consistently with label lookup. Matching uses exact double equality.
- With nonzero scale, slider endpoints come from encoding Min/Max and are ordered even for negative scale. With zero scale, they use the logical minimum/maximum when available; otherwise they use the unsigned bit range.
- Without encoding, slider bounds use the unsigned bit range. Scalar sizes 1–64 are supported without a 32-bit integer cast; byte-array signals, invalid sizes or non-finite bounds return 0d.
- Double cannot represent every integer above 2^53; wide numeric signals have that precision limit.
- All converters are one-way. ConvertBack retains
NotSupportedException; useMode=OneWayfor converted bindings.
Performance and binding updates
Enum formatting and logical extrema use single O(n) passes. Label lookup avoids capturing LINQ predicates; dictionaries reserve the logical-value count. Converters read current model values without caching mutable templates. WPF bindings still require source notifications or explicit refresh after model changes; concurrent collection mutation is not supported.
Validation
From the repository root on Windows:
dotnet run --project Converters.Tests/Converters.Tests.csproj
dotnet pack LDF.Converters/LDF.Converters.csproj -c Release
The test project uses the xUnit v3 executable runner and includes an actual parsed LDF fixture. README and package icon are included in the NuGet package.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows7.0 is compatible. |
-
net10.0-windows7.0
- Oakrey.LDF.Values (>= 4.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 101 | 9/21/2026 |