mirror of
https://github.com/OPCFoundation/UA-.NETStandard.git
synced 2026-10-29 07:07:24 +08:00
Merge pull request #2878 from OPCFoundation/mastercherrypicks
Merge fixes from master in stable branch
This commit is contained in:
@@ -1663,6 +1663,33 @@ namespace Opc.Ua.Client
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tells the server to refresh all conditions being monitored by the subscription for a specific
|
||||
/// monitoredItem for events.
|
||||
/// </summary>
|
||||
public bool ConditionRefresh2(uint monitoredItemId)
|
||||
{
|
||||
VerifySubscriptionState(true);
|
||||
|
||||
try
|
||||
{
|
||||
object[] inputArguments = new object[] { m_id, monitoredItemId };
|
||||
|
||||
m_session.Call(
|
||||
ObjectTypeIds.ConditionType,
|
||||
MethodIds.ConditionType_ConditionRefresh2,
|
||||
inputArguments);
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (ServiceResultException sre)
|
||||
{
|
||||
Utils.LogError(sre, "SubscriptionId {0}: Item {1} Failed to call ConditionRefresh2 on server",
|
||||
m_id, monitoredItemId);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Call the ResendData method on the server for this subscription.
|
||||
/// </summary>
|
||||
|
||||
@@ -454,6 +454,7 @@ namespace Opc.Ua.Client
|
||||
|
||||
var methodsToCall = new CallMethodRequestCollection();
|
||||
methodsToCall.Add(new CallMethodRequest() {
|
||||
ObjectId = ObjectTypeIds.ConditionType,
|
||||
MethodId = MethodIds.ConditionType_ConditionRefresh,
|
||||
InputArguments = new VariantCollection() { new Variant(m_id) }
|
||||
});
|
||||
@@ -464,6 +465,29 @@ namespace Opc.Ua.Client
|
||||
ct).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tells the server to refresh all conditions being monitored by the subscription for a specific
|
||||
/// monitoredItem for events.
|
||||
/// </summary>
|
||||
public async Task ConditionRefresh2Async(uint monitoredItemId, CancellationToken ct = default)
|
||||
{
|
||||
VerifySubscriptionState(true);
|
||||
|
||||
var methodsToCall = new CallMethodRequestCollection();
|
||||
methodsToCall.Add(new CallMethodRequest() {
|
||||
ObjectId = ObjectTypeIds.ConditionType,
|
||||
MethodId = MethodIds.ConditionType_ConditionRefresh2,
|
||||
InputArguments = new VariantCollection() {
|
||||
new Variant(m_id),
|
||||
new Variant( monitoredItemId ) }
|
||||
});
|
||||
|
||||
var response = await m_session.CallAsync(
|
||||
null,
|
||||
methodsToCall,
|
||||
ct).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,11 +118,11 @@ namespace Opc.Ua
|
||||
{ Methods.ProgramStateMachineType_Reset, Objects.ProgramStateMachineType_Halted, Objects.ProgramStateMachineType_HaltedToReady },
|
||||
{ Methods.ProgramStateMachineType_Start, Objects.ProgramStateMachineType_Ready, Objects.ProgramStateMachineType_ReadyToRunning },
|
||||
{ Methods.ProgramStateMachineType_Suspend,Objects.ProgramStateMachineType_Running, Objects.ProgramStateMachineType_RunningToSuspended },
|
||||
{ Methods.ProgramStateMachineType_Reset, Objects.ProgramStateMachineType_Running, Objects.ProgramStateMachineType_RunningToReady },
|
||||
{ Methods.ProgramStateMachineType_Halt, Objects.ProgramStateMachineType_Running, Objects.ProgramStateMachineType_RunningToHalted },
|
||||
{ Methods.ProgramStateMachineType_Resume, Objects.ProgramStateMachineType_Suspended, Objects.ProgramStateMachineType_SuspendedToRunning },
|
||||
{ Methods.ProgramStateMachineType_Reset, Objects.ProgramStateMachineType_Suspended, Objects.ProgramStateMachineType_SuspendedToReady },
|
||||
{ Methods.ProgramStateMachineType_Halt, Objects.ProgramStateMachineType_Suspended, Objects.ProgramStateMachineType_SuspendedToHalted }
|
||||
{ Methods.ProgramStateMachineType_Halt, Objects.ProgramStateMachineType_Suspended, Objects.ProgramStateMachineType_SuspendedToHalted },
|
||||
{ Methods.ProgramStateMachineType_Halt, Objects.ProgramStateMachineType_Ready, Objects.ProgramStateMachineType_ReadyToHalted }
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user