public static void Update(float dt)
        {
            AnimationFrame currentFrame = null;
            AnimationFrame resultFrame = null;
            AnimationFrame nextFrame = null;

            switch (m_State)
            {
                case State.Animating:
                    // animating so we only need to worry about the current ani
                    m_CurrentAnimation.Update(dt);
                    resultFrame = m_CurrentAnimation.GetCurrentFrame();

                    if (m_CurrentAnimation.Finished)
                    {
                        // get the blender to use
                        m_Blender = GetNextBlender();
                        m_Blender.Start();

                        // get the next animation we can blend to
                        m_NextAnimation = GetNextAnimation();
                        m_NextAnimation.Start();

                        // Assign the satellite devices their pattern
                        // parameters and launch the transmission in a new thread
                        SatelliteDevices.SetSatelliteParameters(m_NextAnimation.GenerateSatelliteParameters());
                        Thread thread = new Thread(new ThreadStart(SatelliteDevices.UpdateSatellites));
                        thread.IsBackground = true;
                        thread.Start();

                        //SatelliteDevices.UpdateSatellites();
                        m_State = State.Blending;
                    }
                    break;

                case State.Blending:
                    // update both anis since we're blending between the two
                    m_CurrentAnimation.Update(dt);
                    m_NextAnimation.Update(dt);
                    currentFrame = m_CurrentAnimation.GetCurrentFrame();
                    nextFrame = m_NextAnimation.GetCurrentFrame();
                    resultFrame = m_Blender.Calculate(dt, currentFrame, nextFrame);

                    if (m_Blender.Finished)
                    {
                        // done blending the current to next. Next now is current.
                        m_State = State.Animating;
                        m_CurrentAnimation.Stop();
                        m_CurrentAnimation = m_NextAnimation;
                    }
                    break;
            }

            // let the dome know about the new frame
            Dome.SetFrame(resultFrame);
        }
        static AnimationManager()
        {
            m_Random = new Random(Environment.TickCount);
            m_Blender = new Linear();

            //InitBlenderList();
            InitAnimationList();

            // assume there is at least two animations
            m_CurrentAnimation = m_AnimationList[0];
            m_NextAnimation = m_AnimationList[1];
        }
        static AnimationManager()
        {
            m_Random = new Random(Environment.TickCount);
            m_Blender = new Linear();

            //InitBlenderList();
            InitAnimationList();

            // assume there is at least two animations
            m_CurrentAnimation = m_AnimationList[0];
            m_NextAnimation = m_AnimationList[1];
            MainForm.ConsoleWriteLine("AM: Loading '" + m_CurrentAnimation.Name + "'");
        }
        public static void Update(float dt)
        {
            AnimationFrame currentFrame = null;
            AnimationFrame resultFrame = null;
            AnimationFrame nextFrame = null;

            switch (m_State)
            {
                case State.Animating:
                    // animating so we only need to worry about the current ani
                    m_CurrentAnimation.Update(dt);
                    resultFrame = m_CurrentAnimation.GetCurrentFrame();

                    if (m_CurrentAnimation.Finished)
                    {
                        // get the blender to use
                        m_Blender = GetNextBlender();
                        m_Blender.Start();

                        // get the next animation we can blend to
                        m_NextAnimation = GetNextAnimation();
                        m_NextAnimation.Start();

                        m_State = State.Blending;
                    }
                    break;

                case State.Blending:
                    // update both anis since we're blending between the two
                    m_CurrentAnimation.Update(dt);
                    m_NextAnimation.Update(dt);
                    currentFrame = m_CurrentAnimation.GetCurrentFrame();
                    nextFrame = m_NextAnimation.GetCurrentFrame();
                    resultFrame = m_Blender.Calculate(dt, currentFrame, nextFrame);

                    if (m_Blender.Finished)
                    {
                        // done blending the current to next. Next now is current.
                        m_State = State.Animating;
                        m_CurrentAnimation.Stop();
                        m_CurrentAnimation = m_NextAnimation;
                    }
                    break;
            }

            // let the dome know about the new frame
            Dome.SetFrame(resultFrame);
        }
 public static void SetSatelliteParameters(Animation.SatelliteParameters parameters)
 {
     m_XBeePacketData[0] = Convert.ToByte('p');
     m_XBeePacketData[1] = parameters.pattern;
     m_XBeePacketData[2] = parameters.r;
     m_XBeePacketData[3] = parameters.g;
     m_XBeePacketData[4] = parameters.b;
     m_XBeePacketData[5] = parameters.param0;
     m_XBeePacketData[6] = parameters.param1;
     m_XBeePacketData[7] = parameters.param2;
 }