public Grafica(IPropiedadesGrafica funcion)
        {
            this.funcion = funcion;
            colores[0] = Color.Red;
            colores[1] = Color.Green;
            colores[2] = Color.Orange;
            colores[3] = Color.DarkViolet;
            colores[4] = Color.SaddleBrown;
            colores[5] = Color.LightCoral;
            id = ID;
            ID++;
            ventanaMedidas = new frmMedidas();
            esSenoidal = false;
            iniciarDataGrid();

            zedGraphControl = new ZedGraph.ZedGraphControl();

            //Establece el título del gráfico.
            zedGraphControl.GraphPane.Title.Text = "";
            //Damos nombre a los ejes.
            zedGraphControl.GraphPane.XAxis.Title.Text = "";
            zedGraphControl.GraphPane.YAxis.Title.Text = "";
            //Muestra los valores mientras pasamos por la curva
            zedGraphControl.IsShowPointValues = true;
            zedGraphControl.PointValueEvent += new ZedGraphControl.PointValueHandler(MyPointValueHandler);

            zedGraphControl.IsShowContextMenu = false;
            // Cambia la letra del zedgraphcontrol y el tamaño. NO FUNCIONA!!!
            zedGraphControl.Font = new Font("Times New Roman", 20.0f);

            //Muestro siempre el valor base en la senoidal de segundo orden
            if (funcion.GetType() == typeof(EntradaSenoidalOrden2))
            {
                chkGrReferencias = true;
            }
        }
        private void seleccionarImagenesGraficas(IPropiedadesGrafica controlador, int error)
        {
            if(controlador.GetType() == typeof(Proporcional))
            {
                switch (error)
                {
                    case 1: imgSalida.Image = Controladores.Properties.Resources.controlador_proporcional_escalon;
                            imgError.Image = Controladores.Properties.Resources.error_escalon;
                            break;
                    case 2: imgSalida.Image = Controladores.Properties.Resources.controlador_proporcional_rampa;
                            imgError.Image = Controladores.Properties.Resources.error_rampa;
                            break;
                    case 3: imgSalida.Image = Controladores.Properties.Resources.controlador_proporcional_cuadratico;
                            imgError.Image = Controladores.Properties.Resources.error_cuadratico;
                            break;
                    default:imgSalida.Image = null;
                            imgError.Image = null;
                            break;
                }
            }

            if (controlador.GetType() == typeof(ProporcionalDerivativo))
            {
                switch (error)
                {
                    case 1: imgSalida.Image = Controladores.Properties.Resources.controlador_proporcional_derivativo_escalon;
                            imgError.Image = Controladores.Properties.Resources.error_escalon;
                            break;
                    case 2: imgSalida.Image = Controladores.Properties.Resources.controlador_proporcional_derivativo_rampa;
                            imgError.Image = Controladores.Properties.Resources.error_rampa;
                            break;
                    case 3: imgSalida.Image = Controladores.Properties.Resources.controlador_proporcional_derivativo_cuadratico;
                            imgError.Image = Controladores.Properties.Resources.error_cuadratico;
                            break;
                    default: imgSalida.Image = null;
                             imgError.Image = null;
                             break;
                }
            }

            if (controlador.GetType() == typeof(ProporcionalIntegral))
            {
                switch (error)
                {
                    case 1: imgSalida.Image = Controladores.Properties.Resources.controlador_proporcional_integral_escalon;
                            imgError.Image = Controladores.Properties.Resources.error_escalon;
                            break;
                    case 2: imgSalida.Image = Controladores.Properties.Resources.controlador_proporcional_integral_rampa;
                            imgError.Image = Controladores.Properties.Resources.error_rampa;
                            break;
                    case 3: imgSalida.Image = Controladores.Properties.Resources.controlador_proporcional_integral_cuadratico;
                            imgError.Image = Controladores.Properties.Resources.error_cuadratico;
                            break;
                    default: imgSalida.Image = null;
                             imgError.Image = null;
                             break;
                }
            }

            if (controlador.GetType() == typeof(ProporcionalIntegralDerivativo))
            {
                switch (error)
                {
                    case 1: imgSalida.Image = Controladores.Properties.Resources.controlador_proporcional_integral_derivativo_escalon;
                            imgError.Image = Controladores.Properties.Resources.error_escalon;
                            break;
                    case 2: imgSalida.Image = Controladores.Properties.Resources.controlador_proporcional_integral_derivativo_rampa;
                            imgError.Image = Controladores.Properties.Resources.error_rampa;
                            break;
                    case 3: imgSalida.Image = Controladores.Properties.Resources.controlador_proporcional_integral_derivativo_cuadratico;
                            imgError.Image = Controladores.Properties.Resources.error_cuadratico;
                            break;
                    default: imgSalida.Image = null;
                             imgError.Image = null;
                             break;
                }
            }
        }
 private void seleccionarImagenControlador(IPropiedadesGrafica controlador)
 {
     //se invoca en iniciarComponentesGrafica
     if (controlador.GetType() == typeof(Proporcional)) imgControlador.Image = Controladores.Properties.Resources.controlador_proporcional;
     else if (controlador.GetType() == typeof(ProporcionalDerivativo)) imgControlador.Image = Controladores.Properties.Resources.controlador_proporcional_derivativo;
     else if (controlador.GetType() == typeof(ProporcionalIntegral)) imgControlador.Image = Controladores.Properties.Resources.controlador_proporcional_integral;
     else if (controlador.GetType() == typeof(ProporcionalIntegralDerivativo)) imgControlador.Image = Controladores.Properties.Resources.controlador_proporcional_integral_derivativo;
 }