/// <summary> /// Ctor for the topology node using values. /// </summary> public ContosoTopologyNode(string key, string name, string description, ContosoPushPinCoordinates imagePushpin) : base(key) { Name = name; Description = description; ImagePath = "/Content/img/" + _defaultImage; ImagePushpin = imagePushpin; }
/// <summary> /// Ctor for a Contoso OPC UA node, specifying alert related information. /// </summary> public ContosoOpcUaNode( string opcUaNodeId, string opcUaSymbolicName, List <ContosoPerformanceRelevance> opcUaNodeRelevance, ContosoOpcNodeOpCode opCode, string units, bool visible, double?constValue, double?minimum, double?maximum, List <ContosoAlertActionDefinition> minimumAlertActionDefinitions, List <ContosoAlertActionDefinition> maximumAlertActionDefinitions, ContosoPushPinCoordinates imagePushpin, string warning ) : base(opcUaNodeId, opcUaSymbolicName) { Relevance = opcUaNodeRelevance; OpCode = opCode; Units = units; Visible = visible; ConstValue = constValue; Minimum = minimum; Maximum = maximum; MinimumAlertActions = minimumAlertActionDefinitions; MaximumAlertActions = maximumAlertActionDefinitions; Last = new ContosoDataItem(); ImagePushpin = imagePushpin; WarningValue = warning; }
/// <summary> /// Ctor for child node information of topology nodes (non OPC UA nodes) using values. /// </summary> public ContosoChildInfo(string key, string status, string name, string description, string city, double latitude, double longitude, bool visible, ContosoPushPinCoordinates imagePushpin) { Key = key; SubKey = "null"; Status = status; Name = name; Description = description; City = city; Latitude = latitude; Longitude = longitude; Visible = visible; ImagePushpin = imagePushpin; }
/// <summary> /// Ctor for child node information of OPC UA nodes. /// </summary> public ContosoChildInfo(string key, string subKey, string status, string name, string description, string city, double latitude, double longitude, bool visible, string last, string unit, string warningvalue, ContosoPushPinCoordinates imagePushpin) { Key = key; SubKey = subKey; Status = status; Name = name; Description = description; City = city; Latitude = latitude; Longitude = longitude; Visible = visible; Last = last; Unit = unit != null ? unit : ""; WarningValue = warningvalue; ImagePushpin = imagePushpin; }
/// <summary> /// Adds an OPC UA Node to this OPC UA server topology node. /// </summary> public void AddOpcServerNode( string opcUaNodeId, string opcUaSymbolicName, List <ContosoPerformanceRelevance> opcUaNodeRelevance, ContosoOpcNodeOpCode opCode, string units, bool visible, double?constValue, double?minimum, double?maximum, List <ContosoAlertActionDefinition> minimumAlertActionDefinitions, List <ContosoAlertActionDefinition> maximumAlertActionDefinitions, ContosoPushPinCoordinates imagePushpin, string warning) { foreach (var node in NodeList) { if (OpCodeRequiresOpcUaNode(opCode) && node.NodeId == opcUaNodeId ) { throw new Exception(string.Format("The OPC UA node with NodeId '{0}' and SymbolicName '{1}' does already exist. Please change.", opcUaNodeId, opcUaSymbolicName)); } } ContosoOpcUaNode opcUaNodeObject = new ContosoOpcUaNode( opcUaNodeId, opcUaSymbolicName, opcUaNodeRelevance, opCode, units, visible, constValue, minimum, maximum, minimumAlertActionDefinitions, maximumAlertActionDefinitions, imagePushpin, warning); NodeList.Add(opcUaNodeObject); }
/// <summary> /// Ctor for a Contoso OPC UA node, using alert related descriptions. /// </summary> public ContosoOpcUaNode( string opcUaNodeId, string opcUaSymbolicName, List <ContosoPerformanceRelevance> opcUaNodeRelevance, ContosoOpcNodeDescription opcNodeDescription) : base(opcUaNodeId, opcUaSymbolicName) { Relevance = opcUaNodeRelevance; OpCode = opcNodeDescription.OpCode; Units = opcNodeDescription.Units; Visible = opcNodeDescription.Visible; ConstValue = opcNodeDescription.ConstValue; Minimum = opcNodeDescription.Minimum; Maximum = opcNodeDescription.Maximum; MinimumAlertActions = new List <ContosoAlertActionDefinition>(); MinimumAlertActions.AddRange(ContosoAlertActionDefinition.Init(opcNodeDescription.MinimumAlertActions)); MaximumAlertActions = new List <ContosoAlertActionDefinition>(); MaximumAlertActions.AddRange(ContosoAlertActionDefinition.Init(opcNodeDescription.MaximumAlertActions)); Last = new ContosoDataItem(); ImagePushpin = opcNodeDescription.ImagePushpin; }