Пример #1
0
 private void LegoBrick_BrickChanged(object sender, BrickChangedEventArgs e)
 {
     if (BrickChanged != null)
     {
         BrickChanged(this, e);
     }
 }
Пример #2
0
        void _brick_BrickChanged(object sender, BrickChangedEventArgs e)
        {
            MotorA.Update(_brick);
            MotorB.Update(_brick);
            MotorC.Update(_brick);
            MotorD.Update(_brick);

            InputOne.Update(_brick);
            InputTwo.Update(_brick);
            InputThree.Update(_brick);
            InputFour.Update(_brick);
        }
Пример #3
0
        private void OnBrickChanged(BrickChangedEventArgs e)
        {
            EventHandler <BrickChangedEventArgs> handler = BrickChanged;

            if (handler != null)
            {
                if (_context == SynchronizationContext.Current)
                {
                    handler(this, e);
                }
                else
                {
                    _context.Post(delegate { handler(this, e); }, null);
                }
            }
        }
Пример #4
0
 private void _brick_BrickChanged(object sender, BrickChangedEventArgs e)
 {
     Debug.WriteLine("algo ocurrió");
     txtDistance.Content = e.Ports[InputPort.Four].SIValue.ToString();
 }
Пример #5
0
 void brick_BrickChanged(object sender, BrickChangedEventArgs e)
 {
     InputPorts.DataContext = e.Ports;
     Buttons.DataContext = null;
     Buttons.DataContext = e.Buttons;
 }
Пример #6
0
 static void _brick_BrickChanged(object sender, BrickChangedEventArgs e)
 {
     System.Console.WriteLine(e.Ports[InputPort.Four].SIValue);
 }
Пример #7
0
        private void _brick_BrickChanged(object sender, BrickChangedEventArgs e)
        {
            Debug.WriteLine("algo ocurrió");

        }
Пример #8
0
        void _lego_BrickChanged(object sender, BrickChangedEventArgs e)
        {
            try
            {
                //Only send if >= 2 centimeter change
                if (Math.Abs(_distance - (int)e.Ports[InputPort.Four].SIValue) >= 2)
                {
                    _distance = (int)e.Ports[InputPort.Four].SIValue;

                    //Send the new distance to the SignalRHub 
                   // await _hubProxy.Invoke("SendUpdatedSensorData", _distance);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("exception:" + ex);
            }
        }
Пример #9
0
		private void OnBrickChanged(BrickChangedEventArgs e)
		{
			EventHandler<BrickChangedEventArgs> handler = BrickChanged;
			if(handler != null)
			{
				if(_context == SynchronizationContext.Current)
					handler(this, e);
				else
					_context.Post(delegate { handler(this, e); }, null);
			}
		}
Пример #10
0
 void _lego_BrickChanged(object sender, BrickChangedEventArgs e)
 {
     txtDistance.Text = e.Ports[InputPort.Two].SIValue.ToString();
     txtTouch.Text = e.Ports[InputPort.Four].SIValue.ToString();
 }