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); } }
/// <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); } }
/// <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; }
/// <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; }
/// <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); } }