private void SetCameraMode(string value)
        {
            if (shared.Vessel.isActiveVessel)
            {
                switch (value.ToUpper().Trim())
                {
                case ("AUTO"):
                    FlightCamera.SetMode(FlightCamera.Modes.AUTO);
                    break;

                case ("CHASE"):
                    FlightCamera.SetMode(FlightCamera.Modes.CHASE);
                    break;

                case ("FREE"):
                    FlightCamera.SetMode(FlightCamera.Modes.FREE);
                    break;

                case ("LOCKED"):
                    FlightCamera.SetMode(FlightCamera.Modes.LOCKED);
                    break;

                case ("ORBITAL"):
                    FlightCamera.SetMode(FlightCamera.Modes.ORBITAL);
                    break;

                default:
                    throw new KOSException("Cannot set cameramode, invalid input value.");
                }
            }
        }
        private void updateCameraMode(byte controlMode)
        {
            Debug.Log("Camera update called");
            oldCameraModeControl = receivedCameraControlMode;
            needToUpdateCamera   = false;


            // Switch based on the CameraControlBits values
            switch (controlMode)
            {
            // See if the control bit is a camera mode setting bit - need to add validity checking, to make sure the modes can be entered
            case CameraControlBits.FlightMode:
                cameraManager.SetCameraFlight();
                break;

            case CameraControlBits.IVAMode:
                cameraManager.SetCameraIVA();
                break;

            case CameraControlBits.PlanetaryMode:
                PlanetariumCamera.fetch.Activate();
                break;

            // If it is not a camera mode, it must be a mode for the (hopefully) current camera
            default:

                // Based on the current camera mode, change where the CameraControl value gets sent
                switch (cameraManager.currentCameraMode)
                {
                // Flight Camera
                case CameraManager.CameraMode.Flight:
                    Debug.Log("Camera can have it's mode changed");
                    Debug.Log("Control mode: " + controlMode.ToString());
                    int currentFlightMode = FlightCamera.CamMode;
                    int maxEnum           = Enum.GetNames(typeof(FlightCamera.Modes)).Length - 1;
                    Debug.Log("Max Enum Value: " + maxEnum.ToString());

                    // Switch based on the operation to perform on the flight camera
                    switch (controlMode)
                    {
                    case CameraControlBits.Auto:
                        FlightCamera.SetMode(FlightCamera.Modes.AUTO);
                        printCameraMode("Auto");
                        break;

                    case CameraControlBits.Free:
                        FlightCamera.SetMode(FlightCamera.Modes.FREE);
                        printCameraMode("Free");
                        break;

                    case CameraControlBits.Orbital:
                        FlightCamera.SetMode(FlightCamera.Modes.ORBITAL);
                        printCameraMode("Orbital");
                        break;

                    case CameraControlBits.Chase:
                        FlightCamera.SetMode(FlightCamera.Modes.CHASE);
                        printCameraMode("Chase");
                        break;

                    case CameraControlBits.Locked:
                        FlightCamera.SetMode(FlightCamera.Modes.LOCKED);
                        printCameraMode("Locked");
                        break;

                    case CameraControlBits.NextCameraModeState:
                        printCameraMode("Next");
                        // If the current flight camera mode is at the end of the list, wrap around to the start
                        if (currentFlightMode == maxEnum)
                        {
                            FlightCamera.SetMode((FlightCamera.Modes) 0);
                        }
                        else
                        {
                            FlightCamera.SetMode((FlightCamera.Modes)currentFlightMode + 1);
                        }
                        break;

                    case CameraControlBits.PreviousCameraModeState:
                        printCameraMode("Previous");
                        // If the current flight camera mode is at the start of the list, wrap around to the end
                        if (currentFlightMode == 0)
                        {
                            FlightCamera.SetMode((FlightCamera.Modes)maxEnum);
                        }
                        else
                        {
                            // Hack to get around the issue of orbital mode not being available below a certain altitude around SOIs.
                            FlightCamera.Modes autoMode = FlightCamera.GetAutoModeForVessel(FlightGlobals.ActiveVessel);
                            // If the Flight Camera mode tries to go backwards to orbital mode, and orbital mode is not available, set the camera mode back two places.
                            if (((FlightCamera.Modes)(FlightCamera.CamMode - 1)) == FlightCamera.Modes.ORBITAL && autoMode != FlightCamera.Modes.ORBITAL)
                            {
                                FlightCamera.SetMode((FlightCamera.Modes)(currentFlightMode - 2));
                            }
                            // Otherwise just change the mode back by one
                            else
                            {
                                FlightCamera.SetMode((FlightCamera.Modes)currentFlightMode - 1);
                            }
                        }
                        break;

                    default:
                        printCameraMode("No flight camera state to match the control bits:(");
                        break;
                    }
                    break;         /* End Flight Camera Mode */

                case CameraManager.CameraMode.IVA:
                    break;

                default:
                    Debug.Log(String.Format("Simpit control for the camera mode: {0} is unsupported", cameraManager.currentCameraMode.ToString()));
                    break;
                }     /* End of current camera mode switch */
                break;
            } /* End of control mode switch */
        }