mirror of
https://gitee.com/ThingsGateway/ThingsGateway.git
synced 2025-10-20 10:50:48 +08:00
opcuaServer支持decimal类型
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<Project>
|
||||
|
||||
<PropertyGroup>
|
||||
<PluginVersion>10.9.27</PluginVersion>
|
||||
<PluginVersion>10.9.28</PluginVersion>
|
||||
<ProPluginVersion>10.9.26</ProPluginVersion>
|
||||
<DefaultVersion>10.9.27</DefaultVersion>
|
||||
<DefaultVersion>10.9.28</DefaultVersion>
|
||||
<AuthenticationVersion>2.9.13</AuthenticationVersion>
|
||||
<SourceGeneratorVersion>10.9.13</SourceGeneratorVersion>
|
||||
<NET8Version>8.0.17</NET8Version>
|
||||
|
@@ -116,7 +116,8 @@ public static class JsonUtils
|
||||
case BuiltInType.Int64: { return decoder.ReadInt64(fieldName); }
|
||||
case BuiltInType.UInt64: { return decoder.ReadUInt64(fieldName); }
|
||||
case BuiltInType.Float: { return decoder.ReadFloat(fieldName); }
|
||||
case BuiltInType.Double: { return decoder.ReadDouble(fieldName); }
|
||||
case BuiltInType.Double:
|
||||
case BuiltInType.Number: { return decoder.ReadDouble(fieldName); }
|
||||
case BuiltInType.String:
|
||||
{
|
||||
if (decoder.ReadField(fieldName, out var value))
|
||||
@@ -288,7 +289,7 @@ public static class JsonUtils
|
||||
}
|
||||
case BuiltInType.Number:
|
||||
{
|
||||
encoder.WriteInt64(fieldName, Convert.ToInt64(value));
|
||||
encoder.WriteDouble(fieldName, Convert.ToInt64(value));
|
||||
return;
|
||||
}
|
||||
case BuiltInType.UInteger:
|
||||
|
@@ -287,6 +287,8 @@ public class ThingsGatewayNodeManager : CustomNodeManager2
|
||||
return DataTypeIds.String;
|
||||
if (tp == typeof(DateTime))
|
||||
return DataTypeIds.DateTime;
|
||||
if (tp == typeof(decimal))
|
||||
return DataTypeIds.Decimal;
|
||||
return DataTypeIds.String;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user