From 8cb7d741a532f4e6776c6d320c49bc82cf3e1ffd Mon Sep 17 00:00:00 2001 From: Matthew Kelch Date: Sat, 8 Aug 2026 18:30:21 -0400 Subject: [PATCH 1/8] refactor: reorganize FanaBridge.Core into domain folders (issue #102) Mechanical move of the Core Protocol/ grab-bag and Transport strays into domain homes: Display/{Protocol,Session,Catalog}, Leds/, Devices/ (+Identity/, +Profiles/ absorbing the former Profiles/ root), Tuning/, with ReportElicit joining Transport/. Namespaces follow folders under the unchanged FanaBridge root namespace; Col03FrameClassifier's stale FanaBridge.Protocol declaration corrected to FanaBridge.Transport. Core-subject tests move to tests/FanaBridge.Tests/Core// mirroring their subjects (per-project-root convention: Core/, Plugin/, Updater/). One reference-form change rides along: IFanatecLedModuleHost's Profiles.WheelCapabilities parameter is now unqualified under using FanaBridge.Devices.Profiles (the old prefix resolved via an ancestor namespace that no longer exists). No behavior, API, visibility, or resource changes; RootNamespace, Resources/, and root-namespace Log are untouched. 748/748 tests green; ILRepack merged build clean. --- .../ConnectionMonitor.cs | 2 +- .../{Transport => Devices}/FanatecWheelbase.cs | 7 ++++--- .../IWheelbaseConnection.cs | 2 +- .../Identity}/FanatecDeviceTables.cs | 2 +- .../Identity}/FanatecIdentity.cs | 2 +- .../Identity}/IdentitySettler.cs | 2 +- .../Identity}/SrmConverterIdentity.cs | 2 +- .../Identity}/SystemReportReader.cs | 2 +- .../Identity}/WheelEngage.cs | 2 +- .../{ => Devices}/Profiles/ColorFormat.cs | 2 +- .../{ => Devices}/Profiles/DeviceConfig.cs | 2 +- .../{ => Devices}/Profiles/DisplayType.cs | 2 +- .../{ => Devices}/Profiles/InputMapping.cs | 2 +- .../Profiles/LedChannelConverter.cs | 2 +- .../Profiles/LedColorLimitation.cs | 2 +- .../{ => Devices}/Profiles/LedDefinition.cs | 2 +- .../{ => Devices}/Profiles/LedEnums.cs | 2 +- .../{ => Devices}/Profiles/ProfileMatch.cs | 2 +- .../{ => Devices}/Profiles/ProfileSource.cs | 2 +- .../Profiles/WheelCapabilities.cs | 2 +- .../{ => Devices}/Profiles/WheelProfile.cs | 8 ++++---- .../Profiles/WheelProfileStore.cs | 2 +- .../Catalog}/ItmDeviceCatalog.cs | 3 ++- .../{ => Display}/Protocol/DisplayEncoder.cs | 2 +- .../{ => Display}/Protocol/ItmEncoder.cs | 2 +- .../{ => Display}/Protocol/ItmTelemetry.cs | 4 +++- .../{ => Display}/Protocol/SevenSegment.cs | 2 +- .../Session}/ItmLifecycleController.cs | 4 +++- .../{Protocol => Leds}/ColorHelper.cs | 2 +- .../{Protocol => Leds}/LedEncoder.cs | 2 +- .../{Protocol => Leds}/LegacyLedEncoder.cs | 2 +- .../Transport/Col03FrameClassifier.cs | 4 ++-- src/FanaBridge.Core/Transport/Col03QueueSet.cs | 1 - .../Transport/FanatecTransport.cs | 1 + .../{Protocol => Transport}/ReportElicit.cs | 3 +-- .../{Protocol => Tuning}/EncoderMode.cs | 2 +- .../FanatecTuningController.cs | 2 +- .../Adapters/FanaBridgeVariantProvider.cs | 6 +++--- .../Adapters/FanatecDeviceSettings.cs | 2 +- .../Adapters/FanatecDevicesRegistry.cs | 2 +- .../Adapters/FanatecDisplayDriver.cs | 4 ++-- src/FanaBridge/Adapters/FanatecLedDriver.cs | 4 ++-- src/FanaBridge/Adapters/FanatecLedManager.cs | 3 +-- .../Adapters/FanatecLedModuleHost.cs | 4 ++-- .../Adapters/FanatecWheelDeviceInstance.cs | 5 ++--- src/FanaBridge/Adapters/IDevicePanelFactory.cs | 2 +- .../Adapters/IFanatecLedModuleHost.cs | 3 ++- src/FanaBridge/Adapters/ItmDisplayDriver.cs | 3 ++- src/FanaBridge/Adapters/ItmTelemetryMapper.cs | 2 +- src/FanaBridge/Adapters/NoLedModuleHost.cs | 2 +- .../Diagnostics/ConverterCaptureProbe.cs | 1 + .../Diagnostics/DiagnosticsReport.cs | 2 +- src/FanaBridge/FanatecPlugin.cs | 18 +++++++++++------- src/FanaBridge/UI/DevicePanelFactory.cs | 2 +- .../UI/LedColorLimitationNotice.xaml.cs | 2 +- src/FanaBridge/UI/ScreenSettingsPanel.xaml.cs | 5 +++-- src/FanaBridge/UI/SettingsControl.xaml.cs | 6 +++--- src/FanaBridge/UI/TuningSettingsPanel.xaml.cs | 3 +-- .../UI/WheelProfileWizardDialog.xaml.cs | 6 ++++-- src/FanaBridge/UI/WizardState.cs | 4 ++-- .../Devices}/ConnectFailureMessageTests.cs | 3 ++- .../Devices}/ConnectionMonitorTests.cs | 4 ++-- .../Devices}/FanatecWheelbaseTests.cs | 7 ++++--- .../Identity}/FanatecDeviceTablesTests.cs | 4 ++-- .../Devices/Identity}/IdentitySettlerTests.cs | 4 ++-- .../Identity}/SrmConverterIdentityTests.cs | 4 ++-- .../Profiles}/LedChannelConverterTests.cs | 4 ++-- .../Profiles}/LedColorLimitationTests.cs | 4 ++-- .../Profiles}/WheelProfileItmDeviceTests.cs | 6 +++--- .../Profiles}/WheelProfileStoreTests.cs | 4 ++-- .../FanatecSoftwareMonitorTests.cs | 2 +- .../Display/Catalog}/ItmDeviceCatalogTests.cs | 5 +++-- .../Display/Protocol}/ItmEncoderTests.cs | 4 ++-- .../Display/Protocol}/ItmTelemetryTests.cs | 4 ++-- .../Display/Protocol}/SevenSegmentTests.cs | 4 ++-- .../Session}/ItmLifecycleControllerTests.cs | 7 +++++-- .../{ => Core/Leds}/ColorHelperTests.cs | 4 ++-- .../{ => Core/Leds}/LedEncoderTests.cs | 4 ++-- .../{ => Core/Leds}/LegacyLedEncoderTests.cs | 4 ++-- .../Transport}/Col03FrameClassifierTests.cs | 3 +-- .../{ => Core/Transport}/Col03QueueSetTests.cs | 2 +- .../Transport}/FanatecTransportReaderTests.cs | 3 ++- .../Transport}/HidReportQueueTests.cs | 2 +- .../{ => Core/Transport}/ReportElicitTests.cs | 3 +-- .../Tuning}/FanatecTuningControllerTests.cs | 5 ++--- .../DeviceRegistryOverrideTests.cs | 2 +- .../FanatecDeviceSettingsTests.cs | 2 +- .../FanatecDisplayDriverTests.cs | 2 +- .../FanaBridge.Tests/FanatecLedDriverTests.cs | 4 ++-- .../FanatecWheelDeviceInstanceTests.cs | 8 +++++--- .../FanaBridge.Tests/ItmDisplayDriverTests.cs | 2 +- .../TestDoubles/FakeLedModuleHost.cs | 2 +- tests/FanaBridge.Tests/WizardStateTests.cs | 2 +- 93 files changed, 162 insertions(+), 144 deletions(-) rename src/FanaBridge.Core/{Transport => Devices}/ConnectionMonitor.cs (99%) rename src/FanaBridge.Core/{Transport => Devices}/FanatecWheelbase.cs (99%) rename src/FanaBridge.Core/{Transport => Devices}/IWheelbaseConnection.cs (96%) rename src/FanaBridge.Core/{Protocol => Devices/Identity}/FanatecDeviceTables.cs (99%) rename src/FanaBridge.Core/{Protocol => Devices/Identity}/FanatecIdentity.cs (98%) rename src/FanaBridge.Core/{Transport => Devices/Identity}/IdentitySettler.cs (98%) rename src/FanaBridge.Core/{Protocol => Devices/Identity}/SrmConverterIdentity.cs (99%) rename src/FanaBridge.Core/{Protocol => Devices/Identity}/SystemReportReader.cs (99%) rename src/FanaBridge.Core/{Protocol => Devices/Identity}/WheelEngage.cs (98%) rename src/FanaBridge.Core/{ => Devices}/Profiles/ColorFormat.cs (93%) rename src/FanaBridge.Core/{ => Devices}/Profiles/DeviceConfig.cs (98%) rename src/FanaBridge.Core/{ => Devices}/Profiles/DisplayType.cs (93%) rename src/FanaBridge.Core/{ => Devices}/Profiles/InputMapping.cs (97%) rename src/FanaBridge.Core/{ => Devices}/Profiles/LedChannelConverter.cs (97%) rename src/FanaBridge.Core/{ => Devices}/Profiles/LedColorLimitation.cs (99%) rename src/FanaBridge.Core/{ => Devices}/Profiles/LedDefinition.cs (98%) rename src/FanaBridge.Core/{ => Devices}/Profiles/LedEnums.cs (97%) rename src/FanaBridge.Core/{ => Devices}/Profiles/ProfileMatch.cs (95%) rename src/FanaBridge.Core/{ => Devices}/Profiles/ProfileSource.cs (90%) rename src/FanaBridge.Core/{ => Devices}/Profiles/WheelCapabilities.cs (99%) rename src/FanaBridge.Core/{ => Devices}/Profiles/WheelProfile.cs (96%) rename src/FanaBridge.Core/{ => Devices}/Profiles/WheelProfileStore.cs (99%) rename src/FanaBridge.Core/{Protocol => Display/Catalog}/ItmDeviceCatalog.cs (98%) rename src/FanaBridge.Core/{ => Display}/Protocol/DisplayEncoder.cs (99%) rename src/FanaBridge.Core/{ => Display}/Protocol/ItmEncoder.cs (99%) rename src/FanaBridge.Core/{ => Display}/Protocol/ItmTelemetry.cs (99%) rename src/FanaBridge.Core/{ => Display}/Protocol/SevenSegment.cs (99%) rename src/FanaBridge.Core/{Protocol => Display/Session}/ItmLifecycleController.cs (99%) rename src/FanaBridge.Core/{Protocol => Leds}/ColorHelper.cs (99%) rename src/FanaBridge.Core/{Protocol => Leds}/LedEncoder.cs (99%) rename src/FanaBridge.Core/{Protocol => Leds}/LegacyLedEncoder.cs (99%) rename src/FanaBridge.Core/{Protocol => Transport}/ReportElicit.cs (98%) rename src/FanaBridge.Core/{Protocol => Tuning}/EncoderMode.cs (95%) rename src/FanaBridge.Core/{Protocol => Tuning}/FanatecTuningController.cs (99%) rename tests/FanaBridge.Tests/{ => Core/Devices}/ConnectFailureMessageTests.cs (97%) rename tests/FanaBridge.Tests/{ => Core/Devices}/ConnectionMonitorTests.cs (99%) rename tests/FanaBridge.Tests/{ => Core/Devices}/FanatecWheelbaseTests.cs (99%) rename tests/FanaBridge.Tests/{ => Core/Devices/Identity}/FanatecDeviceTablesTests.cs (97%) rename tests/FanaBridge.Tests/{ => Core/Devices/Identity}/IdentitySettlerTests.cs (98%) rename tests/FanaBridge.Tests/{ => Core/Devices/Identity}/SrmConverterIdentityTests.cs (97%) rename tests/FanaBridge.Tests/{ => Core/Devices/Profiles}/LedChannelConverterTests.cs (95%) rename tests/FanaBridge.Tests/{ => Core/Devices/Profiles}/LedColorLimitationTests.cs (98%) rename tests/FanaBridge.Tests/{ => Core/Devices/Profiles}/WheelProfileItmDeviceTests.cs (95%) rename tests/FanaBridge.Tests/{ => Core/Devices/Profiles}/WheelProfileStoreTests.cs (96%) rename tests/FanaBridge.Tests/{ => Core/Diagnostics}/FanatecSoftwareMonitorTests.cs (98%) rename tests/FanaBridge.Tests/{ => Core/Display/Catalog}/ItmDeviceCatalogTests.cs (94%) rename tests/FanaBridge.Tests/{ => Core/Display/Protocol}/ItmEncoderTests.cs (99%) rename tests/FanaBridge.Tests/{ => Core/Display/Protocol}/ItmTelemetryTests.cs (99%) rename tests/FanaBridge.Tests/{ => Core/Display/Protocol}/SevenSegmentTests.cs (96%) rename tests/FanaBridge.Tests/{ => Core/Display/Session}/ItmLifecycleControllerTests.cs (99%) rename tests/FanaBridge.Tests/{ => Core/Leds}/ColorHelperTests.cs (99%) rename tests/FanaBridge.Tests/{ => Core/Leds}/LedEncoderTests.cs (99%) rename tests/FanaBridge.Tests/{ => Core/Leds}/LegacyLedEncoderTests.cs (99%) rename tests/FanaBridge.Tests/{ => Core/Transport}/Col03FrameClassifierTests.cs (99%) rename tests/FanaBridge.Tests/{ => Core/Transport}/Col03QueueSetTests.cs (98%) rename tests/FanaBridge.Tests/{ => Core/Transport}/FanatecTransportReaderTests.cs (99%) rename tests/FanaBridge.Tests/{ => Core/Transport}/HidReportQueueTests.cs (99%) rename tests/FanaBridge.Tests/{ => Core/Transport}/ReportElicitTests.cs (98%) rename tests/FanaBridge.Tests/{ => Core/Tuning}/FanatecTuningControllerTests.cs (99%) diff --git a/src/FanaBridge.Core/Transport/ConnectionMonitor.cs b/src/FanaBridge.Core/Devices/ConnectionMonitor.cs similarity index 99% rename from src/FanaBridge.Core/Transport/ConnectionMonitor.cs rename to src/FanaBridge.Core/Devices/ConnectionMonitor.cs index d28843d0..c5942024 100644 --- a/src/FanaBridge.Core/Transport/ConnectionMonitor.cs +++ b/src/FanaBridge.Core/Devices/ConnectionMonitor.cs @@ -1,6 +1,6 @@ using System; -namespace FanaBridge.Transport +namespace FanaBridge.Devices { /// /// Encapsulates the Fanatec device connection state machine: diff --git a/src/FanaBridge.Core/Transport/FanatecWheelbase.cs b/src/FanaBridge.Core/Devices/FanatecWheelbase.cs similarity index 99% rename from src/FanaBridge.Core/Transport/FanatecWheelbase.cs rename to src/FanaBridge.Core/Devices/FanatecWheelbase.cs index 5c2a4b4e..790177cc 100644 --- a/src/FanaBridge.Core/Transport/FanatecWheelbase.cs +++ b/src/FanaBridge.Core/Devices/FanatecWheelbase.cs @@ -1,10 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; -using FanaBridge.Profiles; -using FanaBridge.Protocol; +using FanaBridge.Devices.Identity; +using FanaBridge.Devices.Profiles; +using FanaBridge.Transport; -namespace FanaBridge.Transport +namespace FanaBridge.Devices { /// /// Represents a connected Fanatec wheelbase — the root of all communication. diff --git a/src/FanaBridge.Core/Transport/IWheelbaseConnection.cs b/src/FanaBridge.Core/Devices/IWheelbaseConnection.cs similarity index 96% rename from src/FanaBridge.Core/Transport/IWheelbaseConnection.cs rename to src/FanaBridge.Core/Devices/IWheelbaseConnection.cs index b231c27a..f151165c 100644 --- a/src/FanaBridge.Core/Transport/IWheelbaseConnection.cs +++ b/src/FanaBridge.Core/Devices/IWheelbaseConnection.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Transport +namespace FanaBridge.Devices { /// /// Connection-check surface of a , used by diff --git a/src/FanaBridge.Core/Protocol/FanatecDeviceTables.cs b/src/FanaBridge.Core/Devices/Identity/FanatecDeviceTables.cs similarity index 99% rename from src/FanaBridge.Core/Protocol/FanatecDeviceTables.cs rename to src/FanaBridge.Core/Devices/Identity/FanatecDeviceTables.cs index eba62efe..5df8311b 100644 --- a/src/FanaBridge.Core/Protocol/FanatecDeviceTables.cs +++ b/src/FanaBridge.Core/Devices/Identity/FanatecDeviceTables.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace FanaBridge.Protocol +namespace FanaBridge.Devices.Identity { /// /// Reference tables mapping the raw FF 08 system-report bytes to FanaBridge diff --git a/src/FanaBridge.Core/Protocol/FanatecIdentity.cs b/src/FanaBridge.Core/Devices/Identity/FanatecIdentity.cs similarity index 98% rename from src/FanaBridge.Core/Protocol/FanatecIdentity.cs rename to src/FanaBridge.Core/Devices/Identity/FanatecIdentity.cs index 5d035e2b..3f34e165 100644 --- a/src/FanaBridge.Core/Protocol/FanatecIdentity.cs +++ b/src/FanaBridge.Core/Devices/Identity/FanatecIdentity.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Protocol +namespace FanaBridge.Devices.Identity { /// /// Decodes wheelbase + attachment + module identity from the col03 FF 08 diff --git a/src/FanaBridge.Core/Transport/IdentitySettler.cs b/src/FanaBridge.Core/Devices/Identity/IdentitySettler.cs similarity index 98% rename from src/FanaBridge.Core/Transport/IdentitySettler.cs rename to src/FanaBridge.Core/Devices/Identity/IdentitySettler.cs index 509f29b9..12931a5c 100644 --- a/src/FanaBridge.Core/Transport/IdentitySettler.cs +++ b/src/FanaBridge.Core/Devices/Identity/IdentitySettler.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Transport +namespace FanaBridge.Devices.Identity { /// /// Settles raw wheel/hub + module identity readings before they are committed. diff --git a/src/FanaBridge.Core/Protocol/SrmConverterIdentity.cs b/src/FanaBridge.Core/Devices/Identity/SrmConverterIdentity.cs similarity index 99% rename from src/FanaBridge.Core/Protocol/SrmConverterIdentity.cs rename to src/FanaBridge.Core/Devices/Identity/SrmConverterIdentity.cs index 5faacd6f..8611b294 100644 --- a/src/FanaBridge.Core/Protocol/SrmConverterIdentity.cs +++ b/src/FanaBridge.Core/Devices/Identity/SrmConverterIdentity.cs @@ -1,7 +1,7 @@ using System; using FanaBridge.Transport; -namespace FanaBridge.Protocol +namespace FanaBridge.Devices.Identity { /// /// SRM Conversion Kit identity, recovered from the kit's private DE FA AD0xDD diff --git a/src/FanaBridge.Core/Protocol/SystemReportReader.cs b/src/FanaBridge.Core/Devices/Identity/SystemReportReader.cs similarity index 99% rename from src/FanaBridge.Core/Protocol/SystemReportReader.cs rename to src/FanaBridge.Core/Devices/Identity/SystemReportReader.cs index fe52d08f..ba1e4b56 100644 --- a/src/FanaBridge.Core/Protocol/SystemReportReader.cs +++ b/src/FanaBridge.Core/Devices/Identity/SystemReportReader.cs @@ -1,7 +1,7 @@ using System; using FanaBridge.Transport; -namespace FanaBridge.Protocol +namespace FanaBridge.Devices.Identity { /// /// The col03 FF 08 system-report codec — the wire-level side of identity. diff --git a/src/FanaBridge.Core/Protocol/WheelEngage.cs b/src/FanaBridge.Core/Devices/Identity/WheelEngage.cs similarity index 98% rename from src/FanaBridge.Core/Protocol/WheelEngage.cs rename to src/FanaBridge.Core/Devices/Identity/WheelEngage.cs index 6c4486a6..fc0c6254 100644 --- a/src/FanaBridge.Core/Protocol/WheelEngage.cs +++ b/src/FanaBridge.Core/Devices/Identity/WheelEngage.cs @@ -1,6 +1,6 @@ using FanaBridge.Transport; -namespace FanaBridge.Protocol +namespace FanaBridge.Devices.Identity { /// /// Replicates the kernel filter's engage sequence (FWFUProtocolUsbBulkOrInterruptTransfer) diff --git a/src/FanaBridge.Core/Profiles/ColorFormat.cs b/src/FanaBridge.Core/Devices/Profiles/ColorFormat.cs similarity index 93% rename from src/FanaBridge.Core/Profiles/ColorFormat.cs rename to src/FanaBridge.Core/Devices/Profiles/ColorFormat.cs index c36d4d89..3113013b 100644 --- a/src/FanaBridge.Core/Profiles/ColorFormat.cs +++ b/src/FanaBridge.Core/Devices/Profiles/ColorFormat.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Profiles +namespace FanaBridge.Devices.Profiles { /// /// Pixel encoding for the Color LED channel (subcmd 0x02). diff --git a/src/FanaBridge.Core/Profiles/DeviceConfig.cs b/src/FanaBridge.Core/Devices/Profiles/DeviceConfig.cs similarity index 98% rename from src/FanaBridge.Core/Profiles/DeviceConfig.cs rename to src/FanaBridge.Core/Devices/Profiles/DeviceConfig.cs index eb35ce18..1310704e 100644 --- a/src/FanaBridge.Core/Profiles/DeviceConfig.cs +++ b/src/FanaBridge.Core/Devices/Profiles/DeviceConfig.cs @@ -1,6 +1,6 @@ using System; -namespace FanaBridge.Profiles +namespace FanaBridge.Devices.Profiles { /// /// Identifies a specific selectable device configuration — a standalone diff --git a/src/FanaBridge.Core/Profiles/DisplayType.cs b/src/FanaBridge.Core/Devices/Profiles/DisplayType.cs similarity index 93% rename from src/FanaBridge.Core/Profiles/DisplayType.cs rename to src/FanaBridge.Core/Devices/Profiles/DisplayType.cs index b446adbc..159a33a6 100644 --- a/src/FanaBridge.Core/Profiles/DisplayType.cs +++ b/src/FanaBridge.Core/Devices/Profiles/DisplayType.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Profiles +namespace FanaBridge.Devices.Profiles { /// /// The type of display available on a wheel or button module. diff --git a/src/FanaBridge.Core/Profiles/InputMapping.cs b/src/FanaBridge.Core/Devices/Profiles/InputMapping.cs similarity index 97% rename from src/FanaBridge.Core/Profiles/InputMapping.cs rename to src/FanaBridge.Core/Devices/Profiles/InputMapping.cs index 783f8a0f..e2b5c1e3 100644 --- a/src/FanaBridge.Core/Profiles/InputMapping.cs +++ b/src/FanaBridge.Core/Devices/Profiles/InputMapping.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using Newtonsoft.Json; -namespace FanaBridge.Profiles +namespace FanaBridge.Devices.Profiles { /// /// Structured input association for a single LED. diff --git a/src/FanaBridge.Core/Profiles/LedChannelConverter.cs b/src/FanaBridge.Core/Devices/Profiles/LedChannelConverter.cs similarity index 97% rename from src/FanaBridge.Core/Profiles/LedChannelConverter.cs rename to src/FanaBridge.Core/Devices/Profiles/LedChannelConverter.cs index fc216327..c42bd539 100644 --- a/src/FanaBridge.Core/Profiles/LedChannelConverter.cs +++ b/src/FanaBridge.Core/Devices/Profiles/LedChannelConverter.cs @@ -1,7 +1,7 @@ using System; using Newtonsoft.Json; -namespace FanaBridge.Profiles +namespace FanaBridge.Devices.Profiles { /// /// JSON converter for that accepts both v1 and v2 diff --git a/src/FanaBridge.Core/Profiles/LedColorLimitation.cs b/src/FanaBridge.Core/Devices/Profiles/LedColorLimitation.cs similarity index 99% rename from src/FanaBridge.Core/Profiles/LedColorLimitation.cs rename to src/FanaBridge.Core/Devices/Profiles/LedColorLimitation.cs index 2ca84379..e2b283a7 100644 --- a/src/FanaBridge.Core/Profiles/LedColorLimitation.cs +++ b/src/FanaBridge.Core/Devices/Profiles/LedColorLimitation.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; -namespace FanaBridge.Profiles +namespace FanaBridge.Devices.Profiles { /// /// A way in which a wheel's LEDs cannot show what SimHub's color picker offers. diff --git a/src/FanaBridge.Core/Profiles/LedDefinition.cs b/src/FanaBridge.Core/Devices/Profiles/LedDefinition.cs similarity index 98% rename from src/FanaBridge.Core/Profiles/LedDefinition.cs rename to src/FanaBridge.Core/Devices/Profiles/LedDefinition.cs index 19aede41..b312dd90 100644 --- a/src/FanaBridge.Core/Profiles/LedDefinition.cs +++ b/src/FanaBridge.Core/Devices/Profiles/LedDefinition.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace FanaBridge.Profiles +namespace FanaBridge.Devices.Profiles { /// /// Describes a single physical LED on the device. diff --git a/src/FanaBridge.Core/Profiles/LedEnums.cs b/src/FanaBridge.Core/Devices/Profiles/LedEnums.cs similarity index 97% rename from src/FanaBridge.Core/Profiles/LedEnums.cs rename to src/FanaBridge.Core/Devices/Profiles/LedEnums.cs index eacf9906..63b9982d 100644 --- a/src/FanaBridge.Core/Profiles/LedEnums.cs +++ b/src/FanaBridge.Core/Devices/Profiles/LedEnums.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Profiles +namespace FanaBridge.Devices.Profiles { /// /// Hardware communication channel for a single LED. diff --git a/src/FanaBridge.Core/Profiles/ProfileMatch.cs b/src/FanaBridge.Core/Devices/Profiles/ProfileMatch.cs similarity index 95% rename from src/FanaBridge.Core/Profiles/ProfileMatch.cs rename to src/FanaBridge.Core/Devices/Profiles/ProfileMatch.cs index 0e59b200..d1c31562 100644 --- a/src/FanaBridge.Core/Profiles/ProfileMatch.cs +++ b/src/FanaBridge.Core/Devices/Profiles/ProfileMatch.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace FanaBridge.Profiles +namespace FanaBridge.Devices.Profiles { /// /// Matching criteria to associate a profile with the connected hardware. diff --git a/src/FanaBridge.Core/Profiles/ProfileSource.cs b/src/FanaBridge.Core/Devices/Profiles/ProfileSource.cs similarity index 90% rename from src/FanaBridge.Core/Profiles/ProfileSource.cs rename to src/FanaBridge.Core/Devices/Profiles/ProfileSource.cs index 65083c4d..77b4fd66 100644 --- a/src/FanaBridge.Core/Profiles/ProfileSource.cs +++ b/src/FanaBridge.Core/Devices/Profiles/ProfileSource.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Profiles +namespace FanaBridge.Devices.Profiles { /// /// Indicates whether a profile was shipped with the plugin or created by the user. diff --git a/src/FanaBridge.Core/Profiles/WheelCapabilities.cs b/src/FanaBridge.Core/Devices/Profiles/WheelCapabilities.cs similarity index 99% rename from src/FanaBridge.Core/Profiles/WheelCapabilities.cs rename to src/FanaBridge.Core/Devices/Profiles/WheelCapabilities.cs index b10de2eb..5cfbb0af 100644 --- a/src/FanaBridge.Core/Profiles/WheelCapabilities.cs +++ b/src/FanaBridge.Core/Devices/Profiles/WheelCapabilities.cs @@ -1,6 +1,6 @@ using System.Linq; -namespace FanaBridge.Profiles +namespace FanaBridge.Devices.Profiles { /// /// Runtime view of a wheel's hardware capabilities, computed from a diff --git a/src/FanaBridge.Core/Profiles/WheelProfile.cs b/src/FanaBridge.Core/Devices/Profiles/WheelProfile.cs similarity index 96% rename from src/FanaBridge.Core/Profiles/WheelProfile.cs rename to src/FanaBridge.Core/Devices/Profiles/WheelProfile.cs index 507f9e39..c8f9d77f 100644 --- a/src/FanaBridge.Core/Profiles/WheelProfile.cs +++ b/src/FanaBridge.Core/Devices/Profiles/WheelProfile.cs @@ -3,7 +3,7 @@ using System.Linq; using Newtonsoft.Json; -namespace FanaBridge.Profiles +namespace FanaBridge.Devices.Profiles { /// /// A complete wheel profile — the single source of truth for a device's @@ -104,17 +104,17 @@ public DisplayType DisplayType { if (Enum.TryParse(Display, true, out DisplayType dt)) return dt; - return FanaBridge.Profiles.DisplayType.None; + return FanaBridge.Devices.Profiles.DisplayType.None; } } /// /// ITM display wire id (which device the wheel's ITM screen is: 1 base, 3 wheel OLED, - /// 4 Bentley). Defaults to + /// 4 Bentley). Defaults to /// (3) when omitted — correct for PBME and GTSWX. /// [JsonIgnore] - public byte ItmDeviceId => ItmDeviceIdRaw ?? FanaBridge.Protocol.ItmEncoder.DefaultDeviceId; + public byte ItmDeviceId => ItmDeviceIdRaw ?? FanaBridge.Display.Protocol.ItmEncoder.DefaultDeviceId; /// Total LED count across all channels. [JsonIgnore] diff --git a/src/FanaBridge.Core/Profiles/WheelProfileStore.cs b/src/FanaBridge.Core/Devices/Profiles/WheelProfileStore.cs similarity index 99% rename from src/FanaBridge.Core/Profiles/WheelProfileStore.cs rename to src/FanaBridge.Core/Devices/Profiles/WheelProfileStore.cs index c520486f..75ca3c12 100644 --- a/src/FanaBridge.Core/Profiles/WheelProfileStore.cs +++ b/src/FanaBridge.Core/Devices/Profiles/WheelProfileStore.cs @@ -5,7 +5,7 @@ using System.Threading; using Newtonsoft.Json; -namespace FanaBridge.Profiles +namespace FanaBridge.Devices.Profiles { /// /// Loads definitions and provides lookup by diff --git a/src/FanaBridge.Core/Protocol/ItmDeviceCatalog.cs b/src/FanaBridge.Core/Display/Catalog/ItmDeviceCatalog.cs similarity index 98% rename from src/FanaBridge.Core/Protocol/ItmDeviceCatalog.cs rename to src/FanaBridge.Core/Display/Catalog/ItmDeviceCatalog.cs index b0fa7ff8..80a16637 100644 --- a/src/FanaBridge.Core/Protocol/ItmDeviceCatalog.cs +++ b/src/FanaBridge.Core/Display/Catalog/ItmDeviceCatalog.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; +using FanaBridge.Display.Protocol; -namespace FanaBridge.Protocol +namespace FanaBridge.Display.Catalog { /// /// One slot in an ITM device's page set: the on-wire page number, which page content diff --git a/src/FanaBridge.Core/Protocol/DisplayEncoder.cs b/src/FanaBridge.Core/Display/Protocol/DisplayEncoder.cs similarity index 99% rename from src/FanaBridge.Core/Protocol/DisplayEncoder.cs rename to src/FanaBridge.Core/Display/Protocol/DisplayEncoder.cs index f51f8db2..dec0ba92 100644 --- a/src/FanaBridge.Core/Protocol/DisplayEncoder.cs +++ b/src/FanaBridge.Core/Display/Protocol/DisplayEncoder.cs @@ -1,7 +1,7 @@ using System; using FanaBridge.Transport; -namespace FanaBridge.Protocol +namespace FanaBridge.Display.Protocol { /// /// Encodes and sends display control reports for the Fanatec diff --git a/src/FanaBridge.Core/Protocol/ItmEncoder.cs b/src/FanaBridge.Core/Display/Protocol/ItmEncoder.cs similarity index 99% rename from src/FanaBridge.Core/Protocol/ItmEncoder.cs rename to src/FanaBridge.Core/Display/Protocol/ItmEncoder.cs index f43befe4..c0420eee 100644 --- a/src/FanaBridge.Core/Protocol/ItmEncoder.cs +++ b/src/FanaBridge.Core/Display/Protocol/ItmEncoder.cs @@ -4,7 +4,7 @@ using System.Text; using FanaBridge.Transport; -namespace FanaBridge.Protocol +namespace FanaBridge.Display.Protocol { /// /// A single telemetry value for an ITM ValueUpdate entry (col03 FF 05 01). diff --git a/src/FanaBridge.Core/Protocol/ItmTelemetry.cs b/src/FanaBridge.Core/Display/Protocol/ItmTelemetry.cs similarity index 99% rename from src/FanaBridge.Core/Protocol/ItmTelemetry.cs rename to src/FanaBridge.Core/Display/Protocol/ItmTelemetry.cs index d2d2f743..c40c4922 100644 --- a/src/FanaBridge.Core/Protocol/ItmTelemetry.cs +++ b/src/FanaBridge.Core/Display/Protocol/ItmTelemetry.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; +using FanaBridge.Display.Catalog; +using FanaBridge.Transport; -namespace FanaBridge.Protocol +namespace FanaBridge.Display.Protocol { /// /// A page's content identity — the fixed parameter layout the firmware renders (SPEED diff --git a/src/FanaBridge.Core/Protocol/SevenSegment.cs b/src/FanaBridge.Core/Display/Protocol/SevenSegment.cs similarity index 99% rename from src/FanaBridge.Core/Protocol/SevenSegment.cs rename to src/FanaBridge.Core/Display/Protocol/SevenSegment.cs index fbaa8f49..b31cf5ae 100644 --- a/src/FanaBridge.Core/Protocol/SevenSegment.cs +++ b/src/FanaBridge.Core/Display/Protocol/SevenSegment.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Protocol +namespace FanaBridge.Display.Protocol { /// /// 7-segment display encoding table. diff --git a/src/FanaBridge.Core/Protocol/ItmLifecycleController.cs b/src/FanaBridge.Core/Display/Session/ItmLifecycleController.cs similarity index 99% rename from src/FanaBridge.Core/Protocol/ItmLifecycleController.cs rename to src/FanaBridge.Core/Display/Session/ItmLifecycleController.cs index 2dc221bd..a28083e0 100644 --- a/src/FanaBridge.Core/Protocol/ItmLifecycleController.cs +++ b/src/FanaBridge.Core/Display/Session/ItmLifecycleController.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; +using FanaBridge.Display.Catalog; +using FanaBridge.Display.Protocol; -namespace FanaBridge.Protocol +namespace FanaBridge.Display.Session { /// The ITM lifecycle states. See . public enum ItmLifecycleState diff --git a/src/FanaBridge.Core/Protocol/ColorHelper.cs b/src/FanaBridge.Core/Leds/ColorHelper.cs similarity index 99% rename from src/FanaBridge.Core/Protocol/ColorHelper.cs rename to src/FanaBridge.Core/Leds/ColorHelper.cs index 8f88bc3b..8f97e40a 100644 --- a/src/FanaBridge.Core/Protocol/ColorHelper.cs +++ b/src/FanaBridge.Core/Leds/ColorHelper.cs @@ -1,6 +1,6 @@ using System; -namespace FanaBridge.Protocol +namespace FanaBridge.Leds { /// /// RGB color helper with RGB565 conversion and predefined colors. diff --git a/src/FanaBridge.Core/Protocol/LedEncoder.cs b/src/FanaBridge.Core/Leds/LedEncoder.cs similarity index 99% rename from src/FanaBridge.Core/Protocol/LedEncoder.cs rename to src/FanaBridge.Core/Leds/LedEncoder.cs index 1ab8b10a..2e22d862 100644 --- a/src/FanaBridge.Core/Protocol/LedEncoder.cs +++ b/src/FanaBridge.Core/Leds/LedEncoder.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using FanaBridge.Transport; -namespace FanaBridge.Protocol +namespace FanaBridge.Leds { /// /// Encodes and sends LED control reports for Fanatec wheels. diff --git a/src/FanaBridge.Core/Protocol/LegacyLedEncoder.cs b/src/FanaBridge.Core/Leds/LegacyLedEncoder.cs similarity index 99% rename from src/FanaBridge.Core/Protocol/LegacyLedEncoder.cs rename to src/FanaBridge.Core/Leds/LegacyLedEncoder.cs index 626a66ef..c9022839 100644 --- a/src/FanaBridge.Core/Protocol/LegacyLedEncoder.cs +++ b/src/FanaBridge.Core/Leds/LegacyLedEncoder.cs @@ -1,7 +1,7 @@ using System; using FanaBridge.Transport; -namespace FanaBridge.Protocol +namespace FanaBridge.Leds { /// /// Encodes and sends LED control reports for legacy Fanatec wheels diff --git a/src/FanaBridge.Core/Transport/Col03FrameClassifier.cs b/src/FanaBridge.Core/Transport/Col03FrameClassifier.cs index d9258c7d..ebe689d8 100644 --- a/src/FanaBridge.Core/Transport/Col03FrameClassifier.cs +++ b/src/FanaBridge.Core/Transport/Col03FrameClassifier.cs @@ -1,6 +1,6 @@ -using FanaBridge.Transport; +using FanaBridge.Devices.Identity; -namespace FanaBridge.Protocol +namespace FanaBridge.Transport { /// /// The single home for col03 frame-family wire signatures. The transport's diff --git a/src/FanaBridge.Core/Transport/Col03QueueSet.cs b/src/FanaBridge.Core/Transport/Col03QueueSet.cs index f97d0de0..22a60e76 100644 --- a/src/FanaBridge.Core/Transport/Col03QueueSet.cs +++ b/src/FanaBridge.Core/Transport/Col03QueueSet.cs @@ -1,4 +1,3 @@ -using FanaBridge.Protocol; namespace FanaBridge.Transport { diff --git a/src/FanaBridge.Core/Transport/FanatecTransport.cs b/src/FanaBridge.Core/Transport/FanatecTransport.cs index a6d85857..f29ca2db 100644 --- a/src/FanaBridge.Core/Transport/FanatecTransport.cs +++ b/src/FanaBridge.Core/Transport/FanatecTransport.cs @@ -2,6 +2,7 @@ using System.Linq; using System.Runtime.InteropServices; using System.Threading; +using FanaBridge.Devices; using HidSharp; using Microsoft.Win32.SafeHandles; diff --git a/src/FanaBridge.Core/Protocol/ReportElicit.cs b/src/FanaBridge.Core/Transport/ReportElicit.cs similarity index 98% rename from src/FanaBridge.Core/Protocol/ReportElicit.cs rename to src/FanaBridge.Core/Transport/ReportElicit.cs index d805dcf1..26b715d5 100644 --- a/src/FanaBridge.Core/Protocol/ReportElicit.cs +++ b/src/FanaBridge.Core/Transport/ReportElicit.cs @@ -1,7 +1,6 @@ using System; -using FanaBridge.Transport; -namespace FanaBridge.Protocol +namespace FanaBridge.Transport { /// /// The one request→response primitive over a per-family report stream: diff --git a/src/FanaBridge.Core/Protocol/EncoderMode.cs b/src/FanaBridge.Core/Tuning/EncoderMode.cs similarity index 95% rename from src/FanaBridge.Core/Protocol/EncoderMode.cs rename to src/FanaBridge.Core/Tuning/EncoderMode.cs index a8a71d83..ea2463b8 100644 --- a/src/FanaBridge.Core/Protocol/EncoderMode.cs +++ b/src/FanaBridge.Core/Tuning/EncoderMode.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Protocol +namespace FanaBridge.Tuning { /// /// Encoder operating mode for Fanatec button modules. diff --git a/src/FanaBridge.Core/Protocol/FanatecTuningController.cs b/src/FanaBridge.Core/Tuning/FanatecTuningController.cs similarity index 99% rename from src/FanaBridge.Core/Protocol/FanatecTuningController.cs rename to src/FanaBridge.Core/Tuning/FanatecTuningController.cs index f4f9001f..9a3d340b 100644 --- a/src/FanaBridge.Core/Protocol/FanatecTuningController.cs +++ b/src/FanaBridge.Core/Tuning/FanatecTuningController.cs @@ -2,7 +2,7 @@ using System.Threading; using FanaBridge.Transport; -namespace FanaBridge.Protocol +namespace FanaBridge.Tuning { /// /// Manages the Fanatec tuning configuration protocol (col03, cmd class 0x03). diff --git a/src/FanaBridge/Adapters/FanaBridgeVariantProvider.cs b/src/FanaBridge/Adapters/FanaBridgeVariantProvider.cs index dd850c82..7a7a3410 100644 --- a/src/FanaBridge/Adapters/FanaBridgeVariantProvider.cs +++ b/src/FanaBridge/Adapters/FanaBridgeVariantProvider.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -using FanaBridge.Protocol; +using FanaBridge.Devices.Identity; using SimHub.Plugins.OutputPlugins.ControlRemapper.Variants; namespace FanaBridge.Adapters @@ -40,7 +40,7 @@ public class FanaBridgeVariantProvider : IVariantProvider /// /// Fanatec USB vendor id (0x0EB7 = 3767). Matches the value the stock /// FanatecVariantProvider gates on, and - /// . + /// . /// public const int FanatecVendorId = 0x0EB7; @@ -77,7 +77,7 @@ public class FanaBridgeVariantProvider : IVariantProvider /// provider, or no variant at all, decide). /// /// Gated on the Fanatec vendor id AND the connected wheelbase's product id - /// (): we only speak for + /// (): we only speak for /// the device we actually have open over HID. A standalone Fanatec peripheral on /// its own PID (pedals, handbrake) — or another Fanatec base we aren't driving — /// is therefore left alone and falls through to SimHub instead of being tagged with diff --git a/src/FanaBridge/Adapters/FanatecDeviceSettings.cs b/src/FanaBridge/Adapters/FanatecDeviceSettings.cs index 89a1f477..66426822 100644 --- a/src/FanaBridge/Adapters/FanatecDeviceSettings.cs +++ b/src/FanaBridge/Adapters/FanatecDeviceSettings.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; -using FanaBridge.Profiles; +using FanaBridge.Devices.Profiles; using Newtonsoft.Json.Linq; namespace FanaBridge.Adapters diff --git a/src/FanaBridge/Adapters/FanatecDevicesRegistry.cs b/src/FanaBridge/Adapters/FanatecDevicesRegistry.cs index 723b235c..43c835a5 100644 --- a/src/FanaBridge/Adapters/FanatecDevicesRegistry.cs +++ b/src/FanaBridge/Adapters/FanatecDevicesRegistry.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; -using FanaBridge.Profiles; +using FanaBridge.Devices.Profiles; using SimHub.Plugins.Devices; namespace FanaBridge.Adapters diff --git a/src/FanaBridge/Adapters/FanatecDisplayDriver.cs b/src/FanaBridge/Adapters/FanatecDisplayDriver.cs index 55dac741..35423321 100644 --- a/src/FanaBridge/Adapters/FanatecDisplayDriver.cs +++ b/src/FanaBridge/Adapters/FanatecDisplayDriver.cs @@ -1,6 +1,6 @@ -using FanaBridge.Protocol; -using GameReaderCommon; using System; +using FanaBridge.Display.Protocol; +using GameReaderCommon; namespace FanaBridge.Adapters { diff --git a/src/FanaBridge/Adapters/FanatecLedDriver.cs b/src/FanaBridge/Adapters/FanatecLedDriver.cs index 7f8c1805..03279d8e 100644 --- a/src/FanaBridge/Adapters/FanatecLedDriver.cs +++ b/src/FanaBridge/Adapters/FanatecLedDriver.cs @@ -5,8 +5,8 @@ using BA63Driver.Base; using BA63Driver.Interfaces; using BA63Driver.Mapper; -using FanaBridge.Profiles; -using FanaBridge.Protocol; +using FanaBridge.Devices.Profiles; +using FanaBridge.Leds; namespace FanaBridge.Adapters { diff --git a/src/FanaBridge/Adapters/FanatecLedManager.cs b/src/FanaBridge/Adapters/FanatecLedManager.cs index dc1d5ba5..4a7476f8 100644 --- a/src/FanaBridge/Adapters/FanatecLedManager.cs +++ b/src/FanaBridge/Adapters/FanatecLedManager.cs @@ -1,6 +1,5 @@ using System; -using FanaBridge.Profiles; -using FanaBridge.Protocol; +using FanaBridge.Devices.Profiles; using SimHub.Plugins.OutputPlugins.GraphicalDash.PSE; namespace FanaBridge.Adapters diff --git a/src/FanaBridge/Adapters/FanatecLedModuleHost.cs b/src/FanaBridge/Adapters/FanatecLedModuleHost.cs index 8dc7e887..d7ac2c9a 100644 --- a/src/FanaBridge/Adapters/FanatecLedModuleHost.cs +++ b/src/FanaBridge/Adapters/FanatecLedModuleHost.cs @@ -2,8 +2,8 @@ using System.Collections.Generic; using System.Linq; using System.Windows.Controls; -using FanaBridge.Profiles; -using FanaBridge.Transport; +using FanaBridge.Devices; +using FanaBridge.Devices.Profiles; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using SimHub.Plugins; diff --git a/src/FanaBridge/Adapters/FanatecWheelDeviceInstance.cs b/src/FanaBridge/Adapters/FanatecWheelDeviceInstance.cs index d067b0db..03834ca5 100644 --- a/src/FanaBridge/Adapters/FanatecWheelDeviceInstance.cs +++ b/src/FanaBridge/Adapters/FanatecWheelDeviceInstance.cs @@ -3,9 +3,8 @@ using System.ComponentModel; using System.Linq; using FanaBridge; -using FanaBridge.Profiles; -using FanaBridge.Protocol; -using FanaBridge.Transport; +using FanaBridge.Devices.Profiles; +using FanaBridge.Display.Session; using GameReaderCommon; using Newtonsoft.Json.Linq; using SimHub.Plugins; diff --git a/src/FanaBridge/Adapters/IDevicePanelFactory.cs b/src/FanaBridge/Adapters/IDevicePanelFactory.cs index 14285667..593e5a3a 100644 --- a/src/FanaBridge/Adapters/IDevicePanelFactory.cs +++ b/src/FanaBridge/Adapters/IDevicePanelFactory.cs @@ -1,6 +1,6 @@ using System; using System.Windows.Controls; -using FanaBridge.Profiles; +using FanaBridge.Devices.Profiles; namespace FanaBridge.Adapters { diff --git a/src/FanaBridge/Adapters/IFanatecLedModuleHost.cs b/src/FanaBridge/Adapters/IFanatecLedModuleHost.cs index b87de454..9a4ec697 100644 --- a/src/FanaBridge/Adapters/IFanatecLedModuleHost.cs +++ b/src/FanaBridge/Adapters/IFanatecLedModuleHost.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Windows.Controls; +using FanaBridge.Devices.Profiles; using Newtonsoft.Json.Linq; using SimHub.Plugins; @@ -52,7 +53,7 @@ internal interface IFanatecLedModuleHost : IDisposable void StopDriving(); /// Tells the module the active profile may have changed. - void HotSwapIfNeeded(Profiles.WheelCapabilities currentCaps); + void HotSwapIfNeeded(WheelCapabilities currentCaps); /// The module's dynamic button actions (brightness, etc.). IEnumerable GetDynamicActions(); diff --git a/src/FanaBridge/Adapters/ItmDisplayDriver.cs b/src/FanaBridge/Adapters/ItmDisplayDriver.cs index f1c96fb8..762e9839 100644 --- a/src/FanaBridge/Adapters/ItmDisplayDriver.cs +++ b/src/FanaBridge/Adapters/ItmDisplayDriver.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; -using FanaBridge.Protocol; +using FanaBridge.Display.Protocol; +using FanaBridge.Display.Session; using GameReaderCommon; namespace FanaBridge.Adapters diff --git a/src/FanaBridge/Adapters/ItmTelemetryMapper.cs b/src/FanaBridge/Adapters/ItmTelemetryMapper.cs index 258d9e3b..006d2d18 100644 --- a/src/FanaBridge/Adapters/ItmTelemetryMapper.cs +++ b/src/FanaBridge/Adapters/ItmTelemetryMapper.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; +using FanaBridge.Display.Protocol; using GameReaderCommon; -using FanaBridge.Protocol; namespace FanaBridge.Adapters { diff --git a/src/FanaBridge/Adapters/NoLedModuleHost.cs b/src/FanaBridge/Adapters/NoLedModuleHost.cs index 1199feb4..af432a70 100644 --- a/src/FanaBridge/Adapters/NoLedModuleHost.cs +++ b/src/FanaBridge/Adapters/NoLedModuleHost.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; using System.Windows.Controls; -using FanaBridge.Profiles; +using FanaBridge.Devices.Profiles; using Newtonsoft.Json.Linq; using SimHub.Plugins; diff --git a/src/FanaBridge/Diagnostics/ConverterCaptureProbe.cs b/src/FanaBridge/Diagnostics/ConverterCaptureProbe.cs index 081f9f52..26364c38 100644 --- a/src/FanaBridge/Diagnostics/ConverterCaptureProbe.cs +++ b/src/FanaBridge/Diagnostics/ConverterCaptureProbe.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using FanaBridge.Devices.Identity; using FanaBridge.Transport; namespace FanaBridge.Protocol diff --git a/src/FanaBridge/Diagnostics/DiagnosticsReport.cs b/src/FanaBridge/Diagnostics/DiagnosticsReport.cs index 4380e383..3aa06e25 100644 --- a/src/FanaBridge/Diagnostics/DiagnosticsReport.cs +++ b/src/FanaBridge/Diagnostics/DiagnosticsReport.cs @@ -1,7 +1,7 @@ using System; using System.Linq; using System.Text; -using FanaBridge.Transport; +using FanaBridge.Devices; using HidSharp; namespace FanaBridge.Protocol diff --git a/src/FanaBridge/FanatecPlugin.cs b/src/FanaBridge/FanatecPlugin.cs index 23e29494..689ec6b0 100644 --- a/src/FanaBridge/FanatecPlugin.cs +++ b/src/FanaBridge/FanatecPlugin.cs @@ -1,18 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Media; +using System.Windows.Media.Imaging; using FanaBridge.Adapters; -using FanaBridge.Profiles; +using FanaBridge.Devices; +using FanaBridge.Devices.Profiles; +using FanaBridge.Display.Protocol; +using FanaBridge.Leds; using FanaBridge.Protocol; using FanaBridge.Transport; +using FanaBridge.Tuning; using FanaBridge.UI; using FanaBridge.Updater; using FanaBridge.Updates; using GameReaderCommon; using SimHub.Plugins; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using System.Windows.Media; -using System.Windows.Media.Imaging; namespace FanaBridge { diff --git a/src/FanaBridge/UI/DevicePanelFactory.cs b/src/FanaBridge/UI/DevicePanelFactory.cs index 64e906b6..d486bc74 100644 --- a/src/FanaBridge/UI/DevicePanelFactory.cs +++ b/src/FanaBridge/UI/DevicePanelFactory.cs @@ -1,7 +1,7 @@ using System; using System.Windows.Controls; using FanaBridge.Adapters; -using FanaBridge.Profiles; +using FanaBridge.Devices.Profiles; namespace FanaBridge.UI { diff --git a/src/FanaBridge/UI/LedColorLimitationNotice.xaml.cs b/src/FanaBridge/UI/LedColorLimitationNotice.xaml.cs index 6acfcd53..1dd72682 100644 --- a/src/FanaBridge/UI/LedColorLimitationNotice.xaml.cs +++ b/src/FanaBridge/UI/LedColorLimitationNotice.xaml.cs @@ -1,7 +1,7 @@ using System; using System.Windows; using System.Windows.Controls; -using FanaBridge.Profiles; +using FanaBridge.Devices.Profiles; namespace FanaBridge.UI { diff --git a/src/FanaBridge/UI/ScreenSettingsPanel.xaml.cs b/src/FanaBridge/UI/ScreenSettingsPanel.xaml.cs index 862f07ac..aeafeb41 100644 --- a/src/FanaBridge/UI/ScreenSettingsPanel.xaml.cs +++ b/src/FanaBridge/UI/ScreenSettingsPanel.xaml.cs @@ -2,8 +2,9 @@ using System.Windows; using System.Windows.Controls; using FanaBridge.Adapters; -using FanaBridge.Profiles; -using FanaBridge.Protocol; +using FanaBridge.Devices.Profiles; +using FanaBridge.Display.Catalog; +using FanaBridge.Display.Protocol; namespace FanaBridge.UI { diff --git a/src/FanaBridge/UI/SettingsControl.xaml.cs b/src/FanaBridge/UI/SettingsControl.xaml.cs index c4f7bd84..5e6274a5 100644 --- a/src/FanaBridge/UI/SettingsControl.xaml.cs +++ b/src/FanaBridge/UI/SettingsControl.xaml.cs @@ -10,9 +10,9 @@ using System.Windows.Navigation; using System.Windows.Threading; using FanaBridge.Adapters; -using FanaBridge.Profiles; -using FanaBridge.Protocol; -using FanaBridge.Transport; +using FanaBridge.Devices; +using FanaBridge.Devices.Profiles; +using FanaBridge.Display.Protocol; using FanaBridge.Updater; using SimHub.Plugins.Devices; using Timer = System.Timers.Timer; diff --git a/src/FanaBridge/UI/TuningSettingsPanel.xaml.cs b/src/FanaBridge/UI/TuningSettingsPanel.xaml.cs index 7e590768..a1f16c84 100644 --- a/src/FanaBridge/UI/TuningSettingsPanel.xaml.cs +++ b/src/FanaBridge/UI/TuningSettingsPanel.xaml.cs @@ -2,9 +2,8 @@ using System.Windows; using System.Windows.Controls; using FanaBridge; -using FanaBridge.Profiles; -using FanaBridge.Protocol; using FanaBridge.Adapters; +using FanaBridge.Tuning; namespace FanaBridge.UI { diff --git a/src/FanaBridge/UI/WheelProfileWizardDialog.xaml.cs b/src/FanaBridge/UI/WheelProfileWizardDialog.xaml.cs index 1e2a7a9f..5d6ba31e 100644 --- a/src/FanaBridge/UI/WheelProfileWizardDialog.xaml.cs +++ b/src/FanaBridge/UI/WheelProfileWizardDialog.xaml.cs @@ -8,9 +8,11 @@ using System.Windows.Controls; using System.Windows.Threading; using FanaBridge; -using FanaBridge.Profiles; -using FanaBridge.Protocol; +using FanaBridge.Devices.Profiles; +using FanaBridge.Display.Protocol; +using FanaBridge.Leds; using FanaBridge.Transport; +using FanaBridge.Tuning; using Microsoft.Win32; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; diff --git a/src/FanaBridge/UI/WizardState.cs b/src/FanaBridge/UI/WizardState.cs index 24e34378..6ede625e 100644 --- a/src/FanaBridge/UI/WizardState.cs +++ b/src/FanaBridge/UI/WizardState.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; -using FanaBridge.Profiles; -using FanaBridge.Protocol; +using FanaBridge.Devices.Profiles; +using FanaBridge.Tuning; namespace FanaBridge.UI { diff --git a/tests/FanaBridge.Tests/ConnectFailureMessageTests.cs b/tests/FanaBridge.Tests/Core/Devices/ConnectFailureMessageTests.cs similarity index 97% rename from tests/FanaBridge.Tests/ConnectFailureMessageTests.cs rename to tests/FanaBridge.Tests/Core/Devices/ConnectFailureMessageTests.cs index 642a6cc2..3261459b 100644 --- a/tests/FanaBridge.Tests/ConnectFailureMessageTests.cs +++ b/tests/FanaBridge.Tests/Core/Devices/ConnectFailureMessageTests.cs @@ -1,7 +1,8 @@ +using FanaBridge.Devices; using FanaBridge.Transport; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Devices { /// /// Guards the connect-failure message taxonomy. The original code reported diff --git a/tests/FanaBridge.Tests/ConnectionMonitorTests.cs b/tests/FanaBridge.Tests/Core/Devices/ConnectionMonitorTests.cs similarity index 99% rename from tests/FanaBridge.Tests/ConnectionMonitorTests.cs rename to tests/FanaBridge.Tests/Core/Devices/ConnectionMonitorTests.cs index 45dbc2ff..46e40b01 100644 --- a/tests/FanaBridge.Tests/ConnectionMonitorTests.cs +++ b/tests/FanaBridge.Tests/Core/Devices/ConnectionMonitorTests.cs @@ -1,8 +1,8 @@ using System; -using FanaBridge.Transport; +using FanaBridge.Devices; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Devices { public class ConnectionMonitorTests { diff --git a/tests/FanaBridge.Tests/FanatecWheelbaseTests.cs b/tests/FanaBridge.Tests/Core/Devices/FanatecWheelbaseTests.cs similarity index 99% rename from tests/FanaBridge.Tests/FanatecWheelbaseTests.cs rename to tests/FanaBridge.Tests/Core/Devices/FanatecWheelbaseTests.cs index 3b6890b8..01dc713b 100644 --- a/tests/FanaBridge.Tests/FanatecWheelbaseTests.cs +++ b/tests/FanaBridge.Tests/Core/Devices/FanatecWheelbaseTests.cs @@ -1,12 +1,13 @@ using System; using System.Collections.Generic; using System.Linq; -using FanaBridge.Profiles; -using FanaBridge.Protocol; +using FanaBridge.Devices; +using FanaBridge.Devices.Identity; +using FanaBridge.Devices.Profiles; using FanaBridge.Transport; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Devices { /// /// Tests for the wheelbase identity state machine — the layer where field diff --git a/tests/FanaBridge.Tests/FanatecDeviceTablesTests.cs b/tests/FanaBridge.Tests/Core/Devices/Identity/FanatecDeviceTablesTests.cs similarity index 97% rename from tests/FanaBridge.Tests/FanatecDeviceTablesTests.cs rename to tests/FanaBridge.Tests/Core/Devices/Identity/FanatecDeviceTablesTests.cs index ebc88fcc..4ff41ead 100644 --- a/tests/FanaBridge.Tests/FanatecDeviceTablesTests.cs +++ b/tests/FanaBridge.Tests/Core/Devices/Identity/FanatecDeviceTablesTests.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using System.Linq; -using FanaBridge.Protocol; +using FanaBridge.Devices.Identity; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Devices.Identity { /// /// Guards the friendly-name tables against drift. They are a second set of diff --git a/tests/FanaBridge.Tests/IdentitySettlerTests.cs b/tests/FanaBridge.Tests/Core/Devices/Identity/IdentitySettlerTests.cs similarity index 98% rename from tests/FanaBridge.Tests/IdentitySettlerTests.cs rename to tests/FanaBridge.Tests/Core/Devices/Identity/IdentitySettlerTests.cs index 17748e9d..d43cf1c2 100644 --- a/tests/FanaBridge.Tests/IdentitySettlerTests.cs +++ b/tests/FanaBridge.Tests/Core/Devices/Identity/IdentitySettlerTests.cs @@ -1,7 +1,7 @@ -using FanaBridge.Transport; +using FanaBridge.Devices.Identity; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Devices.Identity { public class IdentitySettlerTests { diff --git a/tests/FanaBridge.Tests/SrmConverterIdentityTests.cs b/tests/FanaBridge.Tests/Core/Devices/Identity/SrmConverterIdentityTests.cs similarity index 97% rename from tests/FanaBridge.Tests/SrmConverterIdentityTests.cs rename to tests/FanaBridge.Tests/Core/Devices/Identity/SrmConverterIdentityTests.cs index e7a47ef7..dace5d99 100644 --- a/tests/FanaBridge.Tests/SrmConverterIdentityTests.cs +++ b/tests/FanaBridge.Tests/Core/Devices/Identity/SrmConverterIdentityTests.cs @@ -1,7 +1,7 @@ -using FanaBridge.Protocol; +using FanaBridge.Devices.Identity; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Devices.Identity { /// /// Unit tests for the SRM Conversion Kit 0xDD identity decode. The wire bytes in diff --git a/tests/FanaBridge.Tests/LedChannelConverterTests.cs b/tests/FanaBridge.Tests/Core/Devices/Profiles/LedChannelConverterTests.cs similarity index 95% rename from tests/FanaBridge.Tests/LedChannelConverterTests.cs rename to tests/FanaBridge.Tests/Core/Devices/Profiles/LedChannelConverterTests.cs index 4804e055..38f086bd 100644 --- a/tests/FanaBridge.Tests/LedChannelConverterTests.cs +++ b/tests/FanaBridge.Tests/Core/Devices/Profiles/LedChannelConverterTests.cs @@ -1,8 +1,8 @@ -using FanaBridge.Profiles; +using FanaBridge.Devices.Profiles; using Newtonsoft.Json; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Devices.Profiles { public class LedChannelConverterTests { diff --git a/tests/FanaBridge.Tests/LedColorLimitationTests.cs b/tests/FanaBridge.Tests/Core/Devices/Profiles/LedColorLimitationTests.cs similarity index 98% rename from tests/FanaBridge.Tests/LedColorLimitationTests.cs rename to tests/FanaBridge.Tests/Core/Devices/Profiles/LedColorLimitationTests.cs index 35055722..b9f74162 100644 --- a/tests/FanaBridge.Tests/LedColorLimitationTests.cs +++ b/tests/FanaBridge.Tests/Core/Devices/Profiles/LedColorLimitationTests.cs @@ -1,10 +1,10 @@ using System.Collections.Generic; using System.Linq; -using FanaBridge.Profiles; +using FanaBridge.Devices.Profiles; using Newtonsoft.Json; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Devices.Profiles { /// /// SimHub offers a full color picker for every LED. These tests pin which diff --git a/tests/FanaBridge.Tests/WheelProfileItmDeviceTests.cs b/tests/FanaBridge.Tests/Core/Devices/Profiles/WheelProfileItmDeviceTests.cs similarity index 95% rename from tests/FanaBridge.Tests/WheelProfileItmDeviceTests.cs rename to tests/FanaBridge.Tests/Core/Devices/Profiles/WheelProfileItmDeviceTests.cs index 126d628c..d7efabe8 100644 --- a/tests/FanaBridge.Tests/WheelProfileItmDeviceTests.cs +++ b/tests/FanaBridge.Tests/Core/Devices/Profiles/WheelProfileItmDeviceTests.cs @@ -1,9 +1,9 @@ using System.Linq; -using FanaBridge.Profiles; -using FanaBridge.Protocol; +using FanaBridge.Devices.Profiles; +using FanaBridge.Display.Protocol; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Devices.Profiles { public class WheelProfileItmDeviceTests { diff --git a/tests/FanaBridge.Tests/WheelProfileStoreTests.cs b/tests/FanaBridge.Tests/Core/Devices/Profiles/WheelProfileStoreTests.cs similarity index 96% rename from tests/FanaBridge.Tests/WheelProfileStoreTests.cs rename to tests/FanaBridge.Tests/Core/Devices/Profiles/WheelProfileStoreTests.cs index 66659c37..0bfe4801 100644 --- a/tests/FanaBridge.Tests/WheelProfileStoreTests.cs +++ b/tests/FanaBridge.Tests/Core/Devices/Profiles/WheelProfileStoreTests.cs @@ -1,7 +1,7 @@ -using FanaBridge.Profiles; +using FanaBridge.Devices.Profiles; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Devices.Profiles { public class WheelProfileStoreTests { diff --git a/tests/FanaBridge.Tests/FanatecSoftwareMonitorTests.cs b/tests/FanaBridge.Tests/Core/Diagnostics/FanatecSoftwareMonitorTests.cs similarity index 98% rename from tests/FanaBridge.Tests/FanatecSoftwareMonitorTests.cs rename to tests/FanaBridge.Tests/Core/Diagnostics/FanatecSoftwareMonitorTests.cs index 8dc90254..e20b5c55 100644 --- a/tests/FanaBridge.Tests/FanatecSoftwareMonitorTests.cs +++ b/tests/FanaBridge.Tests/Core/Diagnostics/FanatecSoftwareMonitorTests.cs @@ -4,7 +4,7 @@ using FanaBridge.Diagnostics; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Diagnostics { public class FanatecSoftwareMonitorTests { diff --git a/tests/FanaBridge.Tests/ItmDeviceCatalogTests.cs b/tests/FanaBridge.Tests/Core/Display/Catalog/ItmDeviceCatalogTests.cs similarity index 94% rename from tests/FanaBridge.Tests/ItmDeviceCatalogTests.cs rename to tests/FanaBridge.Tests/Core/Display/Catalog/ItmDeviceCatalogTests.cs index af9e2439..c7c7dd62 100644 --- a/tests/FanaBridge.Tests/ItmDeviceCatalogTests.cs +++ b/tests/FanaBridge.Tests/Core/Display/Catalog/ItmDeviceCatalogTests.cs @@ -1,9 +1,10 @@ using System.Linq; using FanaBridge.Adapters; -using FanaBridge.Protocol; +using FanaBridge.Display.Catalog; +using FanaBridge.Display.Protocol; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Display.Catalog { public class ItmDeviceCatalogTests { diff --git a/tests/FanaBridge.Tests/ItmEncoderTests.cs b/tests/FanaBridge.Tests/Core/Display/Protocol/ItmEncoderTests.cs similarity index 99% rename from tests/FanaBridge.Tests/ItmEncoderTests.cs rename to tests/FanaBridge.Tests/Core/Display/Protocol/ItmEncoderTests.cs index 53b23d80..29d6b73d 100644 --- a/tests/FanaBridge.Tests/ItmEncoderTests.cs +++ b/tests/FanaBridge.Tests/Core/Display/Protocol/ItmEncoderTests.cs @@ -1,10 +1,10 @@ using System; using System.Collections.Generic; -using FanaBridge.Protocol; +using FanaBridge.Display.Protocol; using FanaBridge.Transport; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Display.Protocol { public class ItmEncoderTests { diff --git a/tests/FanaBridge.Tests/ItmTelemetryTests.cs b/tests/FanaBridge.Tests/Core/Display/Protocol/ItmTelemetryTests.cs similarity index 99% rename from tests/FanaBridge.Tests/ItmTelemetryTests.cs rename to tests/FanaBridge.Tests/Core/Display/Protocol/ItmTelemetryTests.cs index 3223a921..ee246d12 100644 --- a/tests/FanaBridge.Tests/ItmTelemetryTests.cs +++ b/tests/FanaBridge.Tests/Core/Display/Protocol/ItmTelemetryTests.cs @@ -3,11 +3,11 @@ using System.Collections.Generic; using System.Runtime.Serialization; using FanaBridge.Adapters; -using FanaBridge.Protocol; +using FanaBridge.Display.Protocol; using GameReaderCommon; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Display.Protocol { public class ItmTelemetryTests { diff --git a/tests/FanaBridge.Tests/SevenSegmentTests.cs b/tests/FanaBridge.Tests/Core/Display/Protocol/SevenSegmentTests.cs similarity index 96% rename from tests/FanaBridge.Tests/SevenSegmentTests.cs rename to tests/FanaBridge.Tests/Core/Display/Protocol/SevenSegmentTests.cs index f6c3778f..fec2cdb2 100644 --- a/tests/FanaBridge.Tests/SevenSegmentTests.cs +++ b/tests/FanaBridge.Tests/Core/Display/Protocol/SevenSegmentTests.cs @@ -1,7 +1,7 @@ -using FanaBridge.Protocol; +using FanaBridge.Display.Protocol; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Display.Protocol { public class SevenSegmentTests { diff --git a/tests/FanaBridge.Tests/ItmLifecycleControllerTests.cs b/tests/FanaBridge.Tests/Core/Display/Session/ItmLifecycleControllerTests.cs similarity index 99% rename from tests/FanaBridge.Tests/ItmLifecycleControllerTests.cs rename to tests/FanaBridge.Tests/Core/Display/Session/ItmLifecycleControllerTests.cs index d1733620..9af03ea0 100644 --- a/tests/FanaBridge.Tests/ItmLifecycleControllerTests.cs +++ b/tests/FanaBridge.Tests/Core/Display/Session/ItmLifecycleControllerTests.cs @@ -1,11 +1,14 @@ using System; using System.Collections.Generic; using System.Linq; -using FanaBridge.Protocol; +using FanaBridge.Devices; +using FanaBridge.Display.Catalog; +using FanaBridge.Display.Protocol; +using FanaBridge.Display.Session; using FanaBridge.Transport; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Display.Session { /// /// Exercises every state transition, recovery rung, deadline, and the push-accumulation diff --git a/tests/FanaBridge.Tests/ColorHelperTests.cs b/tests/FanaBridge.Tests/Core/Leds/ColorHelperTests.cs similarity index 99% rename from tests/FanaBridge.Tests/ColorHelperTests.cs rename to tests/FanaBridge.Tests/Core/Leds/ColorHelperTests.cs index 3469fb09..f06b91f4 100644 --- a/tests/FanaBridge.Tests/ColorHelperTests.cs +++ b/tests/FanaBridge.Tests/Core/Leds/ColorHelperTests.cs @@ -1,7 +1,7 @@ -using FanaBridge.Protocol; +using FanaBridge.Leds; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Leds { public class ColorHelperTests { diff --git a/tests/FanaBridge.Tests/LedEncoderTests.cs b/tests/FanaBridge.Tests/Core/Leds/LedEncoderTests.cs similarity index 99% rename from tests/FanaBridge.Tests/LedEncoderTests.cs rename to tests/FanaBridge.Tests/Core/Leds/LedEncoderTests.cs index 113c713f..b760d5a0 100644 --- a/tests/FanaBridge.Tests/LedEncoderTests.cs +++ b/tests/FanaBridge.Tests/Core/Leds/LedEncoderTests.cs @@ -1,11 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; -using FanaBridge.Protocol; +using FanaBridge.Leds; using FanaBridge.Transport; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Leds { public class LedEncoderTests { diff --git a/tests/FanaBridge.Tests/LegacyLedEncoderTests.cs b/tests/FanaBridge.Tests/Core/Leds/LegacyLedEncoderTests.cs similarity index 99% rename from tests/FanaBridge.Tests/LegacyLedEncoderTests.cs rename to tests/FanaBridge.Tests/Core/Leds/LegacyLedEncoderTests.cs index cfdc175e..a8599d4b 100644 --- a/tests/FanaBridge.Tests/LegacyLedEncoderTests.cs +++ b/tests/FanaBridge.Tests/Core/Leds/LegacyLedEncoderTests.cs @@ -1,11 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; -using FanaBridge.Protocol; +using FanaBridge.Leds; using FanaBridge.Transport; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Leds { public class LegacyLedEncoderTests { diff --git a/tests/FanaBridge.Tests/Col03FrameClassifierTests.cs b/tests/FanaBridge.Tests/Core/Transport/Col03FrameClassifierTests.cs similarity index 99% rename from tests/FanaBridge.Tests/Col03FrameClassifierTests.cs rename to tests/FanaBridge.Tests/Core/Transport/Col03FrameClassifierTests.cs index 289bc58c..4fc353f9 100644 --- a/tests/FanaBridge.Tests/Col03FrameClassifierTests.cs +++ b/tests/FanaBridge.Tests/Core/Transport/Col03FrameClassifierTests.cs @@ -1,8 +1,7 @@ -using FanaBridge.Protocol; using FanaBridge.Transport; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Transport { public class Col03FrameClassifierTests { diff --git a/tests/FanaBridge.Tests/Col03QueueSetTests.cs b/tests/FanaBridge.Tests/Core/Transport/Col03QueueSetTests.cs similarity index 98% rename from tests/FanaBridge.Tests/Col03QueueSetTests.cs rename to tests/FanaBridge.Tests/Core/Transport/Col03QueueSetTests.cs index 36362447..6be79b9a 100644 --- a/tests/FanaBridge.Tests/Col03QueueSetTests.cs +++ b/tests/FanaBridge.Tests/Core/Transport/Col03QueueSetTests.cs @@ -1,7 +1,7 @@ using FanaBridge.Transport; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Transport { public class Col03QueueSetTests { diff --git a/tests/FanaBridge.Tests/FanatecTransportReaderTests.cs b/tests/FanaBridge.Tests/Core/Transport/FanatecTransportReaderTests.cs similarity index 99% rename from tests/FanaBridge.Tests/FanatecTransportReaderTests.cs rename to tests/FanaBridge.Tests/Core/Transport/FanatecTransportReaderTests.cs index 16167459..f606b404 100644 --- a/tests/FanaBridge.Tests/FanatecTransportReaderTests.cs +++ b/tests/FanaBridge.Tests/Core/Transport/FanatecTransportReaderTests.cs @@ -1,9 +1,10 @@ using System; using System.Collections.Generic; +using FanaBridge.Devices; using FanaBridge.Transport; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Transport { /// /// Pins the col03 reader loop's concurrency invariants, which previously diff --git a/tests/FanaBridge.Tests/HidReportQueueTests.cs b/tests/FanaBridge.Tests/Core/Transport/HidReportQueueTests.cs similarity index 99% rename from tests/FanaBridge.Tests/HidReportQueueTests.cs rename to tests/FanaBridge.Tests/Core/Transport/HidReportQueueTests.cs index 4d8f029f..87af1099 100644 --- a/tests/FanaBridge.Tests/HidReportQueueTests.cs +++ b/tests/FanaBridge.Tests/Core/Transport/HidReportQueueTests.cs @@ -4,7 +4,7 @@ using FanaBridge.Transport; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Transport { public class HidReportQueueTests { diff --git a/tests/FanaBridge.Tests/ReportElicitTests.cs b/tests/FanaBridge.Tests/Core/Transport/ReportElicitTests.cs similarity index 98% rename from tests/FanaBridge.Tests/ReportElicitTests.cs rename to tests/FanaBridge.Tests/Core/Transport/ReportElicitTests.cs index f4f253e8..55839962 100644 --- a/tests/FanaBridge.Tests/ReportElicitTests.cs +++ b/tests/FanaBridge.Tests/Core/Transport/ReportElicitTests.cs @@ -1,10 +1,9 @@ using System; using System.Collections.Generic; -using FanaBridge.Protocol; using FanaBridge.Transport; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Transport { public class ReportElicitTests { diff --git a/tests/FanaBridge.Tests/FanatecTuningControllerTests.cs b/tests/FanaBridge.Tests/Core/Tuning/FanatecTuningControllerTests.cs similarity index 99% rename from tests/FanaBridge.Tests/FanatecTuningControllerTests.cs rename to tests/FanaBridge.Tests/Core/Tuning/FanatecTuningControllerTests.cs index 13c0f1d7..784355c5 100644 --- a/tests/FanaBridge.Tests/FanatecTuningControllerTests.cs +++ b/tests/FanaBridge.Tests/Core/Tuning/FanatecTuningControllerTests.cs @@ -1,11 +1,10 @@ using System; using System.Collections.Generic; -using FanaBridge.Profiles; -using FanaBridge.Protocol; using FanaBridge.Transport; +using FanaBridge.Tuning; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Tuning { public class FanatecTuningControllerTests { diff --git a/tests/FanaBridge.Tests/DeviceRegistryOverrideTests.cs b/tests/FanaBridge.Tests/DeviceRegistryOverrideTests.cs index e04c8c65..20fa8bc9 100644 --- a/tests/FanaBridge.Tests/DeviceRegistryOverrideTests.cs +++ b/tests/FanaBridge.Tests/DeviceRegistryOverrideTests.cs @@ -3,7 +3,7 @@ using System.IO; using System.Linq; using FanaBridge.Adapters; -using FanaBridge.Profiles; +using FanaBridge.Devices.Profiles; using Xunit; namespace FanaBridge.Tests diff --git a/tests/FanaBridge.Tests/FanatecDeviceSettingsTests.cs b/tests/FanaBridge.Tests/FanatecDeviceSettingsTests.cs index 88aeed84..a8ca5e84 100644 --- a/tests/FanaBridge.Tests/FanatecDeviceSettingsTests.cs +++ b/tests/FanaBridge.Tests/FanatecDeviceSettingsTests.cs @@ -1,6 +1,6 @@ using System; using FanaBridge.Adapters; -using FanaBridge.Profiles; +using FanaBridge.Devices.Profiles; using FanaBridge.Tests.TestDoubles; using Newtonsoft.Json.Linq; using Xunit; diff --git a/tests/FanaBridge.Tests/FanatecDisplayDriverTests.cs b/tests/FanaBridge.Tests/FanatecDisplayDriverTests.cs index a17c19b1..978fb0bc 100644 --- a/tests/FanaBridge.Tests/FanatecDisplayDriverTests.cs +++ b/tests/FanaBridge.Tests/FanatecDisplayDriverTests.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using FanaBridge.Adapters; -using FanaBridge.Protocol; +using FanaBridge.Display.Protocol; using FanaBridge.Transport; using GameReaderCommon; using Xunit; diff --git a/tests/FanaBridge.Tests/FanatecLedDriverTests.cs b/tests/FanaBridge.Tests/FanatecLedDriverTests.cs index 1553f960..e4f396c8 100644 --- a/tests/FanaBridge.Tests/FanatecLedDriverTests.cs +++ b/tests/FanaBridge.Tests/FanatecLedDriverTests.cs @@ -4,8 +4,8 @@ using System.Linq; using BA63Driver.Mapper; using FanaBridge.Adapters; -using FanaBridge.Profiles; -using FanaBridge.Protocol; +using FanaBridge.Devices.Profiles; +using FanaBridge.Leds; using FanaBridge.Transport; using Newtonsoft.Json; using Xunit; diff --git a/tests/FanaBridge.Tests/FanatecWheelDeviceInstanceTests.cs b/tests/FanaBridge.Tests/FanatecWheelDeviceInstanceTests.cs index 73eb8b57..11f63ab1 100644 --- a/tests/FanaBridge.Tests/FanatecWheelDeviceInstanceTests.cs +++ b/tests/FanaBridge.Tests/FanatecWheelDeviceInstanceTests.cs @@ -3,13 +3,15 @@ using System.Linq; using FanaBridge; using FanaBridge.Adapters; -using FanaBridge.Profiles; -using FanaBridge.Protocol; +using FanaBridge.Devices; +using FanaBridge.Devices.Identity; +using FanaBridge.Devices.Profiles; +using FanaBridge.Display.Protocol; +using FanaBridge.Tests.TestDoubles; using FanaBridge.Transport; using GameReaderCommon; using Newtonsoft.Json.Linq; using SimHub.Plugins.Devices; -using FanaBridge.Tests.TestDoubles; using Xunit; namespace FanaBridge.Tests diff --git a/tests/FanaBridge.Tests/ItmDisplayDriverTests.cs b/tests/FanaBridge.Tests/ItmDisplayDriverTests.cs index c39d4a85..c60dd734 100644 --- a/tests/FanaBridge.Tests/ItmDisplayDriverTests.cs +++ b/tests/FanaBridge.Tests/ItmDisplayDriverTests.cs @@ -3,7 +3,7 @@ using System.Linq; using System.Runtime.Serialization; using FanaBridge.Adapters; -using FanaBridge.Protocol; +using FanaBridge.Display.Protocol; using FanaBridge.Transport; using GameReaderCommon; using Xunit; diff --git a/tests/FanaBridge.Tests/TestDoubles/FakeLedModuleHost.cs b/tests/FanaBridge.Tests/TestDoubles/FakeLedModuleHost.cs index 30fe64a0..d27a8816 100644 --- a/tests/FanaBridge.Tests/TestDoubles/FakeLedModuleHost.cs +++ b/tests/FanaBridge.Tests/TestDoubles/FakeLedModuleHost.cs @@ -3,7 +3,7 @@ using System.Linq; using System.Windows.Controls; using FanaBridge.Adapters; -using FanaBridge.Profiles; +using FanaBridge.Devices.Profiles; using Newtonsoft.Json.Linq; using SimHub.Plugins; diff --git a/tests/FanaBridge.Tests/WizardStateTests.cs b/tests/FanaBridge.Tests/WizardStateTests.cs index acbbaaff..b4c93dbe 100644 --- a/tests/FanaBridge.Tests/WizardStateTests.cs +++ b/tests/FanaBridge.Tests/WizardStateTests.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using System.Linq; -using FanaBridge.Profiles; +using FanaBridge.Devices.Profiles; using FanaBridge.UI; using Xunit; From df27a8881a52846f63783a825d8a73692bdcb5c5 Mon Sep 17 00:00:00 2001 From: Matthew Kelch Date: Sat, 8 Aug 2026 19:28:45 -0400 Subject: [PATCH 2/8] refactor: dissolve plugin Adapters/ into domains under FanaBridge.Plugin.* (issue #102) The plugin's Adapters/ grab-bag is gone: Display/{Drivers,DisplaySettings}, Leds/, Devices/, Settings/ (absorbing root FanatecPluginSettings), ControlMapper/, and UI/ (IDevicePanelFactory). DiagnosticsReport's stale FanaBridge.Protocol declaration corrected to its Diagnostics home. Plugin production namespaces now carry the per-project root FanaBridge.Plugin. (ratified on #102): the shipped DLL merges all assemblies, so the Core/plugin boundary must survive in type names. Core keeps clean FanaBridge.* namespaces. Documented exceptions: FanatecPlugin and the root logging types stay in namespace FanaBridge (the plugin FQN is persisted user state in SimHub); ConverterCaptureProbe is deferred to the friend-access commit. Domain taxonomies are project-local (also ratified): plugin nouns match Core where the capability genuinely spans both sides; the one-type Display/Host segment was flattened into Display/. Plugin-subject tests move to tests/FanaBridge.Tests/Plugin//, and ItmTelemetryTests split by true subject: 30 mapper tests now in Plugin/Display/Drivers/ItmTelemetryMapperTests, 11 protocol tests remain in Core. Mechanical throughout: no behavior, API, visibility, or literal changes; all AttachDelegate keys and settings strings byte-identical. 748/748 tests green; ILRepack merged build clean. --- .../Display/Protocol/ItmTelemetry.cs | 2 +- src/FanaBridge/BuildIdentity.cs | 2 +- .../ControlMapperBridge.cs | 2 +- .../FanaBridgeVariantProvider.cs | 2 +- .../FanatecDevicesRegistry.cs | 4 +- .../FanatecWheelDeviceInstance.cs | 7 +- .../SimHubDevicesGateway.cs | 2 +- .../Diagnostics/DiagnosticsReport.cs | 3 +- .../{Adapters => Display}/DisplaySettings.cs | 2 +- .../Drivers}/FanatecDisplayDriver.cs | 3 +- .../Drivers}/ItmDisplayDriver.cs | 2 +- .../Drivers}/ItmTelemetryMapper.cs | 6 +- src/FanaBridge/FanatecPlugin.cs | 35 +- .../{Adapters => Leds}/FanatecLedDriver.cs | 2 +- .../{Adapters => Leds}/FanatecLedManager.cs | 4 +- .../FanatecLedModuleHost.cs | 2 +- .../IFanatecLedModuleHost.cs | 2 +- .../{Adapters => Leds}/NoLedModuleHost.cs | 2 +- .../FanatecDeviceSettings.cs | 4 +- .../{ => Settings}/FanatecPluginSettings.cs | 4 +- .../FanatecSettingsSnapshot.cs | 5 +- .../PersistedPluginSettings.cs | 2 +- src/FanaBridge/UI/DevicePanelFactory.cs | 5 +- .../{Adapters => UI}/IDevicePanelFactory.cs | 4 +- .../UI/LedColorLimitationNotice.xaml | 2 +- .../UI/LedColorLimitationNotice.xaml.cs | 2 +- src/FanaBridge/UI/ScreenSettingsPanel.xaml | 2 +- src/FanaBridge/UI/ScreenSettingsPanel.xaml.cs | 4 +- src/FanaBridge/UI/SettingsControl.xaml | 2 +- src/FanaBridge/UI/SettingsControl.xaml.cs | 4 +- src/FanaBridge/UI/TuningSettingsPanel.xaml | 2 +- src/FanaBridge/UI/TuningSettingsPanel.xaml.cs | 4 +- .../UI/WheelProfileWizardDialog.xaml | 2 +- .../UI/WheelProfileWizardDialog.xaml.cs | 2 +- src/FanaBridge/UI/WizardState.cs | 2 +- src/FanaBridge/Updates/GitHubHttpClient.cs | 2 +- .../Display/Catalog/ItmDeviceCatalogTests.cs | 2 +- .../Display/Protocol/ItmTelemetryTests.cs | 464 ----------------- .../ControlMapperBridgeTests.cs | 4 +- .../FanaBridgeVariantProviderTests.cs | 4 +- .../Devices}/DeviceRegistryOverrideTests.cs | 5 +- .../Devices}/EnabledHidingProbeTests.cs | 2 +- .../Devices}/EnabledNotificationProbeTests.cs | 2 +- .../FanatecWheelDeviceInstanceTests.cs | 8 +- .../Devices}/SimHubDevicesGatewayTests.cs | 4 +- .../Diagnostics}/FirmwareDecodeTests.cs | 4 +- .../{ => Plugin/Diagnostics}/HidUsageTests.cs | 4 +- .../Drivers}/FanatecDisplayDriverTests.cs | 5 +- .../Display/Drivers}/ItmDisplayDriverTests.cs | 4 +- .../Drivers/ItmTelemetryMapperTests.cs | 473 ++++++++++++++++++ .../Leds}/FanatecLedDriverTests.cs | 4 +- .../Settings}/FanatecDeviceSettingsTests.cs | 5 +- .../{ => Plugin/UI}/WizardStateTests.cs | 4 +- .../TestDoubles/FakeLedModuleHost.cs | 2 +- 54 files changed, 586 insertions(+), 552 deletions(-) rename src/FanaBridge/{Adapters => ControlMapper}/ControlMapperBridge.cs (99%) rename src/FanaBridge/{Adapters => ControlMapper}/FanaBridgeVariantProvider.cs (99%) rename src/FanaBridge/{Adapters => Devices}/FanatecDevicesRegistry.cs (99%) rename src/FanaBridge/{Adapters => Devices}/FanatecWheelDeviceInstance.cs (99%) rename src/FanaBridge/{Adapters => Devices}/SimHubDevicesGateway.cs (98%) rename src/FanaBridge/{Adapters => Display}/DisplaySettings.cs (98%) rename src/FanaBridge/{Adapters => Display/Drivers}/FanatecDisplayDriver.cs (99%) rename src/FanaBridge/{Adapters => Display/Drivers}/ItmDisplayDriver.cs (99%) rename src/FanaBridge/{Adapters => Display/Drivers}/ItmTelemetryMapper.cs (98%) rename src/FanaBridge/{Adapters => Leds}/FanatecLedDriver.cs (99%) rename src/FanaBridge/{Adapters => Leds}/FanatecLedManager.cs (98%) rename src/FanaBridge/{Adapters => Leds}/FanatecLedModuleHost.cs (99%) rename src/FanaBridge/{Adapters => Leds}/IFanatecLedModuleHost.cs (98%) rename src/FanaBridge/{Adapters => Leds}/NoLedModuleHost.cs (96%) rename src/FanaBridge/{Adapters => Settings}/FanatecDeviceSettings.cs (99%) rename src/FanaBridge/{ => Settings}/FanatecPluginSettings.cs (96%) rename src/FanaBridge/{Adapters => Settings}/FanatecSettingsSnapshot.cs (97%) rename src/FanaBridge/{Adapters => Settings}/PersistedPluginSettings.cs (99%) rename src/FanaBridge/{Adapters => UI}/IDevicePanelFactory.cs (91%) rename tests/FanaBridge.Tests/{ => Plugin/ControlMapper}/ControlMapperBridgeTests.cs (99%) rename tests/FanaBridge.Tests/{ => Plugin/ControlMapper}/FanaBridgeVariantProviderTests.cs (98%) rename tests/FanaBridge.Tests/{ => Plugin/Devices}/DeviceRegistryOverrideTests.cs (98%) rename tests/FanaBridge.Tests/{ => Plugin/Devices}/EnabledHidingProbeTests.cs (99%) rename tests/FanaBridge.Tests/{ => Plugin/Devices}/EnabledNotificationProbeTests.cs (99%) rename tests/FanaBridge.Tests/{ => Plugin/Devices}/FanatecWheelDeviceInstanceTests.cs (99%) rename tests/FanaBridge.Tests/{ => Plugin/Devices}/SimHubDevicesGatewayTests.cs (91%) rename tests/FanaBridge.Tests/{ => Plugin/Diagnostics}/FirmwareDecodeTests.cs (97%) rename tests/FanaBridge.Tests/{ => Plugin/Diagnostics}/HidUsageTests.cs (95%) rename tests/FanaBridge.Tests/{ => Plugin/Display/Drivers}/FanatecDisplayDriverTests.cs (99%) rename tests/FanaBridge.Tests/{ => Plugin/Display/Drivers}/ItmDisplayDriverTests.cs (99%) create mode 100644 tests/FanaBridge.Tests/Plugin/Display/Drivers/ItmTelemetryMapperTests.cs rename tests/FanaBridge.Tests/{ => Plugin/Leds}/FanatecLedDriverTests.cs (99%) rename tests/FanaBridge.Tests/{ => Plugin/Settings}/FanatecDeviceSettingsTests.cs (99%) rename tests/FanaBridge.Tests/{ => Plugin/UI}/WizardStateTests.cs (98%) diff --git a/src/FanaBridge.Core/Display/Protocol/ItmTelemetry.cs b/src/FanaBridge.Core/Display/Protocol/ItmTelemetry.cs index c40c4922..bbe945e9 100644 --- a/src/FanaBridge.Core/Display/Protocol/ItmTelemetry.cs +++ b/src/FanaBridge.Core/Display/Protocol/ItmTelemetry.cs @@ -102,7 +102,7 @@ public ItmSubscription(byte firmwareHandle, ushort paramId, byte dataType = 0) /// Wire-side ITM protocol vocabulary: the per-page parameter catalog (which /// parameter IDs a page carries, in order) and firmware subscription-report parsing. /// This is pure wire — no SimHub GameData. The SimHub telemetry → value/suffix - /// mapping lives in ItmTelemetryMapper (Adapters), which knows both sides. + /// mapping lives in ItmTelemetryMapper (Display.Drivers), which knows both sides. /// /// This declares each page's parameter list () and display name /// (), keyed by the content identity. Which pages a diff --git a/src/FanaBridge/BuildIdentity.cs b/src/FanaBridge/BuildIdentity.cs index 4930d994..b47d42c0 100644 --- a/src/FanaBridge/BuildIdentity.cs +++ b/src/FanaBridge/BuildIdentity.cs @@ -1,7 +1,7 @@ using System; using System.Reflection; -namespace FanaBridge +namespace FanaBridge.Plugin { /// /// Build identity of the plugin assembly, read from attributes embedded at diff --git a/src/FanaBridge/Adapters/ControlMapperBridge.cs b/src/FanaBridge/ControlMapper/ControlMapperBridge.cs similarity index 99% rename from src/FanaBridge/Adapters/ControlMapperBridge.cs rename to src/FanaBridge/ControlMapper/ControlMapperBridge.cs index 8326cbad..8016b2d6 100644 --- a/src/FanaBridge/Adapters/ControlMapperBridge.cs +++ b/src/FanaBridge/ControlMapper/ControlMapperBridge.cs @@ -6,7 +6,7 @@ using System.Text; using SimHub.Plugins.OutputPlugins.ControlRemapper.Variants; -namespace FanaBridge.Adapters +namespace FanaBridge.Plugin.ControlMapper { /// /// Reflection plumbing that registers a diff --git a/src/FanaBridge/Adapters/FanaBridgeVariantProvider.cs b/src/FanaBridge/ControlMapper/FanaBridgeVariantProvider.cs similarity index 99% rename from src/FanaBridge/Adapters/FanaBridgeVariantProvider.cs rename to src/FanaBridge/ControlMapper/FanaBridgeVariantProvider.cs index 7a7a3410..acfdbe3f 100644 --- a/src/FanaBridge/Adapters/FanaBridgeVariantProvider.cs +++ b/src/FanaBridge/ControlMapper/FanaBridgeVariantProvider.cs @@ -3,7 +3,7 @@ using FanaBridge.Devices.Identity; using SimHub.Plugins.OutputPlugins.ControlRemapper.Variants; -namespace FanaBridge.Adapters +namespace FanaBridge.Plugin.ControlMapper { /// /// Reports the currently-attached Fanatec rim to SimHub's Control Mapper as an diff --git a/src/FanaBridge/Adapters/FanatecDevicesRegistry.cs b/src/FanaBridge/Devices/FanatecDevicesRegistry.cs similarity index 99% rename from src/FanaBridge/Adapters/FanatecDevicesRegistry.cs rename to src/FanaBridge/Devices/FanatecDevicesRegistry.cs index 43c835a5..c98c007a 100644 --- a/src/FanaBridge/Adapters/FanatecDevicesRegistry.cs +++ b/src/FanaBridge/Devices/FanatecDevicesRegistry.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Linq; using FanaBridge.Devices.Profiles; +using FanaBridge.Plugin.Settings; +using FanaBridge.Plugin.UI; using SimHub.Plugins.Devices; -namespace FanaBridge.Adapters +namespace FanaBridge.Plugin.Devices { /// /// Registers one DeviceDescriptor per loaded so each diff --git a/src/FanaBridge/Adapters/FanatecWheelDeviceInstance.cs b/src/FanaBridge/Devices/FanatecWheelDeviceInstance.cs similarity index 99% rename from src/FanaBridge/Adapters/FanatecWheelDeviceInstance.cs rename to src/FanaBridge/Devices/FanatecWheelDeviceInstance.cs index 03834ca5..a157fd84 100644 --- a/src/FanaBridge/Adapters/FanatecWheelDeviceInstance.cs +++ b/src/FanaBridge/Devices/FanatecWheelDeviceInstance.cs @@ -5,13 +5,18 @@ using FanaBridge; using FanaBridge.Devices.Profiles; using FanaBridge.Display.Session; +using FanaBridge.Plugin.Display; +using FanaBridge.Plugin.Display.Drivers; +using FanaBridge.Plugin.Leds; +using FanaBridge.Plugin.Settings; +using FanaBridge.Plugin.UI; using GameReaderCommon; using Newtonsoft.Json.Linq; using SimHub.Plugins; using SimHub.Plugins.Devices; using SimHub.Plugins.OutputPlugins.GraphicalDash.LedModules; -namespace FanaBridge.Adapters +namespace FanaBridge.Plugin.Devices { /// /// DeviceInstance for a specific Fanatec wheel type. diff --git a/src/FanaBridge/Adapters/SimHubDevicesGateway.cs b/src/FanaBridge/Devices/SimHubDevicesGateway.cs similarity index 98% rename from src/FanaBridge/Adapters/SimHubDevicesGateway.cs rename to src/FanaBridge/Devices/SimHubDevicesGateway.cs index 97c51cca..f2084fe6 100644 --- a/src/FanaBridge/Adapters/SimHubDevicesGateway.cs +++ b/src/FanaBridge/Devices/SimHubDevicesGateway.cs @@ -3,7 +3,7 @@ using SimHub.Plugins; using SimHub.Plugins.Devices; -namespace FanaBridge.Adapters +namespace FanaBridge.Plugin.Devices { /// /// Read-and-check access to SimHub's Devices plugin for the settings diff --git a/src/FanaBridge/Diagnostics/DiagnosticsReport.cs b/src/FanaBridge/Diagnostics/DiagnosticsReport.cs index 3aa06e25..f91588ce 100644 --- a/src/FanaBridge/Diagnostics/DiagnosticsReport.cs +++ b/src/FanaBridge/Diagnostics/DiagnosticsReport.cs @@ -2,9 +2,10 @@ using System.Linq; using System.Text; using FanaBridge.Devices; +using FanaBridge.Protocol; using HidSharp; -namespace FanaBridge.Protocol +namespace FanaBridge.Plugin.Diagnostics { /// /// Builds a human-readable, GitHub-ready snapshot of device detection — the diff --git a/src/FanaBridge/Adapters/DisplaySettings.cs b/src/FanaBridge/Display/DisplaySettings.cs similarity index 98% rename from src/FanaBridge/Adapters/DisplaySettings.cs rename to src/FanaBridge/Display/DisplaySettings.cs index 457e8534..cdc7916e 100644 --- a/src/FanaBridge/Adapters/DisplaySettings.cs +++ b/src/FanaBridge/Display/DisplaySettings.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Adapters +namespace FanaBridge.Plugin.Display { /// /// Type-safe display configuration. diff --git a/src/FanaBridge/Adapters/FanatecDisplayDriver.cs b/src/FanaBridge/Display/Drivers/FanatecDisplayDriver.cs similarity index 99% rename from src/FanaBridge/Adapters/FanatecDisplayDriver.cs rename to src/FanaBridge/Display/Drivers/FanatecDisplayDriver.cs index 35423321..5d107b10 100644 --- a/src/FanaBridge/Adapters/FanatecDisplayDriver.cs +++ b/src/FanaBridge/Display/Drivers/FanatecDisplayDriver.cs @@ -1,8 +1,9 @@ using System; using FanaBridge.Display.Protocol; +using FanaBridge.Plugin.Display; using GameReaderCommon; -namespace FanaBridge.Adapters +namespace FanaBridge.Plugin.Display.Drivers { /// /// Maps telemetry data to the Fanatec 3-digit 7-segment display. diff --git a/src/FanaBridge/Adapters/ItmDisplayDriver.cs b/src/FanaBridge/Display/Drivers/ItmDisplayDriver.cs similarity index 99% rename from src/FanaBridge/Adapters/ItmDisplayDriver.cs rename to src/FanaBridge/Display/Drivers/ItmDisplayDriver.cs index 762e9839..ddebdb89 100644 --- a/src/FanaBridge/Adapters/ItmDisplayDriver.cs +++ b/src/FanaBridge/Display/Drivers/ItmDisplayDriver.cs @@ -4,7 +4,7 @@ using FanaBridge.Display.Session; using GameReaderCommon; -namespace FanaBridge.Adapters +namespace FanaBridge.Plugin.Display.Drivers { /// /// Drives a Fanatec ITM telemetry display: maps SimHub telemetry to the parameters the diff --git a/src/FanaBridge/Adapters/ItmTelemetryMapper.cs b/src/FanaBridge/Display/Drivers/ItmTelemetryMapper.cs similarity index 98% rename from src/FanaBridge/Adapters/ItmTelemetryMapper.cs rename to src/FanaBridge/Display/Drivers/ItmTelemetryMapper.cs index 006d2d18..f818c048 100644 --- a/src/FanaBridge/Adapters/ItmTelemetryMapper.cs +++ b/src/FanaBridge/Display/Drivers/ItmTelemetryMapper.cs @@ -3,7 +3,7 @@ using FanaBridge.Display.Protocol; using GameReaderCommon; -namespace FanaBridge.Adapters +namespace FanaBridge.Plugin.Display.Drivers { /// /// Maps SimHub telemetry to encoded entries @@ -14,8 +14,8 @@ namespace FanaBridge.Adapters /// The wire-side vocabulary — the page catalog (which params a page carries) and /// subscription-report parsing — lives in (Protocol, no SimHub). /// This class knows both sides (wire paramId + SimHub GameData), which is why - /// it belongs in Adapters, not Protocol. It holds no wire framing and no state — the pure, - /// per-frame translation step, the ITM analogue of FanatecDisplayDriver's reads. + /// it belongs in Display.Drivers (plugin), not Protocol (Core). It holds no wire framing and + /// no state — the pure, per-frame translation step, the ITM analogue of FanatecDisplayDriver's reads. /// public static class ItmTelemetryMapper { diff --git a/src/FanaBridge/FanatecPlugin.cs b/src/FanaBridge/FanatecPlugin.cs index 689ec6b0..ba01e0b5 100644 --- a/src/FanaBridge/FanatecPlugin.cs +++ b/src/FanaBridge/FanatecPlugin.cs @@ -4,17 +4,20 @@ using System.Threading.Tasks; using System.Windows.Media; using System.Windows.Media.Imaging; -using FanaBridge.Adapters; using FanaBridge.Devices; using FanaBridge.Devices.Profiles; using FanaBridge.Display.Protocol; using FanaBridge.Leds; -using FanaBridge.Protocol; +using FanaBridge.Plugin; +using FanaBridge.Plugin.ControlMapper; +using FanaBridge.Plugin.Devices; +using FanaBridge.Plugin.Diagnostics; +using FanaBridge.Plugin.Settings; +using FanaBridge.Plugin.UI; +using FanaBridge.Plugin.Updates; using FanaBridge.Transport; using FanaBridge.Tuning; -using FanaBridge.UI; using FanaBridge.Updater; -using FanaBridge.Updates; using GameReaderCommon; using SimHub.Plugins; @@ -65,7 +68,7 @@ public class FanatecPlugin : IPlugin, IDataPlugin, IWPFSettingsV2, IReusable // volatile: written on the DataUpdate thread (UpdateControlMapperIntegration), // read in the WheelChanged handler, which may fire from any thread. Ensures the // handler observes the constructed bridge; a missed read self-heals next tick. - private volatile FanaBridge.Adapters.ControlMapperBridge _controlMapperBridge; + private volatile ControlMapperBridge _controlMapperBridge; /// Frame counter that throttles the Control Mapper reconcile (see ). private int _cmReconcileTick; @@ -75,8 +78,8 @@ public class FanatecPlugin : IPlugin, IDataPlugin, IWPFSettingsV2, IReusable // connected wheel's SimHub device name — the user's rename if set, else the // short name — and label the mapped controller consistently with the Devices view. private readonly object _deviceInstancesLock = new object(); - private readonly List _deviceInstances = - new List(); + private readonly List _deviceInstances = + new List(); /// Fired when connection status or wheel identity changes. May fire from any thread. public event Action StateChanged; @@ -218,10 +221,10 @@ internal void InstallWheelbaseForTest(FanatecWheelbase wheelbase, bool withDispl _display = new DisplayEncoder(wheelbase.Transport); } - /// Called by each so the + /// Called by each so the /// plugin can read the connected wheel's SimHub device name for the Control Mapper /// integration. Idempotent. - internal void RegisterDeviceInstance(Adapters.FanatecWheelDeviceInstance instance) + internal void RegisterDeviceInstance(FanatecWheelDeviceInstance instance) { if (instance == null) return; lock (_deviceInstancesLock) @@ -230,7 +233,7 @@ internal void RegisterDeviceInstance(Adapters.FanatecWheelDeviceInstance instanc } /// Removes a DeviceInstance from the registry (on its End). - internal void UnregisterDeviceInstance(Adapters.FanatecWheelDeviceInstance instance) + internal void UnregisterDeviceInstance(FanatecWheelDeviceInstance instance) { if (instance == null) return; lock (_deviceInstancesLock) @@ -324,7 +327,7 @@ internal void ProbeItmCoDriver() { try { - var bridge = _controlMapperBridge ?? new FanaBridge.Adapters.ControlMapperBridge(); + var bridge = _controlMapperBridge ?? new ControlMapperBridge(); return bridge.IsRecognizeIndividualWheelsOn(PluginManager); } catch { return null; } @@ -412,7 +415,7 @@ public void Init(PluginManager pluginManager) // dashboard while testing the experimental Control Mapper integration. // Cheap (no reflection) — it only reads live wheel state. this.AttachDelegate("FanaBridge.ControlMapperVariant", - () => Adapters.FanaBridgeVariantProvider.ComputeFriendlyName() ?? ""); + () => FanaBridgeVariantProvider.ComputeFriendlyName() ?? ""); // --- Events --- this.AddEvent("DeviceConnected"); @@ -632,7 +635,7 @@ private void UpdateControlMapperIntegration() if (Settings.EnableControlMapperIntegration) { if (_controlMapperBridge == null) - _controlMapperBridge = new FanaBridge.Adapters.ControlMapperBridge(); + _controlMapperBridge = new ControlMapperBridge(); _controlMapperBridge.EnsureRegistered(PluginManager); // Stamp a friendly CustomName on the connected wheel's source(s) so // the UI shows a readable name while the match key stays the stable id. @@ -718,9 +721,9 @@ public void FinalizePlugin() // serializes this against any frame still in flight; see // docs/device-settings-lifecycle.md. Copied out of the lock so // no device work runs while holding the instance list. - List instances; + List instances; lock (_deviceInstancesLock) - instances = new List(_deviceInstances); + instances = new List(_deviceInstances); foreach (var inst in instances) { @@ -777,7 +780,7 @@ public string BuildDiagnosticsReport() string controlMapperSection; try { - var bridge = _controlMapperBridge ?? new FanaBridge.Adapters.ControlMapperBridge(); + var bridge = _controlMapperBridge ?? new ControlMapperBridge(); controlMapperSection = bridge.DescribeResolution(PluginManager); } catch (Exception ex) diff --git a/src/FanaBridge/Adapters/FanatecLedDriver.cs b/src/FanaBridge/Leds/FanatecLedDriver.cs similarity index 99% rename from src/FanaBridge/Adapters/FanatecLedDriver.cs rename to src/FanaBridge/Leds/FanatecLedDriver.cs index 03279d8e..b7e97432 100644 --- a/src/FanaBridge/Adapters/FanatecLedDriver.cs +++ b/src/FanaBridge/Leds/FanatecLedDriver.cs @@ -8,7 +8,7 @@ using FanaBridge.Devices.Profiles; using FanaBridge.Leds; -namespace FanaBridge.Adapters +namespace FanaBridge.Plugin.Leds { /// /// Unified BA63-compatible driver for all Fanatec LED types. diff --git a/src/FanaBridge/Adapters/FanatecLedManager.cs b/src/FanaBridge/Leds/FanatecLedManager.cs similarity index 98% rename from src/FanaBridge/Adapters/FanatecLedManager.cs rename to src/FanaBridge/Leds/FanatecLedManager.cs index 4a7476f8..76905f3f 100644 --- a/src/FanaBridge/Adapters/FanatecLedManager.cs +++ b/src/FanaBridge/Leds/FanatecLedManager.cs @@ -2,13 +2,13 @@ using FanaBridge.Devices.Profiles; using SimHub.Plugins.OutputPlugins.GraphicalDash.PSE; -namespace FanaBridge.Adapters +namespace FanaBridge.Plugin.Leds { /// /// Bridges into SimHub's /// ILedDeviceManager pipeline via LedsGenericManager<T>. /// - /// Each creates one of these with + /// Each creates one of these with /// the appropriate and passes it to /// LedModuleSettings<FanatecLedManager> as a pre-created driver /// (via LedModuleOptions.LedDriver or the constructor overload). diff --git a/src/FanaBridge/Adapters/FanatecLedModuleHost.cs b/src/FanaBridge/Leds/FanatecLedModuleHost.cs similarity index 99% rename from src/FanaBridge/Adapters/FanatecLedModuleHost.cs rename to src/FanaBridge/Leds/FanatecLedModuleHost.cs index d7ac2c9a..9a6f84ed 100644 --- a/src/FanaBridge/Adapters/FanatecLedModuleHost.cs +++ b/src/FanaBridge/Leds/FanatecLedModuleHost.cs @@ -9,7 +9,7 @@ using SimHub.Plugins; using SimHub.Plugins.OutputPlugins.GraphicalDash.LedModules; -namespace FanaBridge.Adapters +namespace FanaBridge.Plugin.Leds { /// /// The real LED settings module, built from registered (override-resolved) diff --git a/src/FanaBridge/Adapters/IFanatecLedModuleHost.cs b/src/FanaBridge/Leds/IFanatecLedModuleHost.cs similarity index 98% rename from src/FanaBridge/Adapters/IFanatecLedModuleHost.cs rename to src/FanaBridge/Leds/IFanatecLedModuleHost.cs index 9a4ec697..da22e535 100644 --- a/src/FanaBridge/Adapters/IFanatecLedModuleHost.cs +++ b/src/FanaBridge/Leds/IFanatecLedModuleHost.cs @@ -5,7 +5,7 @@ using Newtonsoft.Json.Linq; using SimHub.Plugins; -namespace FanaBridge.Adapters +namespace FanaBridge.Plugin.Leds { /// /// The LED settings module, behind an interface so persistence is testable diff --git a/src/FanaBridge/Adapters/NoLedModuleHost.cs b/src/FanaBridge/Leds/NoLedModuleHost.cs similarity index 96% rename from src/FanaBridge/Adapters/NoLedModuleHost.cs rename to src/FanaBridge/Leds/NoLedModuleHost.cs index af432a70..a0ed2fb6 100644 --- a/src/FanaBridge/Adapters/NoLedModuleHost.cs +++ b/src/FanaBridge/Leds/NoLedModuleHost.cs @@ -5,7 +5,7 @@ using Newtonsoft.Json.Linq; using SimHub.Plugins; -namespace FanaBridge.Adapters +namespace FanaBridge.Plugin.Leds { /// /// Stands in for the LED module on devices whose registered capabilities diff --git a/src/FanaBridge/Adapters/FanatecDeviceSettings.cs b/src/FanaBridge/Settings/FanatecDeviceSettings.cs similarity index 99% rename from src/FanaBridge/Adapters/FanatecDeviceSettings.cs rename to src/FanaBridge/Settings/FanatecDeviceSettings.cs index 66426822..65adb78e 100644 --- a/src/FanaBridge/Adapters/FanatecDeviceSettings.cs +++ b/src/FanaBridge/Settings/FanatecDeviceSettings.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.Linq; using FanaBridge.Devices.Profiles; +using FanaBridge.Plugin.Display; +using FanaBridge.Plugin.Leds; using Newtonsoft.Json.Linq; -namespace FanaBridge.Adapters +namespace FanaBridge.Plugin.Settings { /// /// Owns everything a device persists: FanaBridge's own settings, the LED diff --git a/src/FanaBridge/FanatecPluginSettings.cs b/src/FanaBridge/Settings/FanatecPluginSettings.cs similarity index 96% rename from src/FanaBridge/FanatecPluginSettings.cs rename to src/FanaBridge/Settings/FanatecPluginSettings.cs index 8c64ae6f..b46c1a34 100644 --- a/src/FanaBridge/FanatecPluginSettings.cs +++ b/src/FanaBridge/Settings/FanatecPluginSettings.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace FanaBridge +namespace FanaBridge.Plugin.Settings { /// /// Plugin settings. Must be JSON-serializable (public fields/properties, no complex types). @@ -49,7 +49,7 @@ public class FanatecPluginSettings /// (surfaced in the settings UI when it isn't). Gap-filler: SimHub wins for any /// wheel it already recognizes, so existing mappings are never disturbed, and it's /// a no-op unless the user has opted into per-rim mapping at the SimHub level. See - /// . + /// . /// public bool EnableControlMapperIntegration { get; set; } = true; diff --git a/src/FanaBridge/Adapters/FanatecSettingsSnapshot.cs b/src/FanaBridge/Settings/FanatecSettingsSnapshot.cs similarity index 97% rename from src/FanaBridge/Adapters/FanatecSettingsSnapshot.cs rename to src/FanaBridge/Settings/FanatecSettingsSnapshot.cs index ca537f64..f45d8a49 100644 --- a/src/FanaBridge/Adapters/FanatecSettingsSnapshot.cs +++ b/src/FanaBridge/Settings/FanatecSettingsSnapshot.cs @@ -1,6 +1,7 @@ -using Newtonsoft.Json.Linq; +using FanaBridge.Plugin.Display; +using Newtonsoft.Json.Linq; -namespace FanaBridge.Adapters +namespace FanaBridge.Plugin.Settings { /// /// The FanaBridge-owned settings of one device, as an immutable value. diff --git a/src/FanaBridge/Adapters/PersistedPluginSettings.cs b/src/FanaBridge/Settings/PersistedPluginSettings.cs similarity index 99% rename from src/FanaBridge/Adapters/PersistedPluginSettings.cs rename to src/FanaBridge/Settings/PersistedPluginSettings.cs index e272ff3a..e564e52e 100644 --- a/src/FanaBridge/Adapters/PersistedPluginSettings.cs +++ b/src/FanaBridge/Settings/PersistedPluginSettings.cs @@ -3,7 +3,7 @@ using System.IO; using Newtonsoft.Json.Linq; -namespace FanaBridge.Adapters +namespace FanaBridge.Plugin.Settings { /// /// Reads the plugin's persisted settings without a running plugin. diff --git a/src/FanaBridge/UI/DevicePanelFactory.cs b/src/FanaBridge/UI/DevicePanelFactory.cs index d486bc74..ff68a541 100644 --- a/src/FanaBridge/UI/DevicePanelFactory.cs +++ b/src/FanaBridge/UI/DevicePanelFactory.cs @@ -1,9 +1,10 @@ using System; using System.Windows.Controls; -using FanaBridge.Adapters; using FanaBridge.Devices.Profiles; +using FanaBridge.Plugin.Display; +using FanaBridge.Plugin.Settings; -namespace FanaBridge.UI +namespace FanaBridge.Plugin.UI { /// UI-side implementation of the device settings-panel factory. internal sealed class DevicePanelFactory : IDevicePanelFactory diff --git a/src/FanaBridge/Adapters/IDevicePanelFactory.cs b/src/FanaBridge/UI/IDevicePanelFactory.cs similarity index 91% rename from src/FanaBridge/Adapters/IDevicePanelFactory.cs rename to src/FanaBridge/UI/IDevicePanelFactory.cs index 593e5a3a..69cc3cf3 100644 --- a/src/FanaBridge/Adapters/IDevicePanelFactory.cs +++ b/src/FanaBridge/UI/IDevicePanelFactory.cs @@ -1,8 +1,10 @@ using System; using System.Windows.Controls; using FanaBridge.Devices.Profiles; +using FanaBridge.Plugin.Display; +using FanaBridge.Plugin.Settings; -namespace FanaBridge.Adapters +namespace FanaBridge.Plugin.UI { /// /// Constructs the per-device WPF settings panels. diff --git a/src/FanaBridge/UI/LedColorLimitationNotice.xaml b/src/FanaBridge/UI/LedColorLimitationNotice.xaml index ebbdcdec..938fbd6b 100644 --- a/src/FanaBridge/UI/LedColorLimitationNotice.xaml +++ b/src/FanaBridge/UI/LedColorLimitationNotice.xaml @@ -1,4 +1,4 @@ - - + diff --git a/src/FanaBridge/Diagnostics/DiagnosticsReport.cs b/src/FanaBridge/Diagnostics/DiagnosticsReport.cs index f91588ce..f4335b05 100644 --- a/src/FanaBridge/Diagnostics/DiagnosticsReport.cs +++ b/src/FanaBridge/Diagnostics/DiagnosticsReport.cs @@ -2,7 +2,7 @@ using System.Linq; using System.Text; using FanaBridge.Devices; -using FanaBridge.Protocol; +using FanaBridge.Diagnostics; using HidSharp; namespace FanaBridge.Plugin.Diagnostics diff --git a/tests/FanaBridge.Tests/ConverterCaptureProbeTests.cs b/tests/FanaBridge.Tests/Core/Diagnostics/ConverterCaptureProbeTests.cs similarity index 97% rename from tests/FanaBridge.Tests/ConverterCaptureProbeTests.cs rename to tests/FanaBridge.Tests/Core/Diagnostics/ConverterCaptureProbeTests.cs index 8a252948..0ec30ca7 100644 --- a/tests/FanaBridge.Tests/ConverterCaptureProbeTests.cs +++ b/tests/FanaBridge.Tests/Core/Diagnostics/ConverterCaptureProbeTests.cs @@ -1,7 +1,7 @@ -using FanaBridge.Protocol; +using FanaBridge.Diagnostics; using Xunit; -namespace FanaBridge.Tests +namespace FanaBridge.Tests.Core.Diagnostics { /// /// Unit tests for the pure decoders of the converter capture probe — the col01 tail classifier From 1f5856075dd13683a1c741e5e589656e2e1cb3f5 Mon Sep 17 00:00:00 2001 From: Matthew Kelch Date: Sat, 8 Aug 2026 21:20:47 -0400 Subject: [PATCH 4/8] refactor: adopt literal path==namespace scheme with compiler enforcement (issue #102) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Namespaces now spell their location, ratified on #102 after review: Core declares FanaBridge.Core. (RootNamespace made truthful; embedded profile resources verified loading — the loader matches a '.Profiles.' manifest segment, not the root). The plugin declares FanaBridge.; the shipped FanaBridge.dll therefore exports FanaBridge.* from the shell and FanaBridge.Core.* from the merged library, so ownership stays readable in stack traces while every directory spells its namespace. Riding on the same surface: - SimHubLogSink joins its mapped FanaBridge.Logging home; the net48 ModuleInitializer polyfill splits into Properties/ (pragma'd). - UI/ subdivides by feature (Settings/, Wizard/, Devices/) ahead of the display editor; BAML resource URIs regenerate internally (verified). - Layout enforcement is compiler-native — IDE0130 at error severity with EnforceCodeStyleInBuild — rather than a bespoke guard test. Exceptions are two in-file pragmas (root-namespace Log, the polyfill) plus the SimHub reflection shim in tests, each with its reason at the site. - tests/Contracts/ hosts repo/external-contract tests: the XAML x:Class layout check (markup is outside the analyzer's reach) and the SimHub enum snapshot. - docs/architecture.md records the layers, the namespace rule, and the frozen names invisible to the compiler. Mechanical throughout; all SimHub-facing strings byte-identical; the persisted FanaBridge.FanatecPlugin type name is untouched and now path-conformant. 749/749 tests green; merged build exports verified; IDE0130 fail-on-violation verified with a planted file. --- .editorconfig | 4 + Directory.Build.props | 4 + docs/README.md | 1 + docs/architecture.md | 61 +++++++++ .../Devices/ConnectionMonitor.cs | 2 +- .../Devices/FanatecWheelbase.cs | 8 +- .../Devices/IWheelbaseConnection.cs | 2 +- .../Devices/Identity/FanatecDeviceTables.cs | 2 +- .../Devices/Identity/FanatecIdentity.cs | 2 +- .../Devices/Identity/IdentitySettler.cs | 2 +- .../Devices/Identity/SrmConverterIdentity.cs | 4 +- .../Devices/Identity/SystemReportReader.cs | 4 +- .../Devices/Identity/WheelEngage.cs | 4 +- .../Devices/Profiles/ColorFormat.cs | 2 +- .../Devices/Profiles/DeviceConfig.cs | 2 +- .../Devices/Profiles/DisplayType.cs | 2 +- .../Devices/Profiles/InputMapping.cs | 2 +- .../Devices/Profiles/LedChannelConverter.cs | 2 +- .../Devices/Profiles/LedColorLimitation.cs | 2 +- .../Devices/Profiles/LedDefinition.cs | 2 +- .../Devices/Profiles/LedEnums.cs | 2 +- .../Devices/Profiles/ProfileMatch.cs | 2 +- .../Devices/Profiles/ProfileSource.cs | 2 +- .../Devices/Profiles/WheelCapabilities.cs | 2 +- .../Devices/Profiles/WheelProfile.cs | 8 +- .../Devices/Profiles/WheelProfileStore.cs | 4 +- .../Diagnostics/ConverterCaptureProbe.cs | 6 +- .../Diagnostics/FanatecSoftwareMonitor.cs | 2 +- .../Display/Catalog/ItmDeviceCatalog.cs | 4 +- .../Display/Protocol/DisplayEncoder.cs | 4 +- .../Display/Protocol/ItmEncoder.cs | 4 +- .../Display/Protocol/ItmTelemetry.cs | 6 +- .../Display/Protocol/SevenSegment.cs | 2 +- .../Display/Session/ItmLifecycleController.cs | 6 +- src/FanaBridge.Core/FanaBridge.Core.csproj | 11 +- src/FanaBridge.Core/Leds/ColorHelper.cs | 2 +- src/FanaBridge.Core/Leds/LedEncoder.cs | 4 +- src/FanaBridge.Core/Leds/LegacyLedEncoder.cs | 4 +- src/FanaBridge.Core/Logging/Log.cs | 2 + src/FanaBridge.Core/Transport/Col03Family.cs | 2 +- .../Transport/Col03FrameClassifier.cs | 4 +- .../Transport/Col03QueueSet.cs | 2 +- .../Transport/FanatecTransport.cs | 4 +- .../Transport/HidReportQueue.cs | 2 +- .../Transport/IConnectableTransport.cs | 2 +- .../Transport/IDeviceTransport.cs | 2 +- .../Transport/IHidBusEnumerator.cs | 2 +- .../Transport/IReportStream.cs | 2 +- src/FanaBridge.Core/Transport/ReportElicit.cs | 2 +- src/FanaBridge.Core/Tuning/EncoderMode.cs | 2 +- .../Tuning/FanatecTuningController.cs | 4 +- src/FanaBridge/BuildIdentity.cs | 2 +- .../ControlMapper/ControlMapperBridge.cs | 2 +- .../FanaBridgeVariantProvider.cs | 8 +- .../Devices/FanatecDevicesRegistry.cs | 10 +- .../Devices/FanatecWheelDeviceInstance.cs | 16 +-- .../Devices/SimHubDevicesGateway.cs | 2 +- .../Diagnostics/DiagnosticsReport.cs | 6 +- src/FanaBridge/Display/DisplaySettings.cs | 2 +- .../Display/Drivers/FanatecDisplayDriver.cs | 6 +- .../Display/Drivers/ItmDisplayDriver.cs | 6 +- .../Display/Drivers/ItmTelemetryMapper.cs | 4 +- src/FanaBridge/FanatecPlugin.cs | 27 ++-- src/FanaBridge/Leds/FanatecLedDriver.cs | 6 +- src/FanaBridge/Leds/FanatecLedManager.cs | 4 +- src/FanaBridge/Leds/FanatecLedModuleHost.cs | 8 +- src/FanaBridge/Leds/IFanatecLedModuleHost.cs | 4 +- src/FanaBridge/Leds/NoLedModuleHost.cs | 4 +- src/FanaBridge/Logging/SimHubLogSink.cs | 10 +- .../Properties/ModuleInitializerAttribute.cs | 10 ++ .../Settings/FanatecDeviceSettings.cs | 8 +- .../Settings/FanatecPluginSettings.cs | 2 +- .../Settings/FanatecSettingsSnapshot.cs | 4 +- .../Settings/PersistedPluginSettings.cs | 2 +- .../UI/{ => Devices}/DevicePanelFactory.cs | 9 +- .../UI/{ => Devices}/IDevicePanelFactory.cs | 8 +- .../LedColorLimitationNotice.xaml | 2 +- .../LedColorLimitationNotice.xaml.cs | 4 +- .../{ => Settings}/ScreenSettingsPanel.xaml | 2 +- .../ScreenSettingsPanel.xaml.cs | 10 +- .../UI/{ => Settings}/SettingsControl.xaml | 2 +- .../UI/{ => Settings}/SettingsControl.xaml.cs | 9 +- .../{ => Settings}/TuningSettingsPanel.xaml | 2 +- .../TuningSettingsPanel.xaml.cs | 6 +- .../WheelProfileWizardDialog.xaml | 2 +- .../WheelProfileWizardDialog.xaml.cs | 12 +- src/FanaBridge/UI/{ => Wizard}/WizardState.cs | 6 +- src/FanaBridge/Updates/GitHubHttpClient.cs | 2 +- .../SimHubEnumSnapshotTests.cs | 3 +- .../Contracts/XamlClassLayoutTests.cs | 119 ++++++++++++++++++ .../Devices/ConnectFailureMessageTests.cs | 4 +- .../Core/Devices/ConnectionMonitorTests.cs | 2 +- .../Core/Devices/FanatecWheelbaseTests.cs | 9 +- .../Identity/FanatecDeviceTablesTests.cs | 2 +- .../Devices/Identity/IdentitySettlerTests.cs | 2 +- .../Identity/SrmConverterIdentityTests.cs | 2 +- .../Profiles/LedChannelConverterTests.cs | 2 +- .../Profiles/LedColorLimitationTests.cs | 2 +- .../Profiles/WheelProfileItmDeviceTests.cs | 4 +- .../Profiles/WheelProfileStoreTests.cs | 2 +- .../Diagnostics/ConverterCaptureProbeTests.cs | 2 +- .../FanatecSoftwareMonitorTests.cs | 2 +- .../Display/Catalog/ItmDeviceCatalogTests.cs | 6 +- .../Core/Display/Protocol/ItmEncoderTests.cs | 5 +- .../Display/Protocol/ItmTelemetryTests.cs | 2 +- .../Display/Protocol/SevenSegmentTests.cs | 2 +- .../Session/ItmLifecycleControllerTests.cs | 11 +- .../Core/Leds/ColorHelperTests.cs | 2 +- .../Core/Leds/LedEncoderTests.cs | 5 +- .../Core/Leds/LegacyLedEncoderTests.cs | 5 +- .../Transport/Col03FrameClassifierTests.cs | 2 +- .../Core/Transport/Col03QueueSetTests.cs | 2 +- .../Transport/FanatecTransportReaderTests.cs | 4 +- .../Core/Transport/HidReportQueueTests.cs | 2 +- .../Core/Transport/ReportElicitTests.cs | 3 +- .../Tuning/FanatecTuningControllerTests.cs | 5 +- .../ControlMapper/ControlMapperBridgeTests.cs | 3 +- .../ControlMapper}/ControlMapperFakes.cs | 20 +-- .../FanaBridgeVariantProviderTests.cs | 2 +- .../Devices/DeviceRegistryOverrideTests.cs | 6 +- .../FanatecWheelDeviceInstanceTests.cs | 18 +-- .../Devices/SimHubDevicesGatewayTests.cs | 2 +- .../Plugin/Diagnostics/FirmwareDecodeTests.cs | 2 +- .../Plugin/Diagnostics/HidUsageTests.cs | 2 +- .../Drivers/FanatecDisplayDriverTests.cs | 9 +- .../Display/Drivers/ItmDisplayDriverTests.cs | 7 +- .../Drivers/ItmTelemetryMapperTests.cs | 4 +- .../Plugin/Leds/FanatecLedDriverTests.cs | 7 +- .../Settings/FanatecDeviceSettingsTests.cs | 6 +- .../UI/{ => Wizard}/WizardStateTests.cs | 6 +- tests/FanaBridge.Tests/README.md | 38 ++++++ .../TestDoubles/FakeLedModuleHost.cs | 4 +- .../TestDoubles/FakeReportStream.cs | 4 +- 133 files changed, 524 insertions(+), 279 deletions(-) create mode 100644 docs/architecture.md create mode 100644 src/FanaBridge/Properties/ModuleInitializerAttribute.cs rename src/FanaBridge/UI/{ => Devices}/DevicePanelFactory.cs (83%) rename src/FanaBridge/UI/{ => Devices}/IDevicePanelFactory.cs (87%) rename src/FanaBridge/UI/{ => Devices}/LedColorLimitationNotice.xaml (95%) rename src/FanaBridge/UI/{ => Devices}/LedColorLimitationNotice.xaml.cs (96%) rename src/FanaBridge/UI/{ => Settings}/ScreenSettingsPanel.xaml (98%) rename src/FanaBridge/UI/{ => Settings}/ScreenSettingsPanel.xaml.cs (97%) rename src/FanaBridge/UI/{ => Settings}/SettingsControl.xaml (99%) rename src/FanaBridge/UI/{ => Settings}/SettingsControl.xaml.cs (99%) rename src/FanaBridge/UI/{ => Settings}/TuningSettingsPanel.xaml (97%) rename src/FanaBridge/UI/{ => Settings}/TuningSettingsPanel.xaml.cs (98%) rename src/FanaBridge/UI/{ => Wizard}/WheelProfileWizardDialog.xaml (99%) rename src/FanaBridge/UI/{ => Wizard}/WheelProfileWizardDialog.xaml.cs (99%) rename src/FanaBridge/UI/{ => Wizard}/WizardState.cs (99%) rename tests/FanaBridge.Tests/{ => Contracts}/SimHubEnumSnapshotTests.cs (97%) create mode 100644 tests/FanaBridge.Tests/Contracts/XamlClassLayoutTests.cs rename tests/FanaBridge.Tests/{TestDoubles => Plugin/ControlMapper}/ControlMapperFakes.cs (88%) rename tests/FanaBridge.Tests/Plugin/UI/{ => Wizard}/WizardStateTests.cs (97%) create mode 100644 tests/FanaBridge.Tests/README.md diff --git a/.editorconfig b/.editorconfig index 5b6acadf..143210d2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -31,6 +31,10 @@ csharp_new_line_before_finally = true # The codebase uses block-scoped namespaces; keep new files consistent. csharp_style_namespace_declarations = block_scoped:suggestion dotnet_sort_system_directives_first = true +# Namespace must equal project root + relative folder path (issue #102). +# Deliberate exceptions disable IDE0130 in-file with a one-line reason. +dotnet_style_namespace_match_folder = true +dotnet_diagnostic.IDE0130.severity = error # ── this. / var ────────────────────────────────────────────────────── dotnet_style_qualification_for_field = false:suggestion diff --git a/Directory.Build.props b/Directory.Build.props index 76e59ecb..8c78a6bb 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,6 +7,10 @@ IsExternalInit shim). --> latest + + true + 0.7.0 $(VersionPrefix) diff --git a/docs/README.md b/docs/README.md index e56b96e8..83e9ac23 100644 --- a/docs/README.md +++ b/docs/README.md @@ -18,6 +18,7 @@ Documentation specific to the FanaBridge plugin: | Document | Description | |----------|-------------| +| [Architecture](architecture.md) | Layers, namespace rule, test-tree convention, and frozen names | | [Supported Devices](supported-devices.md) | Wheels and hub + module combos with built-in FanaBridge profiles — tested vs. unverified, and their LED/display capabilities | | [Device Settings Lifecycle](device-settings-lifecycle.md) | How a device decides what to store, why the LED editor is built up front, and the rules that keep a save from erasing settings | diff --git a/docs/architecture.md b/docs/architecture.md new file mode 100644 index 00000000..e14481e6 --- /dev/null +++ b/docs/architecture.md @@ -0,0 +1,61 @@ +# Architecture + +Rules and frozen names for the FanaBridge solution. Folder inventories and history live elsewhere; this page is the contract. + +## Layers + +Three source projects, layered by dependency: + +| Project | Role | +|---------|------| +| **FanaBridge.Core** | SimHub-free device stack: HID transport, Fanatec protocol, profiles, LEDs, display encoding, tuning, diagnostics. References only non-SimHub libraries (HidSharp, Newtonsoft.Json). | +| **FanaBridge** (plugin) | SimHub / WPF shell: plugin entrypoint, device registry, Control Mapper bridge, settings, UI, display drivers. References Core and Updater. | +| **FanaBridge.Updater** | Isolated self-updater (release feed, download, file swap). References neither Core nor the plugin — audit boundary for code that rewrites files next to SimHub. | + +**Reference rules:** Core and Updater must not reference SimHub assemblies or each other. The plugin may reference both. Packaging uses **ILRepack** to merge Core + Updater into the shipped **`FanaBridge.dll`** (development builds keep separate assemblies for layering). + +## Namespace rule + +``` +namespace = project namespace root + relative folder path +``` + +| Project | Namespace root | +|---------|----------------| +| `src/FanaBridge.Core` | `FanaBridge.Core` | +| `src/FanaBridge` | `FanaBridge` | +| `src/FanaBridge.Updater` | `FanaBridge.Updater` | +| `tests/FanaBridge.Tests` | `FanaBridge.Tests` | + +Enforced at compile time via **IDE0130** (`dotnet_style_namespace_match_folder = true`, severity error, `EnforceCodeStyleInBuild`). Deliberate exceptions use an in-file `#pragma warning disable IDE0130` with a one-line reason. + +**Product exceptions:** + +1. **`Log` in namespace `FanaBridge`** (`FanaBridge.Core/Logging/Log.cs`) — unqualified `Log.*` call sites in both Core and plugin resolve only when the type lives on the shared root ancestor. +2. **`ModuleInitializerAttribute`** (`FanaBridge/Properties/ModuleInitializerAttribute.cs`) — net48 polyfill; must live in `System.Runtime.CompilerServices` by definition. + +XAML `x:Class` values follow the same path rule and are checked by a contract test (the C# analyzer does not cover markup). + +## Test tree + +`tests/FanaBridge.Tests` mirrors the product projects: + +- `Core/` → `FanaBridge.Tests.Core…` +- `Plugin/` → `FanaBridge.Tests.Plugin…` +- `Updater/` → `FanaBridge.Tests.Updater…` +- `Contracts/` → repo-wide / external-contract tests (XAML layout, SimHub enum snapshot) + +Domain-local fakes live next to their domain; multi-domain doubles live under `TestDoubles/`. + +## Frozen names + +These strings are invisible to the C# namespace analyzer but **breaking to rename** (SimHub persistence, embedded resources, dashboards, or the updater whitelist): + +| Name | Why frozen | +|------|------------| +| **`FanaBridge.dll`** | Shipped assembly file name; updater package whitelist and install path. | +| **`FanaBridge.FanatecPlugin`** | Fully-qualified plugin type name persisted by SimHub. | +| **`Profiles` path segment** (under Core's embedded resources) | The built-in wheel-profile loader matches manifest names on a `.Profiles.` substring and `.json` suffix; keep profile JSON under a `Profiles/` folder. | +| **`FanatecPlugin.FanaBridgeSettings.json`** | On-disk settings file under SimHub `PluginsData/Common/`. | +| **`AttachDelegate` / `AddEvent` keys** | Property and event names registered with SimHub (`FanaBridge.*` properties, `DeviceConnected`, `DeviceDisconnected`, `WheelChanged`, …). Dashboards and automations bind to these strings. | +| **`Fanatec_[_]`** | `DeviceTypeID` format for SimHub device descriptors (and `Fanatec_Module_` parents for hub logos). | diff --git a/src/FanaBridge.Core/Devices/ConnectionMonitor.cs b/src/FanaBridge.Core/Devices/ConnectionMonitor.cs index c5942024..1e03c472 100644 --- a/src/FanaBridge.Core/Devices/ConnectionMonitor.cs +++ b/src/FanaBridge.Core/Devices/ConnectionMonitor.cs @@ -1,6 +1,6 @@ using System; -namespace FanaBridge.Devices +namespace FanaBridge.Core.Devices { /// /// Encapsulates the Fanatec device connection state machine: diff --git a/src/FanaBridge.Core/Devices/FanatecWheelbase.cs b/src/FanaBridge.Core/Devices/FanatecWheelbase.cs index 790177cc..1b45ab93 100644 --- a/src/FanaBridge.Core/Devices/FanatecWheelbase.cs +++ b/src/FanaBridge.Core/Devices/FanatecWheelbase.cs @@ -1,11 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; -using FanaBridge.Devices.Identity; -using FanaBridge.Devices.Profiles; -using FanaBridge.Transport; +using FanaBridge.Core.Devices.Identity; +using FanaBridge.Core.Devices.Profiles; +using FanaBridge.Core.Transport; -namespace FanaBridge.Devices +namespace FanaBridge.Core.Devices { /// /// Represents a connected Fanatec wheelbase — the root of all communication. diff --git a/src/FanaBridge.Core/Devices/IWheelbaseConnection.cs b/src/FanaBridge.Core/Devices/IWheelbaseConnection.cs index f151165c..03c5051d 100644 --- a/src/FanaBridge.Core/Devices/IWheelbaseConnection.cs +++ b/src/FanaBridge.Core/Devices/IWheelbaseConnection.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Devices +namespace FanaBridge.Core.Devices { /// /// Connection-check surface of a , used by diff --git a/src/FanaBridge.Core/Devices/Identity/FanatecDeviceTables.cs b/src/FanaBridge.Core/Devices/Identity/FanatecDeviceTables.cs index 5df8311b..cbd0aa88 100644 --- a/src/FanaBridge.Core/Devices/Identity/FanatecDeviceTables.cs +++ b/src/FanaBridge.Core/Devices/Identity/FanatecDeviceTables.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace FanaBridge.Devices.Identity +namespace FanaBridge.Core.Devices.Identity { /// /// Reference tables mapping the raw FF 08 system-report bytes to FanaBridge diff --git a/src/FanaBridge.Core/Devices/Identity/FanatecIdentity.cs b/src/FanaBridge.Core/Devices/Identity/FanatecIdentity.cs index 3f34e165..6f0c797b 100644 --- a/src/FanaBridge.Core/Devices/Identity/FanatecIdentity.cs +++ b/src/FanaBridge.Core/Devices/Identity/FanatecIdentity.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Devices.Identity +namespace FanaBridge.Core.Devices.Identity { /// /// Decodes wheelbase + attachment + module identity from the col03 FF 08 diff --git a/src/FanaBridge.Core/Devices/Identity/IdentitySettler.cs b/src/FanaBridge.Core/Devices/Identity/IdentitySettler.cs index 12931a5c..5ee283a4 100644 --- a/src/FanaBridge.Core/Devices/Identity/IdentitySettler.cs +++ b/src/FanaBridge.Core/Devices/Identity/IdentitySettler.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Devices.Identity +namespace FanaBridge.Core.Devices.Identity { /// /// Settles raw wheel/hub + module identity readings before they are committed. diff --git a/src/FanaBridge.Core/Devices/Identity/SrmConverterIdentity.cs b/src/FanaBridge.Core/Devices/Identity/SrmConverterIdentity.cs index 8611b294..c0103a82 100644 --- a/src/FanaBridge.Core/Devices/Identity/SrmConverterIdentity.cs +++ b/src/FanaBridge.Core/Devices/Identity/SrmConverterIdentity.cs @@ -1,7 +1,7 @@ using System; -using FanaBridge.Transport; +using FanaBridge.Core.Transport; -namespace FanaBridge.Devices.Identity +namespace FanaBridge.Core.Devices.Identity { /// /// SRM Conversion Kit identity, recovered from the kit's private DE FA AD0xDD diff --git a/src/FanaBridge.Core/Devices/Identity/SystemReportReader.cs b/src/FanaBridge.Core/Devices/Identity/SystemReportReader.cs index ba1e4b56..cb230916 100644 --- a/src/FanaBridge.Core/Devices/Identity/SystemReportReader.cs +++ b/src/FanaBridge.Core/Devices/Identity/SystemReportReader.cs @@ -1,7 +1,7 @@ using System; -using FanaBridge.Transport; +using FanaBridge.Core.Transport; -namespace FanaBridge.Devices.Identity +namespace FanaBridge.Core.Devices.Identity { /// /// The col03 FF 08 system-report codec — the wire-level side of identity. diff --git a/src/FanaBridge.Core/Devices/Identity/WheelEngage.cs b/src/FanaBridge.Core/Devices/Identity/WheelEngage.cs index fc0c6254..59788f49 100644 --- a/src/FanaBridge.Core/Devices/Identity/WheelEngage.cs +++ b/src/FanaBridge.Core/Devices/Identity/WheelEngage.cs @@ -1,6 +1,6 @@ -using FanaBridge.Transport; +using FanaBridge.Core.Transport; -namespace FanaBridge.Devices.Identity +namespace FanaBridge.Core.Devices.Identity { /// /// Replicates the kernel filter's engage sequence (FWFUProtocolUsbBulkOrInterruptTransfer) diff --git a/src/FanaBridge.Core/Devices/Profiles/ColorFormat.cs b/src/FanaBridge.Core/Devices/Profiles/ColorFormat.cs index 3113013b..86e5aa51 100644 --- a/src/FanaBridge.Core/Devices/Profiles/ColorFormat.cs +++ b/src/FanaBridge.Core/Devices/Profiles/ColorFormat.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Devices.Profiles +namespace FanaBridge.Core.Devices.Profiles { /// /// Pixel encoding for the Color LED channel (subcmd 0x02). diff --git a/src/FanaBridge.Core/Devices/Profiles/DeviceConfig.cs b/src/FanaBridge.Core/Devices/Profiles/DeviceConfig.cs index 1310704e..9523b408 100644 --- a/src/FanaBridge.Core/Devices/Profiles/DeviceConfig.cs +++ b/src/FanaBridge.Core/Devices/Profiles/DeviceConfig.cs @@ -1,6 +1,6 @@ using System; -namespace FanaBridge.Devices.Profiles +namespace FanaBridge.Core.Devices.Profiles { /// /// Identifies a specific selectable device configuration — a standalone diff --git a/src/FanaBridge.Core/Devices/Profiles/DisplayType.cs b/src/FanaBridge.Core/Devices/Profiles/DisplayType.cs index 159a33a6..385d909c 100644 --- a/src/FanaBridge.Core/Devices/Profiles/DisplayType.cs +++ b/src/FanaBridge.Core/Devices/Profiles/DisplayType.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Devices.Profiles +namespace FanaBridge.Core.Devices.Profiles { /// /// The type of display available on a wheel or button module. diff --git a/src/FanaBridge.Core/Devices/Profiles/InputMapping.cs b/src/FanaBridge.Core/Devices/Profiles/InputMapping.cs index e2b5c1e3..0fab0aa3 100644 --- a/src/FanaBridge.Core/Devices/Profiles/InputMapping.cs +++ b/src/FanaBridge.Core/Devices/Profiles/InputMapping.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using Newtonsoft.Json; -namespace FanaBridge.Devices.Profiles +namespace FanaBridge.Core.Devices.Profiles { /// /// Structured input association for a single LED. diff --git a/src/FanaBridge.Core/Devices/Profiles/LedChannelConverter.cs b/src/FanaBridge.Core/Devices/Profiles/LedChannelConverter.cs index c42bd539..c325e696 100644 --- a/src/FanaBridge.Core/Devices/Profiles/LedChannelConverter.cs +++ b/src/FanaBridge.Core/Devices/Profiles/LedChannelConverter.cs @@ -1,7 +1,7 @@ using System; using Newtonsoft.Json; -namespace FanaBridge.Devices.Profiles +namespace FanaBridge.Core.Devices.Profiles { /// /// JSON converter for that accepts both v1 and v2 diff --git a/src/FanaBridge.Core/Devices/Profiles/LedColorLimitation.cs b/src/FanaBridge.Core/Devices/Profiles/LedColorLimitation.cs index e2b283a7..076abcbf 100644 --- a/src/FanaBridge.Core/Devices/Profiles/LedColorLimitation.cs +++ b/src/FanaBridge.Core/Devices/Profiles/LedColorLimitation.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; -namespace FanaBridge.Devices.Profiles +namespace FanaBridge.Core.Devices.Profiles { /// /// A way in which a wheel's LEDs cannot show what SimHub's color picker offers. diff --git a/src/FanaBridge.Core/Devices/Profiles/LedDefinition.cs b/src/FanaBridge.Core/Devices/Profiles/LedDefinition.cs index b312dd90..1a1f88bd 100644 --- a/src/FanaBridge.Core/Devices/Profiles/LedDefinition.cs +++ b/src/FanaBridge.Core/Devices/Profiles/LedDefinition.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace FanaBridge.Devices.Profiles +namespace FanaBridge.Core.Devices.Profiles { /// /// Describes a single physical LED on the device. diff --git a/src/FanaBridge.Core/Devices/Profiles/LedEnums.cs b/src/FanaBridge.Core/Devices/Profiles/LedEnums.cs index 63b9982d..2b6aea68 100644 --- a/src/FanaBridge.Core/Devices/Profiles/LedEnums.cs +++ b/src/FanaBridge.Core/Devices/Profiles/LedEnums.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Devices.Profiles +namespace FanaBridge.Core.Devices.Profiles { /// /// Hardware communication channel for a single LED. diff --git a/src/FanaBridge.Core/Devices/Profiles/ProfileMatch.cs b/src/FanaBridge.Core/Devices/Profiles/ProfileMatch.cs index d1c31562..85cd33f9 100644 --- a/src/FanaBridge.Core/Devices/Profiles/ProfileMatch.cs +++ b/src/FanaBridge.Core/Devices/Profiles/ProfileMatch.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace FanaBridge.Devices.Profiles +namespace FanaBridge.Core.Devices.Profiles { /// /// Matching criteria to associate a profile with the connected hardware. diff --git a/src/FanaBridge.Core/Devices/Profiles/ProfileSource.cs b/src/FanaBridge.Core/Devices/Profiles/ProfileSource.cs index 77b4fd66..034f7985 100644 --- a/src/FanaBridge.Core/Devices/Profiles/ProfileSource.cs +++ b/src/FanaBridge.Core/Devices/Profiles/ProfileSource.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Devices.Profiles +namespace FanaBridge.Core.Devices.Profiles { /// /// Indicates whether a profile was shipped with the plugin or created by the user. diff --git a/src/FanaBridge.Core/Devices/Profiles/WheelCapabilities.cs b/src/FanaBridge.Core/Devices/Profiles/WheelCapabilities.cs index 5cfbb0af..829dbe00 100644 --- a/src/FanaBridge.Core/Devices/Profiles/WheelCapabilities.cs +++ b/src/FanaBridge.Core/Devices/Profiles/WheelCapabilities.cs @@ -1,6 +1,6 @@ using System.Linq; -namespace FanaBridge.Devices.Profiles +namespace FanaBridge.Core.Devices.Profiles { /// /// Runtime view of a wheel's hardware capabilities, computed from a diff --git a/src/FanaBridge.Core/Devices/Profiles/WheelProfile.cs b/src/FanaBridge.Core/Devices/Profiles/WheelProfile.cs index c8f9d77f..762d03a6 100644 --- a/src/FanaBridge.Core/Devices/Profiles/WheelProfile.cs +++ b/src/FanaBridge.Core/Devices/Profiles/WheelProfile.cs @@ -3,7 +3,7 @@ using System.Linq; using Newtonsoft.Json; -namespace FanaBridge.Devices.Profiles +namespace FanaBridge.Core.Devices.Profiles { /// /// A complete wheel profile — the single source of truth for a device's @@ -104,17 +104,17 @@ public DisplayType DisplayType { if (Enum.TryParse(Display, true, out DisplayType dt)) return dt; - return FanaBridge.Devices.Profiles.DisplayType.None; + return FanaBridge.Core.Devices.Profiles.DisplayType.None; } } /// /// ITM display wire id (which device the wheel's ITM screen is: 1 base, 3 wheel OLED, - /// 4 Bentley). Defaults to + /// 4 Bentley). Defaults to /// (3) when omitted — correct for PBME and GTSWX. /// [JsonIgnore] - public byte ItmDeviceId => ItmDeviceIdRaw ?? FanaBridge.Display.Protocol.ItmEncoder.DefaultDeviceId; + public byte ItmDeviceId => ItmDeviceIdRaw ?? FanaBridge.Core.Display.Protocol.ItmEncoder.DefaultDeviceId; /// Total LED count across all channels. [JsonIgnore] diff --git a/src/FanaBridge.Core/Devices/Profiles/WheelProfileStore.cs b/src/FanaBridge.Core/Devices/Profiles/WheelProfileStore.cs index 75ca3c12..8741f145 100644 --- a/src/FanaBridge.Core/Devices/Profiles/WheelProfileStore.cs +++ b/src/FanaBridge.Core/Devices/Profiles/WheelProfileStore.cs @@ -5,7 +5,7 @@ using System.Threading; using Newtonsoft.Json; -namespace FanaBridge.Devices.Profiles +namespace FanaBridge.Core.Devices.Profiles { /// /// Loads definitions and provides lookup by @@ -126,7 +126,7 @@ private static void LoadFromEmbeddedResources( foreach (string resourceName in assembly.GetManifestResourceNames()) { // Embedded resource names follow: {RootNamespace}.{RelativePath}.{filename} - // e.g. "FanaBridge.Resources.Profiles.PSWBMW.json" + // e.g. "FanaBridge.Core.Resources.Profiles.PSWBMW.json" if (!resourceName.EndsWith(".json", StringComparison.OrdinalIgnoreCase)) continue; if (resourceName.IndexOf(".Profiles.", StringComparison.OrdinalIgnoreCase) < 0) diff --git a/src/FanaBridge.Core/Diagnostics/ConverterCaptureProbe.cs b/src/FanaBridge.Core/Diagnostics/ConverterCaptureProbe.cs index d036200a..17301db7 100644 --- a/src/FanaBridge.Core/Diagnostics/ConverterCaptureProbe.cs +++ b/src/FanaBridge.Core/Diagnostics/ConverterCaptureProbe.cs @@ -1,10 +1,10 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using FanaBridge.Devices.Identity; -using FanaBridge.Transport; +using FanaBridge.Core.Devices.Identity; +using FanaBridge.Core.Transport; -namespace FanaBridge.Diagnostics +namespace FanaBridge.Core.Diagnostics { /// /// One-shot, read-only identity capture run at diagnostics time so a SINGLE detection report from diff --git a/src/FanaBridge.Core/Diagnostics/FanatecSoftwareMonitor.cs b/src/FanaBridge.Core/Diagnostics/FanatecSoftwareMonitor.cs index 8776c15d..b3e4a420 100644 --- a/src/FanaBridge.Core/Diagnostics/FanatecSoftwareMonitor.cs +++ b/src/FanaBridge.Core/Diagnostics/FanatecSoftwareMonitor.cs @@ -1,6 +1,6 @@ using System; -namespace FanaBridge.Diagnostics +namespace FanaBridge.Core.Diagnostics { /// /// Detects whether the Fanatec app/service is running alongside FanaBridge. Both drive diff --git a/src/FanaBridge.Core/Display/Catalog/ItmDeviceCatalog.cs b/src/FanaBridge.Core/Display/Catalog/ItmDeviceCatalog.cs index 80a16637..5a516bbc 100644 --- a/src/FanaBridge.Core/Display/Catalog/ItmDeviceCatalog.cs +++ b/src/FanaBridge.Core/Display/Catalog/ItmDeviceCatalog.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; -using FanaBridge.Display.Protocol; +using FanaBridge.Core.Display.Protocol; -namespace FanaBridge.Display.Catalog +namespace FanaBridge.Core.Display.Catalog { /// /// One slot in an ITM device's page set: the on-wire page number, which page content diff --git a/src/FanaBridge.Core/Display/Protocol/DisplayEncoder.cs b/src/FanaBridge.Core/Display/Protocol/DisplayEncoder.cs index dec0ba92..f947977a 100644 --- a/src/FanaBridge.Core/Display/Protocol/DisplayEncoder.cs +++ b/src/FanaBridge.Core/Display/Protocol/DisplayEncoder.cs @@ -1,7 +1,7 @@ using System; -using FanaBridge.Transport; +using FanaBridge.Core.Transport; -namespace FanaBridge.Display.Protocol +namespace FanaBridge.Core.Display.Protocol { /// /// Encodes and sends display control reports for the Fanatec diff --git a/src/FanaBridge.Core/Display/Protocol/ItmEncoder.cs b/src/FanaBridge.Core/Display/Protocol/ItmEncoder.cs index c0420eee..6c7b023b 100644 --- a/src/FanaBridge.Core/Display/Protocol/ItmEncoder.cs +++ b/src/FanaBridge.Core/Display/Protocol/ItmEncoder.cs @@ -2,9 +2,9 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; -using FanaBridge.Transport; +using FanaBridge.Core.Transport; -namespace FanaBridge.Display.Protocol +namespace FanaBridge.Core.Display.Protocol { /// /// A single telemetry value for an ITM ValueUpdate entry (col03 FF 05 01). diff --git a/src/FanaBridge.Core/Display/Protocol/ItmTelemetry.cs b/src/FanaBridge.Core/Display/Protocol/ItmTelemetry.cs index bbe945e9..6c48d006 100644 --- a/src/FanaBridge.Core/Display/Protocol/ItmTelemetry.cs +++ b/src/FanaBridge.Core/Display/Protocol/ItmTelemetry.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; -using FanaBridge.Display.Catalog; -using FanaBridge.Transport; +using FanaBridge.Core.Display.Catalog; +using FanaBridge.Core.Transport; -namespace FanaBridge.Display.Protocol +namespace FanaBridge.Core.Display.Protocol { /// /// A page's content identity — the fixed parameter layout the firmware renders (SPEED diff --git a/src/FanaBridge.Core/Display/Protocol/SevenSegment.cs b/src/FanaBridge.Core/Display/Protocol/SevenSegment.cs index b31cf5ae..e580e3d2 100644 --- a/src/FanaBridge.Core/Display/Protocol/SevenSegment.cs +++ b/src/FanaBridge.Core/Display/Protocol/SevenSegment.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Display.Protocol +namespace FanaBridge.Core.Display.Protocol { /// /// 7-segment display encoding table. diff --git a/src/FanaBridge.Core/Display/Session/ItmLifecycleController.cs b/src/FanaBridge.Core/Display/Session/ItmLifecycleController.cs index a28083e0..1d405f24 100644 --- a/src/FanaBridge.Core/Display/Session/ItmLifecycleController.cs +++ b/src/FanaBridge.Core/Display/Session/ItmLifecycleController.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; -using FanaBridge.Display.Catalog; -using FanaBridge.Display.Protocol; +using FanaBridge.Core.Display.Catalog; +using FanaBridge.Core.Display.Protocol; -namespace FanaBridge.Display.Session +namespace FanaBridge.Core.Display.Session { /// The ITM lifecycle states. See . public enum ItmLifecycleState diff --git a/src/FanaBridge.Core/FanaBridge.Core.csproj b/src/FanaBridge.Core/FanaBridge.Core.csproj index 47b43a93..6a7809fd 100644 --- a/src/FanaBridge.Core/FanaBridge.Core.csproj +++ b/src/FanaBridge.Core/FanaBridge.Core.csproj @@ -3,11 +3,12 @@ net48 Library - - FanaBridge + + FanaBridge.Core FanaBridge.Core FanaBridge device stack (SimHub-free): HID transport, Fanatec protocol, wheel profiles FanaBridge diff --git a/src/FanaBridge.Core/Leds/ColorHelper.cs b/src/FanaBridge.Core/Leds/ColorHelper.cs index 8f97e40a..1e1039d9 100644 --- a/src/FanaBridge.Core/Leds/ColorHelper.cs +++ b/src/FanaBridge.Core/Leds/ColorHelper.cs @@ -1,6 +1,6 @@ using System; -namespace FanaBridge.Leds +namespace FanaBridge.Core.Leds { /// /// RGB color helper with RGB565 conversion and predefined colors. diff --git a/src/FanaBridge.Core/Leds/LedEncoder.cs b/src/FanaBridge.Core/Leds/LedEncoder.cs index 2e22d862..7b897479 100644 --- a/src/FanaBridge.Core/Leds/LedEncoder.cs +++ b/src/FanaBridge.Core/Leds/LedEncoder.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; -using FanaBridge.Transport; +using FanaBridge.Core.Transport; -namespace FanaBridge.Leds +namespace FanaBridge.Core.Leds { /// /// Encodes and sends LED control reports for Fanatec wheels. diff --git a/src/FanaBridge.Core/Leds/LegacyLedEncoder.cs b/src/FanaBridge.Core/Leds/LegacyLedEncoder.cs index c9022839..007d69e2 100644 --- a/src/FanaBridge.Core/Leds/LegacyLedEncoder.cs +++ b/src/FanaBridge.Core/Leds/LegacyLedEncoder.cs @@ -1,7 +1,7 @@ using System; -using FanaBridge.Transport; +using FanaBridge.Core.Transport; -namespace FanaBridge.Leds +namespace FanaBridge.Core.Leds { /// /// Encodes and sends LED control reports for legacy Fanatec wheels diff --git a/src/FanaBridge.Core/Logging/Log.cs b/src/FanaBridge.Core/Logging/Log.cs index 270c20b6..aef07ca2 100644 --- a/src/FanaBridge.Core/Logging/Log.cs +++ b/src/FanaBridge.Core/Logging/Log.cs @@ -1,3 +1,5 @@ +// Exception: namespace FanaBridge (not FanaBridge.Core.Logging) so unqualified Log.* from both assemblies resolves via the shared root ancestor. +#pragma warning disable IDE0130 // Log must live in root FanaBridge so unqualified Log.* resolves from both Core and plugin namespace FanaBridge { /// diff --git a/src/FanaBridge.Core/Transport/Col03Family.cs b/src/FanaBridge.Core/Transport/Col03Family.cs index 6d7b42a0..87aadaa5 100644 --- a/src/FanaBridge.Core/Transport/Col03Family.cs +++ b/src/FanaBridge.Core/Transport/Col03Family.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Transport +namespace FanaBridge.Core.Transport { /// /// The frame families multiplexed on the col03 input endpoint, as routed by diff --git a/src/FanaBridge.Core/Transport/Col03FrameClassifier.cs b/src/FanaBridge.Core/Transport/Col03FrameClassifier.cs index ebe689d8..814108a5 100644 --- a/src/FanaBridge.Core/Transport/Col03FrameClassifier.cs +++ b/src/FanaBridge.Core/Transport/Col03FrameClassifier.cs @@ -1,6 +1,6 @@ -using FanaBridge.Devices.Identity; +using FanaBridge.Core.Devices.Identity; -namespace FanaBridge.Transport +namespace FanaBridge.Core.Transport { /// /// The single home for col03 frame-family wire signatures. The transport's diff --git a/src/FanaBridge.Core/Transport/Col03QueueSet.cs b/src/FanaBridge.Core/Transport/Col03QueueSet.cs index 22a60e76..a6f8b61b 100644 --- a/src/FanaBridge.Core/Transport/Col03QueueSet.cs +++ b/src/FanaBridge.Core/Transport/Col03QueueSet.cs @@ -1,5 +1,5 @@ -namespace FanaBridge.Transport +namespace FanaBridge.Core.Transport { /// /// The per-family input queues behind one col03 connection. The transport's diff --git a/src/FanaBridge.Core/Transport/FanatecTransport.cs b/src/FanaBridge.Core/Transport/FanatecTransport.cs index f29ca2db..bc983b62 100644 --- a/src/FanaBridge.Core/Transport/FanatecTransport.cs +++ b/src/FanaBridge.Core/Transport/FanatecTransport.cs @@ -2,11 +2,11 @@ using System.Linq; using System.Runtime.InteropServices; using System.Threading; -using FanaBridge.Devices; +using FanaBridge.Core.Devices; using HidSharp; using Microsoft.Win32.SafeHandles; -namespace FanaBridge.Transport +namespace FanaBridge.Core.Transport { /// /// HID transport layer for Fanatec wheel hardware. diff --git a/src/FanaBridge.Core/Transport/HidReportQueue.cs b/src/FanaBridge.Core/Transport/HidReportQueue.cs index d9a5b98f..46963afe 100644 --- a/src/FanaBridge.Core/Transport/HidReportQueue.cs +++ b/src/FanaBridge.Core/Transport/HidReportQueue.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Threading; -namespace FanaBridge.Transport +namespace FanaBridge.Core.Transport { /// /// Bounded FIFO of HID input reports, bridging the blocking reader thread to diff --git a/src/FanaBridge.Core/Transport/IConnectableTransport.cs b/src/FanaBridge.Core/Transport/IConnectableTransport.cs index 29bfd877..15decdb2 100644 --- a/src/FanaBridge.Core/Transport/IConnectableTransport.cs +++ b/src/FanaBridge.Core/Transport/IConnectableTransport.cs @@ -1,6 +1,6 @@ using System; -namespace FanaBridge.Transport +namespace FanaBridge.Core.Transport { /// /// The connect-lifecycle surface of a device transport, layered on top of diff --git a/src/FanaBridge.Core/Transport/IDeviceTransport.cs b/src/FanaBridge.Core/Transport/IDeviceTransport.cs index 82578ae3..8eded348 100644 --- a/src/FanaBridge.Core/Transport/IDeviceTransport.cs +++ b/src/FanaBridge.Core/Transport/IDeviceTransport.cs @@ -1,6 +1,6 @@ using System; -namespace FanaBridge.Transport +namespace FanaBridge.Core.Transport { /// /// Low-level HID transport abstraction for all protocol encoders diff --git a/src/FanaBridge.Core/Transport/IHidBusEnumerator.cs b/src/FanaBridge.Core/Transport/IHidBusEnumerator.cs index fb5dc6b3..be093f2f 100644 --- a/src/FanaBridge.Core/Transport/IHidBusEnumerator.cs +++ b/src/FanaBridge.Core/Transport/IHidBusEnumerator.cs @@ -2,7 +2,7 @@ using System.Linq; using HidSharp; -namespace FanaBridge.Transport +namespace FanaBridge.Core.Transport { /// /// A lightweight snapshot of one HID device on the bus, with the descriptor diff --git a/src/FanaBridge.Core/Transport/IReportStream.cs b/src/FanaBridge.Core/Transport/IReportStream.cs index b3debd69..d4e9ddee 100644 --- a/src/FanaBridge.Core/Transport/IReportStream.cs +++ b/src/FanaBridge.Core/Transport/IReportStream.cs @@ -1,6 +1,6 @@ using System; -namespace FanaBridge.Transport +namespace FanaBridge.Core.Transport { /// /// One family of inbound HID reports (e.g. col03 FF 08 identity), fed by the diff --git a/src/FanaBridge.Core/Transport/ReportElicit.cs b/src/FanaBridge.Core/Transport/ReportElicit.cs index 26b715d5..bb1c3ffe 100644 --- a/src/FanaBridge.Core/Transport/ReportElicit.cs +++ b/src/FanaBridge.Core/Transport/ReportElicit.cs @@ -1,6 +1,6 @@ using System; -namespace FanaBridge.Transport +namespace FanaBridge.Core.Transport { /// /// The one request→response primitive over a per-family report stream: diff --git a/src/FanaBridge.Core/Tuning/EncoderMode.cs b/src/FanaBridge.Core/Tuning/EncoderMode.cs index ea2463b8..70d635d5 100644 --- a/src/FanaBridge.Core/Tuning/EncoderMode.cs +++ b/src/FanaBridge.Core/Tuning/EncoderMode.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Tuning +namespace FanaBridge.Core.Tuning { /// /// Encoder operating mode for Fanatec button modules. diff --git a/src/FanaBridge.Core/Tuning/FanatecTuningController.cs b/src/FanaBridge.Core/Tuning/FanatecTuningController.cs index 9a3d340b..17093dd6 100644 --- a/src/FanaBridge.Core/Tuning/FanatecTuningController.cs +++ b/src/FanaBridge.Core/Tuning/FanatecTuningController.cs @@ -1,8 +1,8 @@ using System; using System.Threading; -using FanaBridge.Transport; +using FanaBridge.Core.Transport; -namespace FanaBridge.Tuning +namespace FanaBridge.Core.Tuning { /// /// Manages the Fanatec tuning configuration protocol (col03, cmd class 0x03). diff --git a/src/FanaBridge/BuildIdentity.cs b/src/FanaBridge/BuildIdentity.cs index b47d42c0..4930d994 100644 --- a/src/FanaBridge/BuildIdentity.cs +++ b/src/FanaBridge/BuildIdentity.cs @@ -1,7 +1,7 @@ using System; using System.Reflection; -namespace FanaBridge.Plugin +namespace FanaBridge { /// /// Build identity of the plugin assembly, read from attributes embedded at diff --git a/src/FanaBridge/ControlMapper/ControlMapperBridge.cs b/src/FanaBridge/ControlMapper/ControlMapperBridge.cs index 8016b2d6..e36a2c1e 100644 --- a/src/FanaBridge/ControlMapper/ControlMapperBridge.cs +++ b/src/FanaBridge/ControlMapper/ControlMapperBridge.cs @@ -6,7 +6,7 @@ using System.Text; using SimHub.Plugins.OutputPlugins.ControlRemapper.Variants; -namespace FanaBridge.Plugin.ControlMapper +namespace FanaBridge.ControlMapper { /// /// Reflection plumbing that registers a diff --git a/src/FanaBridge/ControlMapper/FanaBridgeVariantProvider.cs b/src/FanaBridge/ControlMapper/FanaBridgeVariantProvider.cs index acfdbe3f..9314c406 100644 --- a/src/FanaBridge/ControlMapper/FanaBridgeVariantProvider.cs +++ b/src/FanaBridge/ControlMapper/FanaBridgeVariantProvider.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; -using FanaBridge.Devices.Identity; +using FanaBridge.Core.Devices.Identity; using SimHub.Plugins.OutputPlugins.ControlRemapper.Variants; -namespace FanaBridge.Plugin.ControlMapper +namespace FanaBridge.ControlMapper { /// /// Reports the currently-attached Fanatec rim to SimHub's Control Mapper as an @@ -40,7 +40,7 @@ public class FanaBridgeVariantProvider : IVariantProvider /// /// Fanatec USB vendor id (0x0EB7 = 3767). Matches the value the stock /// FanatecVariantProvider gates on, and - /// . + /// . /// public const int FanatecVendorId = 0x0EB7; @@ -77,7 +77,7 @@ public class FanaBridgeVariantProvider : IVariantProvider /// provider, or no variant at all, decide). /// /// Gated on the Fanatec vendor id AND the connected wheelbase's product id - /// (): we only speak for + /// (): we only speak for /// the device we actually have open over HID. A standalone Fanatec peripheral on /// its own PID (pedals, handbrake) — or another Fanatec base we aren't driving — /// is therefore left alone and falls through to SimHub instead of being tagged with diff --git a/src/FanaBridge/Devices/FanatecDevicesRegistry.cs b/src/FanaBridge/Devices/FanatecDevicesRegistry.cs index c98c007a..3a1532a1 100644 --- a/src/FanaBridge/Devices/FanatecDevicesRegistry.cs +++ b/src/FanaBridge/Devices/FanatecDevicesRegistry.cs @@ -1,12 +1,12 @@ using System; using System.Collections.Generic; using System.Linq; -using FanaBridge.Devices.Profiles; -using FanaBridge.Plugin.Settings; -using FanaBridge.Plugin.UI; +using FanaBridge.Core.Devices.Profiles; +using FanaBridge.Settings; +using FanaBridge.UI.Devices; using SimHub.Plugins.Devices; -namespace FanaBridge.Plugin.Devices +namespace FanaBridge.Devices { /// /// Registers one DeviceDescriptor per loaded so each @@ -27,7 +27,7 @@ public class FanatecDevicesRegistry : IDeviceDescriptorsRegistry /// plugin: SimHub shows a device's settings whether or not FanaBridge is /// running. Overridable so tests can build instances without WPF. /// - internal static readonly IDevicePanelFactory PanelFactory = new UI.DevicePanelFactory(); + internal static readonly IDevicePanelFactory PanelFactory = new DevicePanelFactory(); public IEnumerable GetDevices() { diff --git a/src/FanaBridge/Devices/FanatecWheelDeviceInstance.cs b/src/FanaBridge/Devices/FanatecWheelDeviceInstance.cs index a157fd84..a1008e17 100644 --- a/src/FanaBridge/Devices/FanatecWheelDeviceInstance.cs +++ b/src/FanaBridge/Devices/FanatecWheelDeviceInstance.cs @@ -3,20 +3,20 @@ using System.ComponentModel; using System.Linq; using FanaBridge; -using FanaBridge.Devices.Profiles; -using FanaBridge.Display.Session; -using FanaBridge.Plugin.Display; -using FanaBridge.Plugin.Display.Drivers; -using FanaBridge.Plugin.Leds; -using FanaBridge.Plugin.Settings; -using FanaBridge.Plugin.UI; +using FanaBridge.Core.Devices.Profiles; +using FanaBridge.Core.Display.Session; +using FanaBridge.Display; +using FanaBridge.Display.Drivers; +using FanaBridge.Leds; +using FanaBridge.Settings; +using FanaBridge.UI.Devices; using GameReaderCommon; using Newtonsoft.Json.Linq; using SimHub.Plugins; using SimHub.Plugins.Devices; using SimHub.Plugins.OutputPlugins.GraphicalDash.LedModules; -namespace FanaBridge.Plugin.Devices +namespace FanaBridge.Devices { /// /// DeviceInstance for a specific Fanatec wheel type. diff --git a/src/FanaBridge/Devices/SimHubDevicesGateway.cs b/src/FanaBridge/Devices/SimHubDevicesGateway.cs index f2084fe6..ed182b1f 100644 --- a/src/FanaBridge/Devices/SimHubDevicesGateway.cs +++ b/src/FanaBridge/Devices/SimHubDevicesGateway.cs @@ -3,7 +3,7 @@ using SimHub.Plugins; using SimHub.Plugins.Devices; -namespace FanaBridge.Plugin.Devices +namespace FanaBridge.Devices { /// /// Read-and-check access to SimHub's Devices plugin for the settings diff --git a/src/FanaBridge/Diagnostics/DiagnosticsReport.cs b/src/FanaBridge/Diagnostics/DiagnosticsReport.cs index f4335b05..4a9f3fed 100644 --- a/src/FanaBridge/Diagnostics/DiagnosticsReport.cs +++ b/src/FanaBridge/Diagnostics/DiagnosticsReport.cs @@ -1,11 +1,11 @@ using System; using System.Linq; using System.Text; -using FanaBridge.Devices; -using FanaBridge.Diagnostics; +using FanaBridge.Core.Devices; +using FanaBridge.Core.Diagnostics; using HidSharp; -namespace FanaBridge.Plugin.Diagnostics +namespace FanaBridge.Diagnostics { /// /// Builds a human-readable, GitHub-ready snapshot of device detection — the diff --git a/src/FanaBridge/Display/DisplaySettings.cs b/src/FanaBridge/Display/DisplaySettings.cs index cdc7916e..7c1627d6 100644 --- a/src/FanaBridge/Display/DisplaySettings.cs +++ b/src/FanaBridge/Display/DisplaySettings.cs @@ -1,4 +1,4 @@ -namespace FanaBridge.Plugin.Display +namespace FanaBridge.Display { /// /// Type-safe display configuration. diff --git a/src/FanaBridge/Display/Drivers/FanatecDisplayDriver.cs b/src/FanaBridge/Display/Drivers/FanatecDisplayDriver.cs index 5d107b10..3df69521 100644 --- a/src/FanaBridge/Display/Drivers/FanatecDisplayDriver.cs +++ b/src/FanaBridge/Display/Drivers/FanatecDisplayDriver.cs @@ -1,9 +1,9 @@ using System; -using FanaBridge.Display.Protocol; -using FanaBridge.Plugin.Display; +using FanaBridge.Core.Display.Protocol; +using FanaBridge.Display; using GameReaderCommon; -namespace FanaBridge.Plugin.Display.Drivers +namespace FanaBridge.Display.Drivers { /// /// Maps telemetry data to the Fanatec 3-digit 7-segment display. diff --git a/src/FanaBridge/Display/Drivers/ItmDisplayDriver.cs b/src/FanaBridge/Display/Drivers/ItmDisplayDriver.cs index ddebdb89..5ae602b9 100644 --- a/src/FanaBridge/Display/Drivers/ItmDisplayDriver.cs +++ b/src/FanaBridge/Display/Drivers/ItmDisplayDriver.cs @@ -1,10 +1,10 @@ using System; using System.Collections.Generic; -using FanaBridge.Display.Protocol; -using FanaBridge.Display.Session; +using FanaBridge.Core.Display.Protocol; +using FanaBridge.Core.Display.Session; using GameReaderCommon; -namespace FanaBridge.Plugin.Display.Drivers +namespace FanaBridge.Display.Drivers { /// /// Drives a Fanatec ITM telemetry display: maps SimHub telemetry to the parameters the diff --git a/src/FanaBridge/Display/Drivers/ItmTelemetryMapper.cs b/src/FanaBridge/Display/Drivers/ItmTelemetryMapper.cs index f818c048..e34f733c 100644 --- a/src/FanaBridge/Display/Drivers/ItmTelemetryMapper.cs +++ b/src/FanaBridge/Display/Drivers/ItmTelemetryMapper.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; -using FanaBridge.Display.Protocol; +using FanaBridge.Core.Display.Protocol; using GameReaderCommon; -namespace FanaBridge.Plugin.Display.Drivers +namespace FanaBridge.Display.Drivers { /// /// Maps SimHub telemetry to encoded entries diff --git a/src/FanaBridge/FanatecPlugin.cs b/src/FanaBridge/FanatecPlugin.cs index ba01e0b5..5825be24 100644 --- a/src/FanaBridge/FanatecPlugin.cs +++ b/src/FanaBridge/FanatecPlugin.cs @@ -4,19 +4,18 @@ using System.Threading.Tasks; using System.Windows.Media; using System.Windows.Media.Imaging; +using FanaBridge.Core.Devices; +using FanaBridge.Core.Devices.Profiles; +using FanaBridge.Core.Display.Protocol; +using FanaBridge.Core.Leds; +using FanaBridge.ControlMapper; using FanaBridge.Devices; -using FanaBridge.Devices.Profiles; -using FanaBridge.Display.Protocol; -using FanaBridge.Leds; -using FanaBridge.Plugin; -using FanaBridge.Plugin.ControlMapper; -using FanaBridge.Plugin.Devices; -using FanaBridge.Plugin.Diagnostics; -using FanaBridge.Plugin.Settings; -using FanaBridge.Plugin.UI; -using FanaBridge.Plugin.Updates; -using FanaBridge.Transport; -using FanaBridge.Tuning; +using FanaBridge.Diagnostics; +using FanaBridge.Settings; +using FanaBridge.UI.Settings; +using FanaBridge.Updates; +using FanaBridge.Core.Transport; +using FanaBridge.Core.Tuning; using FanaBridge.Updater; using GameReaderCommon; using SimHub.Plugins; @@ -271,8 +270,8 @@ public string GetConnectedWheelDisplayName() // Detects the vendor's app/service running alongside FanaBridge — the same // display, no arbitration, so it's a warning the user needs to see instead of // chasing phantom ITM flicker. TTL-cached; edges are logged once. - private readonly Diagnostics.FanatecSoftwareMonitor _fanatecSoftware = - new Diagnostics.FanatecSoftwareMonitor( + private readonly Core.Diagnostics.FanatecSoftwareMonitor _fanatecSoftware = + new Core.Diagnostics.FanatecSoftwareMonitor( log: msg => SimHub.Logging.Current.Warn("FanaBridge: " + msg)); /// diff --git a/src/FanaBridge/Leds/FanatecLedDriver.cs b/src/FanaBridge/Leds/FanatecLedDriver.cs index b7e97432..8fd5b9eb 100644 --- a/src/FanaBridge/Leds/FanatecLedDriver.cs +++ b/src/FanaBridge/Leds/FanatecLedDriver.cs @@ -5,10 +5,10 @@ using BA63Driver.Base; using BA63Driver.Interfaces; using BA63Driver.Mapper; -using FanaBridge.Devices.Profiles; -using FanaBridge.Leds; +using FanaBridge.Core.Devices.Profiles; +using FanaBridge.Core.Leds; -namespace FanaBridge.Plugin.Leds +namespace FanaBridge.Leds { /// /// Unified BA63-compatible driver for all Fanatec LED types. diff --git a/src/FanaBridge/Leds/FanatecLedManager.cs b/src/FanaBridge/Leds/FanatecLedManager.cs index 76905f3f..cf20b408 100644 --- a/src/FanaBridge/Leds/FanatecLedManager.cs +++ b/src/FanaBridge/Leds/FanatecLedManager.cs @@ -1,8 +1,8 @@ using System; -using FanaBridge.Devices.Profiles; +using FanaBridge.Core.Devices.Profiles; using SimHub.Plugins.OutputPlugins.GraphicalDash.PSE; -namespace FanaBridge.Plugin.Leds +namespace FanaBridge.Leds { /// /// Bridges into SimHub's diff --git a/src/FanaBridge/Leds/FanatecLedModuleHost.cs b/src/FanaBridge/Leds/FanatecLedModuleHost.cs index 9a6f84ed..5b35ccac 100644 --- a/src/FanaBridge/Leds/FanatecLedModuleHost.cs +++ b/src/FanaBridge/Leds/FanatecLedModuleHost.cs @@ -2,14 +2,14 @@ using System.Collections.Generic; using System.Linq; using System.Windows.Controls; -using FanaBridge.Devices; -using FanaBridge.Devices.Profiles; +using FanaBridge.Core.Devices; +using FanaBridge.Core.Devices.Profiles; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using SimHub.Plugins; using SimHub.Plugins.OutputPlugins.GraphicalDash.LedModules; -namespace FanaBridge.Plugin.Leds +namespace FanaBridge.Leds { /// /// The real LED settings module, built from registered (override-resolved) @@ -51,7 +51,7 @@ public FanatecLedModuleHost( // resolves capabilities when the tab is opened, so it reflects // the wheel that is actually connected. ExtraSettingsControlFactory = - _ => new UI.LedColorLimitationNotice(currentCapabilities), + _ => new UI.Devices.LedColorLimitationNotice(currentCapabilities), }; _module = new LedModuleSettings(options) diff --git a/src/FanaBridge/Leds/IFanatecLedModuleHost.cs b/src/FanaBridge/Leds/IFanatecLedModuleHost.cs index da22e535..4ce298f1 100644 --- a/src/FanaBridge/Leds/IFanatecLedModuleHost.cs +++ b/src/FanaBridge/Leds/IFanatecLedModuleHost.cs @@ -1,11 +1,11 @@ using System; using System.Collections.Generic; using System.Windows.Controls; -using FanaBridge.Devices.Profiles; +using FanaBridge.Core.Devices.Profiles; using Newtonsoft.Json.Linq; using SimHub.Plugins; -namespace FanaBridge.Plugin.Leds +namespace FanaBridge.Leds { /// /// The LED settings module, behind an interface so persistence is testable diff --git a/src/FanaBridge/Leds/NoLedModuleHost.cs b/src/FanaBridge/Leds/NoLedModuleHost.cs index a0ed2fb6..17c8f53f 100644 --- a/src/FanaBridge/Leds/NoLedModuleHost.cs +++ b/src/FanaBridge/Leds/NoLedModuleHost.cs @@ -1,11 +1,11 @@ using System.Collections.Generic; using System.Linq; using System.Windows.Controls; -using FanaBridge.Devices.Profiles; +using FanaBridge.Core.Devices.Profiles; using Newtonsoft.Json.Linq; using SimHub.Plugins; -namespace FanaBridge.Plugin.Leds +namespace FanaBridge.Leds { /// /// Stands in for the LED module on devices whose registered capabilities diff --git a/src/FanaBridge/Logging/SimHubLogSink.cs b/src/FanaBridge/Logging/SimHubLogSink.cs index 4273b77a..9140c840 100644 --- a/src/FanaBridge/Logging/SimHubLogSink.cs +++ b/src/FanaBridge/Logging/SimHubLogSink.cs @@ -1,6 +1,6 @@ using System.Runtime.CompilerServices; -namespace FanaBridge +namespace FanaBridge.Logging { /// Forwards the core's seam to SimHub's logger. internal sealed class SimHubLogSink : ILogSink @@ -23,11 +23,3 @@ internal static class CoreLogBridge internal static void Install() => Log.Sink = new SimHubLogSink(); } } - -// The C# 9 module-initializer feature is compiler-only; net48 just lacks the -// attribute type. Declaring it internally is the standard polyfill. -namespace System.Runtime.CompilerServices -{ - [AttributeUsage(AttributeTargets.Method, Inherited = false)] - internal sealed class ModuleInitializerAttribute : Attribute { } -} diff --git a/src/FanaBridge/Properties/ModuleInitializerAttribute.cs b/src/FanaBridge/Properties/ModuleInitializerAttribute.cs new file mode 100644 index 00000000..55fa1e36 --- /dev/null +++ b/src/FanaBridge/Properties/ModuleInitializerAttribute.cs @@ -0,0 +1,10 @@ +// net48 polyfill for the C# 9 module-initializer attribute (compiler-only; type missing on TFM). +// Exception to directory/namespace literalness: System.Runtime.CompilerServices by definition. +#pragma warning disable IDE0130 // Polyfill attribute must live in System.Runtime.CompilerServices by definition +using System; + +namespace System.Runtime.CompilerServices +{ + [AttributeUsage(AttributeTargets.Method, Inherited = false)] + internal sealed class ModuleInitializerAttribute : Attribute { } +} diff --git a/src/FanaBridge/Settings/FanatecDeviceSettings.cs b/src/FanaBridge/Settings/FanatecDeviceSettings.cs index 65adb78e..c2d315c5 100644 --- a/src/FanaBridge/Settings/FanatecDeviceSettings.cs +++ b/src/FanaBridge/Settings/FanatecDeviceSettings.cs @@ -1,12 +1,12 @@ using System; using System.Collections.Generic; using System.Linq; -using FanaBridge.Devices.Profiles; -using FanaBridge.Plugin.Display; -using FanaBridge.Plugin.Leds; +using FanaBridge.Core.Devices.Profiles; +using FanaBridge.Display; +using FanaBridge.Leds; using Newtonsoft.Json.Linq; -namespace FanaBridge.Plugin.Settings +namespace FanaBridge.Settings { /// /// Owns everything a device persists: FanaBridge's own settings, the LED diff --git a/src/FanaBridge/Settings/FanatecPluginSettings.cs b/src/FanaBridge/Settings/FanatecPluginSettings.cs index b46c1a34..f6d4f339 100644 --- a/src/FanaBridge/Settings/FanatecPluginSettings.cs +++ b/src/FanaBridge/Settings/FanatecPluginSettings.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace FanaBridge.Plugin.Settings +namespace FanaBridge.Settings { /// /// Plugin settings. Must be JSON-serializable (public fields/properties, no complex types). diff --git a/src/FanaBridge/Settings/FanatecSettingsSnapshot.cs b/src/FanaBridge/Settings/FanatecSettingsSnapshot.cs index f45d8a49..54f919ba 100644 --- a/src/FanaBridge/Settings/FanatecSettingsSnapshot.cs +++ b/src/FanaBridge/Settings/FanatecSettingsSnapshot.cs @@ -1,7 +1,7 @@ -using FanaBridge.Plugin.Display; +using FanaBridge.Display; using Newtonsoft.Json.Linq; -namespace FanaBridge.Plugin.Settings +namespace FanaBridge.Settings { /// /// The FanaBridge-owned settings of one device, as an immutable value. diff --git a/src/FanaBridge/Settings/PersistedPluginSettings.cs b/src/FanaBridge/Settings/PersistedPluginSettings.cs index e564e52e..3e250e7b 100644 --- a/src/FanaBridge/Settings/PersistedPluginSettings.cs +++ b/src/FanaBridge/Settings/PersistedPluginSettings.cs @@ -3,7 +3,7 @@ using System.IO; using Newtonsoft.Json.Linq; -namespace FanaBridge.Plugin.Settings +namespace FanaBridge.Settings { /// /// Reads the plugin's persisted settings without a running plugin. diff --git a/src/FanaBridge/UI/DevicePanelFactory.cs b/src/FanaBridge/UI/Devices/DevicePanelFactory.cs similarity index 83% rename from src/FanaBridge/UI/DevicePanelFactory.cs rename to src/FanaBridge/UI/Devices/DevicePanelFactory.cs index ff68a541..4a3da7d7 100644 --- a/src/FanaBridge/UI/DevicePanelFactory.cs +++ b/src/FanaBridge/UI/Devices/DevicePanelFactory.cs @@ -1,10 +1,11 @@ using System; using System.Windows.Controls; -using FanaBridge.Devices.Profiles; -using FanaBridge.Plugin.Display; -using FanaBridge.Plugin.Settings; +using FanaBridge.Core.Devices.Profiles; +using FanaBridge.Display; +using FanaBridge.Settings; +using FanaBridge.UI.Settings; -namespace FanaBridge.Plugin.UI +namespace FanaBridge.UI.Devices { /// UI-side implementation of the device settings-panel factory. internal sealed class DevicePanelFactory : IDevicePanelFactory diff --git a/src/FanaBridge/UI/IDevicePanelFactory.cs b/src/FanaBridge/UI/Devices/IDevicePanelFactory.cs similarity index 87% rename from src/FanaBridge/UI/IDevicePanelFactory.cs rename to src/FanaBridge/UI/Devices/IDevicePanelFactory.cs index 69cc3cf3..d2a58a3b 100644 --- a/src/FanaBridge/UI/IDevicePanelFactory.cs +++ b/src/FanaBridge/UI/Devices/IDevicePanelFactory.cs @@ -1,10 +1,10 @@ using System; using System.Windows.Controls; -using FanaBridge.Devices.Profiles; -using FanaBridge.Plugin.Display; -using FanaBridge.Plugin.Settings; +using FanaBridge.Core.Devices.Profiles; +using FanaBridge.Display; +using FanaBridge.Settings; -namespace FanaBridge.Plugin.UI +namespace FanaBridge.UI.Devices { /// /// Constructs the per-device WPF settings panels. diff --git a/src/FanaBridge/UI/LedColorLimitationNotice.xaml b/src/FanaBridge/UI/Devices/LedColorLimitationNotice.xaml similarity index 95% rename from src/FanaBridge/UI/LedColorLimitationNotice.xaml rename to src/FanaBridge/UI/Devices/LedColorLimitationNotice.xaml index 938fbd6b..150df6d3 100644 --- a/src/FanaBridge/UI/LedColorLimitationNotice.xaml +++ b/src/FanaBridge/UI/Devices/LedColorLimitationNotice.xaml @@ -1,4 +1,4 @@ -