internal ProgradeThrustController(Vessel v)
     : base(v, "Prograde thrust controller", 88437224)
 {
     pid.IntegralClamp     = double.PositiveInfinity;
     pid.AccumulDerivClamp = double.PositiveInfinity;
     pid.KP   = 0.4;
     pid.KI   = 0.1;
     pid.KD   = 0.5;
     setpoint = new SpeedSetpoint(SpeedType.MetersPerSecond, 100.0f, v);
 }
        /// <summary>
        /// Standard speed control GUI block to integrate in other controllers
        /// </summary>
        /// <returns>true if speed control is enabled</returns>
        public bool SpeedCtrlGUIBlock()
        {
            spd_control_enabled = GUILayout.Toggle(spd_control_enabled, "Speed control", GUIStyles.toggleButtonStyle);
            GUILayout.BeginHorizontal();
            for (int i = 1; i < 6; i++)
            {
                if (GUILayout.Toggle(chosen_spd_mode == i, spd_str_arr[i], GUIStyles.toggleButtonStyle))
                {
                    chosen_spd_mode = i;
                }
            }
            GUILayout.EndHorizontal();

            SpeedType newtype = type;

            if (chosen_spd_mode != 0)
            {
                newtype = (SpeedType)(chosen_spd_mode - 1);
            }

            setpoint_field.DisplayLayout(GUIStyles.textBoxStyle);

            if (newtype != type)
            {
                // need to convert old setpoint to new format
                setpoint_field.Value = setpoint.convert(newtype);
                setpoint             = new SpeedSetpoint(newtype, setpoint_field, vessel);
                type = newtype;
            }
            else
            {
                setpoint = new SpeedSetpoint(type, setpoint_field, vessel);
            }

            return(spd_control_enabled);
        }