优化了opcua node的命名方式,默认连接云端的modbus设备
This commit is contained in:
parent
1697678f34
commit
ae2e67d3f7
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -12,7 +12,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs
|
||||
public class CopyVM : BaseVM
|
||||
{
|
||||
public string 设备名称 { get; set; }
|
||||
public uint 复制数量 { get; set; } = 20;
|
||||
public uint 复制数量 { get; set; } = 1;
|
||||
public string 复制结果 { get; set; }
|
||||
|
||||
public void Copy()
|
||||
|
@ -1,89 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ApplicationConfiguration
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:ua="http://opcfoundation.org/UA/2008/02/Types.xsd"
|
||||
xmlns="http://opcfoundation.org/UA/SDK/Configuration.xsd"
|
||||
>
|
||||
<ApplicationName>Quickstart Console Reference Client</ApplicationName>
|
||||
<ApplicationUri>urn:localhost:UA:Quickstarts:ReferenceClient</ApplicationUri>
|
||||
<ProductUri>uri:opcfoundation.org:Quickstarts:ReferenceClient</ProductUri>
|
||||
<ApplicationType>Client_1</ApplicationType>
|
||||
|
||||
<SecurityConfiguration>
|
||||
|
||||
<!-- Where the application instance certificate is stored (MachineDefault) -->
|
||||
<ApplicationCertificate>
|
||||
<StoreType>Directory</StoreType>
|
||||
<StorePath>%LocalApplicationData%/OPC Foundation/pki/own</StorePath>
|
||||
<SubjectName>CN=Console Reference Client, C=US, S=Arizona, O=OPC Foundation, DC=localhost</SubjectName>
|
||||
</ApplicationCertificate>
|
||||
|
||||
<!-- Where the issuer certificate are stored (certificate authorities) -->
|
||||
<TrustedIssuerCertificates>
|
||||
<StoreType>Directory</StoreType>
|
||||
<StorePath>%LocalApplicationData%/OPC Foundation/pki/issuer</StorePath>
|
||||
</TrustedIssuerCertificates>
|
||||
|
||||
<!-- Where the trust list is stored -->
|
||||
<TrustedPeerCertificates>
|
||||
<StoreType>Directory</StoreType>
|
||||
<StorePath>%LocalApplicationData%/OPC Foundation/pki/trusted</StorePath>
|
||||
</TrustedPeerCertificates>
|
||||
|
||||
<!-- The directory used to store invalid certficates for later review by the administrator. -->
|
||||
<RejectedCertificateStore>
|
||||
<StoreType>Directory</StoreType>
|
||||
<StorePath>%LocalApplicationData%/OPC Foundation/pki/rejected</StorePath>
|
||||
</RejectedCertificateStore>
|
||||
|
||||
<!-- WARNING: The following setting (to automatically accept untrusted certificates) should be used
|
||||
for easy debugging purposes ONLY and turned off for production deployments! -->
|
||||
<AutoAcceptUntrustedCertificates>false</AutoAcceptUntrustedCertificates>
|
||||
|
||||
</SecurityConfiguration>
|
||||
|
||||
<TransportConfigurations></TransportConfigurations>
|
||||
|
||||
<TransportQuotas>
|
||||
<OperationTimeout>600000</OperationTimeout>
|
||||
<MaxStringLength>1048576</MaxStringLength>
|
||||
<MaxByteStringLength>1048576</MaxByteStringLength>
|
||||
<MaxArrayLength>65535</MaxArrayLength>
|
||||
<MaxMessageSize>4194304</MaxMessageSize>
|
||||
<MaxBufferSize>65535</MaxBufferSize>
|
||||
<ChannelLifetime>300000</ChannelLifetime>
|
||||
<SecurityTokenLifetime>3600000</SecurityTokenLifetime>
|
||||
</TransportQuotas>
|
||||
|
||||
<ClientConfiguration>
|
||||
<DefaultSessionTimeout>60000</DefaultSessionTimeout>
|
||||
<WellKnownDiscoveryUrls>
|
||||
<ua:String>opc.tcp://{0}:4840</ua:String>
|
||||
<ua:String>http://{0}:52601/UADiscovery</ua:String>
|
||||
<ua:String>http://{0}/UADiscovery/Default.svc</ua:String>
|
||||
</WellKnownDiscoveryUrls>
|
||||
<DiscoveryServers></DiscoveryServers>
|
||||
<MinSubscriptionLifetime>10000</MinSubscriptionLifetime>
|
||||
</ClientConfiguration>
|
||||
|
||||
<Extensions>
|
||||
</Extensions>
|
||||
|
||||
<TraceConfiguration>
|
||||
<OutputFilePath>%LocalApplicationData%/OPC Foundation/Logs/Quickstarts.ReferenceClient.log.txt</OutputFilePath>
|
||||
<DeleteOnLoad>true</DeleteOnLoad>
|
||||
<!-- Show Only Errors -->
|
||||
<!-- <TraceMasks>1</TraceMasks> -->
|
||||
<!-- Show Only Security and Errors -->
|
||||
<!-- <TraceMasks>513</TraceMasks> -->
|
||||
<!-- Show Only Security, Errors and Trace -->
|
||||
<!-- <TraceMasks>515</TraceMasks> -->
|
||||
<!-- Show Only Security, COM Calls, Errors and Trace -->
|
||||
<!-- <TraceMasks>771</TraceMasks> -->
|
||||
<!-- Show Only Security, Service Calls, Errors and Trace -->
|
||||
<!-- <TraceMasks>523</TraceMasks> -->
|
||||
<!-- Show Only Security, ServiceResultExceptions, Errors and Trace -->
|
||||
<!-- <TraceMasks>519</TraceMasks> -->
|
||||
</TraceConfiguration>
|
||||
|
||||
</ApplicationConfiguration>
|
@ -1,12 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using Microsoft.AspNetCore.Mvc.Razor;
|
||||
using Microsoft.AspNetCore.StaticFiles;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using Microsoft.Extensions.Options;
|
||||
using MQTTnet.AspNetCore;
|
||||
using MQTTnet.AspNetCore.Extensions;
|
||||
@ -84,8 +88,29 @@ namespace IoTGateway
|
||||
{
|
||||
IconFontsHelper.GenerateIconFont();
|
||||
|
||||
var pvd = new StaticFileOptions
|
||||
{
|
||||
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), @"wwwroot")),
|
||||
RequestPath = new PathString(""),
|
||||
//设置不限制content-type 该设置可以下载所有类型的文件,但是不建议这么设置,因为不安全
|
||||
//下面设置可以下载apk和nupkg类型的文件
|
||||
ContentTypeProvider = new FileExtensionContentTypeProvider(new Dictionary<string, string>
|
||||
{
|
||||
{ ".html", "text/html" },
|
||||
{ ".glb", "model/gltf-binary" },
|
||||
{ ".js", "application/javascript" },
|
||||
{ ".css", "text/css" },
|
||||
{ ".wasm", "application/wasm" },
|
||||
{ ".png", "image/png" },
|
||||
{ ".woff", "application/font-woff" },
|
||||
{ ".woff2", "application/font-woff" },
|
||||
{ ".ico", "image/x-icon" },
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
app.UseExceptionHandler(configs.CurrentValue.ErrorHandler);
|
||||
app.UseStaticFiles();
|
||||
app.UseStaticFiles(pvd);
|
||||
app.UseWtmStaticFiles();
|
||||
app.UseRouting();
|
||||
app.UseWtmMultiLanguages();
|
||||
|
Binary file not shown.
@ -88,7 +88,7 @@ namespace Plugin
|
||||
{
|
||||
try
|
||||
{
|
||||
ret.CookedValue = interpreter.Eval(DealMysqlStr(item.Expressions).Replace("raw", ret.Value.ToString()));
|
||||
ret.CookedValue = interpreter.Eval(DealMysqlStr(item.Expressions).Replace("raw", ret.Value?.ToString()));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
@ -79,10 +79,10 @@ namespace Plugin
|
||||
{
|
||||
foreach (var kv in payload.Values)
|
||||
{
|
||||
_mqttClient.PublishAsync($"{TopicBase}/{device.DeviceName}/{kv.Key}", kv.Value.ToString());
|
||||
_mqttClient.PublishAsync($"{TopicBase}/{device.DeviceName}/{kv.Key}", kv.Value?.ToString());
|
||||
|
||||
//更新到UAService
|
||||
_uaNodeManager.UpdateNode($"{device.Parent.DeviceName}_{device.DeviceName}_{kv.Key}", kv.Value);
|
||||
_uaNodeManager.UpdateNode($"{device.Parent.DeviceName}.{device.DeviceName}.{kv.Key}", kv.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2788,7 +2788,7 @@ namespace Quickstarts.ReferenceServer
|
||||
{
|
||||
//先把变量加进去,都用float有瑕疵,属性先不做,
|
||||
|
||||
CreateIoTGatewayVariable(staticFolder, $"{group.DeviceName}_{device.DeviceName}_{variable.Name}", $"{variable.Name}", DataTypeIds.Float, ValueRanks.Scalar);
|
||||
CreateIoTGatewayVariable(staticFolder, $"{group.DeviceName}.{device.DeviceName}.{variable.Name}", $"{variable.Name}", DataTypeIds.Float, ValueRanks.Scalar);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
iotgateway.db
BIN
iotgateway.db
Binary file not shown.
Loading…
Reference in New Issue
Block a user