private void updateConnectedExperiments()
        {
            if (!IsDeployed)
            {
                return;
            }

            int l = experiments.Count;

            for (int i = 0; i < l; i++)
            {
                ModuleSEPScienceExperiment exp = experiments[i];

                if (exp == null)
                {
                    continue;
                }

                if (!exp.IsDeployed)
                {
                    continue;
                }

                if (exp.Handler == null)
                {
                    continue;
                }

                if (exp.Controller != this)
                {
                    continue;
                }

                exp.controllerAutoTransmit = autoTransmit;
                //exp.controllerCanTransmit = transmissionUpgrade;

                exp.Handler.updateController(this);
            }
        }
        private void getConnectedExperiments()
        {
            var modules = vessel.FindPartModulesImplementing <ModuleSEPScienceExperiment>().Where(m => m.IsDeployed).ToList();

            int l = modules.Count;

            for (int i = 0; i < l; i++)
            {
                if (experiments.Count >= maxExperiments)
                {
                    break;
                }

                ModuleSEPScienceExperiment exp = modules[i];

                if (exp == null)
                {
                    continue;
                }

                if (exp.Handler == null)
                {
                    continue;
                }

                if (exp.Controller != null)
                {
                    continue;
                }

                exp.setController(this);
                experiments.Add(exp);
            }

            Events["ConductExperiments"].active = experiments.Count > 0;
        }
        private void updateControllerFields()
        {
            if (!IsDeployed)
            {
                return;
            }

            int l = experiments.Count;

            for (int i = 0; i < l; i++)
            {
                ModuleSEPScienceExperiment exp = experiments[i];

                if (exp == null)
                {
                    continue;
                }

                if (!exp.IsDeployed)
                {
                    continue;
                }

                if (exp.Handler == null)
                {
                    continue;
                }

                if (exp.Controller != this)
                {
                    continue;
                }

                string val = "";

                if (exp.experimentRunning)
                {
                    val = string.Format("Completion: {0:P0}", exp.Handler.completion);
                }
                else
                {
                    val = string.Format("Calibration: {0:P0}", exp.Handler.calibration);
                }

                switch (i)
                {
                case 0:
                    exp0 = val;
                    break;

                case 1:
                    exp1 = val;
                    break;

                case 2:
                    exp2 = val;
                    break;

                case 3:
                    exp3 = val;
                    break;

                case 4:
                    exp4 = val;
                    break;

                case 5:
                    exp5 = val;
                    break;

                case 6:
                    exp6 = val;
                    break;

                case 7:
                    exp7 = val;
                    break;

                default:
                    break;
                }
            }
        }