本文整理汇总了C#中Opc.Ua.BaseInstanceState类的典型用法代码示例。如果您正苦于以下问题:C# BaseInstanceState类的具体用法?C# BaseInstanceState怎么用?C# BaseInstanceState使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BaseInstanceState类属于Opc.Ua命名空间,在下文中一共展示了BaseInstanceState类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
/// <summary>
/// Initializes the snapshot from an instance.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="state">The state.</param>
public void Initialize(
ISystemContext context,
BaseInstanceState state)
{
m_typeDefinitionId = state.TypeDefinitionId;
m_snapshot = CreateChildNode(context, state);
}
示例2: FindChild
/// <summary>
/// Finds the child with the specified browse name.
/// </summary>
protected override BaseInstanceState FindChild(
ISystemContext context,
QualifiedName browseName,
bool createOrReplace,
BaseInstanceState replacement)
{
if (QualifiedName.IsNull(browseName))
{
return null;
}
BaseInstanceState instance = null;
switch (browseName.Name)
{
case DsatsDemo.BrowseNames.Measurements:
{
if (createOrReplace)
{
if (Measurements == null)
{
if (replacement == null)
{
Measurements = new MudPumpMeasurementsFolderState(this);
}
else
{
Measurements = (MudPumpMeasurementsFolderState)replacement;
}
}
}
instance = Measurements;
break;
}
case DsatsDemo.BrowseNames.SetPoints:
{
if (createOrReplace)
{
if (SetPoints == null)
{
if (replacement == null)
{
SetPoints = new MudPumpSetPointsFolderState(this);
}
else
{
SetPoints = (MudPumpSetPointsFolderState)replacement;
}
}
}
instance = SetPoints;
break;
}
}
if (instance != null)
{
return instance;
}
return base.FindChild(context, browseName, createOrReplace, replacement);
}
示例3: FindChild
/// <summary>
/// Finds the child with the specified browse name.
/// </summary>
protected override BaseInstanceState FindChild(
ISystemContext context,
QualifiedName browseName,
bool createOrReplace,
BaseInstanceState replacement)
{
if (QualifiedName.IsNull(browseName))
{
return null;
}
BaseInstanceState instance = null;
switch (browseName.Name)
{
case FileSystem.BrowseNames.Humidity:
{
if (createOrReplace)
{
if (Humidity == null)
{
if (replacement == null)
{
Humidity = new AnalogItemState<double>(this);
}
else
{
Humidity = (AnalogItemState<double>)replacement;
}
}
}
instance = Humidity;
break;
}
case FileSystem.BrowseNames.HumiditySetPoint:
{
if (createOrReplace)
{
if (HumiditySetPoint == null)
{
if (replacement == null)
{
HumiditySetPoint = new AnalogItemState<double>(this);
}
else
{
HumiditySetPoint = (AnalogItemState<double>)replacement;
}
}
}
instance = HumiditySetPoint;
break;
}
}
if (instance != null)
{
return instance;
}
return base.FindChild(context, browseName, createOrReplace, replacement);
}
示例4: FindChild
/// <summary>
/// Finds the child with the specified browse name.
/// </summary>
protected override BaseInstanceState FindChild(
ISystemContext context,
QualifiedName browseName,
bool createOrReplace,
BaseInstanceState replacement)
{
if (QualifiedName.IsNull(browseName))
{
return null;
}
BaseInstanceState instance = null;
switch (browseName.Name)
{
case BrowseNames.InputArguments:
{
if (createOrReplace)
{
if (InputArguments == null)
{
if (replacement == null)
{
InputArguments = new PropertyState<Argument[]>(this);
}
else
{
InputArguments = (PropertyState<Argument[]>)replacement;
}
}
}
instance = InputArguments;
break;
}
case BrowseNames.OutputArguments:
{
if (createOrReplace)
{
if (OutputArguments == null)
{
if (replacement == null)
{
OutputArguments = new PropertyState<Argument[]>(this);
}
else
{
OutputArguments = (PropertyState<Argument[]>)replacement;
}
}
}
instance = OutputArguments;
break;
}
}
if (instance != null)
{
return instance;
}
return base.FindChild(context, browseName, createOrReplace, replacement);
}
示例5: CreateNode
/// <summary>
/// Creates a new instance and assigns unique identifiers to all children.
/// </summary>
/// <param name="context">The operation context.</param>
/// <param name="parentId">An optional parent identifier.</param>
/// <param name="referenceTypeId">The reference type from the parent.</param>
/// <param name="browseName">The browse name.</param>
/// <param name="instance">The instance to create.</param>
/// <returns>The new node id.</returns>
public NodeId CreateNode(
ServerSystemContext context,
NodeId parentId,
NodeId referenceTypeId,
QualifiedName browseName,
BaseInstanceState instance)
{
ServerSystemContext contextToUse = (ServerSystemContext)m_systemContext.Copy(context);
lock (Lock)
{
if (m_predefinedNodes == null)
{
m_predefinedNodes = new NodeIdDictionary<NodeState>();
}
instance.ReferenceTypeId = referenceTypeId;
NodeState parent = null;
if (parentId != null)
{
if (!m_predefinedNodes.TryGetValue(parentId, out parent))
{
throw ServiceResultException.Create(
StatusCodes.BadNodeIdUnknown,
"Cannot find parent with id: {0}",
parentId);
}
parent.AddChild(instance);
}
instance.Create(contextToUse, null, browseName, null, true);
AddPredefinedNode(contextToUse, instance);
return instance.NodeId;
}
}
示例6: FindChild
/// <summary>
/// Finds the child with the specified browse name.
/// </summary>
protected override BaseInstanceState FindChild(
ISystemContext context,
QualifiedName browseName,
bool createOrReplace,
BaseInstanceState replacement)
{
if (QualifiedName.IsNull(browseName))
{
return null;
}
BaseInstanceState instance = null;
switch (browseName.Name)
{
case Opc.Ua.Fdi7.BrowseNames.ProtocolIdentifier:
{
if (createOrReplace)
{
if (ProtocolIdentifier == null)
{
if (replacement == null)
{
ProtocolIdentifier = new PropertyState<string>(this);
}
else
{
ProtocolIdentifier = (PropertyState<string>)replacement;
}
}
}
instance = ProtocolIdentifier;
break;
}
case Opc.Ua.Fdi7.BrowseNames.ServiceProvider:
{
if (createOrReplace)
{
if (ServiceProvider == null)
{
if (replacement == null)
{
ServiceProvider = new ServerCommunicationGENERICServiceState(this);
}
else
{
ServiceProvider = (ServerCommunicationGENERICServiceState)replacement;
}
}
}
instance = ServiceProvider;
break;
}
}
if (instance != null)
{
return instance;
}
return base.FindChild(context, browseName, createOrReplace, replacement);
}
示例7: FindChild
/// <summary>
/// Finds the child with the specified browse name.
/// </summary>
protected override BaseInstanceState FindChild(
ISystemContext context,
QualifiedName browseName,
bool createOrReplace,
BaseInstanceState replacement)
{
if (QualifiedName.IsNull(browseName))
{
return null;
}
BaseInstanceState instance = null;
switch (browseName.Name)
{
case Boiler.BrowseNames.UpdateRate:
{
if (createOrReplace)
{
if (UpdateRate == null)
{
if (replacement == null)
{
UpdateRate = new PropertyState<uint>(this);
}
else
{
UpdateRate = (PropertyState<uint>)replacement;
}
}
}
instance = UpdateRate;
break;
}
}
if (instance != null)
{
return instance;
}
return base.FindChild(context, browseName, createOrReplace, replacement);
}
示例8: FindChild
/// <summary>
/// Finds the child with the specified browse name.
/// </summary>
protected override BaseInstanceState FindChild(
ISystemContext context,
QualifiedName browseName,
bool createOrReplace,
BaseInstanceState replacement)
{
if (QualifiedName.IsNull(browseName))
{
return null;
}
BaseInstanceState instance = null;
switch (browseName.Name)
{
case Quickstarts.HistoricalEvents.BrowseNames.TestDuration:
{
if (createOrReplace)
{
if (TestDuration == null)
{
if (replacement == null)
{
TestDuration = new AnalogItemState<double>(this);
}
else
{
TestDuration = (AnalogItemState<double>)replacement;
}
}
}
instance = TestDuration;
break;
}
case Quickstarts.HistoricalEvents.BrowseNames.InjectedFluid:
{
if (createOrReplace)
{
if (InjectedFluid == null)
{
if (replacement == null)
{
InjectedFluid = new PropertyState<string>(this);
}
else
{
InjectedFluid = (PropertyState<string>)replacement;
}
}
}
instance = InjectedFluid;
break;
}
}
if (instance != null)
{
return instance;
}
return base.FindChild(context, browseName, createOrReplace, replacement);
}
示例9: UpdateDisplayName
/// <summary>
/// Updates the display name for an instance with the unit label name.
/// </summary>
/// <param name="instance">The instance to update.</param>
/// <param name="label">The label to apply.</param>
/// <remarks>This method assumes the DisplayName has the form NameX001 where X0 is the unit label placeholder.</remarks>
private void UpdateDisplayName(BaseInstanceState instance, string unitLabel)
{
LocalizedText displayName = instance.DisplayName;
if (displayName != null)
{
string text = displayName.Text;
if (text != null)
{
text = text.Replace("X0", unitLabel);
}
displayName = new LocalizedText(displayName.Locale, text);
}
instance.DisplayName = displayName;
}
示例10: FindChild
/// <summary>
/// Finds the child with the specified browse name.
/// </summary>
protected override BaseInstanceState FindChild(
ISystemContext context,
QualifiedName browseName,
bool createOrReplace,
BaseInstanceState replacement)
{
if (QualifiedName.IsNull(browseName))
{
return null;
}
BaseInstanceState instance = null;
switch (browseName.Name)
{
case MemoryBuffer.BrowseNames.StartAddress:
{
if (createOrReplace)
{
if (StartAddress == null)
{
if (replacement == null)
{
StartAddress = new PropertyState<uint>(this);
}
else
{
StartAddress = (PropertyState<uint>)replacement;
}
}
}
instance = StartAddress;
break;
}
case MemoryBuffer.BrowseNames.SizeInBytes:
{
if (createOrReplace)
{
if (SizeInBytes == null)
{
if (replacement == null)
{
SizeInBytes = new PropertyState<uint>(this);
}
else
{
SizeInBytes = (PropertyState<uint>)replacement;
}
}
}
instance = SizeInBytes;
break;
}
}
if (instance != null)
{
return instance;
}
return base.FindChild(context, browseName, createOrReplace, replacement);
}
示例11: FindChild
/// <summary>
/// Finds the child with the specified browse name.
/// </summary>
protected override BaseInstanceState FindChild(
ISystemContext context,
QualifiedName browseName,
bool createOrReplace,
BaseInstanceState replacement)
{
if (QualifiedName.IsNull(browseName))
{
return null;
}
BaseInstanceState instance = null;
switch (browseName.Name)
{
case TutorialModel.BrowseNames.Input:
{
if (createOrReplace)
{
if (Input == null)
{
if (replacement == null)
{
Input = new AnalogItemState<double>(this);
}
else
{
Input = (AnalogItemState<double>)replacement;
}
}
}
instance = Input;
break;
}
}
if (instance != null)
{
return instance;
}
return base.FindChild(context, browseName, createOrReplace, replacement);
}