From c123dd54bb778211cbc1e82e0e28485dba7c24ae Mon Sep 17 00:00:00 2001 From: glopesdev Date: Sat, 27 Jul 2024 22:29:21 +0100 Subject: [PATCH 1/4] Update package dependencies --- .../OpenEphys.Onix.Design/OpenEphys.Onix.Design.csproj | 4 ---- OpenEphys.Onix/OpenEphys.Onix/OpenEphys.Onix.csproj | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/OpenEphys.Onix/OpenEphys.Onix.Design/OpenEphys.Onix.Design.csproj b/OpenEphys.Onix/OpenEphys.Onix.Design/OpenEphys.Onix.Design.csproj index 2f8e34b8..31c8aa5d 100644 --- a/OpenEphys.Onix/OpenEphys.Onix.Design/OpenEphys.Onix.Design.csproj +++ b/OpenEphys.Onix/OpenEphys.Onix.Design/OpenEphys.Onix.Design.csproj @@ -9,10 +9,6 @@ 0.1.0 - - - - diff --git a/OpenEphys.Onix/OpenEphys.Onix/OpenEphys.Onix.csproj b/OpenEphys.Onix/OpenEphys.Onix/OpenEphys.Onix.csproj index 43be3221..58ae775d 100644 --- a/OpenEphys.Onix/OpenEphys.Onix/OpenEphys.Onix.csproj +++ b/OpenEphys.Onix/OpenEphys.Onix/OpenEphys.Onix.csproj @@ -11,8 +11,8 @@ - - + + From 391ad2bbc1cdb30e2fdf22f6dd01c2a192936d56 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Sat, 27 Jul 2024 22:56:06 +0100 Subject: [PATCH 2/4] Unify processor architecture --- .../OpenEphys.Onix.Design.csproj | 1 + OpenEphys.Onix/OpenEphys.Onix.sln | 30 ++++--------------- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/OpenEphys.Onix/OpenEphys.Onix.Design/OpenEphys.Onix.Design.csproj b/OpenEphys.Onix/OpenEphys.Onix.Design/OpenEphys.Onix.Design.csproj index 31c8aa5d..1c7a5196 100644 --- a/OpenEphys.Onix/OpenEphys.Onix.Design/OpenEphys.Onix.Design.csproj +++ b/OpenEphys.Onix/OpenEphys.Onix.Design/OpenEphys.Onix.Design.csproj @@ -7,6 +7,7 @@ net472 true 0.1.0 + x64 diff --git a/OpenEphys.Onix/OpenEphys.Onix.sln b/OpenEphys.Onix/OpenEphys.Onix.sln index e63035c6..c47792d3 100644 --- a/OpenEphys.Onix/OpenEphys.Onix.sln +++ b/OpenEphys.Onix/OpenEphys.Onix.sln @@ -5,7 +5,7 @@ VisualStudioVersion = 17.3.32825.248 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenEphys.Onix", "OpenEphys.Onix\OpenEphys.Onix.csproj", "{353B1EBC-F8EB-4D99-8331-9FF15EC17F38}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenEphys.Onix.Design", "OpenEphys.Onix.Design\OpenEphys.Onix.Design.csproj", "{149E86EC-B865-463D-81A8-8290CA7F8871}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenEphys.Onix.Design", "OpenEphys.Onix.Design\OpenEphys.Onix.Design.csproj", "{149E86EC-B865-463D-81A8-8290CA7F8871}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F8644FAC-94E5-4E73-B809-925ABABE35B1}" ProjectSection(SolutionItems) = preProject @@ -14,38 +14,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|ARM64 = Debug|ARM64 Debug|x64 = Debug|x64 - Release|Any CPU = Release|Any CPU - Release|ARM64 = Release|ARM64 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {353B1EBC-F8EB-4D99-8331-9FF15EC17F38}.Debug|Any CPU.ActiveCfg = Debug|x64 - {353B1EBC-F8EB-4D99-8331-9FF15EC17F38}.Debug|Any CPU.Build.0 = Debug|x64 - {353B1EBC-F8EB-4D99-8331-9FF15EC17F38}.Debug|ARM64.ActiveCfg = Debug|x64 - {353B1EBC-F8EB-4D99-8331-9FF15EC17F38}.Debug|ARM64.Build.0 = Debug|x64 {353B1EBC-F8EB-4D99-8331-9FF15EC17F38}.Debug|x64.ActiveCfg = Debug|x64 {353B1EBC-F8EB-4D99-8331-9FF15EC17F38}.Debug|x64.Build.0 = Debug|x64 - {353B1EBC-F8EB-4D99-8331-9FF15EC17F38}.Release|Any CPU.ActiveCfg = Release|x64 - {353B1EBC-F8EB-4D99-8331-9FF15EC17F38}.Release|Any CPU.Build.0 = Release|x64 - {353B1EBC-F8EB-4D99-8331-9FF15EC17F38}.Release|ARM64.ActiveCfg = Release|ARM64 - {353B1EBC-F8EB-4D99-8331-9FF15EC17F38}.Release|ARM64.Build.0 = Release|ARM64 {353B1EBC-F8EB-4D99-8331-9FF15EC17F38}.Release|x64.ActiveCfg = Release|x64 {353B1EBC-F8EB-4D99-8331-9FF15EC17F38}.Release|x64.Build.0 = Release|x64 - {149E86EC-B865-463D-81A8-8290CA7F8871}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {149E86EC-B865-463D-81A8-8290CA7F8871}.Debug|Any CPU.Build.0 = Debug|Any CPU - {149E86EC-B865-463D-81A8-8290CA7F8871}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {149E86EC-B865-463D-81A8-8290CA7F8871}.Debug|ARM64.Build.0 = Debug|Any CPU - {149E86EC-B865-463D-81A8-8290CA7F8871}.Debug|x64.ActiveCfg = Debug|Any CPU - {149E86EC-B865-463D-81A8-8290CA7F8871}.Debug|x64.Build.0 = Debug|Any CPU - {149E86EC-B865-463D-81A8-8290CA7F8871}.Release|Any CPU.ActiveCfg = Release|Any CPU - {149E86EC-B865-463D-81A8-8290CA7F8871}.Release|Any CPU.Build.0 = Release|Any CPU - {149E86EC-B865-463D-81A8-8290CA7F8871}.Release|ARM64.ActiveCfg = Release|Any CPU - {149E86EC-B865-463D-81A8-8290CA7F8871}.Release|ARM64.Build.0 = Release|Any CPU - {149E86EC-B865-463D-81A8-8290CA7F8871}.Release|x64.ActiveCfg = Release|Any CPU - {149E86EC-B865-463D-81A8-8290CA7F8871}.Release|x64.Build.0 = Release|Any CPU + {149E86EC-B865-463D-81A8-8290CA7F8871}.Debug|x64.ActiveCfg = Debug|x64 + {149E86EC-B865-463D-81A8-8290CA7F8871}.Debug|x64.Build.0 = Debug|x64 + {149E86EC-B865-463D-81A8-8290CA7F8871}.Release|x64.ActiveCfg = Release|x64 + {149E86EC-B865-463D-81A8-8290CA7F8871}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 56e026cfff15ee4366be4841d9bb12f85b6c8c32 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Sat, 27 Jul 2024 22:59:46 +0100 Subject: [PATCH 3/4] Remove unused configuration operator for DS90UB9x --- .../{ConfigureDS90UB9x.cs => DS90UB9x.cs} | 30 +------------------ 1 file changed, 1 insertion(+), 29 deletions(-) rename OpenEphys.Onix/OpenEphys.Onix/{ConfigureDS90UB9x.cs => DS90UB9x.cs} (73%) diff --git a/OpenEphys.Onix/OpenEphys.Onix/ConfigureDS90UB9x.cs b/OpenEphys.Onix/OpenEphys.Onix/DS90UB9x.cs similarity index 73% rename from OpenEphys.Onix/OpenEphys.Onix/ConfigureDS90UB9x.cs rename to OpenEphys.Onix/OpenEphys.Onix/DS90UB9x.cs index 67bcae7b..a00c4d6c 100644 --- a/OpenEphys.Onix/OpenEphys.Onix/ConfigureDS90UB9x.cs +++ b/OpenEphys.Onix/OpenEphys.Onix/DS90UB9x.cs @@ -1,33 +1,5 @@ -using System; -using System.ComponentModel; - -namespace OpenEphys.Onix +namespace OpenEphys.Onix { - public class ConfigureDS90UB9x : SingleDeviceFactory - { - public ConfigureDS90UB9x() - : base(typeof(DS90UB9x)) - { - } - - [Category(ConfigurationCategory)] - [Description("Specifies whether the DS90UB9x raw device is enabled.")] - public bool Enable { get; set; } = true; - - public override IObservable Process(IObservable source) - { - var enable = Enable; - var deviceName = DeviceName; - var deviceAddress = DeviceAddress; - return source.ConfigureDevice(context => - { - var device = context.GetDeviceContext(deviceAddress, DeviceType); - device.WriteRegister(DS90UB9x.ENABLE, enable ? 1u : 0); - return DeviceManager.RegisterDevice(deviceName, device, DeviceType); - }); - } - } - static class DS90UB9x { public const int ID = 24; From 7bdb036eb4ecc053556d0d650fea5a23039bb302 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Sat, 27 Jul 2024 23:31:10 +0100 Subject: [PATCH 4/4] Avoid exposing internal implementation classes --- .../ConfigureFmcLinkController.cs | 32 +++++++++++-------- .../OpenEphys.Onix/DeviceContext.cs | 2 +- .../OpenEphys.Onix/HubConfiguration.cs | 8 ----- 3 files changed, 20 insertions(+), 22 deletions(-) delete mode 100644 OpenEphys.Onix/OpenEphys.Onix/HubConfiguration.cs diff --git a/OpenEphys.Onix/OpenEphys.Onix/ConfigureFmcLinkController.cs b/OpenEphys.Onix/OpenEphys.Onix/ConfigureFmcLinkController.cs index 93f579d9..64ecb457 100644 --- a/OpenEphys.Onix/OpenEphys.Onix/ConfigureFmcLinkController.cs +++ b/OpenEphys.Onix/OpenEphys.Onix/ConfigureFmcLinkController.cs @@ -5,7 +5,7 @@ namespace OpenEphys.Onix { - public abstract class ConfigureFmcLinkController : SingleDeviceFactory + internal abstract class ConfigureFmcLinkController : SingleDeviceFactory { public ConfigureFmcLinkController() : base(typeof(FmcLinkController)) @@ -73,20 +73,26 @@ public override IObservable Process(IObservable source return DeviceManager.RegisterDevice(deviceName, deviceInfo); }); } + } - internal static class FmcLinkController - { - public const int ID = 23; + internal static class FmcLinkController + { + public const int ID = 23; - public const uint ENABLE = 0; // The LSB is used to enable or disable the device data stream - public const uint GPOSTATE = 1; // GPO output state (bits 31 downto 3: ignore. bits 2 downto 0: ‘1’ = high, ‘0’ = low) - public const uint DESPWR = 2; // Set link deserializer PDB state, 0 = deserializer power off else on. Does not affect port voltage. - public const uint PORTVOLTAGE = 3; // 10 * link voltage - public const uint SAVEVOLTAGE = 4; // Save link voltage to non-volatile EEPROM if greater than 0. This voltage will be applied after POR. - public const uint LINKSTATE = 5; // bit 1 pass; bit 0 lock + public const uint ENABLE = 0; // The LSB is used to enable or disable the device data stream + public const uint GPOSTATE = 1; // GPO output state (bits 31 downto 3: ignore. bits 2 downto 0: ‘1’ = high, ‘0’ = low) + public const uint DESPWR = 2; // Set link deserializer PDB state, 0 = deserializer power off else on. Does not affect port voltage. + public const uint PORTVOLTAGE = 3; // 10 * link voltage + public const uint SAVEVOLTAGE = 4; // Save link voltage to non-volatile EEPROM if greater than 0. This voltage will be applied after POR. + public const uint LINKSTATE = 5; // bit 1 pass; bit 0 lock - public const uint LINKSTATE_PP = 0x2; // parity check pass bit - public const uint LINKSTATE_SL = 0x1; // SERDES lock bit - } + public const uint LINKSTATE_PP = 0x2; // parity check pass bit + public const uint LINKSTATE_SL = 0x1; // SERDES lock bit + } + + internal enum HubConfiguration + { + Standard, + Passthrough } } diff --git a/OpenEphys.Onix/OpenEphys.Onix/DeviceContext.cs b/OpenEphys.Onix/OpenEphys.Onix/DeviceContext.cs index 6102d1b2..f8c4753c 100644 --- a/OpenEphys.Onix/OpenEphys.Onix/DeviceContext.cs +++ b/OpenEphys.Onix/OpenEphys.Onix/DeviceContext.cs @@ -2,7 +2,7 @@ namespace OpenEphys.Onix { - public class DeviceContext + internal class DeviceContext { readonly ContextTask _context; readonly oni.Device _device; diff --git a/OpenEphys.Onix/OpenEphys.Onix/HubConfiguration.cs b/OpenEphys.Onix/OpenEphys.Onix/HubConfiguration.cs deleted file mode 100644 index 3d2f4e40..00000000 --- a/OpenEphys.Onix/OpenEphys.Onix/HubConfiguration.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace OpenEphys.Onix -{ - public enum HubConfiguration - { - Standard, - Passthrough - } -}