Oakrey.LDF.Values 2.0.1

dotnet add package Oakrey.LDF.Values --version 2.0.1
                    
NuGet\Install-Package Oakrey.LDF.Values -Version 2.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Oakrey.LDF.Values" Version="2.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Oakrey.LDF.Values" Version="2.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Oakrey.LDF.Values" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Oakrey.LDF.Values --version 2.0.1
                    
#r "nuget: Oakrey.LDF.Values, 2.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Oakrey.LDF.Values@2.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Oakrey.LDF.Values&version=2.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Oakrey.LDF.Values&version=2.0.1
                    
Install as a Cake Tool

Oakrey.LDF.Values

Overview

Oakrey.LDF.Values is a .NET 10 class library that adds a runtime value layer on top of Oakrey.LDF. It provides LdfSignalValue for reading and writing individual LIN signal values with physical unit decoding (offset + scale), and LdfTaskFrame for composing and parsing complete raw LIN message byte arrays across all positioned signals in a frame. Both types are designed for use in data-driven and MVVM applications.

Main Features

LdfSignalValue

  • Wraps a Signal template from Oakrey.LDF at a specific bit position inside a parent frame.
  • Exposes three representations of the value simultaneously: Value (physical double), RawValue (byte[]), and SignalContent (NumericBitArray).
  • Physical value decoding uses the SignalEncodingType.Offset and SignalEncodingType.Scale from the bound encoding; falls back to raw integer if no encoding is set.
  • Implements INotifyPropertyChanged � writing any of the three value properties raises change notifications for all three, making direct WPF/MVVM binding straightforward.
  • Three constructors: from a Signal + initial value, from a Signal with a specified double value, and a copy constructor.

LdfTaskFrame

  • Wraps a Frame template and builds an ObservableCollection<LdfSignalValue> directly from the frame's positioned signals.
  • LinMessage composes the current signal contents into a raw byte[] of the frame's response length.
  • SetValues(byte[] slices the incoming byte array to the correct response length (pads or truncates as needed) and pushes each slice into the correct signal via bit position.
  • Copy constructor preserves the same template, signal collection, and bit content.

Architecture

classDiagram
    class LdfTaskFrame {
        +long Id
        +string Name
        +byte[] LinMessage
        +int SignalCount
        +ObservableCollection~LdfSignalValue~ Signals
        +Frame Template
        +SetValues(byte[])
    }

    class LdfSignalValue {
        +string Name
        +int Position
        +long ParentId
        +int Size
        +double Value
        +byte[] RawValue
        +NumericBitArray SignalContent
        +Signal Template
        +NotifyPropertyChanged(string?)
    }

    class INotifyPropertyChanged {
        <<interface>>
        +PropertyChanged
    }

    LdfTaskFrame --> LdfSignalValue : Signals
    LdfSignalValue ..|> INotifyPropertyChanged
    LdfTaskFrame --> Frame : Template
    LdfSignalValue --> Signal : Template
    Signal --> SignalEncodingType : Encoding

Requirements

  • .NET 10 or higher
  • Oakrey.LDF >= 3.2.0 (project reference or NuGet)
  • Oakrey.BitArray >= 3.0.0

Installation

.NET CLI

dotnet add package Oakrey.LDF.Values

Package Manager Console

Install-Package Oakrey.LDF.Values

NuGet Package Manager

Search for Oakrey.LDF.Values under Tools > NuGet Package Manager > Manage NuGet Packages for Solution.

Build

dotnet build
dotnet pack --configuration Release

Example Usage

Construct a task frame from a parsed LDF

LdfMatrix matrix = await LdfMatrix.CreateAsync(new FileInfo("vehicle.ldf"), CancellationToken.None);

Frame frame = matrix.Frames.Single(f => f.Name == "BodyFrame");
LdfTaskFrame taskFrame = new LdfTaskFrame(frame);

Read physical signal values

foreach (LdfSignalValue signal in taskFrame.Signals)
{
    Console.WriteLine($"{signal.Name} @ bit {signal.Position}: value={signal.Value}  raw={BitConverter.ToString(signal.RawValue)}");
}

Write a physical value

LdfSignalValue speedSignal = taskFrame.Signals.Single(s => s.Name == "VehicleSpeed");
speedSignal.Value = 120.0;

// Compose the updated frame as raw bytes ready to transmit
byte[] linMessage = taskFrame.LinMessage;

Parse received raw bytes into signals

byte[] receivedBytes = [0x00, 0x7B, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00];
taskFrame.SetValues(receivedBytes);

foreach (LdfSignalValue signal in taskFrame.Signals)
{
    Console.WriteLine($"{signal.Name} = {signal.Value}");
}

WPF / MVVM binding

LdfSignalValue implements INotifyPropertyChanged. Bind directly to Value, RawValue, or SignalContent in a DataGrid or custom control � updates propagate automatically when any representation is written.

<DataGrid ItemsSource="{Binding TaskFrame.Signals}" AutoGenerateColumns="False">
    <DataGrid.Columns>
        <DataGridTextColumn Header="Signal" Binding="{Binding Name}" />
        <DataGridTextColumn Header="Value"  Binding="{Binding Value, Mode=TwoWay}" />
    </DataGrid.Columns>
</DataGrid>

Development Notes

  • LdfSignalValue.Value getter returns 0 when no SignalEncodingType is bound to the signal. If you expect a raw integer value in that case, read SignalContent directly instead.
  • LdfTaskFrame.SetValues pads with zero bytes when the provided array is shorter than Frame.ResponseLength, and silently truncates when it is longer.
  • LdfTaskFrame.LinMessage rebuilds the byte array on every access from the current frameContent � it is not cached.
  • NotifyPropertyChanged on LdfSignalValue is public, enabling external components to trigger UI refresh after bulk updates without going through the property setters.

Project Information

License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2.0.1 87 5/15/2026
2.0.0 129 2/2/2026
1.0.0 298 4/22/2025