public void DisplayStats(Rocket rocket) { var thrust = rocket._engineRunning ? rocket._rocketInf.Thrust * rocket._thrustPercentage : 0; var resultingDrag = new Force(Angle.Zero, 0); foreach (var drag in rocket.DragForces) { resultingDrag = drag + resultingDrag; } var resultingGravity = new Force(Angle.Zero, 0); foreach (var garvity in rocket.GravityForces) { resultingGravity = garvity + resultingGravity; } var forcesWithoutGravity = resultingDrag + new Force(rocket._angle, thrust); var g = Math.Round(forcesWithoutGravity.GetAcceleration(rocket.Mass).Value / 9.80665, 1); lblStatThrustVal.Text = Decimalpoints.Add(Math.Round(thrust / 1000, 4)) + " kN"; lblStatAccelerationVal.Text = Decimalpoints.Add(Math.Round(rocket.Acceleration.Value, 4)) + " m/s² (" + g + "g)"; lblStatSpeedVal.Text = Decimalpoints.Add(Math.Round(rocket.Speed.Value, 8)) + " m/s"; lblStatWeightVal.Text = Decimalpoints.Add(Math.Round(rocket.Mass.Value, 2)) + " kg"; var fuelPercent = Math.Round(rocket._restFuelWeight / rocket._rocketInf.FuelWeight * 100); lblStatFuelWeightVal.Text = Decimalpoints.Add(Math.Round(rocket._restFuelWeight, 2)) + " kg (" + fuelPercent + "%)"; lblStatGravityVal.Text = Decimalpoints.Add(Math.Round(resultingGravity.Value / 1000, 4)) + " kN"; lblStatDragVal.Text = Decimalpoints.Add(Math.Round(resultingDrag.Value / 1000, 4)) + " kN"; }
public void DisplayInformation(Rocket rocket) { var liftoffTime = rocket.LiftOffTime; var time = TimeKeeper.Now(); var diff = time - liftoffTime; lblClock.Text = "T+ " + diff.ToString(@"dd\.hh\:mm\:ss"); lblRocketName.Text = rocket._name; lblInfModelVal.Text = rocket._rocketInf.Model + " " + rocket._rocketInf.Variant; lblInfManufacturerVal.Text = rocket._rocketInf.Manufacturer; lblInfHeightVal.Text = Decimalpoints.Add(rocket._rocketInf.Height) + "m"; }
public void DisplayLocation(Rocket rocket) { var distance = 0F; foreach (var planet in _objects.Terrains) { var newDistance = PointCalculator.Distance(rocket.Location, planet.Location); if (newDistance > distance) { distance = newDistance - (float)planet.Diameter; } } lblLocClosestVal.Text = Decimalpoints.Add(Math.Round(distance)) + " m"; lblLocAngleVal.Text = Math.Round(rocket._angle.Degree - ((rocket._angle.Degree > 180) ? 360 : 0), 1) + "°"; lblLocCoordsVal.Text = Decimalpoints.Add(Math.Round(rocket.Location.X)) + " | " + Decimalpoints.Add(Math.Round(rocket.Location.Y)); _screen.Color = CalcColor(distance); }