///<summary> Add habitat sub-panel, including tooltips </summary> private static void AddSubPanelHabitat(Panel p) { SimulatedResource atmo_res = resource_sim.Resource("Atmosphere"); SimulatedResource waste_res = resource_sim.Resource("WasteAtmosphere"); SimulatedResource moist_res = resource_sim.Resource("MoistAtmosphere"); // generate tooltips string atmo_tooltip = atmo_res.Tooltip(); string waste_tooltip = waste_res.Tooltip(true); string moist_tooltip = moist_res.Tooltip(true); // generate status string for scrubbing string waste_status = !Features.Poisoning //< feature disabled ? "n/a" : waste_res.produced <= double.Epsilon //< unnecessary ? "not required" : waste_res.consumed <= double.Epsilon //< no scrubbing ? "<color=#ffff00>none</color>" : waste_res.produced > waste_res.consumed * 1.001 //< insufficient scrubbing ? "<color=#ffff00>inadequate</color>" : "good"; //< sufficient scrubbing // generate status string for humidity string moist_status = !Features.Humidity //< feature disabled ? "n/a" : moist_res.produced <= double.Epsilon //< unnecessary ? "not required" : moist_res.consumed <= double.Epsilon //< no humidity control ? "<color=#ffff00>none</color>" : moist_res.produced > moist_res.consumed * 1.001 //< insufficient humidity control ? "<color=#ffff00>inadequate</color>" : "good"; //< sufficient humidity control // generate status string for pressurization string atmo_status = !Features.Pressure //< feature disabled ? "n/a" : atmo_res.consumed <= double.Epsilon //< unnecessary ? "not required" : atmo_res.produced <= double.Epsilon //< no pressure control ? "<color=#ffff00>none</color>" : atmo_res.consumed > atmo_res.produced * 1.001 //< insufficient pressure control ? "<color=#ffff00>inadequate</color>" : "good"; //< sufficient pressure control p.AddSection("HABITAT", string.Empty, () => { p.Prev(ref environment_index, panel_environment.Count); update = true; }, () => { p.Next(ref environment_index, panel_environment.Count); update = true; }); p.AddContent("volume", Lib.HumanReadableVolume(vessel_analyzer.volume), "volume of enabled habitats"); p.AddContent("surface", Lib.HumanReadableSurface(vessel_analyzer.surface), "surface of enabled habitats"); p.AddContent("scrubbing", waste_status, waste_tooltip); p.AddContent("humidity", moist_status, moist_tooltip); p.AddContent("pressurization", atmo_status, atmo_tooltip); p.AddContent("EVA's available", env_analyzer.breathable ? "infinite" : Lib.HumanReadableInteger(vessel_analyzer.evas), env_analyzer.breathable ? "breathable atmosphere" : "approx (derived from stored N2)"); }
///<summary> Add electric charge sub-panel, including tooltips </summary> private static void AddSubPanelEC(Panel p) { // get simulated resource SimulatedResource res = resource_sim.Resource("ElectricCharge"); // create tooltip string tooltip = res.Tooltip(); // render the panel section p.AddSection(Local.Planner_ELECTRICCHARGE); //"ELECTRIC CHARGE" p.AddContent(Local.Planner_storage, Lib.HumanReadableAmount(res.storage), tooltip); //"storage" p.AddContent(Local.Planner_consumed, Lib.HumanReadableRate(res.consumed), tooltip); //"consumed" p.AddContent(Local.Planner_produced, Lib.HumanReadableRate(res.produced), tooltip); //"produced" p.AddContent(Local.Planner_duration, Lib.HumanReadableDuration(res.Lifetime())); //"duration" }
///<summary> Add supply resource sub-panel, including tooltips </summary> ///<remarks> /// does not include electric charge /// does not include special resources like waste atmosphere /// restricted to resources that are configured explicitly in the profile as supplies ///</remarks> private static void AddSubPanelResource(Panel p, string res_name) { // get simulated resource SimulatedResource res = resource_sim.Resource(res_name); // create tooltip string tooltip = res.Tooltip(); // render the panel section p.AddSection(Lib.SpacesOnCaps(res_name).ToUpper(), string.Empty, () => { p.Prev(ref resource_index, panel_resource.Count); update = true; }, () => { p.Next(ref resource_index, panel_resource.Count); update = true; }); p.AddContent("storage", Lib.HumanReadableAmount(res.storage), tooltip); p.AddContent("consumed", Lib.HumanReadableRate(res.consumed), tooltip); p.AddContent("produced", Lib.HumanReadableRate(res.produced), tooltip); p.AddContent("duration", Lib.HumanReadableDuration(res.Lifetime())); }
///<summary> Add supply resource sub-panel, including tooltips </summary> ///<remarks> /// does not include electric charge /// does not include special resources like waste atmosphere /// restricted to resources that are configured explicitly in the profile as supplies ///</remarks> private static void AddSubPanelResource(Panel p, string res_name) { // get simulated resource SimulatedResource res = resource_sim.Resource(res_name); // create tooltip string tooltip = res.Tooltip(); var resource = PartResourceLibrary.Instance.resourceDefinitions[res_name]; // render the panel section p.AddSection(Lib.SpacesOnCaps(resource.displayName).ToUpper(), string.Empty, () => { p.Prev(ref resource_index, panel_resource.Count); enforceUpdate = true; }, () => { p.Next(ref resource_index, panel_resource.Count); enforceUpdate = true; }); p.AddContent(Local.Planner_storage, Lib.HumanReadableAmount(res.storage), tooltip); //"storage" p.AddContent(Local.Planner_consumed, Lib.HumanReadableRate(res.consumed), tooltip); //"consumed" p.AddContent(Local.Planner_produced, Lib.HumanReadableRate(res.produced), tooltip); //"produced" p.AddContent(Local.Planner_duration, Lib.HumanReadableDuration(res.Lifetime())); //"duration" }
///<summary> Add habitat sub-panel, including tooltips </summary> private static void AddSubPanelHabitat(Panel p) { SimulatedResource atmo_res = resource_sim.Resource("Atmosphere"); SimulatedResource waste_res = resource_sim.Resource("WasteAtmosphere"); // generate tooltips string atmo_tooltip = atmo_res.Tooltip(); string waste_tooltip = waste_res.Tooltip(true); // generate status string for scrubbing string waste_status = !Features.Poisoning //< feature disabled ? "n/a" : waste_res.produced <= double.Epsilon //< unnecessary ? Local.Planner_scrubbingunnecessary //"not required" : waste_res.consumed <= double.Epsilon //< no scrubbing ? Lib.Color(Local.Planner_noscrubbing, Lib.Kolor.Orange) //"none" : waste_res.produced > waste_res.consumed * 1.001 //< insufficient scrubbing ? Lib.Color(Local.Planner_insufficientscrubbing, Lib.Kolor.Yellow) //"inadequate" : Lib.Color(Local.Planner_sufficientscrubbing, Lib.Kolor.Green); //"good" //< sufficient scrubbing // generate status string for pressurization string atmo_status = !Features.Pressure //< feature disabled ? "n/a" : atmo_res.consumed <= double.Epsilon //< unnecessary ? Local.Planner_pressurizationunnecessary //"not required" : atmo_res.produced <= double.Epsilon //< no pressure control ? Lib.Color(Local.Planner_nopressurecontrol, Lib.Kolor.Orange) //"none" : atmo_res.consumed > atmo_res.produced * 1.001 //< insufficient pressure control ? Lib.Color(Local.Planner_insufficientpressurecontrol, Lib.Kolor.Yellow) //"inadequate" : Lib.Color(Local.Planner_sufficientpressurecontrol, Lib.Kolor.Green); //"good" //< sufficient pressure control p.AddSection(Local.Planner_HABITAT, string.Empty, //"HABITAT" () => { p.Prev(ref environment_index, panel_environment.Count); enforceUpdate = true; }, () => { p.Next(ref environment_index, panel_environment.Count); enforceUpdate = true; }); p.AddContent(Local.Planner_volume, Lib.HumanReadableVolume(vessel_analyzer.volume), Local.Planner_volume_tip); //"volume""volume of enabled habitats" p.AddContent(Local.Planner_habitatssurface, Lib.HumanReadableSurface(vessel_analyzer.surface), Local.Planner_habitatssurface_tip); //"surface""surface of enabled habitats" p.AddContent(Local.Planner_scrubbing, waste_status, waste_tooltip); //"scrubbing" p.AddContent(Local.Planner_pressurization, atmo_status, atmo_tooltip); //"pressurization" }