/// <summary> /// Handles bus /// </summary> /// <param name="node"></param> /// <param name="value"></param> private void OnBusValueChanged(BusNode node, Object value) { if (node == BusNode.STOP_REQUESTED) { Debug.WriteLine("Caught a program stop request"); this.Close(); } }
/// <summary> /// Called when a value is published to the virtual bus. /// </summary> /// <param name="node">The node that has been published.</param> /// <param name="value">The new value of the node.</param> private void OnValuePublished(BusNode node, object value) { Orientation or = (Orientation)value; if (node == BusNode.ORIENTATION_RIGHT_UPPER_ARM) { _upperArmDisplay.Text = OrientationToString(or); } else if (node == BusNode.ORIENTATION_RIGHT_LOWER_ARM) { _lowerArmDisplay.Text = OrientationToString(or); } else if (node == BusNode.ORIENTATION_RIGHT_HAND) { //_handDisplay.Text = OrientationToString(or); _handDisplay.Text = OrientationToString(Bus.Get <Orientation>(BusNode.ORIENTATION_RIGHT_HAND)); } }