コード例 #1
0
        public override void InitNodeTemplates(INodeTemplateFactory factory)
        {
            base.InitNodeTemplates(factory);


            factory.CreateInterfaceType(DateTimeInterfaceGuid, "TIMES.INTERFACE.NAME", "TIMES.INTERFACE.NAME", int.MaxValue, 1, true);

            factory.CreateNodeTemplate(DriverGuid, "TIMES.DATETIME.NAME", "TIMES.DATETIME.DESCRIPTION", "times", GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Virtual), DateTimeInterfaceGuid, false, true, true, false, true, NodeDataType.NoAttribute, 1, false);

            factory.CreateNodeTemplate(DateTime, "TIMES.DATETIME.DATETIME.NAME", "TIMES.DATETIME.DATETIME.DESCRIPTION", "times-datetime", DateTimeInterfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, true, false, true, NodeDataType.DateTime, 1, false);
            factory.CreateNodeTemplate(Date, "TIMES.DATETIME.DATE.NAME", "TIMES.DATETIME.DATE.DESCRIPTION", "times-date", DateTimeInterfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, true, false, true, NodeDataType.Date, 1, false);
            factory.CreateNodeTemplate(Time, "TIMES.DATETIME.TIME.NAME", "TIMES.DATETIME.TIME.DESCRIPTION", "times-time", DateTimeInterfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, true, false, true, NodeDataType.Time, 1, false);


            factory.CreateNodeTemplate(DayOfWeek, "TIMES.DATETIME.DAY_OF_WEEK.NAME", "TIMES.DATETIME.DAY_OF_WEEK.DESCRIPTION", "times-day-of-week", DateTimeInterfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, true, false, true, NodeDataType.Integer, 1, false);
            factory.CreateNodeTemplate(DayOfMonth, "TIMES.DATETIME.DAY_OF_MONTH.NAME", "TIMES.DATETIME.DAY_OF_MONTH.DESCRIPTION", "times-day-of-month", DateTimeInterfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, true, false, true, NodeDataType.Integer, 1, false);
            factory.CreateNodeTemplate(Month, "TIMES.DATETIME.MONTH.NAME", "TIMES.DATETIME.MONTH.DESCRIPTION", "times-month", DateTimeInterfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, true, false, true, NodeDataType.Integer, 1, false);
            factory.CreateNodeTemplate(Year, "TIMES.DATETIME.YEAR.NAME", "TIMES.DATETIME.YEAR.DESCRIPTION", "times-year", DateTimeInterfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, true, false, true, NodeDataType.Integer, 1, false);

            factory.CreateNodeTemplate(Milliseconds, "TIMES.DATETIME.MILLISECONDS.NAME", "TIMES.DATETIME.MILLISECONDS.DESCRIPTION", "times-milliseconds", DateTimeInterfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, true, false, true, NodeDataType.Integer, 1, false);
            factory.CreateNodeTemplate(Seconds, "TIMES.DATETIME.SECONDS.NAME", "TIMES.DATETIME.SECONDS.DESCRIPTION", "times-seconds", DateTimeInterfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, true, false, true, NodeDataType.Integer, 1, false);
            factory.CreateNodeTemplate(Minutes, "TIMES.DATETIME.MINUTES.NAME", "TIMES.DATETIME.MINUTES.DESCRIPTION", "times-minutes", DateTimeInterfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, true, false, true, NodeDataType.Integer, 1, false);
            factory.CreateNodeTemplate(Hours, "TIMES.DATETIME.HOURS.NAME", "TIMES.DATETIME.HOURS.DESCRIPTION", "times-hours", DateTimeInterfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, true, false, true, NodeDataType.Integer, 1, false);

            factory.CreateNodeTemplate(SecondsSinceBoot, "TIMES.DATETIME.SECONDS_SINCE_BOOT.NAME", "TIMES.DATETIME.SECONDS_SINCE_BOOT.DESCRIPTION", "times-running", DateTimeInterfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, true, false, true, NodeDataType.Integer, 1, false);
        }
コード例 #2
0
        public override void InitNodeTemplates(INodeTemplateFactory factory)
        {
            var gwguid = new Guid("2ca34b3f-1c29-4ab1-99d2-ecfbf2683dd5");

            factory.CreateInterfaceType(gwguid, "ENOCEAN.DEVICE.NAME", "ENOCEAN.DEVICE.DESCRIPTION", int.MaxValue, 1,
                                        true);
            factory.CreateInterfaceType(InterfaceGuid, "ENOCEAN.LEARNED.NAME", "ENOCEAN.LEARNED.DESCRIPTION", int.MaxValue, 1,
                                        true);
            factory.CreateInterfaceType(SimulatedGuid, "ENOCEAN.SIMULATED.NAME", "ENOCEAN.SIMULATED.DESCRIPTION", int.MaxValue, 1,
                                        true);

            factory.CreateNodeTemplate(DriverGuid, "ENOCEAN.DEVICE.NAME", "ENOCEAN.DEVICE.DESCRIPTION",
                                       "enocean-device", GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Usb), gwguid, false, false, true, false, true,
                                       NodeDataType.NoAttribute, 1, false);

            factory.CreatePropertyTemplate(new Guid("f68e5b59-3fea-4739-a7c5-a2e2b52c08ff"), "ENOCEAN.DEVICE.PORT.NAME",
                                           "ENOCEAN.DEVICE.PORT.DESCRIPTION", "enocean-port", PropertyTemplateType.UsbPort, DriverGuid,
                                           "COMMON.CATEGORY.ADDRESS", true, false, null, null, 1, 1);

            factory.CreateNodeTemplate(LearnedGuid, "ENOCEAN.LEARNED.NAME", "ENOCEAN.LEARNED.DESCRIPTION",
                                       "enocean-learned", gwguid, InterfaceGuid, true, false, true, false, true, NodeDataType.NoAttribute, 1,
                                       false);
            factory.CreatePropertyTemplate(new Guid("409ae6c0-3e65-4d7b-9ace-120d2074eec7"), "ENOCEAN.LEARN.NAME", "ENOCEAN.LEARN.DESCRIPTION", "learn", PropertyTemplateType.LearnMode, LearnedGuid, "COMMON.CATEGORY.MISC", true, false, null, null, 1, 1);

            factory.CreateNodeTemplate(SimulatedGuid, "ENOCEAN.SIMULATED.NAME", "ENOCEAN.SIMULATED.DESCRIPTION",
                                       "enocean-simulated", gwguid, SimulatedGuid, true, false, true, false, true, NodeDataType.NoAttribute, 1,
                                       false);

            EnOceanRorgD5Data.AddRorgD5Templates(factory, _enoceanFactory);
            EnOceanRorgA5Data.AddRorgA5Templates(factory, _enoceanFactory);
            EnOceanRorgD2Data.AddRorgD2Templates(factory, _enoceanFactory);
            EnOceanRorgF6Data.AddRorgF6Templates(factory, _enoceanFactory);

            AddWriteAbleDataPoints(factory);
        }
コード例 #3
0
ファイル: KnxFactory.cs プロジェクト: cuonghd4k/automatica
        private void AddDpt3Nodes(INodeTemplateFactory factory, Guid parentNode)
        {
            var dpt3InterfaceGuid = new Guid("45cdff99-5710-499c-b304-12141d4b6913");

            factory.CreateInterfaceType(dpt3InterfaceGuid, "KNX.DPT3.NAME", "KNX.DPT3.DESCRIPTION", 2, Int32.MaxValue,
                                        false);

            var dpt3Guid = new Guid("99d97125-b566-4cac-8210-3ba792db3c04");

            factory.CreateNodeTemplate(dpt3Guid, "KNX.DPT3.NAME", "KNX.DPT3.DESCRIPTION", "knx-dpt3",
                                       parentNode, dpt3InterfaceGuid, false, true, false, true, false,
                                       NodeDataType.NoAttribute, int.MaxValue, false);
            InitDptType((int)DptType.Dpt2, dpt3Guid, factory);


            var dpt3Control  = new Guid("40610606-5306-497c-8ebc-f064cc70b005");
            var dpt3StepCode = new Guid("c3ba5a94-83ba-44d6-b853-ef0c945318c0");

            factory.CreateNodeTemplate(dpt3Control, "KNX.DPT3.CONTROL.NAME", "KNX.DPT3.CONTROL.DESCRIPTION",
                                       "knx-dpt2-control", dpt3InterfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, false, true, false,
                                       NodeDataType.Boolean, 1, false);
            factory.CreateNodeTemplate(dpt3StepCode, "KNX.DPT3.STEPCODE.NAME", "KNX.DPT3.STEPCODE.DESCRIPTION",
                                       "knx-dpt2-step-code", dpt3InterfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, false, true, false,
                                       NodeDataType.Integer, 1, false);
        }
コード例 #4
0
        private void CreateLight(INodeTemplateFactory factory)
        {
            var interfaceGuid = new Guid("6d07b0a9-4635-4404-8254-76079ea7f6ce");

            factory.CreateInterfaceType(interfaceGuid, "APPLE_HOMEKIT_SERVER.BULB.NAME",
                                        "APPLE_HOMEKIT_SERVER.BULB.DESCRIPTION", 3, int.MaxValue, false);

            factory.CreateNodeTemplate(interfaceGuid, "APPLE_HOMEKIT_SERVER.BULB.NAME",
                                       "APPLE_HOMEKIT_SERVER.BULB.DESCRIPTION", "light-bulb-folder", DriverGuid, interfaceGuid, false, false,
                                       true, false, true, NodeDataType.NoAttribute, int.MaxValue, false);
            AddAidProperty(interfaceGuid, factory);

            factory.CreateNodeTemplate(new Guid("37685cd8-0494-4ce4-8c59-1fddcf669aa3"), "APPLE_HOMEKIT_SERVER.BULB.SWITCH.NAME",
                                       "APPLE_HOMEKIT_SERVER.BULB.SWITCH.DESCRIPTION", "light-bulb-switch", interfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true,
                                       true, false, false, NodeDataType.Boolean, 1, false);

            factory.CreateNodeTemplate(new Guid("a0c1a70f-ca76-40e5-b7a1-74ff62edfd19"), "APPLE_HOMEKIT_SERVER.BULB.STATUS.NAME",
                                       "APPLE_HOMEKIT_SERVER.BULB.STATUS.DESCRIPTION", "light-bulb-status", interfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, false,
                                       true, true, false, NodeDataType.Boolean, 1, false);

            factory.CreateNodeTemplate(new Guid("79e7c522-3eaa-49af-8985-44b345e30473"), "APPLE_HOMEKIT_SERVER.BULB.BRIGHTNESS.NAME",
                                       "APPLE_HOMEKIT_SERVER.BULB.BRIGHTNESS.DESCRIPTION", "light-bulb-brightness", interfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), false, false,
                                       true, true, false, NodeDataType.Integer, 1, false);

            factory.CreateNodeTemplate(new Guid("515b3a15-9bc5-4121-9f89-36abbb7108c8"), "APPLE_HOMEKIT_SERVER.BULB.HUE.NAME",
                                       "APPLE_HOMEKIT_SERVER.HUE.BRIGHTNESS.DESCRIPTION", "light-bulb-hue", interfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), false, true,
                                       true, true, false, NodeDataType.String, 1, false);
        }
コード例 #5
0
 private void CreateAction(INodeTemplateFactory factory, Guid guid, string name, bool writeAble, bool readAble, NodeDataType dataType)
 {
     factory.CreateNodeTemplate(guid, $"SONOS.{name.ToUpperInvariant()}.NAME",
                                $"SONOS.{name.ToUpperInvariant()}.DESCRIPTION", name.ToLowerInvariant(), SonosDeviceInterfaceGuid,
                                GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, readAble, true, writeAble, true,
                                dataType, 1, false);
 }
コード例 #6
0
        private void CreateLight(INodeTemplateFactory factory, Guid gwInterface)
        {
            factory.CreateInterfaceType(LightInterfaceGuid, "IKEA.TRADFRI.LIGHT.NAME", "IKEA.TRADFRI.LIGHT.DESCRIPTION", 0, 0, false);

            factory.CreateNodeTemplate(LightContainerGuid, "IKEA.TRADFRI.LIGHT.NAME",
                                       "IKEA.TRADFRI.LIGHT.DESCRIPTION", "container", gwInterface, LightInterfaceGuid, false, false, true,
                                       false, true, NodeDataType.NoAttribute, 0, false);

            factory.CreatePropertyTemplate(new Guid("ae3582db-310e-4a10-9af9-27ef561e475a"), "IKEA.TRADFRI.DEVICE.ID.NAME", "IKEA.TRADFRI.DEVICE.ID.DESCRIPTION",
                                           DeviceIdPropertyKey, PropertyTemplateType.Numeric, LightContainerGuid, "COMMON.CATEGORY.ADDRESS", true, false, null, null, 0,
                                           0);

            factory.CreateNodeTemplate(LightGuid, "IKEA.TRADFRI.LIGHT.SWITCH.NAME", "IKEA.TRADFRI.LIGHT.SWITCH.DESCRIPTION",
                                       "ikea-light-switch", LightInterfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true,
                                       false, true, false, NodeDataType.Boolean, 1, false);
            factory.ChangeDefaultVisuTemplate(LightGuid, VisuMobileObjectTemplateTypes.ToggleButton);

            factory.CreateNodeTemplate(LightDimmerGuid, "IKEA.TRADFRI.LIGHT.DIMMER.NAME", "IKEA.TRADFRI.LIGHT.DIMMER.DESCRIPTION",
                                       "ikea-light-dimmer", LightInterfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true,
                                       false, true, false, NodeDataType.Integer, 1, false);

            factory.CreateNodeTemplate(LightColorGuid, "IKEA.TRADFRI.LIGHT.COLOR.NAME", "IKEA.TRADFRI.LIGHT.COLOR.DESCRIPTION",
                                       "ikea-light-dimmer", LightInterfaceGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true,
                                       false, true, false, NodeDataType.String, 1, false);
        }
コード例 #7
0
 public DriverContextMock(NodeInstance nodeInstance, INodeTemplateFactory nodeTemplateFactory)
 {
     NodeInstance        = nodeInstance;
     NodeTemplateFactory = nodeTemplateFactory;
     TelegramMonitor     = new TelegramMonitorMock();
     LicenseState        = new LicenseStateMock();
 }
コード例 #8
0
        public override void InitNodeTemplates(INodeTemplateFactory factory)
        {
            factory.CreateInterfaceType(DriverGuid, "IKEA.TRADFRI.NAME", "IKEA.TRADFRI.DESCRIPTION", int.MaxValue, 1, true);
            factory.CreateNodeTemplate(DriverGuid, "IKEA.TRADFRI.NAME", "IKEA.TRADFRI.DESCRIPTION", "ikea.tradfri", GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Ethernet),
                                       DriverGuid, false, false, true, false, true, NodeDataType.NoAttribute, Int32.MaxValue, false);

            factory.CreatePropertyTemplate(new Guid("b6b5e4ff-8511-44f4-aceb-bd80d01a141b"), "IKEA.TRADFRI.SCAN.NAME", "IKEA.TRADFRI.SCAN.DESCRIPTION",
                                           "scan", PropertyTemplateType.Scan, DriverGuid, "COMMON.CATEGORY.DISCOVERY", true, false, "", null, 0,
                                           0);

            var gwInterface = new Guid("f15cca2e-7fe5-43f6-ad8a-ea4b60fc7b56");

            factory.CreateInterfaceType(gwInterface, "IKEA.TRADFRI.GATEWAY.NAME", "IKEA.TRADFRI.GATEWAY.DESCRIPTION", int.MaxValue, int.MaxValue, true);
            factory.CreateNodeTemplate(GatewayGuid, "IKEA.TRADFRI.GATEWAY.NAME", "IKEA.TRADFRI.GATEWAY.NAME", "ikea-tradfri-gateway", DriverGuid, gwInterface, false, false, true, false, true, NodeDataType.NoAttribute, int.MaxValue, false);

            factory.CreatePropertyTemplate(new Guid("dbac52e1-a070-4961-b7fe-fb9ee6d924c7"), "IKEA.TRADFRI.GATEWAY.ID.NAME",
                                           "IKEA.TRADFRI.GATEWAY.ID.DESCRIPTION", IdAddressPropertyKey, PropertyTemplateType.Text, GatewayGuid,
                                           "COMMON.CATEGORY.ADDRESS", true, false, "", null, 1, 0);

            factory.CreatePropertyTemplate(new Guid("330b668e-2f46-42c3-b44e-b42a149a2a0d"), "IKEA.TRADFRI.GATEWAY.SECRET.NAME",
                                           "IKEA.TRADFRI.GATEWAY.SECRET.DESCRIPTION", SecretPropertyKey, PropertyTemplateType.Text,
                                           GatewayGuid, "COMMON.CATEGORY.ADDRESS", true, false, "", null, 1, 1);

            factory.CreatePropertyTemplate(new Guid("22438ff2-4739-4fd0-a2a0-abe691dfe1b4"), "IKEA.TRADFRI.GATEWAY.CONNECTION_KEY.NAME",
                                           "IKEA.TRADFRI.GATEWAY.CONNECTION_KEY.DESCRIPTION", ConnectionPropertyKey, PropertyTemplateType.Text,
                                           GatewayGuid, "COMMON.CATEGORY.ADDRESS", false, true, "", null, 1, 2);

            factory.CreatePropertyTemplate(new Guid("252d18ed-af14-447c-8472-2d3d0d15ff0d"), "IKEA.TRADFRI.GATEWAY.SCAN.NAME", "IKEA.TRADFRI.GATEWAY.SCAN.DESCRIPTION",
                                           "scan", PropertyTemplateType.Scan, GatewayGuid, "COMMON.CATEGORY.DISCOVERY", true, false, "", null, 2,
                                           0);

            CreateSwitch(factory, gwInterface);
            CreateLight(factory, gwInterface);
        }
コード例 #9
0
        public override void InitNodeTemplates(INodeTemplateFactory factory)
        {
            factory.CreateInterfaceType(DriverGuid, "APPLE_HOMEKIT_SERVER.NAME", "APPLE_HOMEKIT_SERVER.DESCRIPTION", int.MaxValue, int.MaxValue, true);
            factory.CreateNodeTemplate(DriverGuid, "APPLE_HOMEKIT_SERVER.NAME", "APPLE_HOMEKIT_SERVER.DESCRIPTION", "apple-homekit-server", GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Virtual),
                                       DriverGuid, false, true, true, false, true, NodeDataType.NoAttribute, Int32.MaxValue, false);

            factory.CreateNodeTemplate(new Guid("13d10902-a07c-4abf-a331-70ad2f95a184"), "APPLE_HOMEKIT_SERVER.PAIRING_KEY.NAME", "APPLE_HOMEKIT_SERVER.PAIRING_KEY.DESCRIPTION", "pairing-key", DriverGuid,
                                       GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, true, false, true, NodeDataType.String, 1, false, false);

            factory.CreatePropertyTemplate(new Guid("4085d4eb-11c0-48ff-b005-045020729d85"), "LTSK_PRIVATE", "LTSK_PRIVATE", "ltsk-private",
                                           PropertyTemplateType.Text, DriverGuid, "", false, true, null, null, 0, 0);
            factory.CreatePropertyTemplate(new Guid("4bd1b665-61ec-4f43-b80d-ec236983d365"), "LTPK_PRIVATE", "LTPK_PRIVATE", "ltpk-private",
                                           PropertyTemplateType.Text, DriverGuid, "", false, true, null, null, 0, 0);

            factory.CreatePropertyTemplate(new Guid("c3759cf5-6a9b-4afb-b0e4-32941db684ca"), "CONFIG_VERSION", "CONFIG_VERSION", "config-version",
                                           PropertyTemplateType.Integer, DriverGuid, "", false, true, null, 1, 0, 0);


            factory.CreatePropertyTemplate(new Guid("25497b6e-8059-4dfc-8e9f-917d31c624cf"), "COMMON.PROPERTY.IPPORT.NAME", "COMMON.PROPERTY.IPPORT.DESCRIPTION", "port",
                                           PropertyTemplateType.Integer, DriverGuid, "COMMON.CATEGORY.ADDRESS", true, false, PropertyHelper.CreateRangeMetaString(1, short.MaxValue), 52634, 0, 0);

            CreateLight(factory);
            CreatePowerOutlet(factory);
            CreateContactSensor(factory);
            CreateSwitch(factory);
            CreateTemperatureSensor(factory);
        }
コード例 #10
0
        public override void InitNodeTemplates(INodeTemplateFactory factory)
        {
            factory.CreateInterfaceType(InterfaceId, "CONSTANTS.NAME", "CONSTANTS.DESCRIPTION", int.MaxValue, 1, true);

            factory.CreateNodeTemplate(BusId, "CONSTANTS.NAME", "CONSTANTS.DESCRIPTION", "consts", GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Virtual),
                                       InterfaceId, false, true, true, false, true, NodeDataType.NoAttribute, Int32.MaxValue, false);

            factory.CreateNodeTemplate(ValueId, "CONSTANTS.NODE.CONSTANT.NAME", "CONSTANTS.NODE.CONSTANT.DESCRIPTION", "const", InterfaceId,
                                       GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), false, true, true, false, true, NodeDataType.Integer, Int32.MaxValue, false);
            factory.CreatePropertyTemplate(PropertyValueId, "CONSTANTS.PROPERTY.VALUE.NAME", "CONSTANTS.PROPERTY.VALUE.DESCRIPTION", "const_value", PropertyTemplateType.Integer,
                                           ValueId, "CONSTANTS.CATEGORY.VALUE", true, false, "", "", 1, 1);


            factory.CreateNodeTemplate(PiId, "CONSTANTS.NODE.PI.NAME", "CONSTANTS.NODE.PI.DESCRIPTION", "const_pi", InterfaceId,
                                       GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), false, true, true, false, true, NodeDataType.Double, Int32.MaxValue, false);

            factory.CreateNodeTemplate(HalfPiId, "CONSTANTS.NODE.HALF_PI.NAME", "CONSTANTS.NODE.HALF_PI.DESCRIPTION", "const_halfpi", InterfaceId,
                                       GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), false, true, true, false, true, NodeDataType.Double, Int32.MaxValue, false);


            factory.CreateNodeTemplate(DoublePiId, "CONSTANTS.NODE.DOUBLE_PI.NAME", "CONSTANTS.NODE.DOUBLE_PI.DESCRIPTION", "const_doublepi", InterfaceId,
                                       GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), false, true, true, false, true, NodeDataType.Double, Int32.MaxValue, false);


            factory.CreateNodeTemplate(StringValueId, "CONSTANTS.NODE.STRING.NAME", "CONSTANTS.NODE.STRING.DESCRIPTION", "const_string", InterfaceId,
                                       GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), false, true, true, false, true, NodeDataType.String, Int32.MaxValue, false);
            factory.CreatePropertyTemplate(StringPropertyValueId, "CONSTANTS.PROPERTY.VALUE.NAME", "CONSTANTS.PROPERTY.VALUE.DESCRIPTION", "const_value", PropertyTemplateType.Text,
                                           StringValueId, "CONSTANTS.CATEGORY.VALUE", true, false, "", "", 1, 1);
        }
コード例 #11
0
        private void CreateUuidProperty(INodeTemplateFactory factory, Guid objectRef)
        {
            var gu = GenerateNewGuid(objectRef, 1);

            factory.CreatePropertyTemplate(gu, "LOXONE.MINISERVER.PROPERTY.UUID.NAME", "LOXONE.MINISERVER.PROPERTY.UUID.DESCRIPTION", "uuid", PropertyTemplateType.Text, objectRef, "COMMON.CATEGORY.ADDRESS", true, false, null, "", 1, 1);
            factory.CreatePropertyTemplate(GenerateNewGuid(objectRef, 2), "LOXONE.MINISERVER.PROPERTY.STATE.NAME", "LOXONE.MINISERVER.PROPERTY.STATE.DESCRIPTION", "state", PropertyTemplateType.Text, objectRef, "COMMON.CATEGORY.ADDRESS", false, true, null, "", 1, 1);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="factory"></param>9
        public override void InitNodeTemplates(INodeTemplateFactory factory)
        {
            factory.CreateInterfaceType(DriverGuid, "BLOCKCHAIN_TICKER.NAME", "BLOCKCHAIN_TICKER.DESCRIPTION", int.MaxValue, 1, true);

            factory.CreateNodeTemplate(DriverGuid, "BLOCKCHAIN_TICKER.NAME", "BLOCKCHAIN_TICKER.DESCRIPTION", "blockchain_ticker",
                                       GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Virtual), DriverGuid, false, false, true, false, true, NodeDataType.NoAttribute, 1, false);

            factory.CreatePropertyTemplate(new Guid("07453b89-d9df-450c-9208-7b08d317e2c0"), "BLOCKCHAIN_TICKER.POLL_INTERVAL.NAME", "BLOCKCHAIN_TICKER.POLL_INTERVAL.DESCRIPTION", "poll",
                                           PropertyTemplateType.Range, DriverGuid, "COMMON.CATEGORY.ADDRESS", true, false, PropertyHelper.CreateRangeMetaString(TimeSpan.FromSeconds(1).TotalSeconds, TimeSpan.FromHours(2).TotalSeconds), TimeSpan.FromMinutes(5).TotalSeconds, 1, 1);

            var btcGuid = new Guid("14e2dfca-40a3-4e0b-b44b-e52ef1ca2e00");

            factory.CreateInterfaceType(btcGuid, "BLOCKCHAIN_TICKER.BTC.NAME", "BLOCKCHAIN_TICKER.BTC.DESCRIPTION", int.MaxValue, 1, true);

            factory.CreateNodeTemplate(new Guid("f728a20d-b805-4abd-9965-0e3c299a242c"), "BLOCKCHAIN_TICKER.BTC.NAME", "BLOCKCHAIN_TICKER.DESCRIPTION", "blockchain-btc", DriverGuid,
                                       btcGuid, true, true, true, false, true, NodeDataType.Date, 1, false);

            factory.CreateNodeTemplate(new Guid("c2131e7a-501e-4216-b854-cba3d693103b"), "BLOCKCHAIN_TICKER.BTC.USD.NAME", "BLOCKCHAIN_TICKER.BTC.USD.DESCRIPTION", "blockchain-btc-usd", btcGuid,
                                       GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, true, false, true, NodeDataType.Date, 1, false);
            factory.CreateNodeTemplate(new Guid("1305e068-17e7-416e-9610-62a91b96e026"), "BLOCKCHAIN_TICKER.BTC.USD_WITH_SYMBOL.NAME", "BLOCKCHAIN_TICKER.BTC.USD_WITH_SYMBOL.DESCRIPTION", "blockchain-btc-usd-with-symbol", btcGuid,
                                       GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, true, false, true, NodeDataType.Date, 1, false);


            factory.CreateNodeTemplate(new Guid("6b3975d0-631c-4537-9760-042a23aca312"), "BLOCKCHAIN_TICKER.BTC.EUR.NAME", "BLOCKCHAIN_TICKER.BTC.EUR.DESCRIPTION", "blockchain-btc-eur", btcGuid,
                                       GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, true, false, true, NodeDataType.Date, 1, false);

            factory.CreateNodeTemplate(new Guid("5d552cfd-a4b9-4883-98eb-108f5e4de235"), "BLOCKCHAIN_TICKER.BTC.EUR_WITH_SYMBOL.NAME", "BLOCKCHAIN_TICKER.BTC.EUR_WITH_SYMBOL.DESCRIPTION", "blockchain-btc-eur-with-symbol", btcGuid,
                                       GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, true, false, true, NodeDataType.Date, 1, false);
        }
コード例 #13
0
        public static NodeViewModel CreateNodeViewModel(INodeTemplateFactory templateFactory, FileSystemEntry entry,
                                                        NodeViewModel parent)
        {
            Invariants.Assert(entry != null);
            Invariants.Assert(parent != null);

            var directoryEntry = entry as DirectoryEntry;
            var node           = directoryEntry != null
        ? (NodeViewModel) new DirectoryNodeViewModel(parent)
        : (NodeViewModel) new FileNodeViewModel(parent);

            node.Caption = entry.Name;
            node.Name    = entry.Name;
            if (PathHelpers.IsAbsolutePath(node.Name))
            {
                node.Template = templateFactory.ProjectTemplate;
            }
            else if (directoryEntry != null)
            {
                node.Template = templateFactory.DirectoryTemplate;
            }
            else
            {
                var extension = Path.GetExtension(entry.Name);
                Invariants.Assert(extension != null);
                node.Template = templateFactory.GetFileTemplate(extension);
            }

            return(node);
        }
コード例 #14
0
        private void CreateInfoOnlyDigital(INodeTemplateFactory factory)
        {
            var infoOnlyDigital = new Guid("3358d7e0-592c-4489-be23-b7f5942c9d2b");

            factory.CreateInterfaceType(infoOnlyDigital, "LOXONE.MINISERVER.INFO_ONLY_DIGITAL.NAME", "LOXONE.MINISERVER.INFO_ONLY_DIGITAL.DESCRIPTION", 1, int.MaxValue, false);
            factory.CreateNodeTemplate(InfoOnlyDigitalNode, "LOXONE.MINISERVER.INFO_ONLY_DIGITAL.NAME", "LOXONE.MINISERVER.INFO_ONLY_DIGITAL.DESCRIPTION", "loxone-info-only-digital", FolderNodeInterface, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), false, true, true, false, true, NodeDataType.Double, int.MaxValue, false);
            CreateUuidProperty(factory, InfoOnlyDigitalNode);
        }
コード例 #15
0
        public override void InitNodeTemplates(INodeTemplateFactory factory)
        {
            factory.CreateInterfaceType(DriverGuid, "FRONIUS_SOLAR.NAME", "FRONIUS_SOLAR.DESCRIPTION", int.MaxValue, 1, true);
            factory.CreateNodeTemplate(DriverGuid, "FRONIUS_SOLAR.NAME", "FRONIUS_SOLAR.DESCRIPTION", "fronius_solar", GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Ethernet),
                                       DriverGuid, false, true, true, false, true, NodeDataType.NoAttribute, Int32.MaxValue, false);

            //TODO: Create your node structure here
        }
コード例 #16
0
        private void CreateInfoOnlyAnalog(INodeTemplateFactory factory)
        {
            var infoOnlyAnalog = new Guid("f72d524f-1fdc-4e0b-b1b6-ede9c500e61d");

            factory.CreateInterfaceType(infoOnlyAnalog, "LOXONE.MINISERVER.INFO_ONLY_ANALOG.NAME", "LOXONE.MINISERVER.INFO_ONLY_ANALOG.DESCRIPTION", 1, int.MaxValue, false);
            factory.CreateNodeTemplate(InfoOnlyAnlogNode, "LOXONE.MINISERVER.INFO_ONLY_ANALOG.NAME", "LOXONE.MINISERVER.INFO_ONLY_ANALOG.DESCRIPTION", "loxone-info-only-analog", FolderNodeInterface, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), false, true, true, false, true, NodeDataType.Double, int.MaxValue, false);
            CreateUuidProperty(factory, InfoOnlyAnlogNode);
        }
コード例 #17
0
ファイル: KnxFactory.cs プロジェクト: cuonghd4k/automatica
        private void InitDptType(int type, Guid node, INodeTemplateFactory factory)
        {
            AddAddressProperty(node, factory);

            factory.CreatePropertyTemplate(GenerateNewGuid(node, 2), "KNX.PROPERTIES.DPT.NAME",
                                           "KNX.PROPERTIES.DPT.DESCRIPTION", "knx-dpt", PropertyTemplateType.Integer, node,
                                           "KNX.GROUP.DPT", false, true, "", type, 0, 0);
        }
コード例 #18
0
ファイル: ZWaveFactory.cs プロジェクト: vsssunder/automatica
        public override void InitNodeTemplates(INodeTemplateFactory factory)
        {
            factory.CreateInterfaceType(DriverGuid, "ZWAVE.NAME", "ZWAVE.DESCRIPTION", int.MaxValue, 1, true);
            factory.CreateNodeTemplate(DriverGuid, "ZWAVE.NAME", "ZWAVE.DESCRIPTION", "zwave", GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Virtual),
                                       DriverGuid, false, true, true, false, true, NodeDataType.NoAttribute, Int32.MaxValue, false);

            //TODO: Create your node structure here
        }
コード例 #19
0
        private void CreateFolder(INodeTemplateFactory factory)
        {
            var folderInterface = FolderNodeInterface;

            factory.CreateInterfaceType(folderInterface, "LOXONE.MINISERVER.FOLDER.NAME", "LOXONE.MINISERVER.FOLDER.DESCRIPTION", int.MaxValue, int.MaxValue, false);
            var folderNode = FolderNode;

            factory.CreateNodeTemplate(folderNode, "LOXONE.MINISERVER.FOLDER.NAME", "LOXONE.MINISERVER.FOLDER.DESCRIPTION", "loxone-folder", DriverGuid, FolderNodeInterface, false, true, true, false, true, NodeDataType.NoAttribute, int.MaxValue, false, false);
        }
コード例 #20
0
        private void CreateConnectionState(INodeTemplateFactory factory)
        {
            var connected = new Guid("d101bcce-be51-4aad-bf1f-11d756674b53");

            factory.CreateInterfaceType(connected, "LOXONE.MINISERVER.CONNECTED.NAME", "LOXONE.MINISERVER.CONNECTED.DESCRIPTION", 1, int.MaxValue, false);
            var connectedNode = new Guid("3887cc34-6103-4dc7-aaec-ba30e6e42710");

            factory.CreateNodeTemplate(connectedNode, "LOXONE.MINISERVER.CONNECTED.NAME", "LOXONE.MINISERVER.CONNECTED.DESCRIPTION", "loxone-connected", DriverGuid, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), true, true, true, false, true, NodeDataType.Boolean, 1, false, false);
        }
コード例 #21
0
        private void CreatePushButton(INodeTemplateFactory factory)
        {
            var pushButton = new Guid("ceae14b6-3574-4df9-9d92-f557912922dc");

            factory.CreateInterfaceType(pushButton, "LOXONE.MINISERVER.PUSH_BUTTON.NAME", "LOXONE.MINISERVER.PUSH_BUTTON.DESCRIPTION", 1, int.MaxValue, false);
            factory.CreateNodeTemplate(PushButtonNode, "LOXONE.MINISERVER.PUSH_BUTTON.NAME", "LOXONE.MINISERVER.PUSH_BUTTON.DESCRIPTION", "loxone-push-button", FolderNodeInterface, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), false, true, true, true, false, NodeDataType.Integer, int.MaxValue, false);
            factory.ChangeDefaultVisuTemplate(PushButtonNode, VisuMobileObjectTemplateTypes.ToggleButton);

            CreateUuidProperty(factory, PushButtonNode);
        }
コード例 #22
0
        private void CreateDimmer(INodeTemplateFactory factory)
        {
            var dimmer = new Guid("fd70966f-d53b-4d7d-a625-1b0113364eef");

            factory.CreateInterfaceType(dimmer, "LOXONE.MINISERVER.DIMMER.NAME", "LOXONE.MINISERVER.DIMMER.DESCRIPTION", 1, int.MaxValue, false);
            factory.CreateNodeTemplate(DimmerNode, "LOXONE.MINISERVER.DIMMER.NAME", "LOXONE.MINISERVER.DIMMER.DESCRIPTION", "loxone-dimmer", FolderNodeInterface, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), false, true, true, true, false, NodeDataType.Integer, int.MaxValue, false);
            factory.ChangeDefaultVisuTemplate(DimmerNode, VisuMobileObjectTemplateTypes.Slider);

            CreateUuidProperty(factory, DimmerNode);
        }
コード例 #23
0
 public IncrementalHierarchyBuilderAggregate(
   INodeTemplateFactory nodeTemplateFactory,
   VsHierarchyAggregate hierarchy,
   FileSystemTree fileSystemTree,
   IImageSourceFactory imageSourceFactory) {
   _templateFactory = nodeTemplateFactory;
   _hierarchy = hierarchy;
   _fileSystemTree = fileSystemTree;
   _imageSourceFactory = imageSourceFactory;
 }
コード例 #24
0
        private void CreateSwitch(INodeTemplateFactory factory)
        {
            var switchGuid = new Guid("7a99a720-e031-4a76-b7ef-d734cf7e46a3");

            factory.CreateInterfaceType(switchGuid, "LOXONE.MINISERVER.SWITCH.NAME", "LOXONE.MINISERVER.SWITCH.DESCRIPTION", 1, int.MaxValue, false);
            factory.CreateNodeTemplate(SwitchNodeGuid, "LOXONE.MINISERVER.SWITCH.NAME", "LOXONE.MINISERVER.SWITCH.DESCRIPTION", "loxone-switch", FolderNodeInterface, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), false, true, true, true, false, NodeDataType.Boolean, int.MaxValue, false);
            factory.ChangeDefaultVisuTemplate(SwitchNodeGuid, VisuMobileObjectTemplateTypes.ToggleButton);

            CreateUuidProperty(factory, SwitchNodeGuid);
        }
コード例 #25
0
ファイル: KnxFactory.cs プロジェクト: cuonghd4k/automatica
        private void AddDpt11Nodes(INodeTemplateFactory factory, Guid parentNode)
        {
            var dpt11Guid = new Guid("cae0b84b-b5b7-4399-b8e1-26ad849dd3ac");

            factory.CreateNodeTemplate(dpt11Guid, "KNX.DPT11.NAME", "KNX.DPT11.DESCRIPTION", "knx-dpt11",
                                       parentNode, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), false, true, false, true, false,
                                       NodeDataType.Date, int.MaxValue, false);

            InitDptType((int)DptType.Dpt11, dpt11Guid, factory);
        }
コード例 #26
0
ファイル: KnxFactory.cs プロジェクト: cuonghd4k/automatica
        private void AddDpt10Nodes(INodeTemplateFactory factory, Guid parentNode)
        {
            var dpt10Guid = new Guid("d17b532e-a63a-431e-b125-a305ac3783d4");

            factory.CreateNodeTemplate(dpt10Guid, "KNX.DPT10.NAME", "KNX.DPT10.DESCRIPTION", "knx-dpt10",
                                       parentNode, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), false, true, false, true, false,
                                       NodeDataType.Time, int.MaxValue, false);

            InitDptType((int)DptType.Dpt10, dpt10Guid, factory);
        }
コード例 #27
0
 public IncrementalHierarchyBuilderAggregate(
     INodeTemplateFactory nodeTemplateFactory,
     VsHierarchyAggregate hierarchy,
     FileSystemTree fileSystemTree,
     IImageSourceFactory imageSourceFactory)
 {
     _templateFactory    = nodeTemplateFactory;
     _hierarchy          = hierarchy;
     _fileSystemTree     = fileSystemTree;
     _imageSourceFactory = imageSourceFactory;
 }
コード例 #28
0
ファイル: KnxFactory.cs プロジェクト: cuonghd4k/automatica
        private void AddAddressProperty(Guid nodeTemplate, INodeTemplateFactory factory, int maxAddress)
        {
            var newGuid = GenerateNewGuid(nodeTemplate, 1);

            factory.CreatePropertyTemplate(newGuid, "KNX.PROPERTIES.ADDRESS.NAME",
                                           "KNX.PROPERTIES.ADDRESS.DESCRIPTION", "knx-address", PropertyTemplateType.Range, nodeTemplate,
                                           "COMMON.CATEGORY.ADDRESS", true, false, PropertyHelper.CreateRangeMetaString(0, maxAddress), 0, 0, 0);

            factory.CreatePropertyConstraint(GenerateNewGuid(nodeTemplate, 3), "KNX.CONSTRAINT.UNIQUE_ADDRESS.NAME",
                                             "KNX.CONSTRAINT.UNIQUE_ADDRESS.NAME", PropertyConstraint.Unique, PropertyConstraintLevel.Warn, newGuid);
        }
コード例 #29
0
        public override void InitNodeTemplates(INodeTemplateFactory factory)
        {
            factory.CreateInterfaceType(InterfaceId, "MACHINE_FLAGS.NAME", "MACHINE_FLAGS.DESCRIPTION", int.MaxValue, 1, true);

            factory.CreateNodeTemplate(BusId, "MACHINE_FLAGS.NAME", "MACHINE_FLAGS.DESCRIPTION", "machine-flags", GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Virtual),
                                       InterfaceId, false, true, true, false, true, NodeDataType.NoAttribute, Int32.MaxValue, false);

            factory.CreateNodeTemplate(ValueId, "MACHINE_FLAGS.NODE.NAME", "MACHINE_FLAGS.NODE.DESCRIPTION", "machine-flag", InterfaceId,
                                       GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), false, true, false, true, false, NodeDataType.Double, Int32.MaxValue, false);
            factory.ChangeDefaultVisuTemplate(ValueId, VisuMobileObjectTemplateTypes.NumberBox);
        }
コード例 #30
0
 public IncrementalHierarchyBuilder(
     INodeTemplateFactory nodeTemplateFactory,
     VsHierarchy hierarchy,
     FileSystemTree fileSystemTree,
     IImageSourceFactory imageSourceFactory)
 {
     _templateFactory    = nodeTemplateFactory;
     _hierarchy          = hierarchy;
     _oldNodes           = hierarchy.Nodes;
     _fileSystemTree     = fileSystemTree;
     _imageSourceFactory = imageSourceFactory;
 }
コード例 #31
0
ファイル: KnxFactory.cs プロジェクト: cuonghd4k/automatica
        private void AddDpt1Nodes(INodeTemplateFactory factory, Guid parentNode)
        {
            var dpt1Guid = new Guid("e2fcfcb9-b08b-4597-9ce1-6d604fdbb510");

            factory.CreateNodeTemplate(dpt1Guid, "KNX.DPT1.NAME", "KNX.DPT1.DESCRIPTION", "knx-dpt1",
                                       parentNode, GuidTemplateTypeAttribute.GetFromEnum(InterfaceTypeEnum.Value), false, true, false, true, false,
                                       NodeDataType.Boolean, int.MaxValue, false);

            factory.ChangeDefaultVisuTemplate(dpt1Guid, VisuMobileObjectTemplateTypes.ToggleButton);

            InitDptType((int)DptType.Dpt1, dpt1Guid, factory);
        }