Esempio n. 1
0
        public override string Info()
        {
            bool   recording    = Lib.Proto.GetBool(proto, "recording");
            bool   forcedRun    = Lib.Proto.GetBool(proto, "forcedRun");
            double scienceValue = Lib.Proto.GetDouble(proto, "scienceValue");
            string issue        = Lib.Proto.GetString(proto, "issue");

            var state = Experiment.GetState(scienceValue, issue, recording, forcedRun);

            if (state == Experiment.State.WAITING)
            {
                return("waiting...");
            }

            double dataSampled = Lib.Proto.GetDouble(proto, "dataSampled");
            double data_rate   = Lib.Proto.GetDouble(proto, "data_rate");

            var exp             = Science.Experiment(prefab.experiment_id);
            var recordedPercent = Lib.HumanReadablePerc(dataSampled / exp.max_amount);
            var eta             = data_rate < double.Epsilon || Experiment.Done(exp, dataSampled) ? " done" : " " + Lib.HumanReadableCountdown((exp.max_amount - dataSampled) / data_rate);

            return(!recording
                          ? "<color=red>" + Localizer.Format("#KERBALISM_Generic_STOPPED") + " </color>"
                          : issue.Length == 0 ? "<color=cyan>" + Lib.BuildString(recordedPercent, eta) + "</color>"
                          : Lib.BuildString("<color=yellow>", issue.ToLower(), "</color>"));
        }
Esempio n. 2
0
        public override string Info()
        {
            var state = Experiment.GetState(experiment.scienceValue, experiment.issue, experiment.recording, experiment.forcedRun);

            if (state == Experiment.State.WAITING)
            {
                return("waiting...");
            }
            var exp             = Science.Experiment(experiment.experiment_id);
            var recordedPercent = Lib.HumanReadablePerc(experiment.dataSampled / exp.max_amount);
            var eta             = experiment.data_rate < double.Epsilon || Experiment.Done(exp, experiment.dataSampled) ? " done" : " " + Lib.HumanReadableCountdown((exp.max_amount - experiment.dataSampled) / experiment.data_rate);

            return(!experiment.recording
                          ? "<color=red>" + Localizer.Format("#KERBALISM_Generic_DISABLED") + " </color>"
                          : experiment.issue.Length == 0 ? "<color=cyan>" + Lib.BuildString(recordedPercent, eta) + "</color>"
                          : Lib.BuildString("<color=yellow>", experiment.issue.ToLower(), "</color>"));
        }