Migrate the DIF (DDEC Interface) desktop application from C++ MFC to .NET MAUI targeting Windows, with an architecture that supports future Android tablet deployment. The new application includes a comprehensive ECM simulator so development and testing can happen without physical hardware access.
Source application: C++ MFC Win32 (83 source files, ~15,000 LOC)
Target application: .NET MAUI Windows (8 projects, ~50 source files)
| Phase | Description | Status |
|---|---|---|
| Phase 1 | Foundation (Transport + Data Models) | Complete |
| Phase 2 | Task System | Complete |
| Phase 3 | ECM Simulator | Complete |
| Phase 4 | Communication Service | Complete |
| Phase 5 | UI Layer (.NET MAUI) | Complete |
| Phase 6 | RP1210 Transport (Hardware) | Not started |
Phases 1-5 are complete and testable without hardware. Phase 6 requires lab access.
CDIFApp (MFC Application)
└── CDIFDoc (Document)
├── WorkerThreadProc (background thread)
│ ├── CCMC / CRP1210Wrapper (hardware I/O)
│ ├── CExtractData (J1587 parser)
│ └── CTaskManager (task scheduling)
├── CEcmData[3] (parameter database)
└── CDIFView (UI)
DIF.Maui (MAUI Application)
├── ViewModels (MVVM, CommunityToolkit.Mvvm)
├── EcmCommunicationService (async background loop)
│ ├── IEcmTransport (transport abstraction)
│ ├── J1587Parser (message parsing)
│ └── TaskManager (async task execution)
└── EcmData[3] (parameter database)
Objective: Define the transport abstraction layer and port data models.
Deliverables:
IEcmTransport interface replacing CCMC and CRP1210WrapperTransportConfig, ReadResult, TransportType recordsJ1587Constants with all protocol constantsPidInfo, PidData, EcmData model classesPidDefinitionLoader for Ddec3ec1.csv parsingEdmsParameterLoader for DDECParm.txt parsingFaultCodeLoader for Codes.csv parsingChannelLoader for Channel.csv parsingJ1587Parser porting CExtractData::ProcessJ1587Key mapping:
| C++ Class | C# Class | Project |
|---|---|---|
| CCMC | IEcmTransport | DIF.Transport |
| CRP1210Wrapper | IEcmTransport | DIF.Transport |
| CEcmData | EcmData | DIF.Core |
| CPIDInfo | PidInfo | DIF.Core |
| CPIDData | PidData | DIF.Core |
| DATATYPE enum | PidDataType enum | DIF.Core |
| CExtractData | J1587Parser | DIF.Core |
Objective: Port the task manager and all ECM task operations.
Deliverables:
IEcmTask interface replacing CEcmTask base classTaskManager replacing CTaskManager with async/awaitTaskResult replacing PostAcknowledge patternTask mapping:
| C++ Task | C# Task | Operation |
|---|---|---|
| CCodesTask | DiagnosticCodesTask | Get/Clear fault codes |
| CGovGainTask | GovernorGainTask | Read/Set governor gains |
| CHPAdjustTask | HpAdjustTask | PWM adjustment |
| CInjCalTask | InjectorCalibrationTask | Injector calibration |
| CRatingTask | RatingTask | Engine rating |
| CResetTask | ResetTask | ECM reset |
| CSetChannelTask | SetChannelTask | I/O channel config |
| CSlewTask | SlewTask | Parameter slewing |
| CVSGTask | VsgTask | Variable speed governor |
Pattern change:
| Legacy | New |
|---|---|
| Windows timers (SetTimer/KillTimer) | CancellationTokenSource.CancelAfter |
| CRITICAL_SECTION | SemaphoreSlim |
| PostMessage to owner HWND | TaskResult return value |
| CObList task queue | Sequential async execution |
Objective: Enable testing without hardware.
Deliverables:
SimulatorTransport implementing IEcmTransportEcmSimulator with configurable engine stateEcmState with 45+ configurable parametersMessageRecorder for capturing lab sessionsMessagePlayer for replaying recorded sessionsObjective: Replace the MFC worker thread.
Deliverables:
EcmCommunicationService with async read loopObjective: .NET MAUI Windows application with all pages.
Deliverables:
Page mapping:
| MFC Dialog | MAUI Page | ViewModel |
|---|---|---|
| CDIFView | MainPage | MainViewModel |
| CSlewingDlg | SlewingPage | SlewingViewModel |
| (Codes menu) | DiagnosticCodesPage | DiagnosticCodesViewModel |
| (Rating menu) | RatingPage | RatingViewModel |
| (GovGain menu) | GovernorGainPage | GovernorGainViewModel |
| (VSG menu) | VsgPage | VsgViewModel |
| (InjCal menu) | InjectorCalibrationPage | InjectorCalibrationViewModel |
| (Config dialog) | SettingsPage | SettingsViewModel |
Objective: Connect to real ECM hardware via RP1210 adapters.
Deliverables:
Rp1210Transport implementing IEcmTransportRequires: Windows machine with RP1210 adapter and ECM hardware.
| Step | Component | Can Test Without Hardware |
|---|---|---|
| 1 | DIF.Transport (interface + config) | Yes |
| 2 | DIF.Core Models | Yes |
| 3 | DIF.Core Config loaders | Yes |
| 4 | DIF.Core J1587 Parser | Yes |
| 5 | DIF.Simulator | Yes |
| 6 | DIF.Core.Tests (unit tests) | Yes |
| 7 | DIF.Core Task System | Yes |
| 8 | DIF.Integration.Tests | Yes |
| 9 | DIF.Core Communication Service | Yes |
| 10 | DIF.Maui (UI) | Yes |
| 11 | DIF.Transport RP1210 | No - requires lab |
| 12 | DIF.MessageRecorder | No - requires lab |
Raw -> ScaleFactor -> ConvMult/ConvAdd -> Display