예제 #1
0
        public static Model BuildCANCommunicationDemo()
        {
            Model model = new Model("CANCommunicationDemo");

            Node TEST_HS07 = new Nodes.SensactHs07("TEST_HS07")
            {
                Applications = new List <SensactApplication>()
                {
                    new StandbyControllerApplication
                    {
                        ApplicationId   = "STDBY_XX_XXX_1",
                        OutputRessource = 1,
                        WaittimeInMsec  = 10000
                    },
                    new PWMApplication
                    {
                        ApplicationId            = "PWM___XX_XXX_1",
                        InitialStoredTargetLevel = 255,
                        LowMeansLampOn           = false,
                        MinimalOnLevel           = 20,
                        OutputRessources         = new List <ushort>()
                        {
                            2
                        },
                        StandbyController = "STDBY_XX_XXX_1"
                    },
                }
            };
            //TEST_HS07.Applications.AddBlindButtons("_XX_BLN_", InputPin.I01, InputPin.I02, "XX_XXX_1");
            //TEST_HS07.Applications.AddOnePushbuttonDimmer("_XX_PUB_1", InputPin.I03, "PWM___XX_XXX_1");

            Node TEST_UP02 = new Nodes.SensactUp02("TEST_UP02")
            {
                Applications = new List <SensactApplication>
                {
                    new RotaryEncoderApplication
                    {
                        ApplicationId        = "ROTAR_YY_YYY_1",
                        InputRotaryRessource = RotaryEncoder.ROTARYENCODER_1,
                        InputPushRessource   = 16 + 15,
                        CommandsOnPressed    = new List <Command>
                        {
                            new Command
                            {
                                TargetAppId = "PWM___XX_XXX_1",
                                CommandType = CommandType.TOGGLE,
                            }
                        },
                        CommandsOnTurned = new List <Command>
                        {
                            new Command
                            {
                                TargetAppId = "PWM___XX_XXX_1",
                                CommandType = CommandType.STEP_VERTICAL,
                            }
                        }
                    },
                },
            };

            model.Nodes = new List <Node>()
            {
                TEST_HS07,
                TEST_UP02
            };
            return(model);
        }
예제 #2
0
        public static Model BuildModelToTestAllAllI2CPinsAndCAN()
        {
            //Testet 4 Ausgangsbaugruppen und 4 Eingangsbaugruppen, also 64 Taster und 64 PWM-Outputs
            //Die ersten beiden Taster sind Dimm-Taster (Up/Down) für LED0, Standby ist LED1. Diese beiden LED können auch per CAN eingestellt werden
            //Die verbleibenden Taster schalten die

            Model model = new Model("TestAllAllI2CPinsAndCAN");

            Node TEST_HS08 = new Nodes.SensactHs07("TEST_HS08");

            TEST_HS08.Applications.Add(new PWMApplication
            {
                ApplicationId            = "PWM___XX_XXX_00",
                InitialStoredTargetLevel = 255,
                LowMeansLampOn           = false,
                MinimalOnLevel           = 20,
                OutputRessources         = new List <ushort>()
                {
                    BUS0 + I2C + 0
                },
                StandbyController = "STDBY_XX_XXX_00"
            });
            TEST_HS08.Applications.Add(new StandbyControllerApplication
            {
                ApplicationId   = "STDBY_XX_XXX_00",
                OutputRessource = BUS0 + I2C + 1,
                WaittimeInMsec  = 10000
            });

            //UP-Button
            TEST_HS08.Applications.Add(new PushButtonXApplication
            {
                ApplicationId           = "PUSHB_XX_XXX_00",
                InputRessource          = BUS0 + I2C + 0,
                CommandsOnReleasedShort = new List <Command>()
                {
                    new Command()
                    {
                        CommandType = CommandType.TOGGLE,
                        TargetAppId = "PWM___XX_XXX_00",
                    },
                },

                CommandsOnReleasedLong = new List <Command>()
                {
                    new Command()
                    {
                        CommandType = CommandType.STOP,
                        TargetAppId = "PWM___XX_XXX_00",
                    },
                },
                CommandsOnPressedShortAndHold = new List <Command>()
                {
                    new Command()
                    {
                        CommandType = CommandType.UP,
                        TargetAppId = "PWM___XX_XXX_00",
                    },
                },
            });
            TEST_HS08.Applications.Add(new PushButtonXApplication
            {
                ApplicationId           = "PUSHB_XX_XXX_01",
                InputRessource          = BUS0 + I2C + 1,
                CommandsOnReleasedShort = new List <Command>()
                {
                    new Command()
                    {
                        CommandType = CommandType.TOGGLE,
                        TargetAppId = "PWM___XX_XXX_00",
                    },
                },

                CommandsOnReleasedLong = new List <Command>()
                {
                    new Command()
                    {
                        CommandType = CommandType.STOP,
                        TargetAppId = "PWM___XX_XXX_00",
                    },
                },
                CommandsOnPressedShortAndHold = new List <Command>()
                {
                    new Command()
                    {
                        CommandType = CommandType.DOWN,
                        TargetAppId = "PWM___XX_XXX_00",
                    },
                },
            });

            for (ushort i = 2; i < 64; i++)
            {
                TEST_HS08.Applications.Add(new PoweritemApplication
                {
                    ApplicationId   = string.Format("POWIT_XX_XXX_{0:00}", i),
                    OutputRessource = (ushort)(BUS0 + I2C + i)
                });
                TEST_HS08.Applications.Add(new PushButtonXApplication
                {
                    ApplicationId     = string.Format("PUSHB_XX_XXX_{0:00}", i),
                    InputRessource    = (ushort)(BUS0 + I2C + i),
                    CommandsOnPressed = new List <Command>()
                    {
                        new Command()
                        {
                            CommandType = CommandType.TOGGLE,
                            TargetAppId = string.Format("POWIT_XX_XXX_{0:00}", i),
                        },
                    }
                });
            }



            Node TEST_UP = new Nodes.SensactUp02("TEST_UP02")
            {
                Applications = new List <SensactApplication>
                {
                    new RotaryEncoderApplication
                    {
                        ApplicationId        = "ROTAR_YY_YYY_1",
                        InputRotaryRessource = RotaryEncoder.ROTARYENCODER_1,
                        InputPushRessource   = 16 + 15,
                        CommandsOnPressed    = new List <Command>
                        {
                            new Command
                            {
                                TargetAppId = "PWM___XX_XXX_00",
                                CommandType = CommandType.TOGGLE,
                            }
                        },
                        CommandsOnTurned = new List <Command>
                        {
                            new Command
                            {
                                TargetAppId = "PWM___XX_XXX_00",
                                CommandType = CommandType.STEP_VERTICAL,
                            }
                        }
                    },
                },
            };

            model.Nodes = new List <Node>()
            {
                TEST_HS08,
                TEST_UP
            };
            return(model);
        }
예제 #3
0
        public static Model BuildRGBWDemo()
        {
            Model model = new Model("RGBWDemo");

            Node TEST_HS07 = new Nodes.SensactHs07("TEST_HS07")
            {
                Applications = new List <SensactApplication>()
                {
                    new PushButtonXApplication
                    {
                        ApplicationId     = "PUSHB_XX_XXX_1",
                        InputRessource    = 1,
                        CommandsOnPressed = new List <Command>
                        {
                            new Command
                            {
                                CommandType = CommandType.TOGGLE,
                                TargetAppId = "RGBW__XX_XXX_1",
                            }
                        }
                    },
                    new PushButtonXApplication
                    {
                        ApplicationId     = "PUSHB_XX_XXX_2",
                        InputRessource    = 2,
                        CommandsOnPressed = new List <Command>
                        {
                            new Command
                            {
                                CommandType = CommandType.STEP_VERTICAL,
                                TargetAppId = "RGBW__XX_XXX_1",
                            }
                        }
                    },
                    new RgbwApplication
                    {
                        ApplicationId     = "RGBW__XX_XXX_1",
                        OutputRessourceR  = 1,
                        OutputRessourceG  = 2,
                        OutputRessourceB  = 3,
                        OutputRessourceW  = 4,
                        StandbyController = _(ID.NO_APPLICATION),
                        LowMeansLampOn    = false,
                    },
                }
            };



            Node TEST_UP02 = new Nodes.SensactUp02("TEST_UP02")
            {
                Applications = new List <SensactApplication>
                {
                    new RotaryEncoderApplication
                    {
                        ApplicationId        = "ROTAR_YY_YYY_1",
                        InputRotaryRessource = RotaryEncoder.ROTARYENCODER_1,
                        InputPushRessource   = 0,
                        CommandsOnPressed    = new List <Command>
                        {
                            new Command
                            {
                                TargetAppId = "RGBW__YY_YYY_1",
                                CommandType = CommandType.TOGGLE,
                            }
                        },
                        CommandsOnTurned = new List <Command>
                        {
                            new Command
                            {
                                TargetAppId = "RGBW__YY_YYY_1",
                                CommandType = CommandType.STEP_VERTICAL,
                            }
                        }
                    },
                    new RgbwApplication
                    {
                        ApplicationId     = "RGBW__YY_YYY_1",
                        OutputRessourceR  = 1,
                        OutputRessourceG  = 3,
                        OutputRessourceB  = 5,
                        OutputRessourceW  = 7,
                        StandbyController = _(ID.NO_APPLICATION),
                        LowMeansLampOn    = true,
                    },
                },
            };

            model.Nodes = new List <Node>()
            {
                TEST_HS07,
                TEST_UP02
            };
            return(model);
        }