.NET Based OPC UA Client/Server SDK  3.3.0.530
UnifiedAutomation.UaServer.ModelControllerBase Class Reference

A base class for model controllers. More...

Inherits UnifiedAutomation.UaBase.IModelMapper, INotifyPropertyChanged, UnifiedAutomation.UaServer.INotifyPropertyChangeRequested, and UnifiedAutomation.UaServer.INotifyStatusCodeInfo.

Inherited by UnifiedAutomation.UaServer.BaseEventModel, UnifiedAutomation.UaServer.BaseObjectModel, and UnifiedAutomation.UaServer.BaseVariableModel.

Public Member Functions

virtual ModelHandle GetModelHandle (StringTable namespaceUris, object instance)
 Gets the metadata handle. More...
 
virtual DataValue GetValue (IMapperContext context, ModelMapping mapping)
 Gets the value associated with the mapping. More...
 
virtual bool SetValue (IMapperContext context, ModelMapping mapping, DataValue value)
 Sets the value associated with the mapping. More...
 
StatusCode GetStatusCode (string propertyName)
 Retrieve the status code for the given property. If no status code was explicitly set, StatusCodes.Good will be returned.
Parameters
propertyNameThe property name.
Returns
The status code of the property.

 
void SetStatusCode (string propertyName, StatusCode statusCode)
 Sets the status code of the given property. More...
 

Public Attributes

bool HasStatusCodes => m_statusCodes != null && m_statusCodes.Count > 0
 

Protected Member Functions

void RaisePropertyChangedEvent ([CallerMemberName] string propertyName=null)
 Raises an property change event. More...
 
void RaisePropertyChangeRequestedEvent< T > (T value, [CallerMemberName] string propertyName=null)
 Called when the value of a property is supposed to be changed. More...
 
bool SetField< T > (ref T field, T value, [CallerMemberName] string propertyName=null)
 Sets the backing field to the new value, and triggers a property change event, if the value has changed. More...
 

Properties

ModelHandle ModelHandle [get, set]
 Gets or sets the metadata handle. More...
 
object UserData [get, set]
 Gets or sets the user data. More...
 
- Properties inherited from UnifiedAutomation.UaServer.INotifyStatusCodeInfo
bool HasStatusCodes [get]
 true if no property has an explicit set status code. Hence when all status codes are implicit StatusCodes.Good. More...
 

Events

PropertyChangedEventHandler PropertyChanged
 Occurs when a property value changes. More...
 
EventHandler
< PropertyChangeRequestedEventArgs
PropertyChangeRequested
 The event is emitted just before the value will be changed, and gives the observer the opportunity to reject or adjust (e.g. clamp) the property change by setting the PropertyChangeRequestedEventArgs.StatusCode and PropertyChangeRequestedEventArgs.Value properties. More...
 
EventHandler
< StatusCodeChangedEventArgs
StatusCodeChanged
 
- Events inherited from UnifiedAutomation.UaServer.INotifyPropertyChangeRequested
EventHandler
< PropertyChangeRequestedEventArgs
PropertyChangeRequested
 The property change request event. More...
 
- Events inherited from UnifiedAutomation.UaServer.INotifyStatusCodeInfo
EventHandler
< StatusCodeChangedEventArgs
StatusCodeChanged
 Occurs if the status code of a property was changed. More...
 

Detailed Description

A base class for model controllers.

Member Function Documentation

virtual ModelHandle UnifiedAutomation.UaServer.ModelControllerBase.GetModelHandle ( StringTable  namespaceUris,
object  instance 
)
virtual
virtual DataValue UnifiedAutomation.UaServer.ModelControllerBase.GetValue ( IMapperContext  context,
ModelMapping  mapping 
)
virtual

Gets the value associated with the mapping.

Parameters
contextThe request context.
mappingThe mapping.
Returns
The value. null if he mapping was not understood.

Implements UnifiedAutomation.UaBase.IModelMapper.

void UnifiedAutomation.UaServer.ModelControllerBase.RaisePropertyChangedEvent ( [CallerMemberName] string  propertyName = null)
protected

Raises an property change event.

Parameters
propertyNameThe name of the property.
void UnifiedAutomation.UaServer.ModelControllerBase.RaisePropertyChangeRequestedEvent< T > ( value,
[CallerMemberName] string  propertyName = null 
)
protected

Called when the value of a property is supposed to be changed.

Template Parameters
TThe type of the requested value.
Parameters
valueThe requested value.
propertyNameThe property name.
bool UnifiedAutomation.UaServer.ModelControllerBase.SetField< T > ( ref T  field,
value,
[CallerMemberName] string  propertyName = null 
)
protected

Sets the backing field to the new value, and triggers a property change event, if the value has changed.

Template Parameters
TThe type of the backing field.
Parameters
fieldThe backing field.
valueThe new value.
propertyNameThe property name.
Returns
Retrieves true when the value was changed, otherwise false.
void UnifiedAutomation.UaServer.ModelControllerBase.SetStatusCode ( string  propertyName,
StatusCode  statusCode 
)

Sets the status code of the given property.

Parameters
propertyNameThe property name.
statusCodeThe status code.
virtual bool UnifiedAutomation.UaServer.ModelControllerBase.SetValue ( IMapperContext  context,
ModelMapping  mapping,
DataValue  value 
)
virtual

Sets the value associated with the mapping.

Parameters
contextThe request context.
mappingThe mapping.
valueThe value.
Returns
True if the mapping was understood. False otherwise.

Implements UnifiedAutomation.UaBase.IModelMapper.

Property Documentation

ModelHandle UnifiedAutomation.UaServer.ModelControllerBase.ModelHandle
getset

Gets or sets the metadata handle.

The metadata handle.

object UnifiedAutomation.UaServer.ModelControllerBase.UserData
getset

Gets or sets the user data.

The user data.

Event Documentation

PropertyChangedEventHandler UnifiedAutomation.UaServer.ModelControllerBase.PropertyChanged

Occurs when a property value changes.

EventHandler<PropertyChangeRequestedEventArgs> UnifiedAutomation.UaServer.ModelControllerBase.PropertyChangeRequested

The event is emitted just before the value will be changed, and gives the observer the opportunity to reject or adjust (e.g. clamp) the property change by setting the PropertyChangeRequestedEventArgs.StatusCode and PropertyChangeRequestedEventArgs.Value properties.


The documentation for this class was generated from the following file: