OneDriver.Framework
1.4.0
See the version list below for details.
dotnet add package OneDriver.Framework --version 1.4.0
NuGet\Install-Package OneDriver.Framework -Version 1.4.0
<PackageReference Include="OneDriver.Framework" Version="1.4.0" />
<PackageVersion Include="OneDriver.Framework" Version="1.4.0" />
<PackageReference Include="OneDriver.Framework" />
paket add OneDriver.Framework --version 1.4.0
#r "nuget: OneDriver.Framework, 1.4.0"
#:package OneDriver.Framework@1.4.0
#addin nuget:?package=OneDriver.Framework&version=1.4.0
#tool nuget:?package=OneDriver.Framework&version=1.4.0
OneDriver.Framework
Version: v1.040
Release Date: April 2025
Overview
OneDriver.Framework is a modular and extensible C# library designed to abstract and unify the implementation of hardware drivers for measurement instruments and automation systems. It establishes a standardized approach for devices, parameters, validation, channels, and process data, making it easier to extend support for various protocols and device types.
This release lays the foundation for cross-domain drivers such as power supplies, IO-Link masters, Modbus interfaces, and other sensor/actuator controllers.
๐งฑ Project Structure
Module Layer
The core abstractions for devices, parameters, channels, and process data.Validator Layer
Pluggable validation logic for device connection strings or other input formats.PowerSupply.Abstract
An example of a concrete domain-specific implementation extending the base framework.
โจ Core Concepts
Devices
BaseDevice<TParams>
is the base class for any hardware abstraction. It includes lifecycle methods like Connect()
and Disconnect()
, with parameter validation support via the IValidator
interface.
Derived examples:
BaseDeviceWithChannels<TDeviceParams, TChannelParams>
BaseDeviceWithProcessData<TParams, TProcessData>
Parameters
All device and channel parameters derive from BaseDeviceParam
and BaseChannelParam
, using PropertyHandlers
to support reactive property handling and dynamic access.
Validation
The IValidator
interface defines the validation logic for device-specific initialization strings.
Example: ComportValidator
uses regex to validate serial port strings like COM3;9600
.
Channels
Channels are managed via collections (ObservableCollection<BaseChannel<T>>
) and extended to handle both static and dynamic process data.
Process Data
BaseProcessData
provides timestamped and extendable structures for runtime measurement values, logs, or state snapshots. Works with data tunnel to fire events for continuously updating process data.
๐ฆ Namespaces
OneDriver.Framework.Base
โ Base property managementOneDriver.Framework.Module
โ Core device abstractionsOneDriver.Framework.Module.Parameter
โ Parameter modelsOneDriver.Framework.Libs.Validator
โ ValidatorsOneDriver.Framework.ModuleBuilder
โ Process data interfacesOneDriver.PowerSupply.Abstract
โ Example device domain
๐ Example: Power Supply Abstraction
public abstract class CommonDevice<TDeviceParams, TChannelParams, TChannelProcessData> :
BaseDeviceWithChannelsPd<TDeviceParams, TChannelParams, TChannelProcessData>, IPowerSupply
Implements:
SetVolts()
,SetAmps()
AllChannelsOn()
,AllChannelsOff()
Parameters like MaxVolts
, DesiredVolts
, ControlMode
are managed through CommonDeviceParams
and CommonChannelParams
.
โ Getting Started
- Create your device-specific
Params
classes by extendingBaseDeviceParam
andBaseChannelParam
. - Implement a validator using
IValidator
. - Extend
BaseDevice
or its variants. - Plug your device class into your app or service layer.
- Write unit tests to validate behavior.
๐ ๏ธ Build and Compatibility
- Framework: .NET 8.0
- IDE: Visual Studio 2022+
- OS Support: Windows, Linux (cross-platform)
๐ License
MIT License โ See LICENSE
file.
๐งช Tests
This framework is designed with testability in mind. Use xUnit or your preferred testing framework to mock and test device behavior.
๐ Future Plans
- IO-Link master device abstraction
- CANopen and Modbus master implementation
- gRPC-based remote access to
IDevice
-derived objects - Graphical interface for parameter management
๐ Contributions
We welcome contributions. Please open issues or pull requests with proposed improvements or additional protocol support.
๐จโ๐ป Author
Rahul Bajaj
ยฉ 2025 OneDriver Project
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Newtonsoft.Json (>= 13.0.3)
- Serilog (>= 4.2.0)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on OneDriver.Framework:
Package | Downloads |
---|---|
OneDriver.PowerSupply.Abstract
Package Description |
|
DeviceDescriptor.Abstract
Package Description |
|
OneDriver.Master.Abstract
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.