protected void Notify(CoordinatesProcessedEventArgs e)
 {
     if (this.Processed != null)
     {
         EventHandler<CoordinatesProcessedEventArgs> handler = Processed;
         handler(this, e);
     }
 }
 protected void Notify(CoordinatesProcessedEventArgs e)
 {
     if (this.Processed != null)
     {
         EventHandler <CoordinatesProcessedEventArgs> handler = Processed;
         handler(this, e);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Routing method to send the recieved information the the appropriate WiimoteSampleAggregator.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SendToWiimoteCoordinate(object sender, CoordinatesProcessedEventArgs e)
 {
     if (((WiimoteSampleAggregator)sender).Wiimote.WiimoteState.LEDState.LED1 == true)
     {
         coordinateSet[0].setCoordinates(e);
     }
     else if (((WiimoteSampleAggregator)sender).Wiimote.WiimoteState.LEDState.LED2 == true)
     {
         coordinateSet[1].setCoordinates(e);
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// Saves the cooridantes into memory and passes them on to the WiimoteDataContext viewmodel.
        /// </summary>
        /// <param name="e"></param>
        public void setCoordinates(CoordinatesProcessedEventArgs e)
        {
            Point[] ir = new Point[4];
            for (int i = 0; i < 4 ;i++)
            {
                ir[i] = new Point(e.IRCoordinates[i].X  , e.IRCoordinates[i].Y);
            }

            double[] accel = new double[3];
            for (int i = 0; i < 3; i++)
            {
                accel[i] = e.AccelCoordinates[i];
            }
            MidPoint = new Point(e.MidPoint.X , e.MidPoint.Y);
            Battery = e.battery;
            ID = e.ID;

            IRCoordinates = ir;
            AccelValues = accel;
        }
Exemplo n.º 5
0
        /// <summary>
        /// Saves the cooridantes into memory and passes them on to the WiimoteDataContext viewmodel.
        /// </summary>
        /// <param name="e"></param>
        public void setCoordinates(CoordinatesProcessedEventArgs e)
        {
            Point[] ir = new Point[4];
            for (int i = 0; i < 4; i++)
            {
                ir[i] = new Point(e.IRCoordinates[i].X, e.IRCoordinates[i].Y);
            }

            double[] accel = new double[3];
            for (int i = 0; i < 3; i++)
            {
                accel[i] = e.AccelCoordinates[i];
            }
            MidPoint = new Point(e.MidPoint.X, e.MidPoint.Y);
            Battery  = e.battery;
            ID       = e.ID;

            IRCoordinates = ir;
            AccelValues   = accel;
        }
Exemplo n.º 6
0
        /// <summary>
        /// Routing method to send the recieved information the the appropriate WiimoteSampleAggregator.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SendToWiimoteCoordinate(object sender, CoordinatesProcessedEventArgs e)
        {
            if (((WiimoteSampleAggregator)sender).Wiimote.WiimoteState.LEDState.LED1 == true)
            {
               coordinateSet[0].setCoordinates(e);
            }
            else if(((WiimoteSampleAggregator)sender).Wiimote.WiimoteState.LEDState.LED2 == true)
            { 
                coordinateSet[1].setCoordinates(e);
            }

        }