增加基础通讯库nuget包

This commit is contained in:
2248356998 qq.com
2023-03-04 23:16:03 +08:00
parent 4002aae11c
commit a71e29440f
11 changed files with 120 additions and 75 deletions

View File

@@ -18,6 +18,13 @@
- 采集/上传配置完全支持Excel导入导出
- 插件式驱动,方便驱动二次开发,并支持动态更新
#### nuget
- Modbus库支持ModbusTcp、ModbusRtuOverTcp、ModbusUdp、ModbusServer等
``` powershell
dotnet add package ThingsGateway.Foundation.Adapter.Modbus
```
#### 效果图
<table>

View File

@@ -3,16 +3,27 @@
<PropertyGroup>
<LangVersion>latestMajor</LangVersion>
<TargetFrameworks>net4.6.2;net6.0;net7.0</TargetFrameworks>
<Version>1.0.0</Version>
<Version>1.0.2</Version>
<Title>ThingsGateway.Foundation.Adapter.Modbus</Title>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Title>ThingsGateway.Modbus</Title>
<Authors>Diego</Authors>
<Description>Modbus通讯类库支持MdobusTcp;ModbusRtuOverTcp</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Description>Modbus通讯类库支持MdobusTcp;ModbusRtuOverTcp;ModbusTcpServer</Description>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<RunAnalyzersDuringBuild>True</RunAnalyzersDuringBuild>
<PackageProjectUrl>https://diego2098.gitee.io/thingsgateway/</PackageProjectUrl>
<RepositoryUrl>https://gitee.com/diego2098/ThingsGateway</RepositoryUrl>
<PackageOutputPath>$(SolutionDir)</PackageOutputPath>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
<None Include="..\..\..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\ThingsGateway.Foundation\ThingsGateway.Foundation.csproj" />
</ItemGroup>

View File

@@ -21,9 +21,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\ThingsGateway.Application\ThingsGateway.Application.csproj" />
<ProjectReference Include="..\..\ThingsGateway.Foundation\ThingsGateway.Foundation.csproj" />
<ProjectReference Include="..\ThingsGateway.Foundation.Adapter.Modbus\ThingsGateway.Foundation.Adapter.Modbus.csproj" />
<PackageReference Include="ThingsGateway.Foundation.Adapter.Modbus" Version="1.0.1" />
</ItemGroup>
</Project>

View File

@@ -13,7 +13,7 @@
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command=" set dir=&quot;$(SolutionDir)ThingsGateway.Web.Server\bin\$(Configuration)\$(TargetFramework)\Plugins\$(AssemblyName)&quot;&#xD;&#xA; if not exist %25dir%25 md %25dir%25 &#xD;&#xA;copy &quot;$(TargetDir)*Modbus*.dll&quot; %25dir%25&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;" />
<Exec Command=" set dir=&quot;$(SolutionDir)ThingsGateway.Web.Server\bin\$(Configuration)\$(TargetFramework)\Plugins\$(AssemblyName)&quot;&#xD;&#xA; if not exist %25dir%25 md %25dir%25 &#xD;&#xA;copy &quot;$(TargetDir)*Modbus*.dll&quot; %25dir%25&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;" />
</Target>

View File

@@ -4,10 +4,30 @@
<LangVersion>latestMajor</LangVersion>
<TargetFrameworks>net4.6.2;net6.0;net7.0</TargetFrameworks>
<Version>1.0.0</Version>
<NoWarn>SYSLIB0014;CS8981;</NoWarn>
<Version>1.0.2</Version>
<Title>ThingsGateway.Foundation</Title>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Authors>Diego</Authors>
<Description>ThingsGateway基础通讯库</Description>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<RunAnalyzersDuringBuild>True</RunAnalyzersDuringBuild>
<PackageProjectUrl>https://diego2098.gitee.io/thingsgateway/</PackageProjectUrl>
<RepositoryUrl>https://gitee.com/diego2098/ThingsGateway</RepositoryUrl>
<PackageOutputPath>$(SolutionDir)</PackageOutputPath>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
<None Include="..\..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="CodingSeb.ExpressionEvaluator" Version="1.4.39" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />

View File

@@ -14,7 +14,6 @@ public class AlarmHis : PrimaryIdEntity
[SugarColumn(ColumnName = "Description", ColumnDescription = "描述", IsNullable = true)]
public string Description { get; set; }
[SugarColumn(ColumnName = "DeviceName", ColumnDescription = "设备名称", IsNullable = true)]
public string DeviceName { get; set; }

View File

@@ -51,21 +51,21 @@ public class MemoryVariable : BaseEntity
#region
/// <summary>
/// 报警组
/// </summary>
[Description("报警组")]
public string AlarmGroup { get; set; }
/// <summary>
/// 报警死区
/// </summary>
[Description("报警死区")]
public int AlarmDeadZone { get; set; }
/// <summary>
/// 报警延时
/// </summary>
[Description("报警延时")]
public int AlarmDelayTime { get; set; }
///// <summary>
///// 报警组
///// </summary>
//[Description("报警组")]
//public string AlarmGroup { get; set; }
///// <summary>
///// 报警死区
///// </summary>
//[Description("报警死区")]
//public int AlarmDeadZone { get; set; }
///// <summary>
///// 报警延时
///// </summary>
//[Description("报警延时")]
//public int AlarmDelayTime { get; set; }
/// <summary>
/// 布尔开报警使能
/// </summary>

View File

@@ -137,24 +137,24 @@ namespace ThingsGateway.Application
#region
/// <summary>
/// 报警组
/// </summary>
[ImporterHeader(Name = "报警组")]
[ExporterHeader(DisplayName = "报警组")]
public string AlarmGroup { get; set; } = "";
/// <summary>
/// 报警死区
/// </summary>
[ImporterHeader(Name = "报警死区")]
[ExporterHeader(DisplayName = "报警死区")]
public int AlarmDeadZone { get; set; }
/// <summary>
/// 报警延时
/// </summary>
[ImporterHeader(Name = "报警延时")]
[ExporterHeader(DisplayName = "报警延时")]
public int AlarmDelayTime { get; set; }
///// <summary>
///// 报警组
///// </summary>
//[ImporterHeader(Name = "报警组")]
//[ExporterHeader(DisplayName = "报警组")]
//public string AlarmGroup { get; set; } = "";
///// <summary>
///// 报警死区
///// </summary>
//[ImporterHeader(Name = "报警死区")]
//[ExporterHeader(DisplayName = "报警死区")]
//public int AlarmDeadZone { get; set; }
///// <summary>
///// 报警延时
///// </summary>
//[ImporterHeader(Name = "报警延时")]
//[ExporterHeader(DisplayName = "报警延时")]
//public int AlarmDelayTime { get; set; }
/// <summary>
/// 布尔开报警使能
/// </summary>
@@ -394,24 +394,24 @@ namespace ThingsGateway.Application
[ExporterHeader(DisplayName = "允许远程写入")]
public bool RpcWriteEnable { get; set; }
#region
/// <summary>
/// 报警组
/// </summary>
[ImporterHeader(Name = "报警组")]
[ExporterHeader(DisplayName = "报警组")]
public string AlarmGroup { get; set; } = "";
/// <summary>
/// 报警死区
/// </summary>
[ImporterHeader(Name = "报警死区")]
[ExporterHeader(DisplayName = "报警死区")]
public int AlarmDeadZone { get; set; }
/// <summary>
/// 报警延时
/// </summary>
[ImporterHeader(Name = "报警延时")]
[ExporterHeader(DisplayName = "报警延时")]
public int AlarmDelayTime { get; set; }
///// <summary>
///// 报警组
///// </summary>
//[ImporterHeader(Name = "报警组")]
//[ExporterHeader(DisplayName = "报警组")]
//public string AlarmGroup { get; set; } = "";
///// <summary>
///// 报警死区
///// </summary>
//[ImporterHeader(Name = "报警死区")]
//[ExporterHeader(DisplayName = "报警死区")]
//public int AlarmDeadZone { get; set; }
///// <summary>
///// 报警延时
///// </summary>
//[ImporterHeader(Name = "报警延时")]
//[ExporterHeader(DisplayName = "报警延时")]
//public int AlarmDelayTime { get; set; }
/// <summary>
/// 布尔开报警使能
/// </summary>

View File

@@ -232,20 +232,6 @@
<MTabItem>
<MCard Flat Class="ma-2">
<MRow NoGutters Class="my-2" Justify="JustifyTypes.Center">
<MCol Md=6 Cols=12 class="px-1">
<MSubheader Class="font-weight-black"> @(context.Description(x => x.AlarmDeadZone)) </MSubheader>
<MTextField Dense Outlined HideDetails="@("auto")" @bind-Value=@context.AlarmDeadZone />
</MCol>
<MCol Md=6 Cols=12 class="px-1">
<MSubheader Class="font-weight-black"> @(context.Description(x => x.AlarmDelayTime)) </MSubheader>
<MTextField Dense Outlined HideDetails="@("auto")" @bind-Value=@context.AlarmDelayTime />
</MCol>
<MCol Md=12 Cols=12 class="px-1">
<MSubheader Class="font-weight-black"> @(context.Description(x => x.AlarmGroup)) </MSubheader>
<MTextField Dense Outlined HideDetails="@("auto")" @bind-Value=@context.AlarmGroup />
</MCol>
<MCol Md=12 Cols=12 class="px-1 py-2">
<MDivider Center Height="2"></MDivider>

24
src/nuget-push.ps1 Normal file
View File

@@ -0,0 +1,24 @@
# 脚本来自furion
Write-Warning "正在发布 Nuget 包......";
# 查找所有 *.nupkg 文件
$template_nupkgs = Get-ChildItem -Filter *.nupkg;
# 遍历所有 *.nupkg 文件
for ($i = 0; $i -le $template_nupkgs.Length-1; $i++){
$item = $template_nupkgs[$i];
$nupkg = $item.FullName;
Write-Output "-----------------";
$nupkg;
# nuget setApiKey <apikey> 使用默认apikey
# 发布到 nuget.org 平台
dotnet nuget push $nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json;
Write-Output "-----------------";
}
Write-Warning "发布成功";

BIN
src/nuget.exe Normal file

Binary file not shown.