private void Mapping_DataReceived(object sender, MotionData data)
 {
     this.Invoke(new Action(() =>
     {
         xAccelerationBox.Text = data.Data.X.ToString();
         yAccelerationBox.Text = data.Data.Y.ToString();
         zAccelerationBox.Text = data.Data.Z.ToString();
     }));
 }
 private void waxReceiver_DataReceived(object sender, MotionData data)
 {
     foreach (Mapping m in mappings)
     {
         if (m.SensorId == data.Id)
         {
             m.Update(data);
         }
     }
 }
Exemplo n.º 3
0
        public void Update(MotionData data)
        {
            if (Recognizer != null)
            {
                Recognizer.Update(data);
            }

            if (DataReceived != null)
            {
                DataReceived(this, data);
            }
        }
        private void osc_MessageReceived(object sender, OscMessageReceivedEventArgs e)
        {
            int id = int.Parse(e.Message.Address.Split(new string[1] { "/" }, StringSplitOptions.RemoveEmptyEntries)[1]);
            float x = (float)e.Message.Data[0];
            float y = (float)e.Message.Data[1];
            float z = (float)e.Message.Data[2];

            MotionData md = new MotionData(id, new Vector3(x, y, z));
            if (DataReceived != null)
            {
                DataReceived(this, md);
            }
        }