Example #1
0
        private void UpdateChasePanel()
        {
            try
            {
                lblError.Text = "";

                ClearChasePanels();

                ChaseType chaseType;
                if (Enum.TryParse(cboChaseType.SelectedValue.ToString().Replace(" ", "_"), out chaseType))
                {
                    switch (chaseType)
                    {
                    case ChaseType.Linear_Velocity:
                        if (_panel_LinearVelocity != null)
                        {
                            _object_LinearVelocity = _panel_LinearVelocity.GetChaseObject(_bodyBall);
                        }
                        break;

                    case ChaseType.Linear_Force:
                        if (_panel_LinearForce != null)
                        {
                            _object_LinearForce = _panel_LinearForce.GetChaseObject_Linear(_bodyBall);
                        }
                        break;

                    case ChaseType.Orientation_Velocity:
                        if (_panel_OrientationVelocity != null)
                        {
                            _object_OrientationVelocity = _panel_OrientationVelocity.GetChaseObject(_bodyBall);
                        }
                        break;

                    case ChaseType.Orientation_Torque:
                        if (_panel_OrientationForce != null)
                        {
                            _object_OrientationForce = _panel_OrientationForce.GetChaseObject_Orientation(_bodyBall);
                        }
                        break;

                    default:
                        throw new ApplicationException("Unknown ChaseType: " + chaseType.ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                lblError.Text = ex.Message;
            }
        }