private static void Update(IVariableInstanceFactory nodeDesign, UAVariable nodeSet, IUANodeBase nodeContext, Action <TraceMessage> traceEvent) { nodeDesign.AccessLevel = nodeSet.AccessLevel.GetAccessLevel(traceEvent); nodeDesign.ArrayDimensions = nodeSet.ArrayDimensions.ExportString(string.Empty); nodeDesign.DataType = nodeContext.ExportBrowseName(nodeSet.DataType, DataTypes.Number); //TODO add test case must be DataType, must not be abstract nodeDesign.DefaultValue = nodeSet.Value; //TODO add test case must be of type defined by DataType nodeDesign.Historizing = nodeSet.Historizing.Export(false); nodeDesign.MinimumSamplingInterval = nodeSet.MinimumSamplingInterval.Export(0D); nodeDesign.ValueRank = nodeSet.ValueRank.GetValueRank(traceEvent); if (nodeSet.Translation != null) { traceEvent(TraceMessage.BuildErrorTraceMessage(BuildError.NotSupportedFeature, "- the Translation element for the UAVariable")); } }
private static void Update(IVariableInstanceFactory variableInstance, UAVariable nodeSet, IUANodeBase nodeContext, UAReferenceContext parentReference, Action <TraceMessage> traceEvent) { try { Update(variableInstance, nodeSet, nodeContext, traceEvent); variableInstance.ReferenceType = parentReference == null ? null : parentReference.GetReferenceTypeName(); if (nodeContext.IsProperty) { traceEvent(TraceMessage.BuildErrorTraceMessage(BuildError.WrongReference2Variable, string.Format("Creating Variable - wrong reference type {0}", parentReference.ReferenceKind.ToString()))); } } catch (Exception _ex) { traceEvent(TraceMessage.BuildErrorTraceMessage(BuildError.WrongReference2Property, string.Format("Cannot resolve the reference for Variable because of error {0} at: {1}.", _ex, _ex.StackTrace))); } }
public void InformationModelFactoryIExportVariableInstanceFactoryTestMethod2() { IVariableInstanceFactory _new = m_FactoryBase.AddNodeFactory <IVariableInstanceFactory>(); Assert.IsNotNull(_new); }