예제 #1
0
        public override void InitNodeTemplates(INodeTemplateFactory factory)
        {
            factory.CreateInterfaceType(KnxInterface, "KNX.GATEWAY.NAME", "KNX.GATEWAY.DESCRIPTION", 2, int.MaxValue, true);
            factory.CreateInterfaceType(KnxInterface3Level, "KNX.GATEWAY_3_LEVEL.NAME", "KNX.GATEWAY_3_LEVEL.DESCRIPTION", 31, 1, false);
            factory.CreateInterfaceType(KnxInterface3LevelMain, "KNX.GATEWAY_3_LEVEL.MAIN.NAME", "KNX.GATEWAY_3_LEVEL.MAIN.DESCRIPTION", 7, 31, false);
            factory.CreateInterfaceType(KnxInterface3LevelMiddle, "KNX.GATEWAY_3_LEVEL.MIDDLE.NAME", "KNX.GATEWAY_3_LEVEL.MIDDLE.DESCRIPTION", 255, 7, false);
            factory.CreateInterfaceType(KnxInterface3LevelValue, "KNX.GATEWAY_3_LEVEL.VALUE.NAME", "KNX.GATEWAY_3_LEVEL.VALUE.DESCRIPTION", 0, 255, false);

            factory.CreateInterfaceType(KnxBaos, "KNX.BAOS.NAME", "KNX.BAOS.DESCRIPTION", 0, 1, true);

            factory.CreateNodeTemplate(KnxGatway, "KNX.GATEWAY.NAME", "KNX.GATEWAY.DESCRIPTION", "knx-gw",
                                       GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Ethernet), KnxInterface, false, false, true, false, true,
                                       NodeDataType.NoAttribute, int.MaxValue, false);
            factory.CreatePropertyTemplate(GenerateNewGuid(KnxGatway, 1), "COMMON.PROPERTY.IP.NAME", "COMMON.PROPERTY.IP.DESCRIPTION",
                                           "knx-ip", PropertyTemplateType.Ip, KnxGatway, "COMMON.CATEGORY.ADDRESS", true, false, "", "", 1,
                                           1);
            factory.CreatePropertyTemplate(GenerateNewGuid(KnxGatway, 2), "COMMON.PROPERTY.IPPORT.NAME", "COMMON.PROPERTY.IPPORT.DESCRIPTION",
                                           "knx-port", PropertyTemplateType.Range, KnxGatway, "COMMON.CATEGORY.ADDRESS", true, false, PropertyHelper.CreateRangeMetaString(1, ushort.MaxValue), "3671", 1,
                                           2);
            factory.CreatePropertyTemplate(GenerateNewGuid(KnxGatway, 3), "COMMON.PROPERTY.USE_NAT.NAME", "COMMON.PROPERTY.USE_NAT.DESCRIPTION",
                                           "knx-use-nat", PropertyTemplateType.Bool, KnxGatway, "COMMON.CATEGORY.ADDRESS", true, false, "", false, 1,
                                           3);

            /*      factory.CreateNodeTemplate(KnxSecureGatway, "KNX.SECURE_GATEWAY.NAME", "KNX.SECURE_GATEWAY.DESCRIPTION", "knx-secure-gw",
             *        GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Ethernet), KnxInterface, false, false, true, false, true,
             *        NodeDataType.NoAttribute, int.MaxValue, false);
             *    factory.CreatePropertyTemplate(GenerateNewGuid(KnxSecureGatway, 1), "COMMON.PROPERTY.IP.NAME", "COMMON.PROPERTY.IP.DESCRIPTION",
             *        "knx-ip", PropertyTemplateType.Ip, KnxSecureGatway, "COMMON.CATEGORY.ADDRESS", true, false, "", "", 1,
             *        1);
             *    factory.CreatePropertyTemplate(GenerateNewGuid(KnxSecureGatway, 2), "COMMON.PROPERTY.IPPORT.NAME", "COMMON.PROPERTY.IPPORT.DESCRIPTION",
             *        "knx-port", PropertyTemplateType.Range, KnxSecureGatway, "COMMON.CATEGORY.ADDRESS", true, false, PropertyHelper.CreateRangeMetaString(1, ushort.MaxValue), "3671", 1,
             *        2);
             *    factory.CreatePropertyTemplate(GenerateNewGuid(KnxSecureGatway, 3), "KNX.PROPERTIES.SECURE.MGMPW.NAME", "KNX.PROPERTIES.SECURE.MGMPW.DESCRIPTION",
             *        "knx-mgm-pw", PropertyTemplateType.Text, KnxSecureGatway, "COMMON.CATEGORY.ADDRESS", true, false, "", "", 1,
             *        3);
             *    factory.CreatePropertyTemplate(GenerateNewGuid(KnxSecureGatway, 4), "KNX.PROPERTIES.SECURE.AUTHPW.NAME", "KNX.PROPERTIES.SECURE.AUTHPW.DESCRIPTION",
             *        "knx-auth-pw", PropertyTemplateType.Text, KnxSecureGatway, "COMMON.CATEGORY.ADDRESS", true, false, "", "", 1,
             *        4);
             *    factory.CreatePropertyTemplate(GenerateNewGuid(KnxSecureGatway, 5), "COMMON.PROPERTY.USE_NAT.NAME", "COMMON.PROPERTY.USE_NAT.DESCRIPTION",
             *        "knx-use-nat", PropertyTemplateType.Bool, KnxSecureGatway, "COMMON.CATEGORY.ADDRESS", true, false, "", false, 1,
             *        5);*/

            factory.CreateNodeTemplate(KnxBaos, "KNX.BAOS.NAME", "KNX.BAOS.DESCRIPTION",
                                       "knx-baos", GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Virtual), KnxBaos, false, false, true, false, true,
                                       NodeDataType.NoAttribute, 1, false);

            factory.CreateNodeTemplate(new Guid("86db8e85-0770-47a0-9fa9-71558113a0db"), "KNX.BAOS.DATAPOINTS.NAME", "KNX.BAOS.DATAPOINTS.DESCRIPTION",
                                       "knx-baos", KnxBaos, KnxInterface3LevelMiddle, true, false, true, false, true,
                                       NodeDataType.NoAttribute, 1, false);

            factory.CreateNodeTemplate(KnxGatwayStatus, "KNX.GW_STATUS.NAME", "KNX.GW_STATUS.DESCRITPION",
                                       "knx-gw-state", KnxInterface, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, true, false, true,
                                       NodeDataType.Boolean, 1, false, false);

            factory.CreateNodeTemplate(KnxIpGateway3LevelInterface, "KNX.GATEWAY_3_LEVEL.NAME", "KNX.GATEWAY_3_LEVEL.DESCRIPTION", "knx-3-level",
                                       KnxInterface, KnxInterface3Level, false, false, true, false, true,
                                       NodeDataType.NoAttribute, int.MaxValue, false);

            factory.CreatePropertyTemplate(GenerateNewGuid(KnxIpGateway3LevelInterface, 1), "COMMON.PROPERTY.IMPORT.NAME", "COMMON.PROPERTY.IMPORT.DESCRIPTION",
                                           "knx-import", PropertyTemplateType.ImportData, KnxIpGateway3LevelInterface, "COMMON.CATEGORY.IMPORT", true, false, "OBJECT_SAVED", false, 2,
                                           1);

            factory.CreateNodeTemplate(KnxIp3LevelMainAddress, "KNX.GATEWAY_3_LEVEL.MAIN.NAME", "KNX.GATEWAY_3_LEVEL.MAIN.DESCRIPTION", "knx-3-level-main",
                                       KnxInterface3Level, KnxInterface3LevelMain, false, false, true, false, true,
                                       NodeDataType.NoAttribute, int.MaxValue, false);
            AddAddressProperty(KnxIp3LevelMainAddress, factory, 31);
            factory.ChangeNodeTemplateMetaName(KnxIp3LevelMainAddress, "{PROPERTY:knx-address}{CONST:-}{NODE:Name}");

            factory.CreateNodeTemplate(KnxIp3LevelMiddleAddress, "KNX.GATEWAY_3_LEVEL.MIDDLE.NAME", "KNX.GATEWAY_3_LEVEL.MIDDLE.DESCRIPTION", "knx-3-level-middle",
                                       KnxInterface3LevelMain, KnxInterface3LevelMiddle, false, false, true, false, true,
                                       NodeDataType.NoAttribute, int.MaxValue, false);
            AddAddressProperty(KnxIp3LevelMiddleAddress, factory, 7);
            factory.ChangeNodeTemplateMetaName(KnxIp3LevelMiddleAddress, "{PROPERTY:knx-address}{CONST:-}{NODE:Name}");

            AddDpt1Nodes(factory, KnxInterface3LevelMiddle);
            AddDpt2Nodes(factory, KnxInterface3LevelMiddle);
            AddDpt3Nodes(factory, KnxInterface3LevelMiddle);

            AddDpt5Nodes(factory, KnxInterface3LevelMiddle);
            AddDpt6Nodes(factory, KnxInterface3LevelMiddle);
            AddDpt7Nodes(factory, KnxInterface3LevelMiddle);
            AddDpt8Nodes(factory, KnxInterface3LevelMiddle);
            AddDpt9Nodes(factory, KnxInterface3LevelMiddle);

            AddDpt10Nodes(factory, KnxInterface3LevelMiddle);
            AddDpt11Nodes(factory, KnxInterface3LevelMiddle);
        }
예제 #2
0
        private void AddAddressProperty(Guid node, INodeTemplateFactory factory)
        {
            AddAddressProperty(node, factory, 255);

            factory.ChangeNodeTemplateMetaName(node, "{PROPERTY:knx-address}{CONST:-}{NODE:Name}");
        }