Skip to content

Commit

Permalink
Bump Nuget to 1.5.374.168 (#408)
Browse files Browse the repository at this point in the history
* bump to 1.5.374.168
* make GetManagerHandle none blocking

---------

Co-authored-by: Luis Cantero <[email protected]>
  • Loading branch information
mregen and luiscantero authored Jan 24, 2025
1 parent da8407e commit a5d1fdb
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 91 deletions.
52 changes: 20 additions & 32 deletions src/AlarmCondition/QuickstartNodeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,7 @@ protected void AddExternalReference(
}

// add reserve reference from external node.
var referenceToAdd = new ReferenceNode
{
var referenceToAdd = new ReferenceNode {
ReferenceTypeId = referenceTypeId,
IsInverse = isInverse,
TargetId = targetId
Expand Down Expand Up @@ -811,11 +810,8 @@ public virtual void DeleteAddressSpace()
/// the handle is passed into other methods such as 'Read' or 'Write'.
/// </remarks>
public virtual object GetManagerHandle(NodeId nodeId)
{
lock (Lock)
{
return GetManagerHandle(SystemContext, nodeId, null);
}
{
return GetManagerHandle(SystemContext, nodeId, null);
}

/// <summary>
Expand All @@ -832,8 +828,7 @@ protected virtual NodeHandle GetManagerHandle(ServerSystemContext context, NodeI
{
if (PredefinedNodes.TryGetValue(nodeId, out NodeState node))
{
var handle = new NodeHandle
{
var handle = new NodeHandle {
NodeId = nodeId,
Node = node,
Validated = true,
Expand Down Expand Up @@ -937,18 +932,18 @@ public virtual NodeMetadata GetNodeMetadata(
object targetHandle,
BrowseResultMask resultMask)
{
ServerSystemContext systemContext = SystemContext.Copy(context);
ServerSystemContext systemContext = SystemContext.Copy(context);

// check for valid handle.
NodeHandle handle = IsHandleInNamespace(targetHandle);

if (handle == null)
{
return null;
}

lock (Lock)
{
// check for valid handle.
NodeHandle handle = IsHandleInNamespace(targetHandle);

if (handle == null)
{
return null;
}

// validate node.
NodeState target = ValidateNode(systemContext, handle, null);

Expand All @@ -972,8 +967,7 @@ public virtual NodeMetadata GetNodeMetadata(
Attributes.UserExecutable);

// construct the metadata object.
var metadata = new NodeMetadata(target, target.NodeId)
{
var metadata = new NodeMetadata(target, target.NodeId) {
NodeClass = target.NodeClass,
BrowseName = target.BrowseName,
DisplayName = target.DisplayName
Expand Down Expand Up @@ -1148,8 +1142,7 @@ protected virtual ReferenceDescription GetReferenceDescription(
_ = SystemContext.Copy(context);

// create the type definition reference.
ReferenceDescription description = new()
{
ReferenceDescription description = new() {
NodeId = reference.TargetId
};
description.SetReferenceType(continuationPoint.ResultMask, reference.ReferenceTypeId, !reference.IsInverse);
Expand Down Expand Up @@ -3238,8 +3231,7 @@ protected virtual ServiceResult ReadInitialValue(
NodeHandle handle,
IDataChangeMonitoredItem2 monitoredItem)
{
DataValue initialValue = new()
{
DataValue initialValue = new() {
Value = null,
ServerTimestamp = DateTime.UtcNow,
SourceTimestamp = DateTime.MinValue,
Expand Down Expand Up @@ -3310,8 +3302,7 @@ protected virtual StatusCode ValidateMonitoringFilter(
return StatusCodes.BadAggregateNotSupported;
}

ServerAggregateFilter revisedFilter = new()
{
ServerAggregateFilter revisedFilter = new() {
AggregateType = aggregateFilter.AggregateType,
StartTime = aggregateFilter.StartTime,
ProcessingInterval = aggregateFilter.ProcessingInterval,
Expand All @@ -3326,8 +3317,7 @@ protected virtual StatusCode ValidateMonitoringFilter(
return error;
}

AggregateFilterResult aggregateFilterResult = new()
{
AggregateFilterResult aggregateFilterResult = new() {
RevisedProcessingInterval = aggregateFilter.ProcessingInterval,
RevisedStartTime = aggregateFilter.StartTime,
RevisedAggregateConfiguration = aggregateFilter.AggregateConfiguration
Expand Down Expand Up @@ -4020,8 +4010,7 @@ protected NodeState AddNodeToComponentCache(ISystemContext context, NodeHandle h

if (root != null)
{
entry = new CacheEntry
{
entry = new CacheEntry {
RefCount = 1,
Entry = root
};
Expand All @@ -4038,8 +4027,7 @@ protected NodeState AddNodeToComponentCache(ISystemContext context, NodeHandle h
return entry.Entry;
}

entry = new CacheEntry
{
entry = new CacheEntry {
RefCount = 1,
Entry = node
};
Expand Down
33 changes: 15 additions & 18 deletions src/Reference/ReferenceNodeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2668,29 +2668,26 @@ public override void DeleteAddressSpace()
/// </summary>
protected override NodeHandle GetManagerHandle(ServerSystemContext context, NodeId nodeId, IDictionary<NodeId, NodeState> cache)
{
lock (Lock)
// quickly exclude nodes that are not in the namespace.
if (!IsNodeIdInNamespace(nodeId))
{
// quickly exclude nodes that are not in the namespace.
if (!IsNodeIdInNamespace(nodeId))
{
return null;
}
return null;
}

NodeState node = null;
NodeState node = null;

if (!PredefinedNodes.TryGetValue(nodeId, out node))
{
return null;
}
if (!PredefinedNodes.TryGetValue(nodeId, out node))
{
return null;
}

var handle = new NodeHandle {
NodeId = nodeId,
Node = node,
Validated = true,
};
var handle = new NodeHandle {
NodeId = nodeId,
Node = node,
Validated = true,
};

return handle;
}
return handle;
}

/// <summary>
Expand Down
47 changes: 21 additions & 26 deletions src/SimpleEvent/SimpleEventsNodeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,30 +141,26 @@ public override void DeleteAddressSpace()
/// Returns a unique handle for the node.
/// </summary>
protected override NodeHandle GetManagerHandle(ServerSystemContext context, NodeId nodeId, IDictionary<NodeId, NodeState> cache)
{
lock (Lock)
{
// quickly exclude nodes that are not in the namespace.
if (!IsNodeIdInNamespace(nodeId))
{
return null;
}

// check for predefined nodes.
if (PredefinedNodes != null && PredefinedNodes.TryGetValue(nodeId, out NodeState node))
{
var handle = new NodeHandle
{
NodeId = nodeId,
Validated = true,
Node = node,
};

return handle;
}

return null;
}
{
// quickly exclude nodes that are not in the namespace.
if (!IsNodeIdInNamespace(nodeId))
{
return null;
}

// check for predefined nodes.
if (PredefinedNodes != null && PredefinedNodes.TryGetValue(nodeId, out NodeState node))
{
var handle = new NodeHandle {
NodeId = nodeId,
Validated = true,
Node = node,
};

return handle;
}

return null;
}

/// <summary>
Expand Down Expand Up @@ -217,8 +213,7 @@ private void DoSimulation(object state)
e.SetChildValue(SystemContext, Opc.Ua.BrowseNames.SourceNode, Opc.Ua.ObjectIds.Server, copy: false);
e.SetChildValue(SystemContext, new QualifiedName(BrowseNames.CycleId, NamespaceIndex), m_cycleId.ToString(), copy: false);

var step = new CycleStepDataType
{
var step = new CycleStepDataType {
Name = "Step 1",
Duration = 1000,
};
Expand Down
12 changes: 8 additions & 4 deletions src/opc-plc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,26 @@
<Choose>
<When Condition="'$(Configuration)'=='Debug'">
<ItemGroup Condition="!$(DefineConstants.Contains(UseLocalOpcUaSdk))">
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration.Debug" Version="1.5.374.158" NoWarn="NU5104" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server.Debug" Version="1.5.374.158" NoWarn="NU5104" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration.Debug" Version="1.5.374.168" NoWarn="NU5104" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server.Debug" Version="1.5.374.168" NoWarn="NU5104" />
</ItemGroup>
<ItemGroup Condition="$(DefineConstants.Contains(UseLocalOpcUaSdk))">
<ProjectReference Include="..\..\UA-.NETStandard\Libraries\Opc.Ua.Configuration\Opc.Ua.Configuration.csproj" />
<ProjectReference Include="..\..\UA-.NETStandard\Libraries\Opc.Ua.Security.Certificates\Opc.Ua.Security.Certificates.csproj" />
<ProjectReference Include="..\..\UA-.NETStandard\Libraries\Opc.Ua.Server\Opc.Ua.Server.csproj" />
<ProjectReference Include="..\..\UA-.NETStandard\Stack\Opc.Ua.Core\Opc.Ua.Core.csproj" />
</ItemGroup>
</When>
<When Condition="'$(Configuration)'=='Release'">
<ItemGroup Condition="!$(DefineConstants.Contains(UseLocalOpcUaSdk))">
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration" Version="1.5.374.158" NoWarn="NU5104" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server" Version="1.5.374.158" NoWarn="NU5104" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration" Version="1.5.374.168" NoWarn="NU5104" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server" Version="1.5.374.168" NoWarn="NU5104" />
</ItemGroup>
<ItemGroup Condition="$(DefineConstants.Contains(UseLocalOpcUaSdk))">
<ProjectReference Include="..\..\UA-.NETStandard\Libraries\Opc.Ua.Configuration\Opc.Ua.Configuration.csproj" />
<ProjectReference Include="..\..\UA-.NETStandard\Libraries\Opc.Ua.Security.Certificates\Opc.Ua.Security.Certificates.csproj" />
<ProjectReference Include="..\..\UA-.NETStandard\Libraries\Opc.Ua.Server\Opc.Ua.Server.csproj" />
<ProjectReference Include="..\..\UA-.NETStandard\Stack\Opc.Ua.Core\Opc.Ua.Core.csproj" />
</ItemGroup>
</When>
</Choose>
Expand Down
38 changes: 27 additions & 11 deletions tests/opc-plc-tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,37 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
</ItemGroup>

<!-- When referencing a local build of the OPC UA stack for testing, define the constant UseLocalOpcUaSdk in the file Directory.Build.targets -->
<Choose>
<When Condition="'$(Configuration)'=='Release'">
<ItemGroup>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server" Version="1.5.374.158" NoWarn="NU5104" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration" Version="1.5.374.158" NoWarn="NU5104" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes" Version="1.5.374.158" NoWarn="NU5104" />
<When Condition="'$(Configuration)'=='Debug'">
<ItemGroup Condition="!$(DefineConstants.Contains(UseLocalOpcUaSdk))">
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration.Debug" Version="1.5.374.168" NoWarn="NU5104" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server.Debug" Version="1.5.374.168" NoWarn="NU5104" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes" Version="1.5.374.168" NoWarn="NU5104" />
</ItemGroup>
<ItemGroup Condition="$(DefineConstants.Contains(UseLocalOpcUaSdk))">
<ProjectReference Include="..\..\UA-.NETStandard\Libraries\Opc.Ua.Configuration\Opc.Ua.Configuration.csproj" />
<ProjectReference Include="..\..\UA-.NETStandard\Libraries\Opc.Ua.Security.Certificates\Opc.Ua.Security.Certificates.csproj" />
<ProjectReference Include="..\..\UA-.NETStandard\Libraries\Opc.Ua.Server\Opc.Ua.Server.csproj" />
<ProjectReference Include="..\..\UA-.NETStandard\Libraries\Opc.Ua.Client\Opc.Ua.Client.csproj" />
<ProjectReference Include="..\..\UA-.NETStandard\Libraries\Opc.Ua.Client.ComplexTypes\Opc.Ua.Client.ComplexTypes.csproj" />
<ProjectReference Include="..\..\UA-.NETStandard\Stack\Opc.Ua.Core\Opc.Ua.Core.csproj" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server.Debug" Version="1.5.374.158" NoWarn="NU5104" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration.Debug" Version="1.5.374.158" NoWarn="NU5104" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes.Debug" Version="1.5.374.158" NoWarn="NU5104" />
<When Condition="'$(Configuration)'=='Release'">
<ItemGroup Condition="!$(DefineConstants.Contains(UseLocalOpcUaSdk))">
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration" Version="1.5.374.168" NoWarn="NU5104" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server" Version="1.5.374.168" NoWarn="NU5104" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes.Debug" Version="1.5.374.168" NoWarn="NU5104" /> </ItemGroup>
<ItemGroup Condition="$(DefineConstants.Contains(UseLocalOpcUaSdk))">
<ProjectReference Include="..\..\UA-.NETStandard\Libraries\Opc.Ua.Configuration\Opc.Ua.Configuration.csproj" />
<ProjectReference Include="..\..\UA-.NETStandard\Libraries\Opc.Ua.Security.Certificates\Opc.Ua.Security.Certificates.csproj" />
<ProjectReference Include="..\..\UA-.NETStandard\Libraries\Opc.Ua.Server\Opc.Ua.Server.csproj" />
<ProjectReference Include="..\..\UA-.NETStandard\Libraries\Opc.Ua.Client\Opc.Ua.Client.csproj" />
<ProjectReference Include="..\..\UA-.NETStandard\Libraries\Opc.Ua.Client.ComplexTypes\Opc.Ua.Client.ComplexTypes.csproj" />
<ProjectReference Include="..\..\UA-.NETStandard\Stack\Opc.Ua.Core\Opc.Ua.Core.csproj" />
</ItemGroup>
</Otherwise>
</When>
</Choose>

<ItemGroup>
Expand Down

0 comments on commit a5d1fdb

Please sign in to comment.