Esempio n. 1
0
        public HalloweenScene1(IEnumerable<string> args)
        {
            hours = new OperatingHours("Hours");
            georgeStrobeLight = new StrobeDimmer("George Strobe");
            spiderLight = new StrobeColorDimmer("Spider Light");
            skullsLight = new Dimmer("Skulls");
            cobWebLight = new Dimmer("Cob Web");
            blinkyEyesLight = new Switch("Blinky Eyes");
            rgbLightRight = new StrobeColorDimmer("Light Right");
            georgeLight = new StrobeColorDimmer("George Light");
            leftSkeletonLight = new StrobeColorDimmer("Skeleton Light");
            georgeMotor = new MotorWithFeedback("George Motor");
            candyLight = new StrobeColorDimmer("Candy Light");
            spiderLift = new Switch("Slider Lift");
            smokeMachine = new Switch("Smoke Machine");
            spiderEyes = new Switch("Spider Eyes");
            pressureMat = new DigitalInput("Pressure Mat");
            testButton = new DigitalInput("Test");

            pulsatingEffect1 = new Effect.Pulsating("Pulse FX 1", S(2), 0.1, 0.4);
            pulsatingEffect2 = new Effect.Pulsating("Pulse FX 2", S(2), 0.3, 0.5);
            candyPulse = new Effect.Pulsating("Candy Pulse", S(3), 0.01, 0.1);
            flickerEffect = new Effect.Flicker("Flicker", 0.4, 0.6);

            audioPlayer = new Physical.NetworkAudioPlayer(
                Properties.Settings.Default.NetworkAudioPlayerIP,
                Properties.Settings.Default.NetworkAudioPlayerPort);
        }
Esempio n. 2
0
        public Animatroller.Framework.PhysicalDevice.MotorWithFeedback AddMotor(MotorWithFeedback logicalDevice)
        {
            var moduleControl = new Control.ModuleControl();

            moduleControl.Text = logicalDevice.Name;
            moduleControl.Size = new System.Drawing.Size(160, 80);

            var control = new Control.Motor();

            moduleControl.ChildControl = control;

            flowLayoutPanelLights.Controls.Add(moduleControl);

            var device = new Animatroller.Framework.PhysicalDevice.MotorWithFeedback((target, speed, timeout) =>
            {
                control.Target  = target;
                control.Speed   = speed;
                control.Timeout = timeout;
            });

            control.Trigger = device.Trigger;

            device.Connect(logicalDevice);

            return(device);
        }
Esempio n. 3
0
 public TestScene1(IEnumerable <string> args)
 {
     georgeStrobeLight = new StrobeDimmer("George Strobe");
     spiderLight       = new StrobeColorDimmer("Spider Light");
     skullsLight       = new Dimmer("Skulls");
     cobWebLight       = new Dimmer("Cob Web");
     blinkyEyesLight   = new Switch("Blinky Eyes");
     rgbLightRight     = new StrobeColorDimmer("Light Right");
     rgbLight3         = new StrobeColorDimmer("Light 3");
     rgbLight4         = new StrobeColorDimmer("Light 4");
     georgeMotor       = new MotorWithFeedback("George Motor");
     spiderLift        = new Switch("Spider Lift");
     pressureMat       = new DigitalInput("Pressure Mat");
     pulsatingEffect   = new Effect.Pulsating(S(1), 0.2, 0.7);
     flickerEffect     = new Effect.Flicker(0.4, 0.6);
 }
Esempio n. 4
0
 public TestScene1(IEnumerable<string> args)
 {
     georgeStrobeLight = new StrobeDimmer("George Strobe");
     spiderLight = new StrobeColorDimmer("Spider Light");
     skullsLight = new Dimmer("Skulls");
     cobWebLight = new Dimmer("Cob Web");
     blinkyEyesLight = new Switch("Blinky Eyes");
     rgbLightRight = new StrobeColorDimmer("Light Right");
     rgbLight3 = new StrobeColorDimmer("Light 3");
     rgbLight4 = new StrobeColorDimmer("Light 4");
     georgeMotor = new MotorWithFeedback("George Motor");
     spiderLift = new Switch("Spider Lift");
     pressureMat = new DigitalInput("Pressure Mat");
     pulsatingEffect = new Effect.Pulsating(S(1), 0.2, 0.7);
     flickerEffect = new Effect.Flicker(0.4, 0.6);
 }
Esempio n. 5
0
 public MotorVectorChangedEventArgs(MotorWithFeedback.MotorVector vector)
 {
     this.Vector = vector;
 }
Esempio n. 6
0
        public HalloweenScene2013B(IEnumerable<string> args)
        {
            this.lastFogRun = DateTime.Now;
            stateMachine = new Controller.EnumStateMachine<States>("Main");

            pulsatingEffect1 = new Effect.Pulsating("Pulse FX 1", S(2), 0.1, 0.5, false);
            pulsatingEffect2 = new Effect.Pulsating("Pulse FX 2", S(2), 0.2, 0.8, false);
            flickerEffect = new Effect.Flicker("Flicker", 0.4, 0.6, false);
            flickerEffect2 = new Effect.Flicker("Flicker 2", 0.4, 0.6, false);
            popOutEffect = new Effect.PopOut("PopOut", S(1));

            hoursSmall = new OperatingHours("Hours Small");
            hoursFull = new OperatingHours("Hours Full");
            buttonMotionCat = new DigitalInput("Walkway Motion");
            buttonMotionBeauty = new DigitalInput("Beauty Motion");
            buttonTriggerStairs = new DigitalInput("Stairs Trigger 1");
            buttonTriggerPopup = new DigitalInput("Popup Trigger");
            buttonTestA = new DigitalInput("Test A");
            buttonTestB = new DigitalInput("Test B");
            buttonTestC = new DigitalInput("Test C");
            buttonTestSpider = new DigitalInput("Spider");

            switchDeadendDrive = new Switch("Deadend dr");
            catLights = new Switch("Cat lights");
            catFan = new Switch("Cat");

            georgeMotor = new MotorWithFeedback("George Motor");
            lightPopup = new StrobeDimmer("Popup light");
            lightGeorge = new StrobeColorDimmer("George light");
            lightBeauty = new StrobeColorDimmer("Beauty light");
            lightFloor = new StrobeColorDimmer("Floor light");
            lightSign = new StrobeColorDimmer("Sign");
            skullsLight = new Dimmer("Skulls");
            lightTreeGhost = new Dimmer("Ghosts in tree");
            skullsLight2 = new Dimmer("Skulls 2");
            lightSpiderWeb = new Dimmer("Spiderweb");
            lightEyes = new Switch("Eyes");

            audioCat = new AudioPlayer("Audio Cat");
            audioGeorge = new AudioPlayer("Audio George");
            audioBeauty = new AudioPlayer("Audio Beauty");
            audioSpider = new AudioPlayer("Audio Spider");

            switchHand = new Switch("Hand");
            switchHead = new Switch("Head");
            switchDrawer1 = new Switch("Drawer 1");
            switchDrawer2 = new Switch("Drawer 2");
            switchPopEyes = new Switch("Pop Eyes");
            switchPopUp = new Switch("Pop Up");
            switchSpider = new Switch("Spider");
            switchSpiderEyes1 = new Switch("Spider Eyes 1");
            switchSpiderEyes2 = new Switch("Spider Eyes 2");
            switchFog = new Switch("Fog");

            allPixels = new VirtualPixel1D("All Pixels", 28 + 50);
        }
        public HalloweenScene2013B(IEnumerable <string> args)
        {
            this.lastFogRun = DateTime.Now;
            stateMachine    = new Controller.EnumStateMachine <States>("Main");

            pulsatingEffect1 = new Effect.Pulsating(S(2), 0.1, 0.5, false);
            pulsatingEffect2 = new Effect.Pulsating(S(2), 0.2, 0.8, false);
            flickerEffect    = new Effect.Flicker(0.4, 0.6, false);
            flickerEffect2   = new Effect.Flicker(0.4, 0.6, false);
            popOutEffect     = new Effect.PopOut(S(1));

            hoursSmall          = new OperatingHours("Hours Small");
            hoursFull           = new OperatingHours("Hours Full");
            buttonMotionCat     = new DigitalInput("Walkway Motion");
            buttonMotionBeauty  = new DigitalInput("Beauty Motion");
            buttonTriggerStairs = new DigitalInput("Stairs Trigger 1");
            buttonTriggerPopup  = new DigitalInput("Popup Trigger");
            buttonTestA         = new DigitalInput("Test A");
            buttonTestB         = new DigitalInput("Test B");
            buttonTestC         = new DigitalInput("Test C");
            buttonTestSpider    = new DigitalInput("Spider");

            switchDeadendDrive = new Switch("Deadend dr");
            catLights          = new Switch("Cat lights");
            catFan             = new Switch("Cat");

            georgeMotor    = new MotorWithFeedback("George Motor");
            lightPopup     = new StrobeDimmer("Popup light");
            lightGeorge    = new StrobeColorDimmer("George light");
            lightBeauty    = new StrobeColorDimmer("Beauty light");
            lightFloor     = new StrobeColorDimmer("Floor light");
            lightSign      = new StrobeColorDimmer("Sign");
            skullsLight    = new Dimmer("Skulls");
            lightTreeGhost = new Dimmer("Ghosts in tree");
            skullsLight2   = new Dimmer("Skulls 2");
            lightSpiderWeb = new Dimmer("Spiderweb");
            lightEyes      = new Switch("Eyes");

            audioCat    = new AudioPlayer("Audio Cat");
            audioGeorge = new AudioPlayer("Audio George");
            audioBeauty = new AudioPlayer("Audio Beauty");
            audioSpider = new AudioPlayer("Audio Spider");

            switchHand        = new Switch("Hand");
            switchHead        = new Switch("Head");
            switchDrawer1     = new Switch("Drawer 1");
            switchDrawer2     = new Switch("Drawer 2");
            switchPopEyes     = new Switch("Pop Eyes");
            switchPopUp       = new Switch("Pop Up");
            switchSpider      = new Switch("Spider");
            switchSpiderEyes1 = new Switch("Spider Eyes 1");
            switchSpiderEyes2 = new Switch("Spider Eyes 2");
            switchFog         = new Switch("Fog");

            allPixels = new VirtualPixel1D(28 + 50);

            // Cat
            raspberry1.DigitalInputs[0].Connect(buttonMotionCat);
            raspberry1.DigitalInputs[4].Connect(buttonTriggerStairs, true);
            raspberry1.DigitalOutputs[0].Connect(switchDeadendDrive);
            raspberry1.DigitalOutputs[1].Connect(switchFog);
            raspberry1.Motor.Connect(georgeMotor);

            raspberry1.Connect(audioCat);

            // Beauty
            raspberry2.Connect(audioBeauty);
            raspberry2.DigitalOutputs[7].Connect(switchHand);
            raspberry2.DigitalOutputs[2].Connect(switchHead);
            raspberry2.DigitalOutputs[5].Connect(switchDrawer1);
            raspberry2.DigitalOutputs[6].Connect(switchDrawer2);
            raspberry2.DigitalOutputs[3].Connect(switchPopEyes);
            raspberry2.DigitalOutputs[4].Connect(switchPopUp);

            raspberry2.DigitalInputs[5].Connect(buttonMotionBeauty, true);
            raspberry2.DigitalInputs[6].Connect(buttonTriggerPopup, true);

            // Background/George
            raspberry3.Connect(audioGeorge);

            // Spider
            raspberry4.Connect(audioSpider);

            raspberry4.DigitalOutputs[0].Connect(switchSpider);
            raspberry4.DigitalOutputs[2].Connect(switchSpiderEyes1);
            raspberry4.DigitalOutputs[3].Connect(switchSpiderEyes2);
        }
Esempio n. 8
0
        public HalloweenScene2013B(IEnumerable<string> args)
        {
            this.lastFogRun = DateTime.Now;
            stateMachine = new Controller.EnumStateMachine<States>("Main");

            pulsatingEffect1 = new Effect.Pulsating(S(2), 0.1, 0.5, false);
            pulsatingEffect2 = new Effect.Pulsating(S(2), 0.2, 0.8, false);
            flickerEffect = new Effect.Flicker(0.4, 0.6, false);
            flickerEffect2 = new Effect.Flicker(0.4, 0.6, false);
            popOutEffect = new Effect.PopOut(S(1));

            hoursSmall = new OperatingHours("Hours Small");
            hoursFull = new OperatingHours("Hours Full");
            buttonMotionCat = new DigitalInput("Walkway Motion");
            buttonMotionBeauty = new DigitalInput("Beauty Motion");
            buttonTriggerStairs = new DigitalInput("Stairs Trigger 1");
            buttonTriggerPopup = new DigitalInput("Popup Trigger");
            buttonTestA = new DigitalInput("Test A");
            buttonTestB = new DigitalInput("Test B");
            buttonTestC = new DigitalInput("Test C");
            buttonTestSpider = new DigitalInput("Spider");

            switchDeadendDrive = new Switch("Deadend dr");
            catLights = new Switch("Cat lights");
            catFan = new Switch("Cat");

            georgeMotor = new MotorWithFeedback("George Motor");
            lightPopup = new StrobeDimmer("Popup light");
            lightGeorge = new StrobeColorDimmer("George light");
            lightBeauty = new StrobeColorDimmer("Beauty light");
            lightFloor = new StrobeColorDimmer("Floor light");
            lightSign = new StrobeColorDimmer("Sign");
            skullsLight = new Dimmer("Skulls");
            lightTreeGhost = new Dimmer("Ghosts in tree");
            skullsLight2 = new Dimmer("Skulls 2");
            lightSpiderWeb = new Dimmer("Spiderweb");
            lightEyes = new Switch("Eyes");

            audioCat = new AudioPlayer("Audio Cat");
            audioGeorge = new AudioPlayer("Audio George");
            audioBeauty = new AudioPlayer("Audio Beauty");
            audioSpider = new AudioPlayer("Audio Spider");

            switchHand = new Switch("Hand");
            switchHead = new Switch("Head");
            switchDrawer1 = new Switch("Drawer 1");
            switchDrawer2 = new Switch("Drawer 2");
            switchPopEyes = new Switch("Pop Eyes");
            switchPopUp = new Switch("Pop Up");
            switchSpider = new Switch("Spider");
            switchSpiderEyes1 = new Switch("Spider Eyes 1");
            switchSpiderEyes2 = new Switch("Spider Eyes 2");
            switchFog = new Switch("Fog");

            allPixels = new VirtualPixel1D(28 + 50);

            // Cat
            raspberry1.DigitalInputs[0].Connect(buttonMotionCat);
            raspberry1.DigitalInputs[4].Connect(buttonTriggerStairs, true);
            raspberry1.DigitalOutputs[0].Connect(switchDeadendDrive);
            raspberry1.DigitalOutputs[1].Connect(switchFog);
            raspberry1.Motor.Connect(georgeMotor);

            raspberry1.Connect(audioCat);

            // Beauty
            raspberry2.Connect(audioBeauty);
            raspberry2.DigitalOutputs[7].Connect(switchHand);
            raspberry2.DigitalOutputs[2].Connect(switchHead);
            raspberry2.DigitalOutputs[5].Connect(switchDrawer1);
            raspberry2.DigitalOutputs[6].Connect(switchDrawer2);
            raspberry2.DigitalOutputs[3].Connect(switchPopEyes);
            raspberry2.DigitalOutputs[4].Connect(switchPopUp);

            raspberry2.DigitalInputs[5].Connect(buttonMotionBeauty, true);
            raspberry2.DigitalInputs[6].Connect(buttonTriggerPopup, true);

            // Background/George
            raspberry3.Connect(audioGeorge);

            // Spider
            raspberry4.Connect(audioSpider);

            raspberry4.DigitalOutputs[0].Connect(switchSpider);
            raspberry4.DigitalOutputs[2].Connect(switchSpiderEyes1);
            raspberry4.DigitalOutputs[3].Connect(switchSpiderEyes2);
        }
        public HalloweenScene1(IEnumerable <string> args, System.Collections.Specialized.NameValueCollection settings)
        {
            hours             = new OperatingHours("Hours");
            georgeStrobeLight = new StrobeDimmer("George Strobe");
            spiderLight       = new StrobeColorDimmer("Spider Light");
            skullsLight       = new Dimmer("Skulls");
            cobWebLight       = new Dimmer("Cob Web");
            blinkyEyesLight   = new Switch("Blinky Eyes");
            rgbLightRight     = new StrobeColorDimmer("Light Right");
            georgeLight       = new StrobeColorDimmer("George Light");
            leftSkeletonLight = new StrobeColorDimmer("Skeleton Light");
            georgeMotor       = new MotorWithFeedback("George Motor");
            candyLight        = new StrobeColorDimmer("Candy Light");
            spiderLift        = new Switch("Slider Lift");
            smokeMachine      = new Switch("Smoke Machine");
            spiderEyes        = new Switch("Spider Eyes");
            pressureMat       = new DigitalInput("Pressure Mat");
            testButton        = new DigitalInput("Test");

            pulsatingEffect1 = new Effect.Pulsating(S(2), 0.1, 0.4);
            pulsatingEffect2 = new Effect.Pulsating(S(2), 0.3, 0.5);
            candyPulse       = new Effect.Pulsating(S(3), 0.01, 0.1);
            flickerEffect    = new Effect.Flicker(0.4, 0.6);

            audioPlayer = new Physical.NetworkAudioPlayer(
                settings["NetworkAudioPlayerIP"],
                int.Parse(settings["NetworkAudioPlayerPort"]));

            hours.AddRange("6:00 pm", "10:00 pm");

            var testSequence = new Controller.Sequence("Test Sequence");

            testSequence
            .WhenExecuted
            .Execute(instance =>
            {
                candyPulse.Start();
                audioPlayer.PlayEffect("Laugh");
                georgeMotor.SetVector(1.0, 160, S(5));
                georgeStrobeLight.SetStrobe(0.55, 1.0);
                georgeLight.SetStrobe(0.78, Color.Brown);

                georgeMotor.WaitForVectorReached();
                instance.WaitFor(S(2));
                georgeStrobeLight.TurnOff();
                georgeLight.TurnOff();

                georgeMotor.SetVector(0.9, 0, S(6));
                georgeMotor.WaitForVectorReached();
                candyPulse.Stop();
            });

            var testSequence2 = new Controller.Sequence("Test Sequence 2");

            testSequence2.WhenExecuted
            .Execute(instance =>
            {
                audioPlayer.PlayEffect("348 Spider Hiss");
                spiderLight.SetStrobe(0.78, Color.Red);

                spiderLift.SetPower(true);

                instance.WaitFor(S(3));

                // Spider up
                audioPlayer.PlayEffect("Scream");
                spiderLift.SetPower(false);

                instance.WaitFor(S(2));
                spiderLight.TurnOff();
            });

            var testSequence3 = new Controller.Sequence("Test Sequence 3");

            testSequence3.WhenExecuted
            .Execute(instance =>
            {
                spiderEyes.SetPower(true);
                instance.WaitFor(S(10));
                spiderEyes.SetPower(false);
            });

            var mainSequence = new Controller.Sequence("Main Sequence");

            mainSequence.WhenExecuted
            .Execute(instance =>
            {
                pulsatingEffect1.Stop();
                pulsatingEffect2.Stop();
                flickerEffect.Stop();
                blinkyEyesLight.SetPower(false);
                candyLight.SetColor(Color.Red);

                audioPlayer.PauseBackground();
                audioPlayer.PlayEffect("Door-creak");
                instance.WaitFor(S(2));


                instance.WaitFor(S(2));
                candyPulse.Stop();
                candyLight.SetStrobe(1, Color.White);
                instance.WaitFor(S(0.5));
                candyLight.TurnOff();
                instance.WaitFor(S(1));

                audioPlayer.PlayEffect("348 Spider Hiss");
                instance.WaitFor(S(0.5));
                spiderLight.SetStrobe(0.78, Color.Red);

                spiderLift.SetPower(true);
                spiderEyes.SetPower(true);

                instance.WaitFor(S(1));
                audioPlayer.PlayEffect("348 Spider Hiss");
                instance.WaitFor(S(2));

                // Spider up
                audioPlayer.PlayEffect("Scream");
                spiderLift.SetPower(false);
                spiderEyes.SetPower(false);
                smokeMachine.SetPower(true);

                instance.WaitFor(S(2));
                spiderLight.TurnOff();
                audioPlayer.PlayEffect("Violin screech");
                instance.WaitFor(S(2));


                // Skeleton to the right
                //                    audioPlayer.PlayEffect("Ghostly");
                rgbLightRight.SetStrobe(0.78, Color.Violet);
                instance.WaitFor(MS(1000));
                rgbLightRight.SetColor(Color.Red);
                instance.WaitFor(MS(1000));
                rgbLightRight.SetColor(Color.Blue);
                instance.WaitFor(S(2));
                rgbLightRight.TurnOff();
                instance.WaitFor(S(1));


                // Skeleton to the left
                audioPlayer.PlayEffect("death-scream");
                instance.WaitFor(S(0.5));
                leftSkeletonLight.SetStrobe(0.78, Color.Pink);
                instance.WaitFor(S(3));
                smokeMachine.SetPower(false);
                instance.WaitFor(S(1));
                leftSkeletonLight.TurnOff();


                // George
                audioPlayer.PlayEffect("Laugh");
                instance.WaitFor(MS(800));
                georgeMotor.SetVector(1.0, 160, S(5));
                georgeStrobeLight.SetStrobe(0.55, 1.0);
                georgeLight.SetStrobe(0.78, Color.Brown);

                georgeMotor.WaitForVectorReached();
                instance.WaitFor(S(2));
                georgeStrobeLight.TurnOff();
                georgeLight.TurnOff();

                candyPulse.MinBrightness = 0.05;
                candyPulse.MaxBrightness = 1.0;
                candyLight.SetColor(Color.Violet);
                candyPulse.Start();
                georgeMotor.SetVector(0.9, 0, S(6));
                georgeMotor.WaitForVectorReached();


                blinkyEyesLight.SetPower(true);

                flickerEffect.Start();
                pulsatingEffect1.Start();

                instance.WaitFor(S(5));
                smokeMachine.SetPower(true);

                audioPlayer.PlayBackground();
                // Wait for reset
                instance.WaitFor(S(15));
                pulsatingEffect2.Start();
                candyPulse.MinBrightness = 0.01;
                candyPulse.MaxBrightness = 0.1;
                candyLight.SetColor(Color.Green);
                smokeMachine.SetPower(false);
            });

            pressureMat.ActiveChanged += (sender, e) =>
            {
                if (e.NewState)
                {
                    if (hours.IsOpen)
                    {
                        Executor.Current.Execute(mainSequence);
                    }
                    else
                    {
                        audioPlayer.PlayEffect("Laugh");
                    }
                }
            };

            testButton.ActiveChanged += (sender, e) =>
            {
                if (e.NewState)
                {
                    Executor.Current.Execute(mainSequence);
                }
            };

            hours.OpenHoursChanged += (sender, e) =>
            {
                if (e.IsOpenNow)
                {
                    pulsatingEffect1.Start();
                    pulsatingEffect2.Start();
                    flickerEffect.Start();
                    candyPulse.Start();
                    blinkyEyesLight.SetPower(true);
                    audioPlayer.PlayBackground();
                }
                else
                {
                    pulsatingEffect1.Stop();
                    pulsatingEffect2.Stop();
                    flickerEffect.Stop();
                    candyPulse.Stop();
                    blinkyEyesLight.SetPower(false);
                    audioPlayer.PauseBackground();
                }
            };

            // Have it turned off, but prepare it with blue color for the effect
            rgbLightRight.SetColor(Color.Blue, 0);
            candyLight.SetColor(Color.Green, 0);
            pulsatingEffect1.AddDevice(rgbLightRight);
            pulsatingEffect2.AddDevice(cobWebLight);
            candyPulse.AddDevice(candyLight);

            flickerEffect.AddDevice(skullsLight);
        }