private void SetSingleActivationInfo() { if (PartExtensions.HasModule <ModuleAnimateGeneric>(selectedPart, m => m.isOneShot)) { infoItems.Add(PartInfoItem.Create("Single Activation")); } }
private void SetGeneratorInfo() { var moduleGenerator = PartExtensions.GetModule <ModuleGenerator>(selectedPart); if (moduleGenerator != null) { if (moduleGenerator.resHandler.inputResources.Count > 0) { infoItems.Add(PartInfoItem.Create("Generator Input")); for (int i = 0; i < moduleGenerator.resHandler.inputResources.Count; ++i) { var generatorResource = moduleGenerator.resHandler.inputResources[i]; infoItems.Add(PartInfoItem.Create("\t" + generatorResource.name, generatorResource.rate.ToRate())); } } if (moduleGenerator.resHandler.outputResources.Count > 0) { infoItems.Add(PartInfoItem.Create("Generator Output")); for (int i = 0; i < moduleGenerator.resHandler.outputResources.Count; ++i) { var generatorResource = moduleGenerator.resHandler.outputResources[i]; infoItems.Add(PartInfoItem.Create("\t" + generatorResource.name, generatorResource.rate.ToRate())); } } if (moduleGenerator.isAlwaysActive) { infoItems.Add(PartInfoItem.Create("Generator is Always Active")); } } }
private void SetVesselInfo() { SimManager.Gravity = CelestialBodies.SelectedBody.Gravity; if (BuildAdvanced.Instance.ShowAtmosphericDetails) { SimManager.Atmosphere = CelestialBodies.SelectedBody.GetAtmospheres(BuildAdvanced.Altitude); } else { SimManager.Atmosphere = 0.0; } SimManager.RequestSimulation(); SimManager.TryStartSimulation(); if (lastStage != null) { PartInfoItem.Release(infoItems); infoItems.Clear(); infoItems.Add(PartInfoItem.Create("Delta-V", lastStage.deltaV.ToString("N0") + " / " + lastStage.totalDeltaV.ToString("N0") + "m/s")); infoItems.Add(PartInfoItem.Create("Mass", Units.ToMass(lastStage.mass, lastStage.totalMass))); infoItems.Add(PartInfoItem.Create("TWR", lastStage.thrustToWeight.ToString("F2") + " (" + lastStage.maxThrustToWeight.ToString("F2") + ")")); infoItems.Add(PartInfoItem.Create("Parts", lastStage.partCount + " / " + lastStage.totalPartCount)); } }
private void SetScienceContainerInfo() { if (PartExtensions.HasModule <ModuleScienceContainer>(selectedPart)) { infoItems.Add(PartInfoItem.Create("Science Container")); } }
private void SetResourceItems() { bool visibleResources = false; for (int i = 0; i < selectedPart.Resources.dict.Count; ++i) { if (selectedPart.Resources.dict.At(i).hideFlow == false) { visibleResources = true; break; } } if (visibleResources) { infoItems.Add(PartInfoItem.Create("Resources")); for (int i = 0; i < selectedPart.Resources.dict.Count; ++i) { var partResource = selectedPart.Resources.dict.At(i); if (partResource.hideFlow == false) { infoItems.Add(PartResourceExtensions.GetDensity(partResource) > 0 ? PartInfoItem.Create("\t" + partResource.info.name, "(" + PartResourceExtensions.GetMass(partResource).ToMass() + ") " + partResource.amount.ToString("F1")) : PartInfoItem.Create("\t" + partResource.info.name, partResource.amount.ToString("F1"))); } } } }
private void SetMassItems() { if (selectedPart.physicalSignificance == Part.PhysicalSignificance.FULL) { infoItems.Add(PartInfoItem.Create("Mass", Units.ToMass(PartExtensions.GetDryMass(selectedPart), PartExtensions.GetWetMass(selectedPart)))); } }
private void SetGeneratorInfo() { moduleGenerator = selectedPart.GetModule <ModuleGenerator>(); if (moduleGenerator != null) { if (moduleGenerator.inputList.Count > 0) { infoItems.Add(PartInfoItem.Create("Generator Input")); for (int i = 0; i < moduleGenerator.inputList.Count; ++i) { generatorResource = moduleGenerator.inputList[i]; infoItems.Add(PartInfoItem.Create("\t" + generatorResource.name, generatorResource.rate.ToRate())); } } if (moduleGenerator.outputList.Count > 0) { infoItems.Add(PartInfoItem.Create("Generator Output")); for (int i = 0; i < moduleGenerator.outputList.Count; ++i) { generatorResource = moduleGenerator.outputList[i]; infoItems.Add(PartInfoItem.Create("\t" + generatorResource.name, generatorResource.rate.ToRate())); } } if (moduleGenerator.isAlwaysActive) { infoItems.Add(PartInfoItem.Create("Generator is Always Active")); } } }
private void SetEngineInfo() { var protoModuleEngine = PartExtensions.GetProtoModuleEngine(selectedPart); if (protoModuleEngine != null) { infoItems.Add(PartInfoItem.Create("Thrust", Units.ToForce(protoModuleEngine.MinimumThrust, protoModuleEngine.MaximumThrust))); infoItems.Add(PartInfoItem.Create("Isp", Units.ConcatF(protoModuleEngine.GetSpecificImpulse(1.0f), protoModuleEngine.GetSpecificImpulse(0.0f)) + "s")); if (protoModuleEngine.Propellants.Count > 0) { infoItems.Add(PartInfoItem.Create("Propellants")); float totalRatio = 0.0f; for (int i = 0; i < protoModuleEngine.Propellants.Count; ++i) { totalRatio = totalRatio + protoModuleEngine.Propellants[i].ratio; } for (int i = 0; i < protoModuleEngine.Propellants.Count; ++i) { var propellant = protoModuleEngine.Propellants[i]; infoItems.Add(PartInfoItem.Create("\t" + propellant.name, (propellant.ratio / totalRatio).ToPercent())); } } } }
private void SetSasInfo() { if (PartExtensions.HasModule <ModuleSAS>(selectedPart)) { infoItems.Add(PartInfoItem.Create("SAS Equiped")); } }
private void SetGimbalInfo() { moduleGimbal = selectedPart.GetModule <ModuleGimbal>(); if (moduleGimbal != null) { infoItems.Add(PartInfoItem.Create("Thrust Vectoring", moduleGimbal.gimbalRange.ToString("F2"))); } }
private void SetRcsInfo() { moduleRcs = selectedPart.GetModule <ModuleRCS>(); if (moduleRcs != null) { infoItems.Add(PartInfoItem.Create("Thruster Power", moduleRcs.thrusterPower.ToForce())); infoItems.Add(PartInfoItem.Create("Specific Impulse", Units.ConcatF(moduleRcs.atmosphereCurve.Evaluate(1.0f), moduleRcs.atmosphereCurve.Evaluate(0.0f)) + "s")); } }
private void SetTransmitterInfo() { moduleDataTransmitter = selectedPart.GetModule <ModuleDataTransmitter>(); if (moduleDataTransmitter != null) { infoItems.Add(PartInfoItem.Create("Packet Size", moduleDataTransmitter.packetSize.ToString("F2") + " Mits")); infoItems.Add(PartInfoItem.Create("Bandwidth", (moduleDataTransmitter.packetInterval * moduleDataTransmitter.packetSize).ToString("F2") + "Mits/sec")); infoItems.Add(PartInfoItem.Create(moduleDataTransmitter.requiredResource, moduleDataTransmitter.packetResourceCost.ToString("F2") + "/Packet")); } }
private void SetParachuteInfo() { moduleParachute = selectedPart.GetModule <ModuleParachute>(); if (moduleParachute != null) { infoItems.Add(PartInfoItem.Create("Deployed Drag", Units.ConcatF(moduleParachute.semiDeployedDrag, moduleParachute.fullyDeployedDrag))); infoItems.Add(PartInfoItem.Create("Deployment Altitude", moduleParachute.deployAltitude.ToDistance())); infoItems.Add(PartInfoItem.Create("Deployment Pressure", moduleParachute.minAirPressureToOpen.ToString("F2"))); } }
private void SetDecouplerInfo() { protoModuleDecoupler = selectedPart.GetProtoModuleDecoupler(); if (protoModuleDecoupler != null) { infoItems.Add(PartInfoItem.Create("Ejection Force", protoModuleDecoupler.EjectionForce.ToForce())); if (protoModuleDecoupler.IsOmniDecoupler) { infoItems.Add(PartInfoItem.Create("Omni-directional")); } } }
private void SetTransmitterInfo() { moduleDataTransmitter = selectedPart.GetModule <ModuleDataTransmitter>(); if (moduleDataTransmitter != null) { infoItems.Add(PartInfoItem.Create("Packet Size", moduleDataTransmitter.packetSize.ToString("F2") + " Mits")); infoItems.Add(PartInfoItem.Create("Bandwidth", (moduleDataTransmitter.packetInterval * moduleDataTransmitter.packetSize).ToString("F2") + "Mits/sec")); // TODO: allow for multiple consumed resources infoItems.Add(PartInfoItem.Create(moduleDataTransmitter.GetConsumedResources()[0].name, moduleDataTransmitter.packetResourceCost.ToString("F2") + "/Packet")); } }
private void SetScienceExperimentInfo() { moduleScienceExperiment = selectedPart.GetModule <ModuleScienceExperiment>(); if (moduleScienceExperiment != null) { infoItems.Add(PartInfoItem.Create("Science Experiment", moduleScienceExperiment.experimentActionName)); infoItems.Add(PartInfoItem.Create("\tTransmit Efficiency", moduleScienceExperiment.xmitDataScalar.ToPercent())); if (moduleScienceExperiment.rerunnable == false) { infoItems.Add(PartInfoItem.Create("\tSingle Usage")); } } }
private void SetAlternatorInfo() { moduleAlternator = selectedPart.GetModule <ModuleAlternator>(); if (moduleAlternator != null) { infoItems.Add(PartInfoItem.Create("Alternator")); for (int i = 0; i < moduleAlternator.outputResources.Count; ++i) { moduleResource = moduleAlternator.outputResources[i]; infoItems.Add(PartInfoItem.Create("\t" + moduleResource.name, moduleResource.rate.ToRate())); } } }
private void SetSolarPanelInfo() { moduleDeployableSolarPanel = selectedPart.GetModule <ModuleDeployableSolarPanel>(); if (moduleDeployableSolarPanel != null) { infoItems.Add(PartInfoItem.Create("Charge Rate", moduleDeployableSolarPanel.chargeRate.ToRate())); if (moduleDeployableSolarPanel.isBreakable) { infoItems.Add(PartInfoItem.Create("Breakable")); } if (moduleDeployableSolarPanel.sunTracking) { infoItems.Add(PartInfoItem.Create("Sun Tracking")); } } }
private void SetReactionWheelInfo() { moduleReactionWheel = selectedPart.GetModule <ModuleReactionWheel>(); if (moduleReactionWheel != null) { infoItems.Add(PartInfoItem.Create("Reaction Wheel Torque")); infoItems.Add(PartInfoItem.Create("\tPitch", moduleReactionWheel.PitchTorque.ToTorque())); infoItems.Add(PartInfoItem.Create("\tRoll", moduleReactionWheel.RollTorque.ToTorque())); infoItems.Add(PartInfoItem.Create("\tYaw", moduleReactionWheel.YawTorque.ToTorque())); for (int i = 0; i < moduleReactionWheel.inputResources.Count; ++i) { moduleResource = moduleReactionWheel.inputResources[i]; infoItems.Add(PartInfoItem.Create("\t" + moduleResource.name, moduleResource.rate.ToRate())); } } }
private void SetSolarPanelInfo() { var moduleDeployableSolarPanel = PartExtensions.GetModule <ModuleDeployableSolarPanel>(selectedPart); if (moduleDeployableSolarPanel != null) { infoItems.Add(PartInfoItem.Create("Charge Rate", moduleDeployableSolarPanel.chargeRate.ToRate())); if (moduleDeployableSolarPanel.isBreakable) { infoItems.Add(PartInfoItem.Create("Breakable")); } if (moduleDeployableSolarPanel.trackingBody == Sun.Instance) { infoItems.Add(PartInfoItem.Create("Sun Tracking")); } } }
private void SetCostInfo() { infoItems.Add(PartInfoItem.Create("Cost", Units.ConcatF(selectedPart.GetCostDry(), selectedPart.GetCostWet()))); }
private void SetCostInfo() { infoItems.Add(PartInfoItem.Create("Cost", Units.ConcatF(PartExtensions.GetCostDry(selectedPart), PartExtensions.GetCostWet(selectedPart)))); }