Example #1
0
        /*!
         * Initializes this calibration element
         * @param   rotationElement the element that rotates (can have children that travel with it)
         * @param   element the element that is touched to begin rotation, will track the finger
         * @param   the outer ring image
         * @param   the middle ring image
         * @param   the inner ring image
         * @param   sphero the sphero that will be calibrated
         */
        public CalibrateElement(
            FrameworkElement rotationElement,
            FrameworkElement element,
            FrameworkElement ringOuter,
            FrameworkElement ringMiddle,
            FrameworkElement ringInner,
            FrameworkElement fingerPoint,
            RobotKit.Robot sphero)
        {
            m_sphero = (RobotKit.Sphero)sphero;
            m_calibrateRotationRoot = rotationElement;
            m_calibrateElement      = element;

            m_calibrateElement.PointerPressed     += OnPointerPressed;
            m_calibrateElement.PointerMoved       += OnPointerMoved;
            m_calibrateElement.PointerReleased    += OnPointerReleased;
            m_calibrateElement.PointerCaptureLost += OnPointerReleased;
            m_calibrateElement.PointerCanceled    += OnPointerReleased;

            m_ringOuter  = ringOuter;
            m_ringMiddle = ringMiddle;
            m_ringInner  = ringInner;

            m_fingerPoint = fingerPoint;

            SetupRotation();

            m_lastCommandSentTimeMs = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
        }
        /*!
         * Initializes this calibration element
         * @param   rotationElement the element that rotates (can have children that travel with it)
         * @param   element the element that is touched to begin rotation, will track the finger
         * @param   the outer ring image
         * @param   the middle ring image
         * @param   the inner ring image
         * @param   sphero the sphero that will be calibrated
         */
        public CalibrateElement(
            FrameworkElement rotationElement,
            FrameworkElement element,
            FrameworkElement ringOuter,
            FrameworkElement ringMiddle,
            FrameworkElement ringInner,
            FrameworkElement fingerPoint,
            RobotKit.Robot sphero) {
            m_sphero = (RobotKit.Sphero)sphero;
            m_calibrateRotationRoot = rotationElement;
            m_calibrateElement = element;

            m_calibrateElement.PointerPressed += OnPointerPressed;
            m_calibrateElement.PointerMoved += OnPointerMoved;
            m_calibrateElement.PointerReleased += OnPointerReleased;
            m_calibrateElement.PointerCaptureLost += OnPointerReleased;
            m_calibrateElement.PointerCanceled += OnPointerReleased;

            m_ringOuter = ringOuter;
            m_ringMiddle = ringMiddle;
            m_ringInner = ringInner;

            m_fingerPoint = fingerPoint;

            SetupRotation();

            m_lastCommandSentTimeMs = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
        }
        /*!
         * @brief	creates a joystick with the given @a puck element for a @a sphero
         * @param	puck the puck to control with the joystick
         * @param	sphero the sphero to control
         */
        public Joystick(FrameworkElement puck, RobotKit.Sphero sphero) {
            m_sphero = sphero;

            m_puckControl = puck;
            m_puckControl.PointerPressed += PointerPressed;
            m_puckControl.PointerMoved += PointerMoved;
            m_puckControl.PointerReleased += PointerReleased;
            m_puckControl.PointerCaptureLost += PointerReleased;
            m_puckControl.PointerCanceled += PointerReleased;

            m_translateTransform = new TranslateTransform();
            m_puckControl.RenderTransform = m_translateTransform;
        }
Example #4
0
        /*!
         * @brief	creates a joystick with the given @a puck element for a @a sphero
         * @param	puck the puck to control with the joystick
         * @param	sphero the sphero to control
         */
        public Joystick(FrameworkElement puck, RobotKit.Sphero sphero)
        {
            m_sphero = sphero;

            m_puckControl = puck;
            m_puckControl.PointerPressed     += PointerPressed;
            m_puckControl.PointerMoved       += PointerMoved;
            m_puckControl.PointerReleased    += PointerReleased;
            m_puckControl.PointerCaptureLost += PointerReleased;
            m_puckControl.PointerCanceled    += PointerReleased;

            m_translateTransform          = new TranslateTransform();
            m_puckControl.RenderTransform = m_translateTransform;
        }
        /*!
         * @brief	creates a joystick with the given @a puck element for a @a sphero
         * @param	puck the puck to control with the joystick
         * @param	sphero the sphero to control
         */
        public ColorWheel(FrameworkElement puck, RobotKit.Sphero sphero) {
            m_sphero = sphero;

            m_puckControl = puck;
            m_puckControl.PointerPressed += PointerPressed;
            m_puckControl.PointerMoved += PointerMoved;
            m_puckControl.PointerReleased += PointerReleased;
            m_puckControl.PointerCaptureLost += PointerReleased;
            m_puckControl.PointerCanceled += PointerReleased;

            m_translateTransform = new TranslateTransform();
            m_puckControl.RenderTransform = m_translateTransform;

            m_lastCommandSentTimeMs = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
        }
Example #6
0
        /*!
         * @brief	creates a joystick with the given @a puck element for a @a sphero
         * @param	puck the puck to control with the joystick
         * @param	sphero the sphero to control
         */
        public ColorWheel(FrameworkElement puck, RobotKit.Sphero sphero)
        {
            m_sphero = sphero;

            m_puckControl = puck;
            m_puckControl.PointerPressed     += PointerPressed;
            m_puckControl.PointerMoved       += PointerMoved;
            m_puckControl.PointerReleased    += PointerReleased;
            m_puckControl.PointerCaptureLost += PointerReleased;
            m_puckControl.PointerCanceled    += PointerReleased;

            m_translateTransform          = new TranslateTransform();
            m_puckControl.RenderTransform = m_translateTransform;

            m_lastCommandSentTimeMs = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
        }