dotnet workload install maui-windowscd /mnt/d/source/repos/ddec/dif-maui
# Restore packages
dotnet restore
# Build only the testable projects (excludes DIF.Maui which requires Windows)
dotnet build src/DIF.Transport
dotnet build src/DIF.Core
dotnet build src/DIF.Simulator
dotnet build tests/DIF.Core.Tests
dotnet build tests/DIF.Integration.Tests
# Run all tests
dotnet test
# Build the message recorder tool
dotnet build tools/DIF.MessageRecorder
The DIF.Maui project will fail to build on Linux because the maui-windows workload is not available. This is expected.
cd D:\source\repos\ddec\dif-maui
# Install MAUI workload (one-time)
dotnet workload install maui-windows
# Restore and build everything
dotnet restore
dotnet build
# Run tests
dotnet test
# Run the MAUI app
dotnet run --project src/DIF.Maui
DIF.slnx in Visual Studio 2022DIF.Maui as the startup projectWindows Machine as the targetdif-maui/
├── DIF.slnx Solution file
├── docs/ Documentation (this folder)
├── src/
│ ├── DIF.Transport/ Transport abstraction (class library)
│ │ └── DIF.Transport.csproj Target: net10.0
│ ├── DIF.Core/ Business logic (class library)
│ │ └── DIF.Core.csproj Target: net10.0, depends on DIF.Transport
│ ├── DIF.Simulator/ ECM simulator (class library)
│ │ └── DIF.Simulator.csproj Target: net10.0, depends on DIF.Transport + DIF.Core
│ └── DIF.Maui/ .NET MAUI Windows app
│ └── DIF.Maui.csproj Target: net10.0-windows10.0.19041.0
├── tests/
│ ├── DIF.Core.Tests/ Unit tests
│ │ └── DIF.Core.Tests.csproj xUnit 2.9.3
│ ├── DIF.Integration.Tests/ Integration tests
│ │ └── DIF.Integration.Tests.csproj
│ └── DIF.Transport.Tests/ Transport tests (future)
└── tools/
└── DIF.MessageRecorder/ Lab recording tool
└── DIF.MessageRecorder.csproj
The application loads CSV configuration files at startup. These files define PID parameters, fault codes, and channel mappings.
At runtime, the app looks for DatFiles in AppContext.BaseDirectory:
<app-directory>/
└── DatFiles/
├── Ddec3ec1.csv PID definitions for Master ECM
├── DDECParm.txt EDMS parameter names (83 entries)
├── Codes.csv Fault code definitions
└── Channel.csv I/O channel definitions
Copy the DatFiles directory to the build output:
src/DIF.Maui/DatFiles/.csproj:<ItemGroup>
<Content Include="DatFiles\**" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
Ddec3ec1.csv (15 columns, comma-separated):
PID,Description,EDMSName,Units,BitSize,BitOffset,ScaleFactor,DataType,OnRequest,RequestOnce,MinValue,MaxValue,SlewableParam,ConvMult,ConvAdd
190,"Engine Speed","EC1_RPM","RPM",16,0,0.25,Uns16,0,0,0,3000,0,1.0,0.0
DDECParm.txt (one name per line):
EC1_RPM
EC1_BVOLT
EC1_CLTO
...
Codes.csv (fault code definitions):
CodeNumber,Description,FaultType,FMI
.NET Desktop Development + .NET MAUIDIF.slnxdif-maui folderDIF.slnxThe application defaults to the simulator transport. No hardware configuration needed.
The simulator starts with:
Go to Settings page in the app:
Settings are persisted via MAUI Preferences (platform-specific storage).
"MAUI workload not installed" - Run dotnet workload install maui-windows on Windows. On Linux, skip the MAUI project.
"Target framework not supported" - Ensure .NET 10 SDK is installed. Check with dotnet --list-sdks.
"DatFiles not found" - Ensure CSV files are in the DatFiles directory relative to the executable.
"ObjectDisposedException in MessagePlayer" - This was fixed by setting _playbackCts = null after dispose. Ensure you have the latest code.
"GovernorGainTask assertion failures" - This was fixed with the defensive _targetMid check. The fix allows unit tests to call ProcessResponse without first calling SendRequestAsync.
"No data displayed" - Check that:
SimulateTimeouts = false)"Task timeout" - Default timeout is 12 seconds. If the simulator has ResponseDelayMs set, tasks may time out.