mirror of
https://gitee.com/ThingsGateway/ThingsGateway.git
synced 2025-10-26 13:25:18 +08:00
Compare commits
4 Commits
10.11.56.0
...
10.11.64.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
615e3bb24c | ||
|
|
4a7534b210 | ||
|
|
58e099cb93 | ||
|
|
a94a9c953c |
@@ -15,7 +15,7 @@
|
|||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-sm-10 h-100">
|
<div class="col-12 col-sm-10 h-100 ps-2">
|
||||||
<AdminTable @ref=table TItem="SysUser"
|
<AdminTable @ref=table TItem="SysUser"
|
||||||
AutoGenerateColumns="true"
|
AutoGenerateColumns="true"
|
||||||
ShowAdvancedSearch=false
|
ShowAdvancedSearch=false
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
<link rel="stylesheet" href=@($"_content/BootstrapBlazor/css/motronic.min.css?v={this.GetType().Assembly.GetName().Version}") />
|
<link rel="stylesheet" href=@($"_content/BootstrapBlazor/css/motronic.min.css?v={this.GetType().Assembly.GetName().Version}") />
|
||||||
<link rel="stylesheet" href=@($"ThingsGateway.AdminServer.styles.css?v={this.GetType().Assembly.GetName().Version}") />
|
<link rel="stylesheet" href=@($"ThingsGateway.AdminServer.styles.css?v={this.GetType().Assembly.GetName().Version}") />
|
||||||
<link rel="stylesheet" href=@($"{WebsiteConst.DefaultResourceUrl}css/site.css?v={this.GetType().Assembly.GetName().Version}") />
|
<link rel="stylesheet" href=@($"{WebsiteConst.DefaultResourceUrl}css/site.css?v={this.GetType().Assembly.GetName().Version}") />
|
||||||
|
<link rel="stylesheet" href=@($"{WebsiteConst.DefaultResourceUrl}css/devui.css?v={this.GetType().Assembly.GetName().Version}") />
|
||||||
|
|
||||||
@* <script src=@($"{WebsiteConst.DefaultResourceUrl}js/theme.js") type="module"></script><!-- 初始主题 --> *@
|
@* <script src=@($"{WebsiteConst.DefaultResourceUrl}js/theme.js") type="module"></script><!-- 初始主题 --> *@
|
||||||
<!-- PWA Manifest -->
|
<!-- PWA Manifest -->
|
||||||
<link rel="manifest" href="./manifest.json" />
|
<link rel="manifest" href="./manifest.json" />
|
||||||
@@ -44,6 +46,7 @@
|
|||||||
<!-- PWA Service Worker -->
|
<!-- PWA Service Worker -->
|
||||||
<script type="text/javascript">'serviceWorker' in navigator && navigator.serviceWorker.register('./service-worker.js')</script>
|
<script type="text/javascript">'serviceWorker' in navigator && navigator.serviceWorker.register('./service-worker.js')</script>
|
||||||
|
|
||||||
|
<script src="pwa-install.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
34
src/Admin/ThingsGateway.AdminServer/wwwroot/pwa-install.js
Normal file
34
src/Admin/ThingsGateway.AdminServer/wwwroot/pwa-install.js
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
let installPromptTriggered = false;
|
||||||
|
|
||||||
|
function getCookie(name) {
|
||||||
|
const match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
|
||||||
|
return match ? match[2] : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function hasShownInstallPrompt() {
|
||||||
|
return getCookie("tgPWAInstallPromptShown") === "true";
|
||||||
|
}
|
||||||
|
|
||||||
|
function markInstallPromptShown() {
|
||||||
|
document.cookie = "tgPWAInstallPromptShown=true; max-age=31536000; path=/";
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('beforeinstallprompt', (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
if (!hasShownInstallPrompt() && !installPromptTriggered) {
|
||||||
|
installPromptTriggered = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
e.prompt()
|
||||||
|
.then(() => e.userChoice)
|
||||||
|
.then(choiceResult => {
|
||||||
|
markInstallPromptShown();
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
// 可选错误处理
|
||||||
|
});
|
||||||
|
}, 2000); // 延迟 2 秒提示
|
||||||
|
} else {
|
||||||
|
// console.log("已提示过安装,不再弹出");
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="BootstrapBlazor.TableExport" Version="9.2.6" />
|
<PackageReference Include="BootstrapBlazor.TableExport" Version="9.2.6" />
|
||||||
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
|
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
|
||||||
<PackageReference Include="BootstrapBlazor" Version="9.10.1" />
|
<PackageReference Include="BootstrapBlazor" Version="9.10.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<Project>
|
<Project>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PluginVersion>10.11.56</PluginVersion>
|
<PluginVersion>10.11.64</PluginVersion>
|
||||||
<ProPluginVersion>10.11.56</ProPluginVersion>
|
<ProPluginVersion>10.11.64</ProPluginVersion>
|
||||||
<DefaultVersion>10.11.56</DefaultVersion>
|
<DefaultVersion>10.11.64</DefaultVersion>
|
||||||
<AuthenticationVersion>10.11.5</AuthenticationVersion>
|
<AuthenticationVersion>10.11.6</AuthenticationVersion>
|
||||||
<SourceGeneratorVersion>10.11.4</SourceGeneratorVersion>
|
<SourceGeneratorVersion>10.11.6</SourceGeneratorVersion>
|
||||||
<NET8Version>8.0.20</NET8Version>
|
<NET8Version>8.0.20</NET8Version>
|
||||||
<NET9Version>9.0.9</NET9Version>
|
<NET9Version>9.0.9</NET9Version>
|
||||||
<SatelliteResourceLanguages>zh-Hans;en-US</SatelliteResourceLanguages>
|
<SatelliteResourceLanguages>zh-Hans;en-US</SatelliteResourceLanguages>
|
||||||
|
|||||||
@@ -136,6 +136,9 @@ public static class CSharpScriptEngineExtension
|
|||||||
}
|
}
|
||||||
catch (NullReferenceException)
|
catch (NullReferenceException)
|
||||||
{
|
{
|
||||||
|
//如果编译失败,应该不重复编译,避免oom
|
||||||
|
Instance.Set<T>(field, null, TimeSpan.FromHours(1));
|
||||||
|
|
||||||
string exString = string.Format(CSScriptResource.CSScriptResource.Error1, typeof(T).FullName);
|
string exString = string.Format(CSScriptResource.CSScriptResource.Error1, typeof(T).FullName);
|
||||||
throw new(exString);
|
throw new(exString);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="$(NET9Version)" />
|
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="$(NET9Version)" />
|
||||||
<PackageReference Include="TouchSocket" Version="4.0.0-beta.28" />
|
<PackageReference Include="TouchSocket" Version="4.0.0-beta.57" />
|
||||||
<PackageReference Include="TouchSocket.SerialPorts" Version="4.0.0-beta.28" />
|
<PackageReference Include="TouchSocket.SerialPorts" Version="4.0.0-beta.57" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
|
||||||
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
|
||||||
// 源代码使用协议遵循本仓库的开源协议及附加协议
|
|
||||||
// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
|
||||||
// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
|
||||||
// 使用文档:https://thingsgateway.cn/
|
|
||||||
// QQ群:605534569
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
namespace ThingsGateway.Gateway.Application;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 插件配置项
|
|
||||||
/// <br></br>
|
|
||||||
/// 使用<see cref="DynamicPropertyAttribute"/> 标识所需的配置属性
|
|
||||||
/// </summary>
|
|
||||||
public class MempryDevicePropertyBase : CollectPropertyBase
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// <para></para>
|
|
||||||
/// 采集插件,继承实现不同PLC通讯
|
|
||||||
/// <para></para>
|
|
||||||
/// </summary>
|
|
||||||
public class MempryDevice : CollectBase
|
|
||||||
{
|
|
||||||
private MempryDevicePropertyBase _driverPropertyBase = new MempryDevicePropertyBase();
|
|
||||||
public override CollectPropertyBase CollectProperties => _driverPropertyBase;
|
|
||||||
|
|
||||||
#if !Management
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否连接成功
|
|
||||||
/// </summary>
|
|
||||||
public override bool IsConnected()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override Task<List<VariableSourceRead>> ProtectedLoadSourceReadAsync(List<VariableRuntime> deviceVariables)
|
|
||||||
{
|
|
||||||
return Task.FromResult(new List<VariableSourceRead>());
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool IsRuntimeSourceValid(VariableRuntime a)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
@@ -37,6 +37,8 @@ public abstract class DriverBase : AsyncDisposableObject, IDriver
|
|||||||
|
|
||||||
#region 属性
|
#region 属性
|
||||||
|
|
||||||
|
public virtual bool RefreshRuntimeAlways { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 调试UI Type,如果不存在,返回null
|
/// 调试UI Type,如果不存在,返回null
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -64,26 +64,36 @@ public static class DynamicModelExtension
|
|||||||
|
|
||||||
if (GlobalData.IdDevices.TryGetValue(businessId, out var deviceRuntime))
|
if (GlobalData.IdDevices.TryGetValue(businessId, out var deviceRuntime))
|
||||||
{
|
{
|
||||||
if (deviceRuntime.Driver is BusinessBase businessBase && businessBase.DriverProperties is IBusinessPropertyAllVariableBase property)
|
if (deviceRuntime.Driver is BusinessBase businessBase)
|
||||||
{
|
{
|
||||||
if (property.IsAllVariable)
|
if (businessBase.DriverProperties is IBusinessPropertyAllVariableBase property && property.IsAllVariable)
|
||||||
{
|
{
|
||||||
// 检查是否存在对应的业务设备Id
|
return GetVariableProperty(variableRuntime, businessId, propertyName, businessBase);
|
||||||
if (variableRuntime.VariablePropertys?.ContainsKey(businessId) == true)
|
|
||||||
{
|
|
||||||
variableRuntime.VariablePropertys[businessId].TryGetValue(propertyName, out var value);
|
|
||||||
return value; // 返回属性值
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return ThingsGatewayStringConverter.Default.Serialize(null, businessBase.VariablePropertys.GetValue(propertyName, false));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else if (businessBase.RefreshRuntimeAlways)
|
||||||
|
{
|
||||||
|
return GetVariableProperty(variableRuntime, businessId, propertyName, businessBase);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return null; // 未找到对应的业务设备Id,返回null
|
return null; // 未找到对应的业务设备Id,返回null
|
||||||
|
|
||||||
|
static string? GetVariableProperty(VariableRuntime variableRuntime, long businessId, string propertyName, BusinessBase businessBase)
|
||||||
|
{
|
||||||
|
// 检查是否存在对应的业务设备Id
|
||||||
|
if (variableRuntime.VariablePropertys?.ContainsKey(businessId) == true)
|
||||||
|
{
|
||||||
|
variableRuntime.VariablePropertys[businessId].TryGetValue(propertyName, out var value);
|
||||||
|
return value; // 返回属性值
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return ThingsGatewayStringConverter.Default.Serialize(null, businessBase.VariablePropertys.GetValue(propertyName, false));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ namespace ThingsGateway.Gateway.Application
|
|||||||
string PluginDirectory { get; }
|
string PluginDirectory { get; }
|
||||||
Dictionary<long, VariableRuntime> IdVariableRuntimes { get; }
|
Dictionary<long, VariableRuntime> IdVariableRuntimes { get; }
|
||||||
IDeviceThreadManage DeviceThreadManage { get; }
|
IDeviceThreadManage DeviceThreadManage { get; }
|
||||||
|
bool RefreshRuntimeAlways { get; set; }
|
||||||
|
|
||||||
bool IsConnected();
|
bool IsConnected();
|
||||||
void PauseThread(bool pause);
|
void PauseThread(bool pause);
|
||||||
|
|||||||
@@ -125,9 +125,14 @@ public static class GlobalData
|
|||||||
{
|
{
|
||||||
if (GlobalData.IdDevices.TryGetValue(businessDeviceId, out var deviceRuntime))
|
if (GlobalData.IdDevices.TryGetValue(businessDeviceId, out var deviceRuntime))
|
||||||
{
|
{
|
||||||
if (deviceRuntime.Driver?.DriverProperties is IBusinessPropertyAllVariableBase property)
|
|
||||||
|
if (deviceRuntime.Driver is BusinessBase businessBase)
|
||||||
{
|
{
|
||||||
if (property.IsAllVariable)
|
if (businessBase.DriverProperties is IBusinessPropertyAllVariableBase property && property.IsAllVariable)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (businessBase.RefreshRuntimeAlways)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -141,7 +146,46 @@ public static class GlobalData
|
|||||||
|
|
||||||
return a.VariablePropertys?.ContainsKey(businessDeviceId) == true;
|
return a.VariablePropertys?.ContainsKey(businessDeviceId) == true;
|
||||||
}
|
}
|
||||||
|
public static DeviceRuntime[] GetAllVariableBusinessDeviceRuntime()
|
||||||
|
{
|
||||||
|
var channelDevice = GlobalData.IdDevices.Where(a =>
|
||||||
|
{
|
||||||
|
if (a.Value.Driver is BusinessBase businessBase)
|
||||||
|
{
|
||||||
|
if (businessBase.DriverProperties is IBusinessPropertyAllVariableBase property && property.IsAllVariable)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (businessBase.RefreshRuntimeAlways)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}).Select(a => a.Value).ToArray();
|
||||||
|
return channelDevice;
|
||||||
|
}
|
||||||
|
public static IDriver[] GetAllVariableBusinessDriver()
|
||||||
|
{
|
||||||
|
var channelDevice = GlobalData.IdDevices.Where(a =>
|
||||||
|
{
|
||||||
|
if (a.Value.Driver is BusinessBase businessBase)
|
||||||
|
{
|
||||||
|
if (businessBase.DriverProperties is IBusinessPropertyAllVariableBase property && property.IsAllVariable)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (businessBase.RefreshRuntimeAlways)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}).Select(a => a.Value.Driver).ToArray();
|
||||||
|
return channelDevice;
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 只读的通道字典,提供对通道的只读访问
|
/// 只读的通道字典,提供对通道的只读访问
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public partial class ManagementTask : AsyncDisposableObject
|
|||||||
var tcpDmtpClient = new TcpDmtpClient();
|
var tcpDmtpClient = new TcpDmtpClient();
|
||||||
var config = new TouchSocketConfig()
|
var config = new TouchSocketConfig()
|
||||||
.SetRemoteIPHost(_managementOptions.ServerUri)
|
.SetRemoteIPHost(_managementOptions.ServerUri)
|
||||||
.SetAdapterOption(new AdapterOption() { MaxPackageSize = 1024 * 1024 * 1024 })
|
.SetAdapterOption(a => a.MaxPackageSize = 1024 * 1024 * 1024)
|
||||||
.SetDmtpOption(a => a.VerifyToken = _managementOptions.VerifyToken)
|
.SetDmtpOption(a => a.VerifyToken = _managementOptions.VerifyToken)
|
||||||
.ConfigureContainer(a =>
|
.ConfigureContainer(a =>
|
||||||
{
|
{
|
||||||
@@ -156,7 +156,7 @@ public partial class ManagementTask : AsyncDisposableObject
|
|||||||
var tcpDmtpService = new TcpDmtpService();
|
var tcpDmtpService = new TcpDmtpService();
|
||||||
var config = new TouchSocketConfig()
|
var config = new TouchSocketConfig()
|
||||||
.SetListenIPHosts(_managementOptions.ServerUri)
|
.SetListenIPHosts(_managementOptions.ServerUri)
|
||||||
.SetAdapterOption(new AdapterOption() { MaxPackageSize = 1024 * 1024 * 1024 })
|
.SetAdapterOption(a => a.MaxPackageSize = 1024 * 1024 * 1024)
|
||||||
.SetDmtpOption(a => a.VerifyToken = _managementOptions.VerifyToken)
|
.SetDmtpOption(a => a.VerifyToken = _managementOptions.VerifyToken)
|
||||||
.ConfigureContainer(a =>
|
.ConfigureContainer(a =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ internal sealed class RedundancyTask : IRpcDriver, IAsyncDisposable
|
|||||||
var tcpDmtpClient = new TcpDmtpClient();
|
var tcpDmtpClient = new TcpDmtpClient();
|
||||||
var config = new TouchSocketConfig()
|
var config = new TouchSocketConfig()
|
||||||
.SetRemoteIPHost(redundancy.MasterUri)
|
.SetRemoteIPHost(redundancy.MasterUri)
|
||||||
.SetAdapterOption(new AdapterOption() { MaxPackageSize = 0x20000000 })
|
.SetAdapterOption(a => a.MaxPackageSize = 0x20000000)
|
||||||
.SetDmtpOption(a => a.VerifyToken = redundancy.VerifyToken)
|
.SetDmtpOption(a => a.VerifyToken = redundancy.VerifyToken)
|
||||||
.ConfigureContainer(a =>
|
.ConfigureContainer(a =>
|
||||||
{
|
{
|
||||||
@@ -376,7 +376,7 @@ internal sealed class RedundancyTask : IRpcDriver, IAsyncDisposable
|
|||||||
var tcpDmtpService = new TcpDmtpService();
|
var tcpDmtpService = new TcpDmtpService();
|
||||||
var config = new TouchSocketConfig()
|
var config = new TouchSocketConfig()
|
||||||
.SetListenIPHosts(redundancy.MasterUri)
|
.SetListenIPHosts(redundancy.MasterUri)
|
||||||
.SetAdapterOption(new AdapterOption() { MaxPackageSize = 0x20000000 })
|
.SetAdapterOption(a => a.MaxPackageSize = 0x20000000)
|
||||||
.SetDmtpOption(a => a.VerifyToken = redundancy.VerifyToken)
|
.SetDmtpOption(a => a.VerifyToken = redundancy.VerifyToken)
|
||||||
.ConfigureContainer(a =>
|
.ConfigureContainer(a =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -240,6 +240,11 @@ internal static class RuntimeServiceHelper
|
|||||||
if (group.Key != null)
|
if (group.Key != null)
|
||||||
await group.Key.RestartDeviceAsync(group.Value, false).ConfigureAwait(false);
|
await group.Key.RestartDeviceAsync(group.Value, false).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
foreach (var group in GlobalData.GetAllVariableBusinessDeviceRuntime().Where(a => a.Driver?.DeviceThreadManage != null).GroupBy(a => a.Driver.DeviceThreadManage))
|
||||||
|
{
|
||||||
|
if (group.Key != null)
|
||||||
|
await group.Key.RestartDeviceAsync(group.ToArray(), false).ConfigureAwait(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public static async Task RemoveDeviceAsync(HashSet<long> newDeciceIds)
|
public static async Task RemoveDeviceAsync(HashSet<long> newDeciceIds)
|
||||||
{
|
{
|
||||||
@@ -255,11 +260,18 @@ internal static class RuntimeServiceHelper
|
|||||||
if (group.Key != null)
|
if (group.Key != null)
|
||||||
await group.Key.RemoveDeviceAsync(group.Value.Select(a => a.Id).ToArray()).ConfigureAwait(false);
|
await group.Key.RemoveDeviceAsync(group.Value.Select(a => a.Id).ToArray()).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var group in GlobalData.GetAllVariableBusinessDeviceRuntime().Where(a => a.Driver?.DeviceThreadManage != null).GroupBy(a => a.Driver.DeviceThreadManage))
|
||||||
|
{
|
||||||
|
if (group.Key != null)
|
||||||
|
await group.Key.RestartDeviceAsync(group.ToArray(), false).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task ChangedDriverAsync(ILogger logger)
|
public static async Task ChangedDriverAsync(ILogger logger)
|
||||||
{
|
{
|
||||||
var channelDevice = GlobalData.IdDevices.Where(a => a.Value.Driver?.DriverProperties is IBusinessPropertyAllVariableBase property && property.IsAllVariable).Select(a => a.Value).ToArray();
|
var channelDevice = GlobalData.GetAllVariableBusinessDeviceRuntime();
|
||||||
|
|
||||||
await channelDevice.ParallelForEachAsync(async (item, token) =>
|
await channelDevice.ParallelForEachAsync(async (item, token) =>
|
||||||
{
|
{
|
||||||
@@ -275,7 +287,7 @@ internal static class RuntimeServiceHelper
|
|||||||
}
|
}
|
||||||
public static async Task ChangedDriverAsync(ConcurrentHashSet<IDriver> changedDriver, ILogger logger)
|
public static async Task ChangedDriverAsync(ConcurrentHashSet<IDriver> changedDriver, ILogger logger)
|
||||||
{
|
{
|
||||||
var drivers = GlobalData.IdDevices.Where(a => a.Value.Driver?.DriverProperties is IBusinessPropertyAllVariableBase property && property.IsAllVariable).Select(a => a.Value.Driver);
|
var drivers = GlobalData.GetAllVariableBusinessDriver();
|
||||||
|
|
||||||
var changedDrivers = drivers.Concat(changedDriver).Where(a => a.DisposedValue == false).Distinct().ToArray();
|
var changedDrivers = drivers.Concat(changedDriver).Where(a => a.DisposedValue == false).Distinct().ToArray();
|
||||||
await changedDrivers.ParallelForEachAsync(async (driver, token) =>
|
await changedDrivers.ParallelForEachAsync(async (driver, token) =>
|
||||||
|
|||||||
@@ -11,9 +11,9 @@
|
|||||||
<PackageReference Include="Riok.Mapperly" Version="4.2.1" ExcludeAssets="runtime" PrivateAssets="all" />
|
<PackageReference Include="Riok.Mapperly" Version="4.2.1" ExcludeAssets="runtime" PrivateAssets="all" />
|
||||||
<PackageReference Include="Rougamo.Fody" Version="5.0.1" />
|
<PackageReference Include="Rougamo.Fody" Version="5.0.1" />
|
||||||
<PackageReference Include="System.Linq.Async" Version="6.0.3" />
|
<PackageReference Include="System.Linq.Async" Version="6.0.3" />
|
||||||
<PackageReference Include="TouchSocket.Dmtp" Version="4.0.0-beta.28" />
|
<PackageReference Include="TouchSocket.Dmtp" Version="4.0.0-beta.57" />
|
||||||
<!--<PackageReference Include="TouchSocket.WebApi.Swagger" Version="4.0.0-beta.28" />-->
|
<!--<PackageReference Include="TouchSocket.WebApi.Swagger" Version="4.0.0-beta.57" />-->
|
||||||
<PackageReference Include="TouchSocket.WebApi" Version="4.0.0-beta.28" />
|
<PackageReference Include="TouchSocket.WebApi" Version="4.0.0-beta.57" />
|
||||||
<PackageReference Include="ThingsGateway.Authentication" Version="$(AuthenticationVersion)" />
|
<PackageReference Include="ThingsGateway.Authentication" Version="$(AuthenticationVersion)" />
|
||||||
<!--<ProjectReference Include="..\..\PluginPro\ThingsGateway.Authentication\ThingsGateway.Authentication.csproj" />-->
|
<!--<ProjectReference Include="..\..\PluginPro\ThingsGateway.Authentication\ThingsGateway.Authentication.csproj" />-->
|
||||||
|
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ namespace BenchmarkConsoleApp
|
|||||||
{
|
{
|
||||||
internal class Program
|
internal class Program
|
||||||
{
|
{
|
||||||
public static int ClientCount = 30;
|
public static int ClientCount = 3;
|
||||||
public static int TaskNumberOfItems = 30;
|
public static int TaskNumberOfItems = 1;
|
||||||
public static int NumberOfItems = 30;
|
public static int NumberOfItems = 3;
|
||||||
|
|
||||||
private static async Task Main(string[] args)
|
private static async Task Main(string[] args)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -43,13 +43,13 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="BenchmarkDotNet" Version="0.15.3" />
|
<PackageReference Include="BenchmarkDotNet" Version="0.15.3" />
|
||||||
<PackageReference Include="HslCommunication" Version="12.5.1" />
|
<PackageReference Include="HslCommunication" Version="12.5.1" />
|
||||||
<PackageReference Include="Longbow.Modbus" Version="9.0.7" />
|
<PackageReference Include="Longbow.Modbus" Version="9.0.9" />
|
||||||
<PackageReference Include="NModbus" Version="3.0.81" />
|
<PackageReference Include="NModbus" Version="3.0.81" />
|
||||||
<PackageReference Include="NModbus.Serial" Version="3.0.81" />
|
<PackageReference Include="NModbus.Serial" Version="3.0.81" />
|
||||||
<PackageReference Include="S7netplus" Version="0.20.0" />
|
<PackageReference Include="S7netplus" Version="0.20.0" />
|
||||||
<!--<PackageReference Include="ThingsGateway.Foundation.Modbus" Version="$(DefaultVersion)" />
|
<!--<PackageReference Include="ThingsGateway.Foundation.Modbus" Version="$(DefaultVersion)" />
|
||||||
<PackageReference Include="ThingsGateway.Foundation.SiemensS7" Version="$(DefaultVersion)" />-->
|
<PackageReference Include="ThingsGateway.Foundation.SiemensS7" Version="$(DefaultVersion)" />-->
|
||||||
<PackageReference Include="TouchSocket.Modbus" Version="4.0.0-beta.28" />
|
<PackageReference Include="TouchSocket.Modbus" Version="4.0.0-beta.57" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public partial class SqlHistoryAlarm : BusinessBaseWithCacheAlarm
|
|||||||
{
|
{
|
||||||
internal readonly SqlHistoryAlarmProperty _driverPropertys = new();
|
internal readonly SqlHistoryAlarmProperty _driverPropertys = new();
|
||||||
private readonly SqlHistoryAlarmVariableProperty _variablePropertys = new();
|
private readonly SqlHistoryAlarmVariableProperty _variablePropertys = new();
|
||||||
|
public override bool RefreshRuntimeAlways { get; set; } = true;
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public override Type DriverUIType
|
public override Type DriverUIType
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public class TDengineDBProducerProperty : RealDBProducerProperty
|
|||||||
|
|
||||||
public TDengineDBProducerProperty()
|
public TDengineDBProducerProperty()
|
||||||
{
|
{
|
||||||
BigTextConnectStr = "protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata;db=power";
|
BigTextConnectStr = "protocol=WebSocket;host=localhost;port=6041;useSSL=false;username=root;password=taosdata;db=power;autoReconnect=true";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<ProjectReference Include="..\..\Gateway\ThingsGateway.Gateway.Razor\ThingsGateway.Gateway.Razor.csproj">
|
<ProjectReference Include="..\..\Gateway\ThingsGateway.Gateway.Razor\ThingsGateway.Gateway.Razor.csproj">
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\ThingsGateway.Foundation.Dlt645\ThingsGateway.Foundation.Dlt645.csproj">
|
<ProjectReference Include="..\ThingsGateway.Foundation.Dlt645\ThingsGateway.Foundation.Dlt645.csproj">
|
||||||
<PrivateAssets>contentFiles;compile;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
<PrivateAssets>contentFiles;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<ProjectReference Include="..\..\Gateway\ThingsGateway.Gateway.Application\ThingsGateway.Gateway.Application.csproj">
|
<ProjectReference Include="..\..\Gateway\ThingsGateway.Gateway.Application\ThingsGateway.Gateway.Application.csproj">
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<PackageReference Include="Confluent.Kafka" Version="2.11.1" GeneratePathProperty="true">
|
<PackageReference Include="Confluent.Kafka" Version="2.11.1" GeneratePathProperty="true">
|
||||||
<PrivateAssets>contentFiles;compile;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
<PrivateAssets>contentFiles;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<ProjectReference Include="..\..\Gateway\ThingsGateway.Gateway.Razor\ThingsGateway.Gateway.Razor.csproj">
|
<ProjectReference Include="..\..\Gateway\ThingsGateway.Gateway.Razor\ThingsGateway.Gateway.Razor.csproj">
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\ThingsGateway.Foundation.Modbus\ThingsGateway.Foundation.Modbus.csproj">
|
<ProjectReference Include="..\ThingsGateway.Foundation.Modbus\ThingsGateway.Foundation.Modbus.csproj">
|
||||||
<PrivateAssets>contentFiles;compile;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
<PrivateAssets>contentFiles;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -27,21 +27,21 @@
|
|||||||
|
|
||||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
|
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
|
||||||
<PackageReference Include="MQTTnet.AspNetCore" Version="4.3.7.1207" GeneratePathProperty="true">
|
<PackageReference Include="MQTTnet.AspNetCore" Version="4.3.7.1207" GeneratePathProperty="true">
|
||||||
<PrivateAssets>contentFiles;compile;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
<PrivateAssets>contentFiles;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="MQTTnet" Version="4.3.7.1207" GeneratePathProperty="true">
|
<PackageReference Include="MQTTnet" Version="4.3.7.1207" GeneratePathProperty="true">
|
||||||
<PrivateAssets>contentFiles;compile;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
<PrivateAssets>contentFiles;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Condition=" '$(TargetFramework)' != 'net6.0' ">
|
<ItemGroup Condition=" '$(TargetFramework)' != 'net6.0' ">
|
||||||
<PackageReference Include="MQTTnet.Server" Version="5.0.1.1416" GeneratePathProperty="true">
|
<PackageReference Include="MQTTnet.Server" Version="5.0.1.1416" GeneratePathProperty="true">
|
||||||
<PrivateAssets>contentFiles;compile;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
<PrivateAssets>contentFiles;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="MQTTnet.AspNetCore" Version="5.0.1.1416" GeneratePathProperty="true">
|
<PackageReference Include="MQTTnet.AspNetCore" Version="5.0.1.1416" GeneratePathProperty="true">
|
||||||
<PrivateAssets>contentFiles;compile;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
<PrivateAssets>contentFiles;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="MQTTnet" Version="5.0.1.1416" GeneratePathProperty="true">
|
<PackageReference Include="MQTTnet" Version="5.0.1.1416" GeneratePathProperty="true">
|
||||||
<PrivateAssets>contentFiles;compile;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
<PrivateAssets>contentFiles;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<ProjectReference Include="..\..\Gateway\ThingsGateway.Gateway.Razor\ThingsGateway.Gateway.Razor.csproj">
|
<ProjectReference Include="..\..\Gateway\ThingsGateway.Gateway.Razor\ThingsGateway.Gateway.Razor.csproj">
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\ThingsGateway.Foundation.OpcDa\ThingsGateway.Foundation.OpcDa.csproj">
|
<ProjectReference Include="..\ThingsGateway.Foundation.OpcDa\ThingsGateway.Foundation.OpcDa.csproj">
|
||||||
<PrivateAssets>contentFiles;compile;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
<PrivateAssets>contentFiles;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -26,31 +26,31 @@
|
|||||||
<ProjectReference Include="..\ThingsGateway.Foundation.OpcUa\ThingsGateway.Foundation.OpcUa.csproj" />
|
<ProjectReference Include="..\ThingsGateway.Foundation.OpcUa\ThingsGateway.Foundation.OpcUa.csproj" />
|
||||||
|
|
||||||
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server" Version="1.5.376.244" GeneratePathProperty="true">
|
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server" Version="1.5.376.244" GeneratePathProperty="true">
|
||||||
<PrivateAssets>contentFiles;compile;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
<PrivateAssets>contentFiles;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes" Version="1.5.376.244" GeneratePathProperty="true">
|
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes" Version="1.5.376.244" GeneratePathProperty="true">
|
||||||
<PrivateAssets>contentFiles;compile;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
<PrivateAssets>contentFiles;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client" Version="1.5.376.244" GeneratePathProperty="true">
|
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client" Version="1.5.376.244" GeneratePathProperty="true">
|
||||||
<PrivateAssets>contentFiles;compile;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
<PrivateAssets>contentFiles;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Core" Version="1.5.376.244" GeneratePathProperty="true">
|
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Core" Version="1.5.376.244" GeneratePathProperty="true">
|
||||||
<PrivateAssets>contentFiles;compile;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
<PrivateAssets>contentFiles;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration" Version="1.5.376.244" GeneratePathProperty="true">
|
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration" Version="1.5.376.244" GeneratePathProperty="true">
|
||||||
<PrivateAssets>contentFiles;compile;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
<PrivateAssets>contentFiles;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Security.Certificates" Version="1.5.376.244" GeneratePathProperty="true">
|
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Security.Certificates" Version="1.5.376.244" GeneratePathProperty="true">
|
||||||
<PrivateAssets>contentFiles;compile;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
<PrivateAssets>contentFiles;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<!--<PackageReference Include="System.Formats.Asn1" Version="8.0.2" GeneratePathProperty="true">
|
<!--<PackageReference Include="System.Formats.Asn1" Version="8.0.2" GeneratePathProperty="true">
|
||||||
<PrivateAssets>contentFiles;compile;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
<PrivateAssets>contentFiles;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
||||||
</PackageReference>-->
|
</PackageReference>-->
|
||||||
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="RabbitMQ.Client" Version="7.1.2" GeneratePathProperty="true">
|
<PackageReference Include="RabbitMQ.Client" Version="7.1.2" GeneratePathProperty="true">
|
||||||
<PrivateAssets>contentFiles;compile;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
<PrivateAssets>contentFiles;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<ProjectReference Include="..\..\Gateway\ThingsGateway.Gateway.Razor\ThingsGateway.Gateway.Razor.csproj">
|
<ProjectReference Include="..\..\Gateway\ThingsGateway.Gateway.Razor\ThingsGateway.Gateway.Razor.csproj">
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\ThingsGateway.Foundation.SiemensS7\ThingsGateway.Foundation.SiemensS7.csproj">
|
<ProjectReference Include="..\ThingsGateway.Foundation.SiemensS7\ThingsGateway.Foundation.SiemensS7.csproj">
|
||||||
<PrivateAssets>contentFiles;compile;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
<PrivateAssets>contentFiles;build;buildMultitargeting;buildTransitive;analyzers;</PrivateAssets>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -8,17 +8,6 @@
|
|||||||
// QQ群:605534569
|
// QQ群:605534569
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
using Microsoft.AspNetCore.ResponseCompression;
|
|
||||||
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
using ThingsGateway.Admin.Application;
|
|
||||||
using ThingsGateway.DB;
|
|
||||||
using ThingsGateway.NewLife;
|
|
||||||
using ThingsGateway.NewLife.Log;
|
|
||||||
using ThingsGateway.SqlSugar;
|
|
||||||
|
|
||||||
namespace ThingsGateway.Server;
|
namespace ThingsGateway.Server;
|
||||||
|
|
||||||
public class Program
|
public class Program
|
||||||
@@ -26,7 +15,7 @@ public class Program
|
|||||||
|
|
||||||
public static async Task Main(string[] args)
|
public static async Task Main(string[] args)
|
||||||
{
|
{
|
||||||
|
|
||||||
await Task.Delay(2000).ConfigureAwait(false);
|
await Task.Delay(2000).ConfigureAwait(false);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
12
src/ThingsGateway.ScriptDebug/Properties/launchSettings.json
Normal file
12
src/ThingsGateway.ScriptDebug/Properties/launchSettings.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"profiles": {
|
||||||
|
"ThingsGateway.ScriptDebug": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
},
|
||||||
|
"applicationUrl": "https://localhost:60174;http://localhost:60175"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
52
src/ThingsGateway.ScriptDebug/Test/TestClientRpc.cs
Normal file
52
src/ThingsGateway.ScriptDebug/Test/TestClientRpc.cs
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
//此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||||
|
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||||
|
// 源代码使用协议遵循本仓库的开源协议及附加协议
|
||||||
|
// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
||||||
|
// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
||||||
|
// 使用文档:https://thingsgateway.cn/
|
||||||
|
// QQ群:605534569
|
||||||
|
// ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
using MQTTnet;
|
||||||
|
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
using ThingsGateway.Foundation;
|
||||||
|
using ThingsGateway.NewLife.Json.Extension;
|
||||||
|
using ThingsGateway.Plugin.Mqtt;
|
||||||
|
|
||||||
|
using TouchSocket.Core;
|
||||||
|
|
||||||
|
public class TestClientRpc : DynamicMqttClientRpcBase
|
||||||
|
{
|
||||||
|
public override async Task RPCInvokeAsync(ILog logMessage, MqttApplicationMessageReceivedEventArgs args, MqttClientProperty driverPropertys, IMqttClient mqttClient, Func<string, Dictionary<string, Dictionary<string, JToken>>, ValueTask<Dictionary<string, Dictionary<string, IOperResult>>>> getRpcResult, Func<CancellationToken, ValueTask<OperResult>> tryMqttClientAsync, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
if (driverPropertys.RpcWriteTopic.IsNullOrWhiteSpace()) return;
|
||||||
|
var t = string.Format(null, "{0}/+", driverPropertys.RpcWriteTopic);
|
||||||
|
if (MqttTopicFilterComparer.Compare(args.ApplicationMessage.Topic, t) != MqttTopicFilterCompareResult.IsMatch)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var rpcDatas = Encoding.UTF8.GetString(args.ApplicationMessage.Payload).FromJsonNetString<Dictionary<string, Dictionary<string, JToken>>>();
|
||||||
|
if (rpcDatas == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var mqttRpcResult = await getRpcResult(args.ClientId, rpcDatas).ConfigureAwait(false);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var isConnect = await tryMqttClientAsync(CancellationToken.None).ConfigureAwait(false);
|
||||||
|
if (isConnect.IsSuccess)
|
||||||
|
{
|
||||||
|
var variableMessage = new MqttApplicationMessageBuilder()
|
||||||
|
.WithTopic($"{args.ApplicationMessage.Topic}/Response")
|
||||||
|
.WithPayload(mqttRpcResult.ToSystemTextJsonString(driverPropertys.JsonFormattingIndented)).Build();
|
||||||
|
await mqttClient.PublishAsync(variableMessage, cancellationToken).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,263 +1,263 @@
|
|||||||
|
|
||||||
//using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
//using ThingsGateway.Foundation;
|
using ThingsGateway.Foundation;
|
||||||
//using ThingsGateway.Gateway.Application;
|
using ThingsGateway.Gateway.Application;
|
||||||
//namespace ThingsGateway.Server;
|
namespace ThingsGateway.Server;
|
||||||
|
|
||||||
///// <summary>
|
/// <summary>
|
||||||
///// 插件类,默认实现了<see cref="IDevice"/>接口,继承<see cref="CollectFoundationBase"/> 实现采集插件
|
/// 插件类,默认实现了<see cref="IDevice"/>接口,继承<see cref="CollectFoundationBase"/> 实现采集插件
|
||||||
///// </summary>
|
/// </summary>
|
||||||
//public class TestCollectPlugin : CollectFoundationBase
|
public class TestCollectPlugin : CollectFoundationBase
|
||||||
//{
|
{
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 调试UI Type,如果不存在无需重写
|
/// 调试UI Type,如果不存在无需重写
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public override Type DriverDebugUIType => base.DriverDebugUIType;
|
public override Type DriverDebugUIType => base.DriverDebugUIType;
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 插件属性UI Type,继承<see cref="IPropertyUIBase"/>如果不存在无需重写
|
/// 插件属性UI Type,继承<see cref="IPropertyUIBase"/>如果不存在无需重写
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public override Type DriverPropertyUIType => base.DriverPropertyUIType;
|
public override Type DriverPropertyUIType => base.DriverPropertyUIType;
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 插件UI Type,继承<see cref="IDriverUIBase"/>如果不存在无需重写
|
/// 插件UI Type,继承<see cref="IDriverUIBase"/>如果不存在无需重写
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public override Type DriverUIType => base.DriverUIType;
|
public override Type DriverUIType => base.DriverUIType;
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 插件变量寄存器UI Type,继承<see cref="IAddressUIBase"/>如果不存在无需重写
|
/// 插件变量寄存器UI Type,继承<see cref="IAddressUIBase"/>如果不存在无需重写
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public override Type DriverVariableAddressUIType => base.DriverVariableAddressUIType;
|
public override Type DriverVariableAddressUIType => base.DriverVariableAddressUIType;
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 插件配置项,继承<see cref="CollectPropertyBase"/> 返回类实例
|
/// 插件配置项,继承<see cref="CollectPropertyBase"/> 返回类实例
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public override CollectPropertyBase CollectProperties => _property;
|
public override CollectPropertyBase CollectProperties => _property;
|
||||||
// private TestCollectProperty? _property = new();
|
private TestCollectProperty? _property = new();
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 在插件初始化时调用,只会执行一次,参数为插件默认的链路通道类,如未实现可忽略l
|
/// 在插件初始化时调用,只会执行一次,参数为插件默认的链路通道类,如未实现可忽略l
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// protected override Task InitChannelAsync(IChannel? channel, CancellationToken cancellationToken)
|
protected override Task InitChannelAsync(IChannel? channel, CancellationToken cancellationToken)
|
||||||
// {
|
{
|
||||||
// //做一些初始化操作
|
//做一些初始化操作
|
||||||
|
|
||||||
// return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 变量打包操作,会在默认的AfterVariablesChangedAsync方法里执行,参数为设备变量列表,返回源读取变量列表
|
/// 变量打包操作,会在默认的AfterVariablesChangedAsync方法里执行,参数为设备变量列表,返回源读取变量列表
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// protected override Task<List<VariableSourceRead>> ProtectedLoadSourceReadAsync(List<VariableRuntime> deviceVariables)
|
protected override Task<List<VariableSourceRead>> ProtectedLoadSourceReadAsync(List<VariableRuntime> deviceVariables)
|
||||||
// {
|
{
|
||||||
// //实现将设备变量打包成源读取变量
|
//实现将设备变量打包成源读取变量
|
||||||
// //比如如果需要实现MC中的字多读功能,需将多个变量地址打包成一个源读取地址和读取长度,根据一系列规则,添加解析标识,然后在返回的整个字节数组中解析出原来的变量地址代表的数据字节
|
//比如如果需要实现MC中的字多读功能,需将多个变量地址打包成一个源读取地址和读取长度,根据一系列规则,添加解析标识,然后在返回的整个字节数组中解析出原来的变量地址代表的数据字节
|
||||||
|
|
||||||
// //一般可操作 VariableRuntime 类中的 index, thingsgatewaybitconvter 等属性
|
//一般可操作 VariableRuntime 类中的 index, thingsgatewaybitconvter 等属性
|
||||||
// //一般可操作 VariableSourceRead 类中的 address, length 等属性
|
//一般可操作 VariableSourceRead 类中的 address, length 等属性
|
||||||
|
|
||||||
// return Task.FromResult(new List<VariableSourceRead>());
|
return Task.FromResult(new List<VariableSourceRead>());
|
||||||
// }
|
}
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 实现<see cref="IDevice"/>
|
/// 实现<see cref="IDevice"/>
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public override IDevice? FoundationDevice => base.FoundationDevice;
|
public override IDevice? FoundationDevice => base.FoundationDevice;
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 特殊方法,添加<see cref="DynamicMethodAttribute"/> 特性 ,返回IOperResult
|
/// 特殊方法,添加<see cref="DynamicMethodAttribute"/> 特性 ,返回IOperResult
|
||||||
// /// 支持<see cref="CancellationToken"/> 参数,需放到最后
|
/// 支持<see cref="CancellationToken"/> 参数,需放到最后
|
||||||
// /// 默认解析方式为英文分号
|
/// 默认解析方式为英文分号
|
||||||
// /// 比如rpc参数为 test1;test2,解析query1="test1",query2="test2"
|
/// 比如rpc参数为 test1;test2,解析query1="test1",query2="test2"
|
||||||
// /// 也可以在变量地址中填入test1,rpc参数传入test2,解析query1="test1",query2="test2"
|
/// 也可以在变量地址中填入test1,rpc参数传入test2,解析query1="test1",query2="test2"
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// [DynamicMethod("测试特殊方法")]
|
[DynamicMethod("测试特殊方法")]
|
||||||
// public IOperResult<string> TestMethod(string query1, string query2, CancellationToken cancellationToken)
|
public IOperResult<string> TestMethod(string query1, string query2, CancellationToken cancellationToken)
|
||||||
// {
|
{
|
||||||
// return new OperResult<string>() { Content = "测试特殊方法" };
|
return new OperResult<string>() { Content = "测试特殊方法" };
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
|
||||||
///// <summary>
|
/// <summary>
|
||||||
///// 插件类配置
|
/// 插件类配置
|
||||||
///// </summary>
|
/// </summary>
|
||||||
//public class TestCollectProperty : CollectFoundationPackPropertyBase
|
public class TestCollectProperty : CollectFoundationPackPropertyBase
|
||||||
//{
|
{
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 添加<see cref="DynamicPropertyAttribute"/> 特性,如需多语言配置,可添加json资源,参考其他插件
|
/// 添加<see cref="DynamicPropertyAttribute"/> 特性,如需多语言配置,可添加json资源,参考其他插件
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// [DynamicProperty(Description = null, Remark = null)]
|
[DynamicProperty(Description = null, Remark = null)]
|
||||||
// public string TestString { get; set; }
|
public string TestString { get; set; }
|
||||||
|
|
||||||
//}
|
}
|
||||||
|
|
||||||
///// <summary>
|
/// <summary>
|
||||||
///// 插件类,完全自定义
|
/// 插件类,完全自定义
|
||||||
///// </summary>
|
/// </summary>
|
||||||
//public class TestCollectPlugin1 : CollectBase
|
public class TestCollectPlugin1 : CollectBase
|
||||||
//{
|
{
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 调试UI Type,如果不存在无需重写
|
/// 调试UI Type,如果不存在无需重写
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public override Type DriverDebugUIType => base.DriverDebugUIType;
|
public override Type DriverDebugUIType => base.DriverDebugUIType;
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 插件属性UI Type,继承<see cref="IPropertyUIBase"/>如果不存在无需重写
|
/// 插件属性UI Type,继承<see cref="IPropertyUIBase"/>如果不存在无需重写
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public override Type DriverPropertyUIType => base.DriverPropertyUIType;
|
public override Type DriverPropertyUIType => base.DriverPropertyUIType;
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 插件UI Type,继承<see cref="IDriverUIBase"/>如果不存在无需重写
|
/// 插件UI Type,继承<see cref="IDriverUIBase"/>如果不存在无需重写
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public override Type DriverUIType => base.DriverUIType;
|
public override Type DriverUIType => base.DriverUIType;
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 插件变量寄存器UI Type,继承<see cref="IAddressUIBase"/>如果不存在无需重写
|
/// 插件变量寄存器UI Type,继承<see cref="IAddressUIBase"/>如果不存在无需重写
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public override Type DriverVariableAddressUIType => base.DriverVariableAddressUIType;
|
public override Type DriverVariableAddressUIType => base.DriverVariableAddressUIType;
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 插件配置项,继承<see cref="CollectPropertyBase"/> 返回类实例
|
/// 插件配置项,继承<see cref="CollectPropertyBase"/> 返回类实例
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public override CollectPropertyBase CollectProperties => _property;
|
public override CollectPropertyBase CollectProperties => _property;
|
||||||
// private TestCollectProperty1? _property = new();
|
private TestCollectProperty1? _property = new();
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 在插件初始化时调用,只会执行一次,参数为插件默认的链路通道类,如未实现可忽略l
|
/// 在插件初始化时调用,只会执行一次,参数为插件默认的链路通道类,如未实现可忽略l
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// protected override Task InitChannelAsync(IChannel? channel, CancellationToken cancellationToken)
|
protected override Task InitChannelAsync(IChannel? channel, CancellationToken cancellationToken)
|
||||||
// {
|
{
|
||||||
// //做一些初始化操作
|
//做一些初始化操作
|
||||||
|
|
||||||
// return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 变量打包操作,会在默认的AfterVariablesChangedAsync方法里执行,参数为设备变量列表,返回源读取变量列表
|
/// 变量打包操作,会在默认的AfterVariablesChangedAsync方法里执行,参数为设备变量列表,返回源读取变量列表
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// protected override Task<List<VariableSourceRead>> ProtectedLoadSourceReadAsync(List<VariableRuntime> deviceVariables)
|
protected override Task<List<VariableSourceRead>> ProtectedLoadSourceReadAsync(List<VariableRuntime> deviceVariables)
|
||||||
// {
|
{
|
||||||
// //实现将设备变量打包成源读取变量
|
//实现将设备变量打包成源读取变量
|
||||||
// //比如如果需要实现MC中的字多读功能,需将多个变量地址打包成一个源读取地址和读取长度,根据一系列规则,添加解析标识,然后在返回的整个字节数组中解析出原来的变量地址代表的数据字节
|
//比如如果需要实现MC中的字多读功能,需将多个变量地址打包成一个源读取地址和读取长度,根据一系列规则,添加解析标识,然后在返回的整个字节数组中解析出原来的变量地址代表的数据字节
|
||||||
|
|
||||||
// //一般可操作 VariableRuntime 类中的 index, thingsgatewaybitconvter 等属性
|
//一般可操作 VariableRuntime 类中的 index, thingsgatewaybitconvter 等属性
|
||||||
// //一般可操作 VariableSourceRead 类中的 address, length 等属性
|
//一般可操作 VariableSourceRead 类中的 address, length 等属性
|
||||||
|
|
||||||
// return Task.FromResult(new List<VariableSourceRead>());
|
return Task.FromResult(new List<VariableSourceRead>());
|
||||||
// }
|
}
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 如果不实现ReadSourceAsync方法,可以返回flase
|
/// 如果不实现ReadSourceAsync方法,可以返回flase
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// protected override bool VariableSourceReadsEnable => base.VariableSourceReadsEnable;
|
protected override bool VariableSourceReadsEnable => base.VariableSourceReadsEnable;
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 获取任务列表,默认会实现 TestOnline任务,SetDeviceStatus任务以及 VariableSourceRead等任务,VariableSourceRead任务启用条件为<see cref="VariableSourceReadsEnable"/> 为true。任务即是timer实现,可通过<see cref="ScheduledTaskHelper.GetTask(string, Func{object?, CancellationToken, Task}, object?, TouchSocket.Core.ILog, CancellationToken)"/> 方法实现定时任务
|
/// 获取任务列表,默认会实现 TestOnline任务,SetDeviceStatus任务以及 VariableSourceRead等任务,VariableSourceRead任务启用条件为<see cref="VariableSourceReadsEnable"/> 为true。任务即是timer实现,可通过<see cref="ScheduledTaskHelper.GetTask(string, Func{object?, CancellationToken, Task}, object?, TouchSocket.Core.ILog, CancellationToken)"/> 方法实现定时任务
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// /// <param name="cancellationToken"></param>
|
/// <param name="cancellationToken"></param>
|
||||||
// /// <returns></returns>
|
/// <returns></returns>
|
||||||
// protected override List<IScheduledTask> ProtectedGetTasks(CancellationToken cancellationToken)
|
protected override List<IScheduledTask> ProtectedGetTasks(CancellationToken cancellationToken)
|
||||||
// {
|
{
|
||||||
// return base.ProtectedGetTasks(cancellationToken);
|
return base.ProtectedGetTasks(cancellationToken);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 实现离线重连任务
|
/// 实现离线重连任务
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// /// <param name="state"></param>
|
/// <param name="state"></param>
|
||||||
// /// <param name="cancellationToken"></param>
|
/// <param name="cancellationToken"></param>
|
||||||
// /// <returns></returns>
|
/// <returns></returns>
|
||||||
// protected override Task TestOnline(object? state, CancellationToken cancellationToken)
|
protected override Task TestOnline(object? state, CancellationToken cancellationToken)
|
||||||
// {
|
{
|
||||||
// return base.TestOnline(state, cancellationToken);
|
return base.TestOnline(state, cancellationToken);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 返回是否成功连接设备
|
/// 返回是否成功连接设备
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// /// <returns></returns>
|
/// <returns></returns>
|
||||||
// public override bool IsConnected()
|
public override bool IsConnected()
|
||||||
// {
|
{
|
||||||
// return true;
|
return true;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 在变量发生组态变化后执行,默认会执行<see cref="ProtectedLoadSourceReadAsync"/> 方法,重新获取源读取变量列表,并且重新启动VariableSourceRead等任务
|
/// 在变量发生组态变化后执行,默认会执行<see cref="ProtectedLoadSourceReadAsync"/> 方法,重新获取源读取变量列表,并且重新启动VariableSourceRead等任务
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// /// <param name="cancellationToken"></param>
|
/// <param name="cancellationToken"></param>
|
||||||
// /// <returns></returns>
|
/// <returns></returns>
|
||||||
// public override Task AfterVariablesChangedAsync(CancellationToken cancellationToken)
|
public override Task AfterVariablesChangedAsync(CancellationToken cancellationToken)
|
||||||
// {
|
{
|
||||||
// return base.AfterVariablesChangedAsync(cancellationToken);
|
return base.AfterVariablesChangedAsync(cancellationToken);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 变量寄存器的字符串描述
|
/// 变量寄存器的字符串描述
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// /// <returns></returns>
|
/// <returns></returns>
|
||||||
// public override string GetAddressDescription()
|
public override string GetAddressDescription()
|
||||||
// {
|
{
|
||||||
// return base.GetAddressDescription();
|
return base.GetAddressDescription();
|
||||||
// }
|
}
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 设备暂停时执行,默认会暂停所有任务
|
/// 设备暂停时执行,默认会暂停所有任务
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// /// <param name="pause"></param>
|
/// <param name="pause"></param>
|
||||||
// public override void PauseThread(bool pause)
|
public override void PauseThread(bool pause)
|
||||||
// {
|
{
|
||||||
// base.PauseThread(pause);
|
base.PauseThread(pause);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 开始前执行
|
/// 开始前执行
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// protected override Task ProtectedStartAsync(CancellationToken cancellationToken)
|
protected override Task ProtectedStartAsync(CancellationToken cancellationToken)
|
||||||
// {
|
{
|
||||||
// //一般实现PLC长连接
|
//一般实现PLC长连接
|
||||||
// return base.ProtectedStartAsync(cancellationToken);
|
return base.ProtectedStartAsync(cancellationToken);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 写入变量,实现设备写入操作,注意执行写锁, using var writeLock =await ReadWriteLock.WriterLockAsync(cancellationToken).ConfigureAwait(false);
|
/// 写入变量,实现设备写入操作,注意执行写锁, using var writeLock =await ReadWriteLock.WriterLockAsync(cancellationToken).ConfigureAwait(false);
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// protected override ValueTask<Dictionary<string, OperResult>> WriteValuesAsync(Dictionary<VariableRuntime, JToken> writeInfoLists, CancellationToken cancellationToken)
|
protected override ValueTask<Dictionary<string, OperResult>> WriteValuesAsync(Dictionary<VariableRuntime, JToken> writeInfoLists, CancellationToken cancellationToken)
|
||||||
// {
|
{
|
||||||
// return base.WriteValuesAsync(writeInfoLists, cancellationToken);
|
return base.WriteValuesAsync(writeInfoLists, cancellationToken);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 读取源变量,在<see cref="VariableSourceReadsEnable"/> 为true时,添加源读取任务,任务启动时会执行
|
/// 读取源变量,在<see cref="VariableSourceReadsEnable"/> 为true时,添加源读取任务,任务启动时会执行
|
||||||
// /// 一般需要更新设备变量值,调用<see cref="VariableRuntime.SetValue(object?, DateTime, bool)"/>
|
/// 一般需要更新设备变量值,调用<see cref="VariableRuntime.SetValue(object?, DateTime, bool)"/>
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// protected override ValueTask<OperResult<ReadOnlyMemory<byte>>> ReadSourceAsync(VariableSourceRead variableSourceRead, CancellationToken cancellationToken)
|
protected override ValueTask<OperResult<ReadOnlyMemory<byte>>> ReadSourceAsync(VariableSourceRead variableSourceRead, CancellationToken cancellationToken)
|
||||||
// {
|
{
|
||||||
// return base.ReadSourceAsync(variableSourceRead, cancellationToken);
|
return base.ReadSourceAsync(variableSourceRead, cancellationToken);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// protected override Task DisposeAsync(bool disposing)
|
protected override Task DisposeAsync(bool disposing)
|
||||||
// {
|
{
|
||||||
// return base.DisposeAsync(disposing);
|
return base.DisposeAsync(disposing);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 特殊方法,添加<see cref="DynamicMethodAttribute"/> 特性 ,返回IOperResult
|
/// 特殊方法,添加<see cref="DynamicMethodAttribute"/> 特性 ,返回IOperResult
|
||||||
// /// 支持<see cref="CancellationToken"/> 参数,需放到最后
|
/// 支持<see cref="CancellationToken"/> 参数,需放到最后
|
||||||
// /// 默认解析方式为英文分号
|
/// 默认解析方式为英文分号
|
||||||
// /// 比如rpc参数为 test1;test2,解析query1="test1",query2="test2"
|
/// 比如rpc参数为 test1;test2,解析query1="test1",query2="test2"
|
||||||
// /// 也可以在变量地址中填入test1,rpc参数传入test2,解析query1="test1",query2="test2"
|
/// 也可以在变量地址中填入test1,rpc参数传入test2,解析query1="test1",query2="test2"
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// [DynamicMethod("测试特殊方法")]
|
[DynamicMethod("测试特殊方法")]
|
||||||
// public IOperResult<string> TestMethod(string query1, string query2, CancellationToken cancellationToken)
|
public IOperResult<string> TestMethod(string query1, string query2, CancellationToken cancellationToken)
|
||||||
// {
|
{
|
||||||
// return new OperResult<string>() { Content = "测试特殊方法" };
|
return new OperResult<string>() { Content = "测试特殊方法" };
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
|
||||||
///// <summary>
|
/// <summary>
|
||||||
///// 插件类配置
|
/// 插件类配置
|
||||||
///// </summary>
|
/// </summary>
|
||||||
//public class TestCollectProperty1 : CollectPropertyBase
|
public class TestCollectProperty1 : CollectPropertyBase
|
||||||
//{
|
{
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 添加<see cref="DynamicPropertyAttribute"/> 特性,如需多语言配置,可添加json资源,参考其他插件
|
/// 添加<see cref="DynamicPropertyAttribute"/> 特性,如需多语言配置,可添加json资源,参考其他插件
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// [DynamicProperty(Description = null, Remark = null)]
|
[DynamicProperty(Description = null, Remark = null)]
|
||||||
// public string TestString { get; set; }
|
public string TestString { get; set; }
|
||||||
|
|
||||||
//}
|
}
|
||||||
|
|||||||
@@ -1,56 +1,56 @@
|
|||||||
//////------------------------------------------------------------------------------
|
////------------------------------------------------------------------------------
|
||||||
//////此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
////此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||||
////// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
//// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||||
////// 源代码使用协议遵循本仓库的开源协议及附加协议
|
//// 源代码使用协议遵循本仓库的开源协议及附加协议
|
||||||
////// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
//// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
||||||
////// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
//// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
||||||
////// 使用文档:https://thingsgateway.cn/
|
//// 使用文档:https://thingsgateway.cn/
|
||||||
////// QQ群:605534569
|
//// QQ群:605534569
|
||||||
////// ------------------------------------------------------------------------------
|
//// ------------------------------------------------------------------------------
|
||||||
|
|
||||||
//using System.Dynamic;
|
using System.Dynamic;
|
||||||
|
|
||||||
//using ThingsGateway.Foundation;
|
using ThingsGateway.Foundation;
|
||||||
//using ThingsGateway.Gateway.Application;
|
using ThingsGateway.Gateway.Application;
|
||||||
//public class TestDynamicModel : IDynamicModel
|
public class TestDynamicModel : IDynamicModel
|
||||||
//{
|
{
|
||||||
// public IEnumerable<dynamic> GetList(IEnumerable<object> datas)
|
public IEnumerable<dynamic> GetList(IEnumerable<object> datas)
|
||||||
// {
|
{
|
||||||
// if (datas == null) return null;
|
if (datas == null) return null;
|
||||||
// List<ExpandoObject> deviceObjs = new List<ExpandoObject>();
|
List<ExpandoObject> deviceObjs = new List<ExpandoObject>();
|
||||||
// //按设备名称分组
|
//按设备名称分组
|
||||||
// var groups = datas.Where(a => !string.IsNullOrEmpty(((AlarmVariable)a).DeviceName)).GroupBy(a => ((AlarmVariable)a).DeviceName, a => ((AlarmVariable)a));
|
var groups = datas.Where(a => !string.IsNullOrEmpty(((AlarmVariable)a).DeviceName)).GroupBy(a => ((AlarmVariable)a).DeviceName, a => ((AlarmVariable)a));
|
||||||
// foreach (var group in groups)
|
foreach (var group in groups)
|
||||||
// {
|
{
|
||||||
// //按采集时间分组
|
//按采集时间分组
|
||||||
// var data = group.GroupBy(a => a.AlarmTime.DateTimeToUnixTimestamp());
|
var data = group.GroupBy(a => a.AlarmTime.DateTimeToUnixTimestamp());
|
||||||
// var deviceObj = new ExpandoObject();
|
var deviceObj = new ExpandoObject();
|
||||||
// List<ExpandoObject> expandos = new List<ExpandoObject>();
|
List<ExpandoObject> expandos = new List<ExpandoObject>();
|
||||||
// foreach (var item in data)
|
foreach (var item in data)
|
||||||
// {
|
{
|
||||||
// var expando = new ExpandoObject();
|
var expando = new ExpandoObject();
|
||||||
// expando.TryAdd("ts", item.Key);
|
expando.TryAdd("ts", item.Key);
|
||||||
// var variableObj = new ExpandoObject();
|
var variableObj = new ExpandoObject();
|
||||||
// foreach (var tag in item)
|
foreach (var tag in item)
|
||||||
// {
|
{
|
||||||
// var alarmObj = new ExpandoObject();
|
var alarmObj = new ExpandoObject();
|
||||||
// alarmObj.TryAdd(nameof(tag.AlarmCode), tag.AlarmCode);
|
alarmObj.TryAdd(nameof(tag.AlarmCode), tag.AlarmCode);
|
||||||
// alarmObj.TryAdd(nameof(tag.AlarmText), tag.AlarmText);
|
alarmObj.TryAdd(nameof(tag.AlarmText), tag.AlarmText);
|
||||||
// alarmObj.TryAdd(nameof(tag.AlarmType), tag.AlarmType);
|
alarmObj.TryAdd(nameof(tag.AlarmType), tag.AlarmType);
|
||||||
// alarmObj.TryAdd(nameof(tag.AlarmLimit), tag.AlarmLimit);
|
alarmObj.TryAdd(nameof(tag.AlarmLimit), tag.AlarmLimit);
|
||||||
// alarmObj.TryAdd(nameof(tag.EventTime), tag.EventTime);
|
alarmObj.TryAdd(nameof(tag.EventTime), tag.EventTime);
|
||||||
// alarmObj.TryAdd(nameof(tag.EventType), tag.EventType);
|
alarmObj.TryAdd(nameof(tag.EventType), tag.EventType);
|
||||||
|
|
||||||
// variableObj.TryAdd(tag.Name, alarmObj);
|
variableObj.TryAdd(tag.Name, alarmObj);
|
||||||
// }
|
}
|
||||||
// expando.TryAdd("alarms", variableObj);
|
expando.TryAdd("alarms", variableObj);
|
||||||
|
|
||||||
// expandos.Add(expando);
|
expandos.Add(expando);
|
||||||
// }
|
}
|
||||||
// deviceObj.TryAdd(group.Key, expandos);
|
deviceObj.TryAdd(group.Key, expandos);
|
||||||
// deviceObjs.Add(deviceObj);
|
deviceObjs.Add(deviceObj);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// return deviceObjs;
|
return deviceObjs;
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
@@ -1,46 +1,46 @@
|
|||||||
|
|
||||||
//using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
//using ThingsGateway.Gateway.Application;
|
using ThingsGateway.Gateway.Application;
|
||||||
|
|
||||||
//public class TestExexcuteExpressions : IExexcuteExpressions
|
public class TestExexcuteExpressions : IExexcuteExpressions
|
||||||
//{
|
{
|
||||||
|
|
||||||
// public TouchSocket.Core.ILog Logger { get; set; }
|
public TouchSocket.Core.ILog Logger { get; set; }
|
||||||
|
|
||||||
// public async System.Threading.Tasks.Task<NodeOutput> ExecuteAsync(NodeInput input, System.Threading.CancellationToken cancellationToken)
|
public async System.Threading.Tasks.Task<NodeOutput> ExecuteAsync(NodeInput input, System.Threading.CancellationToken cancellationToken)
|
||||||
// {
|
{
|
||||||
// //想上传mqtt,可以自己写mqtt上传代码,或者通过mqtt插件的公开方法上传
|
//想上传mqtt,可以自己写mqtt上传代码,或者通过mqtt插件的公开方法上传
|
||||||
|
|
||||||
// //直接获取mqttclient插件类型的第一个设备
|
//直接获取mqttclient插件类型的第一个设备
|
||||||
// var mqttClient = GlobalData.ReadOnlyChannels.FirstOrDefault(a => a.Value.PluginName == "ThingsGateway.Plugin.Mqtt.MqttClient").Value?.ReadDeviceRuntimes?.FirstOrDefault().Value?.Driver as ThingsGateway.Plugin.Mqtt.MqttClient;
|
//var mqttClient = GlobalData.ReadOnlyChannels.FirstOrDefault(a => a.Value.PluginName == "ThingsGateway.Plugin.Mqtt.MqttClient").Value?.ReadDeviceRuntimes?.FirstOrDefault().Value?.Driver as ThingsGateway.Plugin.Mqtt.MqttClient;
|
||||||
// if (mqttClient == null)
|
//if (mqttClient == null)
|
||||||
// throw new("mqttClient NOT FOUND");
|
// throw new("mqttClient NOT FOUND");
|
||||||
|
|
||||||
// TopicArray topicArray = new()
|
//TopicArray topicArray = new()
|
||||||
// {
|
//{
|
||||||
// Topic = "test",
|
// Topic = "test",
|
||||||
// Payload = Encoding.UTF8.GetBytes("test")
|
// Payload = Encoding.UTF8.GetBytes("test")
|
||||||
// };
|
//};
|
||||||
// var result = await mqttClient.MqttUpAsync(topicArray, default).ConfigureAwait(false);// 主题 和 负载
|
//var result = await mqttClient.MqttUpAsync(topicArray, default).ConfigureAwait(false);// 主题 和 负载
|
||||||
// if (!result.IsSuccess)
|
//if (!result.IsSuccess)
|
||||||
// throw new(result.ErrorMessage);
|
// throw new(result.ErrorMessage);
|
||||||
// return new NodeOutput() { Value = result };
|
//return new NodeOutput() { Value = result };
|
||||||
|
|
||||||
// //通过设备名称找出mqttClient插件
|
//通过设备名称找出mqttClient插件
|
||||||
// //var mqttClient = GlobalData.ReadOnlyDevices.FirstOrDefault(a => a.Value.Name == "mqttDevice1").Value?.Driver as ThingsGateway.Plugin.Mqtt.MqttClient;
|
var mqttClient = GlobalData.ReadOnlyDevices.FirstOrDefault(a => a.Value.Name == "mqttDevice1").Value?.Driver as ThingsGateway.Plugin.Mqtt.MqttClient;
|
||||||
|
|
||||||
// //if (mqttClient == null)
|
if (mqttClient == null)
|
||||||
// // throw new("mqttClient NOT FOUND");
|
throw new("mqttClient NOT FOUND");
|
||||||
|
|
||||||
// //TopicArray topicArray = new()
|
TopicArray topicArray = new()
|
||||||
// //{
|
{
|
||||||
// // Topic = "test",
|
Topic = "test",
|
||||||
// // Payload = Encoding.UTF8.GetBytes("test")
|
Payload = Encoding.UTF8.GetBytes("test")
|
||||||
// //};
|
};
|
||||||
// //var result = await mqttClient.MqttUpAsync(topicArray, default).ConfigureAwait(false);// 主题 和 负载
|
var result = await mqttClient.MqttUpAsync(topicArray, default).ConfigureAwait(false);// 主题 和 负载
|
||||||
// //if (!result.IsSuccess)
|
if (!result.IsSuccess)
|
||||||
// // throw new(result.ErrorMessage);
|
throw new(result.ErrorMessage);
|
||||||
// //return new NodeOutput() { Value = result };
|
return new NodeOutput() { Value = result };
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
@@ -1,223 +1,236 @@
|
|||||||
//////------------------------------------------------------------------------------
|
using System.Collections.Concurrent;
|
||||||
//////此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
|
||||||
////// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
|
||||||
////// 源代码使用协议遵循本仓库的开源协议及附加协议
|
|
||||||
////// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
|
||||||
////// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
|
||||||
////// 使用文档:https://thingsgateway.cn/
|
|
||||||
////// QQ群:605534569
|
|
||||||
////// ------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
//using ThingsGateway.Foundation;
|
using ThingsGateway.Foundation;
|
||||||
//using ThingsGateway.Gateway.Application;
|
using ThingsGateway.Gateway.Application;
|
||||||
//using ThingsGateway.NewLife.Extension;
|
using ThingsGateway.NewLife.Extension;
|
||||||
//public class TestKafkaDynamicModel : DynamicModelBase
|
public class TestKafkaDynamicModel1 : DynamicModelBase
|
||||||
//{
|
{
|
||||||
// private Dictionary<string, VariableRuntime> variableRuntimes = new();
|
private Dictionary<string, VariableRuntime> variableRuntimes = new();
|
||||||
|
|
||||||
// private long id = 0;
|
private long id = 0;
|
||||||
|
|
||||||
// public TestKafkaDynamicModel()
|
public TestKafkaDynamicModel1()
|
||||||
// {
|
{
|
||||||
// var name = "kafka1";
|
var name = "测试MqttServer";
|
||||||
// if (GlobalData.ReadOnlyDevices.TryGetValue(name, out var kafka1))
|
if (GlobalData.ReadOnlyDevices.TryGetValue(name, out var kafka1))
|
||||||
// {
|
{
|
||||||
// id = kafka1.Id;
|
id = kafka1.Id;
|
||||||
|
|
||||||
// foreach (var item in kafka1.Driver?.IdVariableRuntimes)
|
foreach (var item in kafka1.Driver?.IdVariableRuntimes)
|
||||||
// {
|
{
|
||||||
// //变量备注1作为Key(AE报警SourceId)
|
//变量备注1作为Key(AE报警SourceId)
|
||||||
// var data1 = item.Value.GetPropertyValue(id, nameof(BusinessVariableProperty.Data1));
|
var data1 = item.Value.GetPropertyValue(id, nameof(BusinessVariableProperty.Data1));
|
||||||
// if (!data1.IsNullOrEmpty())
|
if (!data1.IsNullOrEmpty())
|
||||||
// {
|
{
|
||||||
// variableRuntimes.Add(data1, item.Value);
|
variableRuntimes.Add(data1, item.Value);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// }
|
}
|
||||||
// else
|
else
|
||||||
// {
|
{
|
||||||
// throw new Exception($"找不到设备 {name}");
|
throw new Exception($"找不到设备 {name}");
|
||||||
// }
|
}
|
||||||
|
|
||||||
// }
|
}
|
||||||
// public override IEnumerable<dynamic> GetList(IEnumerable<object> datas)
|
|
||||||
// {
|
|
||||||
// if (datas == null) return null;
|
|
||||||
// var pluginEventDatas = datas.Cast<PluginEventData>();
|
|
||||||
// var opcDatas = pluginEventDatas.Select(
|
|
||||||
// a =>
|
|
||||||
// {
|
|
||||||
// if (a.ObjectValue == null)
|
|
||||||
// {
|
|
||||||
// a.ObjectValue = a.Value.ToObject(Type.GetType(a.ValueType));
|
|
||||||
// }
|
|
||||||
// return a.ObjectValue is ThingsGateway.Plugin.OpcAe.OpcAeEventData opcData ? opcData : null;
|
|
||||||
// }
|
|
||||||
// ).Where(a => a != null).ToList();
|
|
||||||
|
|
||||||
// List<KafkaAlarmEntity> alarmEntities = new List<KafkaAlarmEntity>();
|
private ConcurrentDictionary<Tuple<string, string, int>, DateTime> EventKeyTimes = new();
|
||||||
// if (opcDatas.Count == 0)
|
|
||||||
// {
|
public override IEnumerable<dynamic> GetList(IEnumerable<object> datas)
|
||||||
// Logger?.LogInformation("没有OPCAE数据");
|
{
|
||||||
// return alarmEntities;
|
if (datas == null) return null;
|
||||||
// }
|
var pluginEventDatas = datas.Cast<PluginEventData>();
|
||||||
|
var opcDatas = pluginEventDatas.Select(
|
||||||
|
a =>
|
||||||
|
{
|
||||||
|
if (a.ObjectValue == null)
|
||||||
|
{
|
||||||
|
a.ObjectValue = a.Value.ToObject(Type.GetType(a.ValueType));
|
||||||
|
}
|
||||||
|
return a.ObjectValue is ThingsGateway.Plugin.OpcAe.OpcAeEventData opcData ? opcData : null;
|
||||||
|
}
|
||||||
|
).Where(a => a != null).ToList();
|
||||||
|
|
||||||
|
List<KafkaAlarmEntity> alarmEntities = new List<KafkaAlarmEntity>();
|
||||||
|
if (opcDatas.Count == 0)
|
||||||
|
{
|
||||||
|
Logger?.LogInformation("没有OPCAE数据");
|
||||||
|
return alarmEntities;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// foreach (var opcAeEventData in opcDatas)
|
foreach (var opcAeEventData in opcDatas)
|
||||||
// {
|
{
|
||||||
// //一般只需要条件报警
|
//一般只需要条件报警
|
||||||
// //if (opcAeEventData.EventType != Opc.Ae.EventType.Condition)
|
//if (opcAeEventData.EventType != Opc.Ae.EventType.Condition)
|
||||||
// // continue;
|
// continue;
|
||||||
// //重连时触发的事件,可以跳过不处理
|
//重连时触发的事件,可以跳过不处理
|
||||||
// //if(opcAeEventData.Refresh)
|
//if(opcAeEventData.Refresh)
|
||||||
// // continue;
|
// continue;
|
||||||
// var sourceName = opcAeEventData.SourceID;
|
var sourceName = opcAeEventData.SourceID;
|
||||||
// if (variableRuntimes.TryGetValue(sourceName, out var variableRuntime))
|
if (variableRuntimes.TryGetValue(sourceName, out var variableRuntime))
|
||||||
// {
|
{
|
||||||
// var ack = opcAeEventData.EventType != Opc.Ae.EventType.Condition ? false : ((Opc.Ae.ConditionState)opcAeEventData.NewState).HasFlag(Opc.Ae.ConditionState.Acknowledged);
|
|
||||||
|
var ack = opcAeEventData.EventType != Opc.Ae.EventType.Condition ? false : ((Opc.Ae.ConditionState)opcAeEventData.NewState).HasFlag(Opc.Ae.ConditionState.Acknowledged);
|
||||||
|
|
||||||
// bool isRecover = opcAeEventData.EventType != Opc.Ae.EventType.Condition ? false : !((Opc.Ae.ConditionState)opcAeEventData.NewState).HasFlag(Opc.Ae.ConditionState.Active);
|
bool isRecover = opcAeEventData.EventType != Opc.Ae.EventType.Condition ? false : !((Opc.Ae.ConditionState)opcAeEventData.NewState).HasFlag(Opc.Ae.ConditionState.Active);
|
||||||
|
if (opcAeEventData.EventType != Opc.Ae.EventType.Condition)
|
||||||
|
{
|
||||||
|
bool alarm = (opcAeEventData.Message).Contains("raised");
|
||||||
|
if (alarm)
|
||||||
|
{
|
||||||
|
opcAeEventData.AlarmTime = opcAeEventData.Time;
|
||||||
|
EventKeyTimes.AddOrUpdate(Tuple.Create(opcAeEventData.SourceID, opcAeEventData.ConditionName, opcAeEventData.Cookie), opcAeEventData.Time, (k, v) => opcAeEventData.Time);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (EventKeyTimes.TryGetValue(Tuple.Create(opcAeEventData.SourceID, opcAeEventData.ConditionName, opcAeEventData.Cookie), out var time))
|
||||||
|
opcAeEventData.AlarmTime = time;
|
||||||
|
else
|
||||||
|
opcAeEventData.AlarmTime = opcAeEventData.Time;
|
||||||
|
}
|
||||||
|
isRecover = !alarm;
|
||||||
|
}
|
||||||
|
|
||||||
// //构建告警实体
|
//构建告警实体
|
||||||
// KafkaAlarmEntity alarmEntity = new KafkaAlarmEntity
|
KafkaAlarmEntity alarmEntity = new KafkaAlarmEntity
|
||||||
// {
|
{
|
||||||
// AlarmCode = variableRuntime.GetPropertyValue(id, nameof(BusinessVariableProperty.Data2)), //唯一编码
|
alarmCode = variableRuntime.GetPropertyValue(id, nameof(BusinessVariableProperty.Data2)), //唯一编码
|
||||||
// ResourceCode = variableRuntime.GetPropertyValue(id, nameof(BusinessVariableProperty.Data3)), //资源编码
|
resourceCode = variableRuntime.GetPropertyValue(id, nameof(BusinessVariableProperty.Data3)), //资源编码
|
||||||
// ResourceName = variableRuntime.GetPropertyValue(id, nameof(BusinessVariableProperty.Data4)), //资源名称
|
resourceName = variableRuntime.GetPropertyValue(id, nameof(BusinessVariableProperty.Data4)), //资源名称
|
||||||
// MetricCode = variableRuntime.GetPropertyValue(id, nameof(BusinessVariableProperty.Data5)), //指标编码
|
metricCode = variableRuntime.GetPropertyValue(id, nameof(BusinessVariableProperty.Data5)), //指标编码
|
||||||
// MetricName = variableRuntime.GetPropertyValue(id, nameof(BusinessVariableProperty.Data6)), //指标名称
|
metricName = variableRuntime.GetPropertyValue(id, nameof(BusinessVariableProperty.Data6)), //指标名称
|
||||||
// Content = $"{variableRuntime.GetPropertyValue(id, nameof(BusinessVariableProperty.Data4))},{opcAeEventData.Message}", //告警内容,设备名称+告警内容(包含阈值信息),可能opcae里没有带阈值信息,那么就需要录入固定值,可选Data10
|
content = $"{variableRuntime.GetPropertyValue(id, nameof(BusinessVariableProperty.Data4))}{variableRuntime.GetPropertyValue(id, nameof(BusinessVariableProperty.Data6))}{opcAeEventData.Message}", //告警内容,设备名称+告警内容(包含阈值信息),可能opcae里没有带阈值信息,那么就需要录入固定值,可选Data10
|
||||||
// AlarmType = variableRuntime.GetPropertyValue(id, nameof(BusinessVariableProperty.Data7)), // opcAeEventData.Severity 告警类型,子系统产生告警的类型,可能需要固定备注值
|
alarmType = variableRuntime.GetPropertyValue(id, nameof(BusinessVariableProperty.Data7)), // opcAeEventData.Severity 告警类型,子系统产生告警的类型,可能需要固定备注值
|
||||||
|
|
||||||
// ConfirmedTime = ack ? opcAeEventData.Time.DateTimeToUnixTimestamp() : null, //告警确认时间
|
confirmedTime = ack ? opcAeEventData.Time.DateTimeToUnixTimestamp() : null, //告警确认时间
|
||||||
// FixTime = isRecover ? opcAeEventData.Time.DateTimeToUnixTimestamp() : null, //解除告警时间
|
fixTime = isRecover ? opcAeEventData.Time : null, //解除告警时间
|
||||||
// LastTime = opcAeEventData.AlarmTime.DateTimeToUnixTimestamp(), //产生告警时间
|
lastTime = opcAeEventData.AlarmTime, //产生告警时间
|
||||||
// Status = isRecover ? "FIXED" : "UNFIXED", //告警状态
|
status = isRecover ? "FIXED" : "UNFIXED", //告警状态
|
||||||
// AlarmLevel = variableRuntime.GetPropertyValue(id, nameof(BusinessVariableProperty.Data8)), //opcAeEventData.Severity.ToString(), //告警等级,可能需要固定备注值
|
alarmLevel = variableRuntime.GetPropertyValue(id, nameof(BusinessVariableProperty.Data8)), //opcAeEventData.Severity.ToString(), //告警等级,可能需要固定备注值
|
||||||
// SubSystemCode = variableRuntime.GetPropertyValue(id, nameof(BusinessVariableProperty.Data9)), //子系统编码
|
subSystemCode = variableRuntime.GetPropertyValue(id, nameof(BusinessVariableProperty.Data9)), //子系统编码
|
||||||
// Type = "SUB_SYSTEM_ALARM", //默认填写字段
|
type = "SUB_SYSTEM_ALARM", //默认填写字段
|
||||||
// ConfirmAccount = opcAeEventData.ActorID, //告警确认人
|
confirmAccount = opcAeEventData.ActorID, //告警确认人
|
||||||
// ClearAccount = opcAeEventData.ActorID, //告警清除人
|
clearAccount = opcAeEventData.ActorID, //告警清除人
|
||||||
// ProcessInstruction = null //告警处理说明,OPCAE不带有
|
processInstruction = null //告警处理说明,OPCAE不带有
|
||||||
// };
|
};
|
||||||
// alarmEntities.Add(alarmEntity);
|
alarmEntities.Add(alarmEntity);
|
||||||
// }
|
}
|
||||||
// else
|
else
|
||||||
// {
|
{
|
||||||
// Logger?.LogInformation($"找不到相关变量{sourceName}");
|
Logger?.LogInformation($"找不到相关变量{sourceName}");
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// return alarmEntities;
|
return alarmEntities;
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
|
||||||
|
|
||||||
///// <summary>
|
/// <summary>
|
||||||
///// 告警实体
|
/// 告警实体
|
||||||
///// </summary>
|
/// </summary>
|
||||||
//public class KafkaAlarmEntity
|
public class KafkaAlarmEntity
|
||||||
//{
|
{
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 告警编码唯一 (非空)
|
/// 告警编码唯一 (非空)
|
||||||
// /// 示例:"8e8a118ac452fd04da8c26fa588a7cab"
|
/// 示例:"8e8a118ac452fd04da8c26fa588a7cab"
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public string AlarmCode { get; set; }
|
public string alarmCode { get; set; }
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 资源编码,唯一编码,需要按照映射表上传 (非空)
|
/// 资源编码,唯一编码,需要按照映射表上传 (非空)
|
||||||
// /// 示例:"RS_A6K9MUSG19V"
|
/// 示例:"RS_A6K9MUSG19V"
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public string ResourceCode { get; set; }
|
public string resourceCode { get; set; }
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 资源名称,需要按照映射表上传 (非空)
|
/// 资源名称,需要按照映射表上传 (非空)
|
||||||
// /// 示例:"MB-A7"
|
/// 示例:"MB-A7"
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public string ResourceName { get; set; }
|
public string resourceName { get; set; }
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 指标编码唯一,需要按照映射表上传 (非空)
|
/// 指标编码唯一,需要按照映射表上传 (非空)
|
||||||
// /// 示例:"ActivePowerPa"
|
/// 示例:"ActivePowerPa"
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public string MetricCode { get; set; }
|
public string metricCode { get; set; }
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 指标名称,需要按照映射表上传 (非空)
|
/// 指标名称,需要按照映射表上传 (非空)
|
||||||
// /// 示例:"有功功率Pa"
|
/// 示例:"有功功率Pa"
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public string MetricName { get; set; }
|
public string metricName { get; set; }
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 告警内容:设备名称+告警内容(包含阈值信息) (非空)
|
/// 告警内容:设备名称+告警内容(包含阈值信息) (非空)
|
||||||
// /// 示例:"MB-A7,有功功率Pa > 30"
|
/// 示例:"MB-A7,有功功率Pa > 30"
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public string Content { get; set; }
|
public string content { get; set; }
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 告警类型,子系统产生告警的类型 (非空)
|
/// 告警类型,子系统产生告警的类型 (非空)
|
||||||
// /// 示例:"0101" 表示高限报警
|
/// 示例:"0101" 表示高限报警
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public string AlarmType { get; set; }
|
public string alarmType { get; set; }
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 告警确认时间 (可空,时间戳)
|
/// 告警确认时间 (可空,时间戳)
|
||||||
// /// 示例:1586152800000
|
/// 示例:1586152800000
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public long? ConfirmedTime { get; set; }
|
public long? confirmedTime { get; set; }
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 解除告警时间 (可空,时间戳)
|
/// 解除告警时间 (可空,时间戳)
|
||||||
// /// 示例:1586152800000
|
/// 示例:1586152800000
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public long? FixTime { get; set; }
|
public DateTime? fixTime { get; set; }
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 产生告警时间 (非空,时间戳)
|
/// 产生告警时间 (非空,时间戳)
|
||||||
// /// 示例:1586152800000
|
/// 示例:1586152800000
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public long LastTime { get; set; }
|
public DateTime lastTime { get; set; }
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 告警状态 (非空)
|
/// 告警状态 (非空)
|
||||||
// /// 可选值:UNFIXED(新增告警)、FIXED(解除告警)
|
/// 可选值:UNFIXED(新增告警)、FIXED(解除告警)
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public string Status { get; set; }
|
public string status { get; set; }
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 告警等级,需要按照映射表上传 (非空)
|
/// 告警等级,需要按照映射表上传 (非空)
|
||||||
// /// 示例:"1"
|
/// 示例:"1"
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public string AlarmLevel { get; set; }
|
public string alarmLevel { get; set; }
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 子系统编码 (非空)
|
/// 子系统编码 (非空)
|
||||||
// /// 示例:"MS_NEW_PD_DCIM_001"
|
/// 示例:"MS_NEW_PD_DCIM_001"
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public string SubSystemCode { get; set; }
|
public string subSystemCode { get; set; }
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 默认填写字段 (非空)
|
/// 默认填写字段 (非空)
|
||||||
// /// 固定值:"SUB_SYSTEM_ALARM"
|
/// 固定值:"SUB_SYSTEM_ALARM"
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public string Type { get; set; }
|
public string type { get; set; }
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 告警确认人 (可空)
|
/// 告警确认人 (可空)
|
||||||
// /// 示例:"admin3"
|
/// 示例:"admin3"
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public string ConfirmAccount { get; set; }
|
public string confirmAccount { get; set; }
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 告警清除人 (可空)
|
/// 告警清除人 (可空)
|
||||||
// /// 示例:"admin"
|
/// 示例:"admin"
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public string ClearAccount { get; set; }
|
public string clearAccount { get; set; }
|
||||||
|
|
||||||
// /// <summary>
|
/// <summary>
|
||||||
// /// 告警处理说明 (可空)
|
/// 告警处理说明 (可空)
|
||||||
// /// 示例:"admin"
|
/// 示例:"admin"
|
||||||
// /// </summary>
|
/// </summary>
|
||||||
// public string ProcessInstruction { get; set; }
|
public string processInstruction { get; set; }
|
||||||
//}
|
}
|
||||||
@@ -1,46 +1,46 @@
|
|||||||
////------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
////此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
//此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||||
//// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||||
//// 源代码使用协议遵循本仓库的开源协议及附加协议
|
// 源代码使用协议遵循本仓库的开源协议及附加协议
|
||||||
//// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
||||||
//// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
||||||
//// 使用文档:https://thingsgateway.cn/
|
// 使用文档:https://thingsgateway.cn/
|
||||||
//// QQ群:605534569
|
// QQ群:605534569
|
||||||
//// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
|
|
||||||
//using ThingsGateway.Gateway.Application;
|
using ThingsGateway.Gateway.Application;
|
||||||
//using ThingsGateway.NewLife.Json.Extension;
|
using ThingsGateway.NewLife.Json.Extension;
|
||||||
//using ThingsGateway.Plugin.DB;
|
using ThingsGateway.Plugin.DB;
|
||||||
//using ThingsGateway.SqlSugar;
|
using ThingsGateway.SqlSugar;
|
||||||
|
|
||||||
//using TouchSocket.Core;
|
using TouchSocket.Core;
|
||||||
|
|
||||||
//public class TestSQL : DynamicSQLBase
|
public class TestSQL : DynamicSQLBase
|
||||||
//{
|
{
|
||||||
// public override Task DBInit(ISqlSugarClient db, CancellationToken cancellationToken)
|
public override Task DBInit(ISqlSugarClient db, CancellationToken cancellationToken)
|
||||||
// {
|
{
|
||||||
// db.DbMaintenance.CreateDatabase();
|
db.DbMaintenance.CreateDatabase();
|
||||||
// db.CodeFirst.InitTables<ThingsGateway.Plugin.OpcAe.OpcAeEventData>();
|
db.CodeFirst.InitTables<ThingsGateway.Plugin.OpcAe.OpcAeEventData>();
|
||||||
// return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// public override async Task DBInsertable(ISqlSugarClient db, IEnumerable<object> datas, CancellationToken cancellationToken)
|
public override async Task DBInsertable(ISqlSugarClient db, IEnumerable<object> datas, CancellationToken cancellationToken)
|
||||||
// {
|
{
|
||||||
// var pluginEventDatas = datas.Cast<PluginEventData>();
|
var pluginEventDatas = datas.Cast<PluginEventData>();
|
||||||
// var opcDatas = pluginEventDatas.Select(
|
var opcDatas = pluginEventDatas.Select(
|
||||||
// a =>
|
a =>
|
||||||
// {
|
{
|
||||||
// if (a.ObjectValue == null)
|
if (a.ObjectValue == null)
|
||||||
// {
|
{
|
||||||
// a.ObjectValue = a.Value.ToObject(Type.GetType(a.ValueType));
|
a.ObjectValue = a.Value.ToObject(Type.GetType(a.ValueType));
|
||||||
// }
|
}
|
||||||
// return a.ObjectValue is ThingsGateway.Plugin.OpcAe.OpcAeEventData opcData ? opcData : null;
|
return a.ObjectValue is ThingsGateway.Plugin.OpcAe.OpcAeEventData opcData ? opcData : null;
|
||||||
// }
|
}
|
||||||
// ).Where(a => a != null).ToList();
|
).Where(a => a != null).ToList();
|
||||||
// if (opcDatas.Count == 0)
|
if (opcDatas.Count == 0)
|
||||||
// return;
|
return;
|
||||||
// Logger?.Info(opcDatas.ToSystemTextJsonString());
|
Logger?.Info(opcDatas.ToSystemTextJsonString());
|
||||||
|
|
||||||
// await db.Insertable(opcDatas).ExecuteCommandAsync(cancellationToken).ConfigureAwait(false);
|
await db.Insertable(opcDatas).ExecuteCommandAsync(cancellationToken).ConfigureAwait(false);
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
|||||||
49
src/ThingsGateway.ScriptDebug/Test/TestServerRpc.cs
Normal file
49
src/ThingsGateway.ScriptDebug/Test/TestServerRpc.cs
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
//此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
|
||||||
|
// 此代码版权(除特别声明外的代码)归作者本人Diego所有
|
||||||
|
// 源代码使用协议遵循本仓库的开源协议及附加协议
|
||||||
|
// Gitee源代码仓库:https://gitee.com/diego2098/ThingsGateway
|
||||||
|
// Github源代码仓库:https://github.com/kimdiego2098/ThingsGateway
|
||||||
|
// 使用文档:https://thingsgateway.cn/
|
||||||
|
// QQ群:605534569
|
||||||
|
// ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
using MQTTnet;
|
||||||
|
using MQTTnet.Server;
|
||||||
|
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
using ThingsGateway.Foundation;
|
||||||
|
using ThingsGateway.NewLife.Json.Extension;
|
||||||
|
using ThingsGateway.Plugin.Mqtt;
|
||||||
|
|
||||||
|
using TouchSocket.Core;
|
||||||
|
|
||||||
|
public class TestServerRpc : DynamicMqttServerRpcBase
|
||||||
|
{
|
||||||
|
public override async Task RPCInvokeAsync(ILog logMessage, InterceptingPublishEventArgs args, MqttServerProperty driverPropertys, MQTTnet.Server.MqttServer mqttServer, Func<string, Dictionary<string, Dictionary<string, JToken>>, ValueTask<Dictionary<string, Dictionary<string, IOperResult>>>> getRpcResult, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
if (driverPropertys.RpcWriteTopic.IsNullOrWhiteSpace()) return;
|
||||||
|
|
||||||
|
var t = string.Format(null, "{0}/+", driverPropertys.RpcWriteTopic);
|
||||||
|
if (MqttTopicFilterComparer.Compare(args.ApplicationMessage.Topic, t) != MqttTopicFilterCompareResult.IsMatch)
|
||||||
|
return;
|
||||||
|
var rpcDatas = Encoding.UTF8.GetString(args.ApplicationMessage.Payload).FromJsonNetString<Dictionary<string, Dictionary<string, JToken>>>();
|
||||||
|
if (rpcDatas == null)
|
||||||
|
return;
|
||||||
|
var mqttRpcResult = await getRpcResult(args.ClientId, rpcDatas).ConfigureAwait(false);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var variableMessage = new MqttApplicationMessageBuilder()
|
||||||
|
.WithTopic($"{args.ApplicationMessage.Topic}/Response")
|
||||||
|
.WithPayload(mqttRpcResult.ToSystemTextJsonString(driverPropertys.JsonFormattingIndented)).Build();
|
||||||
|
await mqttServer.InjectApplicationMessage(new InjectedMqttApplicationMessage(variableMessage), cancellationToken).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,43 +3,24 @@
|
|||||||
<Import Project="..\Version.props" />
|
<Import Project="..\Version.props" />
|
||||||
|
|
||||||
|
|
||||||
<ItemGroup Condition=" '$(SolutionName)' != 'ThingsGatewayRelease'">
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Gateway\ThingsGateway.Gateway.Application\ThingsGateway.Gateway.Application.csproj" />
|
<ProjectReference Include="..\Gateway\ThingsGateway.Gateway.Application\ThingsGateway.Gateway.Application.csproj" />
|
||||||
<ProjectReference Include="..\Gateway\ThingsGateway.Gateway.Razor\ThingsGateway.Gateway.Razor.csproj" />
|
<ProjectReference Include="..\Gateway\ThingsGateway.Gateway.Razor\ThingsGateway.Gateway.Razor.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
<!--发布版-->
|
|
||||||
<Import Project="targets\Gateway.targets" Condition=" '$(SolutionName)' == 'ThingsGatewayRelease' " />
|
|
||||||
<Import Project="targets\Admin.targets" Condition=" '$(SolutionName)' == 'ThingsGatewayRelease' " />
|
|
||||||
|
|
||||||
<Import Project="targets\PluginContext.targets" Condition=" '$(SolutionName)' == 'ThingsGatewayPro' AND '$(Configuration)' != 'Debug' " />
|
|
||||||
|
|
||||||
<!--nuget包解压复制文件,上下文动态加载-->
|
|
||||||
<Import Project="targets\PluginContext.targets" Condition=" '$(SolutionName)' != 'ThingsGatewayPro' AND '$(Configuration)' != 'Debug' " />
|
|
||||||
<!--直接引用-->
|
<!--直接引用-->
|
||||||
<Import Project="targets\PluginDebug.targets" Condition=" '$(SolutionName)' != 'ThingsGatewayPro' AND '$(Configuration)' == 'Debug' " />
|
<Import Project="targets\PluginDebug.targets"/>
|
||||||
|
|
||||||
|
|
||||||
|
<Import Project="targets\ProPluginDebug.targets" Condition=" '$(SolutionName)' == 'ThingsGatewayPro' "/>
|
||||||
|
|
||||||
|
|
||||||
<!--nuget包解压复制文件,插件域隔离动态加载-->
|
|
||||||
<!--<Import Project="targets\Plugin.targets" />-->
|
|
||||||
|
|
||||||
<!--nuget包解压复制文件,上下文动态加载,Pro插件-->
|
<!--nuget包解压复制文件,上下文动态加载,Pro插件-->
|
||||||
<Import Project="targets\Pro2.targets" Condition=" '$(SolutionName)' != 'ThingsGatewayPro' OR '$(Configuration)' != 'Debug'" />
|
<Import Project="targets\Pro2.targets" Condition=" '$(SolutionName)' != 'ThingsGatewayPro'" />
|
||||||
|
|
||||||
<!--直接引用Pro-->
|
<Import Project="targets\Pro7.targets" Condition=" '$(SolutionName)' != 'ThingsGatewayPro'" />
|
||||||
<Import Project="targets\PluginDebug.targets" Condition=" '$(SolutionName)' == 'ThingsGatewayPro' AND '$(Configuration)' == 'Debug'" />
|
|
||||||
|
|
||||||
|
|
||||||
<Import Project="targets\ProPluginDebug.targets" Condition=" '$(SolutionName)' == 'ThingsGatewayPro' AND '$(Configuration)' == 'Debug'" />
|
|
||||||
|
|
||||||
<!--<Import Project="targets\Pro3.targets" Condition=" '$(SolutionName)' == 'ThingsGatewayPro' " />
|
|
||||||
<Import Project="targets\Pro5.targets" Condition=" '$(SolutionName)' == 'ThingsGatewayPro' " />-->
|
|
||||||
<!--<Import Project="targets\Pro6.targets" Condition=" '$(SolutionName)' == 'ThingsGatewayPro' AND '$(Configuration)' != 'Debug'" />-->
|
|
||||||
<!--nuget包解压复制文件,上下文动态加载,Pro插件-->
|
|
||||||
<Import Project="targets\Pro7.targets" Condition=" '$(SolutionName)' != 'ThingsGatewayPro' OR '$(Configuration)' != 'Debug'" />
|
|
||||||
|
|
||||||
<!--打包复制-->
|
|
||||||
<Import Project="targets\PluginPublish.targets" />
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|
||||||
<GenerateDocumentationFile>false</GenerateDocumentationFile>
|
<GenerateDocumentationFile>false</GenerateDocumentationFile>
|
||||||
|
|||||||
@@ -5,61 +5,61 @@
|
|||||||
<!--Modbus 插件-->
|
<!--Modbus 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.Modbus" Version="$(PluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.Modbus" Version="$(PluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<!--SiemensS7 插件-->
|
<!--SiemensS7 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.SiemensS7" Version="$(PluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.SiemensS7" Version="$(PluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<!--Dlt645 插件-->
|
<!--Dlt645 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.Dlt645" Version="$(PluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.Dlt645" Version="$(PluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<!--OpcDa 插件-->
|
<!--OpcDa 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.OpcDa" Version="$(PluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.OpcDa" Version="$(PluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<!--OpcUa 插件-->
|
<!--OpcUa 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.OpcUa" Version="$(PluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.OpcUa" Version="$(PluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<!--DB 插件-->
|
<!--DB 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.DB" Version="$(PluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.DB" Version="$(PluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<!--Kafka 插件-->
|
<!--Kafka 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.Kafka" Version="$(PluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.Kafka" Version="$(PluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<!--Mqtt 插件-->
|
<!--Mqtt 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.Mqtt" Version="$(PluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.Mqtt" Version="$(PluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<!--RabbitMQ 插件-->
|
<!--RabbitMQ 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.RabbitMQ" Version="$(PluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.RabbitMQ" Version="$(PluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<!--webhook 插件-->
|
<!--webhook 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.Http" Version="$(PluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.Http" Version="$(PluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,62 +6,62 @@
|
|||||||
<!--Modbus 插件-->
|
<!--Modbus 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.Modbus" Version="$(PluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.Modbus" Version="$(PluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<!--SiemensS7 插件-->
|
<!--SiemensS7 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.SiemensS7" Version="$(PluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.SiemensS7" Version="$(PluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<!--Dlt645 插件-->
|
<!--Dlt645 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.Dlt645" Version="$(PluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.Dlt645" Version="$(PluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<!--OpcDa 插件-->
|
<!--OpcDa 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.OpcDa" Version="$(PluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.OpcDa" Version="$(PluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<!--OpcUa 插件-->
|
<!--OpcUa 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.OpcUa" Version="$(PluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.OpcUa" Version="$(PluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<!--DB 插件-->
|
<!--DB 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.DB" Version="$(PluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.DB" Version="$(PluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<!--Kafka 插件-->
|
<!--Kafka 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.Kafka" Version="$(PluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.Kafka" Version="$(PluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<!--Mqtt 插件-->
|
<!--Mqtt 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.Mqtt" Version="$(PluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.Mqtt" Version="$(PluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
<!--RabbitMQ 插件-->
|
<!--RabbitMQ 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.RabbitMQ" Version="$(PluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.RabbitMQ" Version="$(PluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
|
|
||||||
<!--webhook 插件-->
|
<!--webhook 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.Http" Version="$(PluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.Http" Version="$(PluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,39 +3,39 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ThingsGateway.Plugin.SyncBridge" Version="$(ProPluginVersion)" GeneratePathProperty="true">
|
<PackageReference Include="ThingsGateway.Plugin.SyncBridge" Version="$(ProPluginVersion)" GeneratePathProperty="true">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<IncludeAssets> native;</IncludeAssets>
|
<IncludeAssets> all;</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="ThingsGateway.Plugin.Inovance" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets=" native;" />
|
<PackageReference Include="ThingsGateway.Plugin.Inovance" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
<PackageReference Include="ThingsGateway.Plugin.TIANXIN" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets=" native;" />
|
<PackageReference Include="ThingsGateway.Plugin.TIANXIN" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
<PackageReference Include="ThingsGateway.Plugin.HJ212" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets=" native;" />
|
<PackageReference Include="ThingsGateway.Plugin.HJ212" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
<PackageReference Include="ThingsGateway.Plugin.BACnet" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets=" native;" />
|
<PackageReference Include="ThingsGateway.Plugin.BACnet" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
<!--AllenBradleyCip 插件-->
|
<!--AllenBradleyCip 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.AllenBradleyCip" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets=" native;" />
|
<PackageReference Include="ThingsGateway.Plugin.AllenBradleyCip" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
<!--DCON 插件-->
|
<!--DCON 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.DCON" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets=" native;" />
|
<PackageReference Include="ThingsGateway.Plugin.DCON" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
<!--EDPF_NT 插件-->
|
<!--EDPF_NT 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.EDPF_NT" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets=" native;" />
|
<PackageReference Include="ThingsGateway.Plugin.EDPF_NT" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
<!--KELID2008 插件-->
|
<!--KELID2008 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.KELID2008" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets=" native;" />
|
<PackageReference Include="ThingsGateway.Plugin.KELID2008" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
<!--LKSIS 插件-->
|
<!--LKSIS 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.LKSIS" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets=" native;" />
|
<PackageReference Include="ThingsGateway.Plugin.LKSIS" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
<!--Melsec 插件-->
|
<!--Melsec 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.Melsec" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets=" native;" />
|
<PackageReference Include="ThingsGateway.Plugin.Melsec" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
<!--Omron 插件-->
|
<!--Omron 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.Omron" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets=" native;" />
|
<PackageReference Include="ThingsGateway.Plugin.Omron" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
<!--DKQ_A16D 插件-->
|
<!--DKQ_A16D 插件-->
|
||||||
<!--<PackageReference Include="ThingsGateway.Plugin.DKQ_A16D" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets=" native;" />-->
|
<!--<PackageReference Include="ThingsGateway.Plugin.DKQ_A16D" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />-->
|
||||||
<!--IDR210 插件-->
|
<!--IDR210 插件-->
|
||||||
<!--<PackageReference Include="ThingsGateway.Plugin.IDR210" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets=" native;" />-->
|
<!--<PackageReference Include="ThingsGateway.Plugin.IDR210" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />-->
|
||||||
<!--URF_R330 插件-->
|
<!--URF_R330 插件-->
|
||||||
<!--<PackageReference Include="ThingsGateway.Plugin.URF_R330" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets=" native;" />-->
|
<!--<PackageReference Include="ThingsGateway.Plugin.URF_R330" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />-->
|
||||||
<!--USBScaner 插件-->
|
<!--USBScaner 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.USBScaner" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets=" native;" />
|
<PackageReference Include="ThingsGateway.Plugin.USBScaner" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
|
|
||||||
|
|
||||||
<PackageReference Include="ThingsGateway.Plugin.SECS" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets=" native;" />
|
<PackageReference Include="ThingsGateway.Plugin.SECS" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
<PackageReference Include="ThingsGateway.Plugin.TS550" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets=" native;" />
|
<PackageReference Include="ThingsGateway.Plugin.TS550" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
<PackageReference Include="ThingsGateway.Plugin.Vigor" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets=" native;" />
|
<PackageReference Include="ThingsGateway.Plugin.Vigor" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<!--HUANANSFSK 插件-->
|
<!--HUANANSFSK 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.HUANANSFSK" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="native;" />
|
<PackageReference Include="ThingsGateway.Plugin.HUANANSFSK" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
<!--YPSFSK 插件-->
|
<!--YPSFSK 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.YPSFSK" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="native;" />
|
<PackageReference Include="ThingsGateway.Plugin.YPSFSK" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="CopyOtherPlugin3NugetPackages" AfterTargets="Build">
|
<Target Name="CopyOtherPlugin3NugetPackages" AfterTargets="Build">
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<Project>
|
<Project>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ThingsGateway.Plugin.ModbusC1" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="native;" />
|
<PackageReference Include="ThingsGateway.Plugin.ModbusC1" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
<PackageReference Include="ThingsGateway.Plugin.ModbusGY" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="native;" />
|
<PackageReference Include="ThingsGateway.Plugin.ModbusGY" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<!--MqttYINGKE 插件-->
|
<!--MqttYINGKE 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.MqttYINGKE" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="native;" />
|
<PackageReference Include="ThingsGateway.Plugin.MqttYINGKE" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="CopyOtherPlugin5NugetPackages" AfterTargets="Build">
|
<Target Name="CopyOtherPlugin5NugetPackages" AfterTargets="Build">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<!--MqttYINGKE 插件-->
|
<!--MqttYINGKE 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.IXCom29s" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="native;" />
|
<PackageReference Include="ThingsGateway.Plugin.IXCom29s" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="CopyOtherPlugin6NugetPackages" AfterTargets="Build">
|
<Target Name="CopyOtherPlugin6NugetPackages" AfterTargets="Build">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<!--MqttYINGKE 插件-->
|
<!--MqttYINGKE 插件-->
|
||||||
<PackageReference Include="ThingsGateway.Plugin.OpcAe" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="native;" />
|
<PackageReference Include="ThingsGateway.Plugin.OpcAe" Version="$(ProPluginVersion)" GeneratePathProperty="true" Private="false" IncludeAssets="all;" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="CopyOtherPlugin7NugetPackages" AfterTargets="Build">
|
<Target Name="CopyOtherPlugin7NugetPackages" AfterTargets="Build">
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
<ProjectReference Include="..\PluginPro\ThingsGateway.Plugin.IXCom29s\ThingsGateway.Plugin.IXCom29s.csproj" />
|
<ProjectReference Include="..\PluginPro\ThingsGateway.Plugin.IXCom29s\ThingsGateway.Plugin.IXCom29s.csproj" />
|
||||||
<ProjectReference Include="..\PluginPro\ThingsGateway.Plugin.OpcAe\ThingsGateway.Plugin.OpcAe.csproj" />
|
<ProjectReference Include="..\PluginPro\ThingsGateway.Plugin.OpcAe\ThingsGateway.Plugin.OpcAe.csproj" />
|
||||||
<ProjectReference Include="..\PluginPro\ThingsGateway.Foundation.OpcAe\ThingsGateway.Foundation.OpcAe.csproj" />
|
<ProjectReference Include="..\PluginPro\ThingsGateway.Foundation.OpcAe\ThingsGateway.Foundation.OpcAe.csproj" />
|
||||||
|
<ProjectReference Include="..\PluginPro\ThingsGateway.Gateway.VariableCore\ThingsGateway.Gateway.VariableCore.csproj" />
|
||||||
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user