// specifics support public Specifics Specs() { Specifics specs = new Specifics(); specs.add("Havest size", Lib.HumanReadableAmount(crop_size, " " + crop_resource)); specs.add("Harvest time", Lib.HumanReadableDuration(1.0 / crop_rate)); specs.add("Lighting tolerance", Lib.HumanReadableFlux(light_tolerance)); if (pressure_tolerance > double.Epsilon) { specs.add("Pressure tolerance", Lib.HumanReadablePressure(Sim.PressureAtSeaLevel() * pressure_tolerance)); } if (radiation_tolerance > double.Epsilon) { specs.add("Radiation tolerance", Lib.HumanReadableRadiation(radiation_tolerance)); } specs.add("Lamps EC rate", Lib.HumanReadableRate(ec_rate)); specs.add(string.Empty); specs.add("<color=#00ffff>Required resources</color>"); foreach (ModuleResource input in resHandler.inputResources) { specs.add(input.name, Lib.BuildString("<color=#ff0000>", Lib.HumanReadableRate(input.rate), "</color>")); } specs.add(string.Empty); specs.add("<color=#00ffff>By-products</color>"); foreach (ModuleResource output in resHandler.outputResources) { specs.add(output.name, Lib.BuildString("<color=#00ff00>", Lib.HumanReadableRate(output.rate), "</color>")); } return(specs); }
static void render_habitat(Panel p, Vessel v, vessel_info vi) { // if habitat feature is disabled, do not show the panel if (!Features.Habitat) return; // if vessel is unmanned, do not show the panel if (vi.crew_count == 0) return; // determine some content, with colors string pressure_str = Lib.Color(Lib.HumanReadablePressure(vi.pressure * Sim.PressureAtSeaLevel()), vi.pressure < Settings.PressureThreshold, "yellow"); string poisoning_str = Lib.Color(Lib.HumanReadablePerc(vi.poisoning, "F2"), vi.poisoning > Settings.PoisoningThreshold * 0.5, "yellow"); // render panel, add some content based on enabled features if (!v.isEVA) { p.section("HABITAT"); if (Features.Pressure) p.content("pressure", pressure_str); if (Features.Poisoning) p.content("co2 level", poisoning_str); if (Features.Shielding) p.content("shielding", Habitat.shielding_to_string(vi.shielding)); if (Features.LivingSpace) p.content("living space", Habitat.living_space_to_string(vi.living_space)); if (Features.Comfort) p.content("comfort", vi.comforts.summary(), vi.comforts.tooltip()); } else { p.section("HABITAT"); if (Features.Poisoning) p.content("co2 level", poisoning_str); } }
// specifics support public Specifics Specs() { Specifics specs = new Specifics(); specs.Add("Harvest size", Lib.HumanReadableAmount(crop_size, " " + crop_resource)); specs.Add("Harvest time", Lib.HumanReadableDuration(1.0 / crop_rate)); specs.Add("Lighting tolerance", Lib.HumanReadableFlux(light_tolerance)); if (pressure_tolerance > double.Epsilon) { specs.Add("Pressure tolerance", Lib.HumanReadablePressure(Sim.PressureAtSeaLevel() * pressure_tolerance)); } if (radiation_tolerance > double.Epsilon) { specs.Add("Radiation tolerance", Lib.HumanReadableRadiation(radiation_tolerance)); } specs.Add("Lamps EC rate", Lib.HumanReadableRate(ec_rate)); specs.Add(string.Empty); specs.Add("<color=#00ffff>Required resources</color>"); // do we have combined WasteAtmosphere and CO2 Set_WACO2(); bool dis_WACO2 = false; foreach (ModuleResource input in resHandler.inputResources) { // combine WasteAtmosphere and CO2 if both exist if (WACO2 && (input.name == "WasteAtmosphere" || input.name == "CarbonDioxide")) { if (dis_WACO2) { continue; } ModuleResource sec; if (input.name == "WasteAtmosphere") { sec = resHandler.inputResources.Find(x => x.name.Contains("CarbonDioxide")); } else { sec = resHandler.inputResources.Find(x => x.name.Contains("WasteAtmosphere")); } specs.Add("CarbonDioxide", Lib.BuildString("<color=#ffaa00>", Lib.HumanReadableRate(input.rate + sec.rate), "</color>")); specs.Add("Crops can also use the CO2 in the atmosphere without a scrubber."); dis_WACO2 = true; } else { specs.Add(input.name, Lib.BuildString("<color=#ffaa00>", Lib.HumanReadableRate(input.rate), "</color>")); } } specs.Add(string.Empty); specs.Add("<color=#00ffff>By-products</color>"); foreach (ModuleResource output in resHandler.outputResources) { specs.Add(output.name, Lib.BuildString("<color=#00ff00>", Lib.HumanReadableRate(output.rate), "</color>")); } return(specs); }
// get readings value in [0,1] range, for pin animation public static double Telemetry_pin(Vessel v, Vessel_info vi, string type) { switch (type) { case "temperature": return(Math.Min(vi.temperature / 11000.0, 1.0)); case "radiation": return(Math.Min(vi.radiation * 3600.0 / 11.0, 1.0)); case "pressure": return(Math.Min(v.mainBody.GetPressure(v.altitude) / Sim.PressureAtSeaLevel() / 11.0, 1.0)); case "gravioli": return(Math.Min(vi.gravioli, 1.0)); } return(0.0); }
static void Render_habitat(Panel p, Vessel v, VesselData vd) { // if habitat feature is disabled, do not show the panel if (!Features.Habitat) { return; } // if vessel is unmanned, do not show the panel if (vd.CrewCount == 0) { return; } // render panel, add some content based on enabled features p.AddSection("HABITAT"); if (Features.Poisoning) { p.AddContent("co2 level", Lib.Color(vd.Poisoning > Settings.PoisoningThreshold, Lib.HumanReadablePerc(vd.Poisoning, "F2"), Lib.Kolor.Yellow)); } if (Features.Radiation && v.isEVA) { p.AddContent("radiation", Lib.HumanReadableRadiation(vd.EnvHabitatRadiation)); } if (!v.isEVA) { if (Features.Pressure) { p.AddContent("pressure", Lib.HumanReadablePressure(vd.Pressure * Sim.PressureAtSeaLevel())); } if (Features.Shielding) { p.AddContent("shielding", Habitat.Shielding_to_string(vd.Shielding)); } if (Features.LivingSpace) { p.AddContent("living space", Habitat.Living_space_to_string(vd.LivingSpace)); } if (Features.Comfort) { p.AddContent("comfort", vd.Comforts.Summary(), vd.Comforts.Tooltip()); } if (Features.Pressure) { p.AddContent("EVA's available", vd.EnvBreathable ? "infinite" : Lib.HumanReadableInteger(vd.Evas), vd.EnvBreathable ? "breathable atmosphere" : "approx (derived from stored N2)"); } } }
static void Render_habitat(Panel p, Vessel v, Vessel_info vi) { // if habitat feature is disabled, do not show the panel if (!Features.Habitat) { return; } // if vessel is unmanned, do not show the panel if (vi.crew_count == 0) { return; } // render panel, add some content based on enabled features p.AddSection("HABITAT"); if (Features.Poisoning) { p.AddContent("co2 level", Lib.Color(Lib.HumanReadablePerc(vi.poisoning, "F2"), vi.poisoning > Settings.PoisoningThreshold, "yellow")); } if (!v.isEVA) { if (Features.Humidity) { p.AddContent("humidity", Lib.Color(Lib.HumanReadablePerc(vi.humidity, "F2"), vi.humidity > Settings.HumidityThreshold, "yellow")); } if (Features.Pressure) { p.AddContent("pressure", Lib.HumanReadablePressure(vi.pressure * Sim.PressureAtSeaLevel())); } if (Features.Shielding) { p.AddContent("shielding", Habitat.Shielding_to_string(vi.shielding)); } if (Features.LivingSpace) { p.AddContent("living space", Habitat.Living_space_to_string(vi.living_space)); } if (Features.Comfort) { p.AddContent("comfort", vi.comforts.Summary(), vi.comforts.Tooltip()); } if (Features.Pressure) { p.AddContent("EVA's available", vi.breathable ? "infinite" : Lib.HumanReadableInteger(vi.evas), vi.breathable ? "breathable atmosphere" : "approx (derived from stored N2)"); } } }
// get readings value in [0,1] range, for pin animation public static double Telemetry_pin(Vessel v, VesselData vd, string type) { switch (type) { case "temperature": return(Math.Min(vd.EnvTemperature / 11000.0, 1.0)); case "radiation": return(Math.Min(vd.EnvRadiation * 3600.0 / 11.0, 1.0)); case "habitat_radiation": return(Math.Min(HabitatRadiation(vd) * 3600.0 / 11.0, 1.0)); case "pressure": return(Math.Min(v.mainBody.GetPressure(v.altitude) / Sim.PressureAtSeaLevel() / 11.0, 1.0)); case "gravioli": return(Math.Min(vd.EnvGravioli, 1.0)); } return(0.0); }
static void Render_Habitat(Panel p, Vessel v, Vessel_Info vi) { // if habitat feature is disabled, do not show the panel if (!Features.Habitat) { return; } // if vessel is unmanned, do not show the panel if (vi.crew_count == 0) { return; } // render panel, add some content based on enabled features p.SetSection("HABITAT"); if (Features.Poisoning) { p.SetContent("co2 level", Lib.Color(Lib.HumanReadablePerc(vi.poisoning, "F2"), vi.poisoning > Settings.PoisoningThreshold, "yellow")); } if (!v.isEVA) { if (Features.Pressure) { p.SetContent("pressure", Lib.HumanReadablePressure(vi.pressure * Sim.PressureAtSeaLevel())); } if (Features.Shielding) { p.SetContent("shielding", Lib.HumanReadableShielding(vi.shielding)); } if (Features.LivingSpace) { p.SetContent("living space", Habitat.Living_Space_to_String(vi.living_space)); } if (Features.Comfort) { p.SetContent("comfort", vi.comforts.Summary(), vi.comforts.Tooltip()); } } }