from KL.constants import ObjectIds
from KL.types import NumericNodeId, QualifiedName, NodeId, Variant, VariantType
from KL.application_protocol import NodeClass, LocalizedText, ObjectTypeAttributes, \
    AddNodesItem, AddReferencesItem, ReferenceTypeAttributes, VariableAttributes, ObjectAttributes, DataTypeAttributes, EnumValueType
from KL import constants


def create_standard_address_space_Part13(server):
    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11187, 0)
    node.BrowseName = QualifiedName('AggregateConfigurationType', 0)
    node.NodeClass = NodeClass.ObjectType
    node.ParentNodeId = NumericNodeId(58, 0)
    node.ReferenceTypeId = NumericNodeId(45, 0)
    attrs = ObjectTypeAttributes()
    attrs.DisplayName = LocalizedText("AggregateConfigurationType")
    attrs.IsAbstract = False
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(11187, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(11188, 0)
    refs.append(ref)
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(11187, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(11189, 0)
    refs.append(ref)
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(11187, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(11190, 0)
    refs.append(ref)
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(11187, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(11191, 0)
    refs.append(ref)
    ref = AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(45, 0)
    ref.SourceNodeId = NumericNodeId(11187, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(58, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11188, 0)
    node.BrowseName = QualifiedName('TreatUncertainAsBad', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(11187, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = VariableAttributes()
    attrs.DisplayName = LocalizedText("TreatUncertainAsBad")
    attrs.DataType = NodeId(ObjectIds.Boolean)
    attrs.ValueRank = -1
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11188, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(68, 0)
    refs.append(ref)
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(37, 0)
    ref.SourceNodeId = NumericNodeId(11188, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(78, 0)
    refs.append(ref)
    ref = AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(11188, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(11187, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11189, 0)
    node.BrowseName = QualifiedName('PercentDataBad', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(11187, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = VariableAttributes()
    attrs.DisplayName = LocalizedText("PercentDataBad")
    attrs.DataType = NodeId(ObjectIds.Byte)
    attrs.ValueRank = -1
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11189, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(68, 0)
    refs.append(ref)
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(37, 0)
    ref.SourceNodeId = NumericNodeId(11189, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(78, 0)
    refs.append(ref)
    ref = AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(11189, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(11187, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11190, 0)
    node.BrowseName = QualifiedName('PercentDataGood', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(11187, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = VariableAttributes()
    attrs.DisplayName = LocalizedText("PercentDataGood")
    attrs.DataType = NodeId(ObjectIds.Byte)
    attrs.ValueRank = -1
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11190, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(68, 0)
    refs.append(ref)
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(37, 0)
    ref.SourceNodeId = NumericNodeId(11190, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(78, 0)
    refs.append(ref)
    ref = AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(11190, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(11187, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11191, 0)
    node.BrowseName = QualifiedName('UseSlopedExtrapolation', 0)
    node.NodeClass = NodeClass.Variable
    node.ParentNodeId = NumericNodeId(11187, 0)
    node.ReferenceTypeId = NumericNodeId(46, 0)
    node.TypeDefinition = NumericNodeId(68, 0)
    attrs = VariableAttributes()
    attrs.DisplayName = LocalizedText("UseSlopedExtrapolation")
    attrs.DataType = NodeId(ObjectIds.Boolean)
    attrs.ValueRank = -1
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11191, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(68, 0)
    refs.append(ref)
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(37, 0)
    ref.SourceNodeId = NumericNodeId(11191, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(78, 0)
    refs.append(ref)
    ref = AddReferencesItem()
    ref.IsForward = False
    ref.ReferenceTypeId = NumericNodeId(46, 0)
    ref.SourceNodeId = NumericNodeId(11191, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(11187, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2341, 0)
    node.BrowseName = QualifiedName('Interpolative', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("Interpolative")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2341, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2342, 0)
    node.BrowseName = QualifiedName('Average', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("Average")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2342, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2343, 0)
    node.BrowseName = QualifiedName('TimeAverage', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("TimeAverage")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2343, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11285, 0)
    node.BrowseName = QualifiedName('TimeAverage2', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("TimeAverage2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11285, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2344, 0)
    node.BrowseName = QualifiedName('Total', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("Total")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2344, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11304, 0)
    node.BrowseName = QualifiedName('Total2', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("Total2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11304, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2346, 0)
    node.BrowseName = QualifiedName('Minimum', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("Minimum")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2346, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2347, 0)
    node.BrowseName = QualifiedName('Maximum', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("Maximum")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2347, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2348, 0)
    node.BrowseName = QualifiedName('MinimumActualTime', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("MinimumActualTime")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2348, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2349, 0)
    node.BrowseName = QualifiedName('MaximumActualTime', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("MaximumActualTime")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2349, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2350, 0)
    node.BrowseName = QualifiedName('Range', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("Range")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2350, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11286, 0)
    node.BrowseName = QualifiedName('Minimum2', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("Minimum2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11286, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11287, 0)
    node.BrowseName = QualifiedName('Maximum2', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("Maximum2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11287, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11305, 0)
    node.BrowseName = QualifiedName('MinimumActualTime2', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("MinimumActualTime2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11305, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11306, 0)
    node.BrowseName = QualifiedName('MaximumActualTime2', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("MaximumActualTime2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11306, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11288, 0)
    node.BrowseName = QualifiedName('Range2', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("Range2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11288, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2351, 0)
    node.BrowseName = QualifiedName('AnnotationCount', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("AnnotationCount")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2351, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2352, 0)
    node.BrowseName = QualifiedName('Count', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("Count")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2352, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11307, 0)
    node.BrowseName = QualifiedName('DurationInStateZero', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("DurationInStateZero")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11307, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11308, 0)
    node.BrowseName = QualifiedName('DurationInStateNonZero', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("DurationInStateNonZero")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11308, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2355, 0)
    node.BrowseName = QualifiedName('NumberOfTransitions', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("NumberOfTransitions")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2355, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2357, 0)
    node.BrowseName = QualifiedName('Start', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("Start")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2357, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2358, 0)
    node.BrowseName = QualifiedName('End', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("End")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2358, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2359, 0)
    node.BrowseName = QualifiedName('Delta', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("Delta")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2359, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11505, 0)
    node.BrowseName = QualifiedName('StartBound', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("StartBound")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11505, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11506, 0)
    node.BrowseName = QualifiedName('EndBound', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("EndBound")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11506, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11507, 0)
    node.BrowseName = QualifiedName('DeltaBounds', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("DeltaBounds")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11507, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2360, 0)
    node.BrowseName = QualifiedName('DurationGood', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("DurationGood")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2360, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2361, 0)
    node.BrowseName = QualifiedName('DurationBad', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("DurationBad")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2361, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2362, 0)
    node.BrowseName = QualifiedName('PercentGood', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("PercentGood")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2362, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2363, 0)
    node.BrowseName = QualifiedName('PercentBad', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("PercentBad")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2363, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(2364, 0)
    node.BrowseName = QualifiedName('WorstQuality', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("WorstQuality")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(2364, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11292, 0)
    node.BrowseName = QualifiedName('WorstQuality2', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("WorstQuality2")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11292, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11426, 0)
    node.BrowseName = QualifiedName('StandardDeviationSample', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("StandardDeviationSample")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11426, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11427, 0)
    node.BrowseName = QualifiedName('StandardDeviationPopulation', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("StandardDeviationPopulation")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11427, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11428, 0)
    node.BrowseName = QualifiedName('VarianceSample', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("VarianceSample")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11428, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)

    node = AddNodesItem()
    node.RequestedNewNodeId = NumericNodeId(11429, 0)
    node.BrowseName = QualifiedName('VariancePopulation', 0)
    node.NodeClass = NodeClass.Object
    node.TypeDefinition = NumericNodeId(2340, 0)
    attrs = ObjectAttributes()
    attrs.DisplayName = LocalizedText("VariancePopulation")
    attrs.EventNotifier = 0
    node.NodeAttributes = attrs
    server.add_nodes([node])
    refs = []
    ref = AddReferencesItem()
    ref.IsForward = True
    ref.ReferenceTypeId = NumericNodeId(40, 0)
    ref.SourceNodeId = NumericNodeId(11429, 0)
    ref.TargetNodeClass = NodeClass.DataType
    ref.TargetNodeId = NumericNodeId(2340, 0)
    refs.append(ref)
    server.add_references(refs)