TGateway.NOAOTPROPlugin 2.3.2

dotnet add package TGateway.NOAOTPROPlugin --version 2.3.2
                    
NuGet\Install-Package TGateway.NOAOTPROPlugin -Version 2.3.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TGateway.NOAOTPROPlugin" Version="2.3.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TGateway.NOAOTPROPlugin" Version="2.3.2" />
                    
Directory.Packages.props
<PackageReference Include="TGateway.NOAOTPROPlugin" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TGateway.NOAOTPROPlugin --version 2.3.2
                    
#r "nuget: TGateway.NOAOTPROPlugin, 2.3.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TGateway.NOAOTPROPlugin@2.3.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TGateway.NOAOTPROPlugin&version=2.3.2
                    
Install as a Cake Addin
#tool nuget:?package=TGateway.NOAOTPROPlugin&version=2.3.2
                    
Install as a Cake Tool

TGateway.PRO

TGateway.PRO 是 TGateway 的扩展协议和行业驱动项目。它复用开源运行时的插件模型、权限模型、调试服务和源生成器,不提供独立宿主,需要与同级 TGateway 一起构建和部署。

项目组成

模块 路径 说明
PRO 驱动基础 src/TGateway.NOAOTPROFoundation 行业协议报文、设备客户端、数据类型和底层通信实现
PRO 插件 src/TGateway.NOAOTPROPlugin 采集插件、转发插件、调试 API、权限和本地化资源
自动化测试 test/TGateway.PROTest 协议解析、驱动行为、并发、安全和配置测试

协议与插件

当前源码包含以下协议族和设备类型:

  • Allen-Bradley ControlLogix 与 PCCC。
  • CAN、DCON、EDPF-NT、HJ212。
  • IEC 104 从站、IEC 61850 客户端/服务端和 SOE 事件。
  • 汇川、凯利德、LKSIS、台信、TS550、Vigor。
  • 三菱 1E/3E、欧姆龙 FINS、Modbus C1/C20。
  • SECS、USB 扫码器和 ZeroMQ。

具体能力以 src/TGateway.NOAOTPROPlugin/Plugin 下的当前插件为准。采集插件继承 Runtime 的 CollectBase 体系,协议服务或转发插件继承 DataForwardBase 体系,并复用统一的动态属性和权限元数据。

依赖关系

TGateway.NOAOTPROPlugin
|-- TGateway.Application
|-- TGateway.Plugin
|-- TGateway.NOAOTFoundation
|-- TGateway.NOAOTPROFoundation
`-- TGateway.PluginsGenerator

在完整工作区中,项目会直接引用同级 Runtime 与 TAdmin 源码。单独打包时则按项目文件中声明的当前 NuGet 版本解析依赖。

构建

推荐从 TGateway 目录构建聚合解决方案:

dotnet restore TGateway.slnx
dotnet build TGateway.slnx -c Release

只构建 PRO 插件:

dotnet build TGateway.PRO/src/TGateway.NOAOTPROPlugin/TGateway.NOAOTPROPlugin.csproj -c Release

测试

从 TGateway 目录执行。测试会访问友元程序集的内部协议类型,需在命令入口为整个依赖图统一关闭混淆,并将中间文件和输出放入独立目录;同时关闭自动打包,避免测试产物覆盖发布 NuGet 包。

dotnet test TGateway.PRO/test/TGateway.PROTest/TGateway.PROTest.csproj -c Release -p:SmartAssemblyIsEnabled=false -p:GeneratePackageOnBuild=false --artifacts-path .artifacts/pro-tests

普通 Release 构建沿用生产混淆设置。不要在测试项目的 ProjectReference 上单独设置 SmartAssemblyIsEnabled:这会让同一依赖以不同全局属性重复构建,却写入同一目录,引发 DLL 文件锁冲突。聚焦验证时可在上述命令后追加 --filter。

部分集成测试需要通过以下环境变量提供测试数据库,未配置时只运行不依赖外部数据库的测试:

  • ORM_TEST_MYSQL
  • ORM_TEST_PGSQL
  • ORM_TEST_SQLSERVER

开发约定

  • 新插件直接实现当前 Runtime 插件契约,不保留旧接口别名或兼容分支。
  • 驱动配置使用动态属性类型声明,不在插件中维护第二套配置模型。
  • 新增 WebApi DTO 后同步更新生成式 JSON 上下文要求。
  • 原生库和运行时文件放在插件项目的 runtimes 目录,并按目标 RID 验证发布产物。

相关资源

  • TGateway
  • TGateway.Studio
  • 官方文档:https://runtime.thingsgateway.cn/
  • Gitee:https://gitee.com/ThingsGateway/ThingsGateway
  • GitHub:https://github.com/kimdiego2098/ThingsGateway

许可证

本项目使用 Apache-2.0 协议,具体发布和使用范围以仓库许可文件为准。

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.3.2 51 9/30/2026
2.3.1 59 9/29/2026
2.2.46 41 9/29/2026