Ejemplo n.º 1
0
        public bool CanRunExperiment(ModuleScienceExperiment baseExperiment, float currentScienceValue)
        {
            var currentExperiment = baseExperiment as DMModuleScienceAnimate;

            if (currentScienceValue < _AutomatedScienceSamplerInstance.craftSettings.threshold)
            {
                _AutomatedScienceSamplerInstance.Log(currentExperiment.experimentID, ": Science value is less than cutoff threshold: ", currentScienceValue, "<", _AutomatedScienceSamplerInstance.craftSettings.threshold);
                return(false);
            }
            if (!currentExperiment.rerunnable && !_AutomatedScienceSamplerInstance.craftSettings.oneTimeOnly)
            {
                _AutomatedScienceSamplerInstance.Log(currentExperiment.experimentID, ": Runing rerunable experiments is disabled");
                return(false);
            }
            if (currentExperiment.Inoperable)
            {
                _AutomatedScienceSamplerInstance.Log(currentExperiment.experimentID, ": Experiment is inoperable");
                return(false);
            }
            if (currentExperiment.Deployed)
            {
                _AutomatedScienceSamplerInstance.Log(currentExperiment.experimentID, ": Experiment is deployed");
                return(false);
            }
            if (!currentExperiment.experiment.IsUnlocked())
            {
                _AutomatedScienceSamplerInstance.Log(currentExperiment.experimentID, ": Experiment is locked");
                return(false);
            }
            return(DMAPI.experimentCanConduct(currentExperiment));
        }
Ejemplo n.º 2
0
 public void deployExperiment(ModuleScienceExperiment exp)
 {
     if (DMAPI.experimentCanConduct(exp as IScienceDataContainer))
     {
         DMAPI.deployDMExperiment(exp as IScienceDataContainer);
     }
 }
Ejemplo n.º 3
0
        public bool checkExperiment(ModuleScienceExperiment exp, ExperimentSituations expSituation, CelestialBody lastBody, string curBiome)
        {
            ScienceExperiment sciexp   = ResearchAndDevelopment.GetExperiment(exp.experimentID);
            ScienceSubject    sub      = ResearchAndDevelopment.GetExperimentSubject(sciexp, expSituation, lastBody, curBiome, curBiome);
            float             dmscival = ResearchAndDevelopment.GetScienceValue(sciexp.dataScale * sciexp.baseValue, sub);

            float dmexpds = sciexp.dataScale;
            float dmexpbv = sciexp.baseValue;

            return(!exp.Inoperable && !exp.Deployed && DMAPI.experimentCanConduct(exp) && dmscival > 1f);
        }
        public bool CanRunExperiment(ModuleScienceExperiment baseExperiment, float currentScienceValue)
        {
            var currentExperiment = baseExperiment as DMModuleScienceAnimate;

            if (currentScienceValue < _AutomatedScienceSamplerInstance.craftSettings.threshold)
            {
                Log(currentExperiment.experimentID, ": Science value is less than cutoff threshold: ", currentScienceValue, "<", _AutomatedScienceSamplerInstance.craftSettings.threshold);
                return(false);
            }
            if (!currentExperiment.rerunnable && !_AutomatedScienceSamplerInstance.craftSettings.oneTimeOnly)
            {
                Log(currentExperiment.experimentID, ": Runing rerunable experiments is disabled");
                return(false);
            }
            if (currentExperiment.Inoperable)
            {
                Log(currentExperiment.experimentID, ": Experiment is inoperable");
                return(false);
            }
            if (currentExperiment.Deployed)
            {
                Log(currentExperiment.experimentID, ": Experiment is deployed");
                return(false);
            }
            if (!currentExperiment.experiment.IsUnlocked())
            {
                Log(currentExperiment.experimentID, ": Experiment is locked");
                return(false);
            }
            if (!string.IsNullOrEmpty(currentExperiment.animationName))
            {
                var anim = currentExperiment.part.FindModelAnimators(currentExperiment.animationName)[0];
                if (anim.isPlaying)
                {
                    Log(currentExperiment.experimentID, ": Animation is playing");
                    return(false);
                }
            }
            return(DMAPI.experimentCanConduct(currentExperiment));
        }