Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Samples/Client.Net4/UA Sample Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<Version>10.0.10</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Bindings.Https">
<Version>2.0.158.59919-preview</Version>
<Version>2.0.0-preview.2</Version>
</PackageReference>
</ItemGroup>
<PropertyGroup />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,15 @@ private void SetLimits(Type type)

if (type == typeof(float))
{
ValueCTRL.Minimum = Decimal.MinValue;
ValueCTRL.Maximum = Decimal.MaxValue;
ValueCTRL.Minimum = decimal.MinValue;
ValueCTRL.Maximum = decimal.MaxValue;
ValueCTRL.DecimalPlaces = 6;
}

if (type == typeof(double))
{
ValueCTRL.Minimum = Decimal.MinValue;
ValueCTRL.Maximum = Decimal.MaxValue;
ValueCTRL.Minimum = decimal.MinValue;
ValueCTRL.Maximum = decimal.MaxValue;
ValueCTRL.DecimalPlaces = 15;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public Opc.Ua.Security.ListOfSecurityProfiles Profiles
builder.Append(", ");
}

builder.Append(SecurityPolicies.GetDisplayName(value[ii].ProfileUri));
builder.Append(SecurityPolicies.Default.GetDisplayName(value[ii].ProfileUri));
}
}
}
Expand Down
20 changes: 10 additions & 10 deletions Samples/ClientControls.Net4/Endpoints/ConfiguredServerDlg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
{
m_endpointDescription = endpointDescription;
m_protocol = new Protocol(endpointDescription);
m_currentPolicy = SecurityPolicies.GetDisplayName(endpointDescription.SecurityPolicyUri);
m_currentPolicy = SecurityPolicies.Default.GetDisplayName(endpointDescription.SecurityPolicyUri);
m_messageSecurityMode = endpointDescription.SecurityMode;

switch (m_endpointDescription.EncodingSupport)
Expand Down Expand Up @@ -280,7 +280,7 @@
{
m_stringRepresentation = m_protocol.ToString() + " - ";
m_stringRepresentation += m_endpointDescription.SecurityMode + " - ";
m_stringRepresentation += SecurityPolicies.GetDisplayName(m_endpointDescription.SecurityPolicyUri) + " - ";
m_stringRepresentation += SecurityPolicies.Default.GetDisplayName(m_endpointDescription.SecurityPolicyUri) + " - ";

switch (m_endpointDescription.EncodingSupport)
{
Expand Down Expand Up @@ -332,7 +332,7 @@
#endregion

#region Public Interface
public List<EndpointDescription> AvailableEnpoints

Check warning on line 335 in Samples/ClientControls.Net4/Endpoints/ConfiguredServerDlg.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Change 'List<EndpointDescription>' in 'ConfiguredServerDlg.AvailableEnpoints' to use 'Collection<T>', 'ReadOnlyCollection<T>' or 'KeyedCollection<K,V>' (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1002)
{
get { return m_availableEndpoints; }
}
Expand Down Expand Up @@ -585,7 +585,7 @@
continue;
}

if (currentPolicy != SecurityPolicies.GetDisplayName(endpoint.SecurityPolicyUri))
if (currentPolicy != SecurityPolicies.Default.GetDisplayName(endpoint.SecurityPolicyUri))
{
continue;
}
Expand Down Expand Up @@ -875,7 +875,7 @@
// set all available security policies.
if (m_showAllOptions)
{
SecurityPolicyCB.Items.AddRange(SecurityPolicies.GetDisplayNames());
SecurityPolicyCB.Items.AddRange(SecurityPolicies.Default.GetDisplayNames());
}

// find all unique security policies.
Expand All @@ -899,7 +899,7 @@
continue;
}

string policyName = SecurityPolicies.GetDisplayName(endpoint.SecurityPolicyUri);
string policyName = SecurityPolicies.Default.GetDisplayName(endpoint.SecurityPolicyUri);

if (policyName != null)
{
Expand All @@ -918,7 +918,7 @@
// add at least one policy.
if (SecurityPolicyCB.Items.Count == 0)
{
SecurityPolicyCB.Items.Add(SecurityPolicies.GetDisplayName(SecurityPolicies.None));
SecurityPolicyCB.Items.Add(SecurityPolicies.Default.GetDisplayName(SecurityPolicies.None));
}

// set the current value.
Expand Down Expand Up @@ -955,13 +955,13 @@
if (endpoint != null)
{
Protocol protocol = new Protocol(endpoint);
String securityPolicy = SecurityPolicies.GetDisplayName(endpoint.SecurityPolicyUri);
String securityPolicy = SecurityPolicies.Default.GetDisplayName(endpoint.SecurityPolicyUri);

foreach (EndpointDescription endpointDescription in endpoints)
{
if ((protocol.Matches(Utils.ParseUri(endpointDescription.EndpointUrl))) &&
(endpoint.SecurityMode == endpointDescription.SecurityMode) &&
(securityPolicy == SecurityPolicies.GetDisplayName(endpointDescription.SecurityPolicyUri)))
(securityPolicy == SecurityPolicies.Default.GetDisplayName(endpointDescription.SecurityPolicyUri)))
{
switch (endpointDescription.EncodingSupport)
{
Expand Down Expand Up @@ -1355,7 +1355,7 @@
endpoint = new EndpointDescription();
endpoint.EndpointUrl = builder.ToString();
endpoint.SecurityMode = (MessageSecurityMode)SecurityModeCB.SelectedItem;
endpoint.SecurityPolicyUri = SecurityPolicies.GetUri((string)SecurityPolicyCB.SelectedItem);
endpoint.SecurityPolicyUri = SecurityPolicies.Default.GetUri((string)SecurityPolicyCB.SelectedItem);
endpoint.Server.ApplicationName = new LocalizedText(endpoint.EndpointUrl);
endpoint.Server.ApplicationType = ApplicationType.Server;
endpoint.Server.ApplicationUri = endpoint.EndpointUrl;
Expand Down Expand Up @@ -1791,7 +1791,7 @@
{
m_statusObject.SetStatus(StatusChannel.SecurityPolicyUri, "Error: Security Policy URI is missing.", StatusType.Warning);
}
else if (string.IsNullOrEmpty(SecurityPolicies.GetDisplayName(m_currentDescription.SecurityPolicyUri)))
else if (string.IsNullOrEmpty(SecurityPolicies.Default.GetDisplayName(m_currentDescription.SecurityPolicyUri)))
{
m_statusObject.SetStatus(StatusChannel.SecurityPolicyUri, "Error: Security Policy URI is invalid.", StatusType.Warning);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ protected override async Task UpdateItemAsync(ListViewItem listItem, object item

listItem.SubItems[3].Text = String.Format(
"{0}/{1}",
SecurityPolicies.GetDisplayName(endpoint.Description.SecurityPolicyUri),
SecurityPolicies.Default.GetDisplayName(endpoint.Description.SecurityPolicyUri),
endpoint.Description.SecurityMode);

listItem.SubItems[4].Text = "<Unknown>";
Expand Down
8 changes: 4 additions & 4 deletions Samples/ClientControls.Net4/UA Client Controls.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,16 @@
<Version>10.0.10</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Core">
<Version>2.0.158.59919-preview</Version>
<Version>2.0.0-preview.2</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client">
<Version>2.0.158.59919-preview</Version>
<Version>2.0.0-preview.2</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes">
<Version>2.0.158.59919-preview</Version>
<Version>2.0.0-preview.2</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration">
<Version>2.0.158.59919-preview</Version>
<Version>2.0.0-preview.2</Version>
</PackageReference>
</ItemGroup>
<ItemGroup Label="Compile items now included by globbing that were not in the original project file">
Expand Down
2 changes: 1 addition & 1 deletion Samples/Controls.Net4/Common/PerformanceTestDlg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private void SaveResults(string filePath)
writer.Write("{0}", uri);
writer.Write(",{0}", uri.Scheme);
writer.Write(",{0}", endpoint.SecurityMode);
writer.Write(",{0}", SecurityPolicies.GetDisplayName(endpoint.SecurityPolicyUri));
writer.Write(",{0}", SecurityPolicies.Default.GetDisplayName(endpoint.SecurityPolicyUri));
writer.Write(",{0}", (results[ii].Endpoint.Configuration.UseBinaryEncoding) ? "Binary" : "XML");

foreach (KeyValuePair<int, double> result in results[ii].Results)
Expand Down
6 changes: 3 additions & 3 deletions Samples/Controls.Net4/Sessions/SecuritySettingsDlg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public SecuritySettingsDlg()
SecurityModeCB.Items.Add(value);
}

SecurityPolicyUriCB.Items.AddRange(SecurityPolicies.GetDisplayNames());
SecurityPolicyUriCB.Items.AddRange(SecurityPolicies.Default.GetDisplayNames());
}

/// <summary>
Expand All @@ -78,7 +78,7 @@ public bool ShowDialog(ITelemetryContext telemetry, ref MessageSecurityMode secu

if (!String.IsNullOrEmpty(securityPolicyUri))
{
SecurityPolicyUriCB.SelectedItem = SecurityPolicies.GetDisplayName(securityPolicyUri);
SecurityPolicyUriCB.SelectedItem = SecurityPolicies.Default.GetDisplayName(securityPolicyUri);
}

// show dialog.
Expand All @@ -88,7 +88,7 @@ public bool ShowDialog(ITelemetryContext telemetry, ref MessageSecurityMode secu
}

securityMode = (MessageSecurityMode)SecurityModeCB.SelectedItem;
securityPolicyUri = SecurityPolicies.GetUri((string)SecurityPolicyUriCB.SelectedItem);
securityPolicyUri = SecurityPolicies.Default.GetUri((string)SecurityPolicyUriCB.SelectedItem);
useNativeStack = UseNativeStackCK.Checked;

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ private void DeadbandTypeCB_SelectedIndexChanged(object sender, EventArgs e)
}
else
{
DeadbandNC.Minimum = Decimal.MinValue;
DeadbandNC.Maximum = Decimal.MaxValue;
DeadbandNC.Minimum = decimal.MinValue;
DeadbandNC.Maximum = decimal.MaxValue;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Samples/Controls.Net4/UA Sample Controls.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@
<Version>10.0.10</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes">
<Version>2.0.158.59919-preview</Version>
<Version>2.0.0-preview.2</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Server">
<Version>2.0.158.59919-preview</Version>
<Version>2.0.0-preview.2</Version>
</PackageReference>
</ItemGroup>
<ItemGroup Label="EmbeddedResource items now included by globbing that were not in the original project file">
Expand Down
4 changes: 2 additions & 2 deletions Samples/GDS/Client/GlobalDiscoveryClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
<Version>10.0.10</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration">
<Version>2.0.158.59919-preview</Version>
<Version>2.0.0-preview.2</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Gds.Client.Common">
<Version>2.0.158.59919-preview</Version>
<Version>2.0.0-preview.2</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Samples/GDS/ClientControls/Controls/DiscoveryControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ private void ShowEndpointDescriptions(List<EndpointDescription> endpoints)

row[0] = endpoint.EndpointUrl;
row[1] = endpoint.SecurityMode.ToString();
row[2] = SecurityPolicies.GetDisplayName(endpoint.SecurityPolicyUri);
row[2] = SecurityPolicies.Default.GetDisplayName(endpoint.SecurityPolicyUri);
row[3] = endpoint;

EndpointsTable.Rows.Add(row);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
<Version>10.0.10</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client">
<Version>2.0.158.59919-preview</Version>
<Version>2.0.0-preview.2</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Gds.Client.Common">
<Version>2.0.158.59919-preview</Version>
<Version>2.0.0-preview.2</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions Samples/GDS/ConsoleServer/NetCoreGlobalDiscoveryServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.10" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.23.0" />
<PackageReference Include="Mono.Options" Version="6.12.0.148" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client" Version="2.0.158.59919-preview" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Gds.Server.Common" Version="2.0.158.59919-preview" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration" Version="2.0.158.59919-preview" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client" Version="2.0.0-preview.2" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Gds.Server.Common" Version="2.0.0-preview.2" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration" Version="2.0.0-preview.2" />
</ItemGroup>

</Project>
25 changes: 12 additions & 13 deletions Samples/GDS/ConsoleServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -531,23 +531,22 @@ private void EventStatus(ISession session, SessionEventReason reason)

private void PrintSessionStatus(ISession session, string reason, bool lastContact = false)
{
lock (session.DiagnosticsLock)
// The session owns its diagnostics lock and no longer exposes it;
// ReadDiagnostics applies each projection while holding that lock.
string item = Utils.Format("{0,9}:{1,20}:", reason, session.ReadDiagnostics(d => d.SessionName));
if (lastContact)
{
string item = Utils.Format("{0,9}:{1,20}:", reason, session.SessionDiagnostics.SessionName);
if (lastContact)
{
item += Utils.Format("Last Event:{0:HH:mm:ss}", session.SessionDiagnostics.ClientLastContactTime.ToLocalTime());
}
else
item += Utils.Format("Last Event:{0:HH:mm:ss}", session.ReadDiagnostics(d => d.ClientLastContactTime).ToLocalTime());
}
else
{
if (session.Identity != null)
{
if (session.Identity != null)
{
item += Utils.Format(":{0,20}", session.Identity.DisplayName);
}
item += Utils.Format(":{0}", session.Id);
item += Utils.Format(":{0,20}", session.Identity.DisplayName);
}
Console.WriteLine(item);
item += Utils.Format(":{0}", session.Id);
}
Console.WriteLine(item);
}

private async void StatusThreadAsync()
Expand Down
6 changes: 3 additions & 3 deletions Samples/GDS/Server/GlobalDiscoveryServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
<Version>10.0.10</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Configuration">
<Version>2.0.158.59919-preview</Version>
<Version>2.0.0-preview.2</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Client">
<Version>2.0.158.59919-preview</Version>
<Version>2.0.0-preview.2</Version>
</PackageReference>
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Gds.Server.Common">
<Version>2.0.158.59919-preview</Version>
<Version>2.0.0-preview.2</Version>
</PackageReference>
</ItemGroup>
<PropertyGroup />
Expand Down
2 changes: 1 addition & 1 deletion Samples/LDS/ConsoleServer/ConsoleLds.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.10" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.10" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Lds.Server" Version="2.0.158.59919-preview" />
<PackageReference Include="OPCFoundation.NetStandard.Opc.Ua.Lds.Server" Version="2.0.0-preview.2" />
</ItemGroup>

</Project>
28 changes: 27 additions & 1 deletion Samples/Opc.Ua.Sample/Base/CustomNodeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2935,6 +2935,32 @@ public virtual void TransferMonitoredItems(
IList<IMonitoredItem> monitoredItems,
IList<bool> processedItems,
IList<ServiceResult> errors)
{
TransferMonitoredItems(
context,
sendInitialValues,
monitoredItems,
processedItems,
errors,
new MonitoredItemTransferOptions());
}

/// <summary>
/// Transfers a set of monitored items.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="sendInitialValues">Whether the subscription should send initial values after transfer.</param>
/// <param name="monitoredItems">The set of monitoring items to update.</param>
/// <param name="processedItems">The list of bool with items that were already processed.</param>
/// <param name="errors">Any errors.</param>
/// <param name="transferOptions">Controls how the transfer is executed.</param>
public virtual void TransferMonitoredItems(
OperationContext context,
bool sendInitialValues,
IList<IMonitoredItem> monitoredItems,
IList<bool> processedItems,
IList<ServiceResult> errors,
MonitoredItemTransferOptions transferOptions)
{
ServerSystemContext systemContext = m_systemContext.Copy(context);
IList<IMonitoredItem> transferredItems = new List<IMonitoredItem>();
Expand Down Expand Up @@ -2964,7 +2990,7 @@ public virtual void TransferMonitoredItems(
// owned by this node manager.
processedItems[ii] = true;
transferredItems.Add(monitoredItems[ii]);
if (sendInitialValues)
if (sendInitialValues && !transferOptions.DeferInitialValues)
{
monitoredItems[ii].SetupResendDataTrigger();
}
Expand Down
Loading
Loading