Beispiel #1
0
        private object calculateRowTotals(Rocket rocket, InputValue value)
        {
            object lowValue       = string.Empty;
            object highValue      = string.Empty;
            object averageValue   = string.Empty;
            object lowValueStage  = string.Empty;
            object highValueStage = string.Empty;

            switch (value)
            {
            case InputValue.WetMass:
                averageValue   = rocket.AverageWetMass().ToString();
                lowValueStage  = rocket.LowestWetMass(out lowValue).ToString();
                highValueStage = rocket.HighestWetMass(out highValue).ToString();
                break;

            case InputValue.DryMass:
                averageValue   = rocket.AverageDryMass().ToString();
                lowValueStage  = rocket.LowestDryMass(out lowValue).ToString();
                highValueStage = rocket.HighestDryMass(out highValue).ToString();
                break;

            case InputValue.Isp:
                averageValue   = rocket.AverageIsp().ToString();
                lowValueStage  = rocket.LowestIsp(out lowValue).ToString();
                highValueStage = rocket.HighestIsp(out highValue).ToString();
                break;

            case InputValue.Thrust:
                averageValue   = rocket.AverageThrust().ToString();
                lowValueStage  = rocket.LowestThrust(out lowValue).ToString();
                highValueStage = rocket.HighestThrust(out highValue).ToString();
                break;

            case InputValue.MinTWR:
                averageValue   = rocket.AverageMinTWR().ToString();
                lowValueStage  = rocket.LowestMinTWR(out lowValue).ToString();
                highValueStage = rocket.HighestMinTWR(out highValue).ToString();
                break;

            case InputValue.MaxTWR:
                averageValue   = rocket.AverageMaxTWR().ToString();
                lowValueStage  = rocket.LowestMaxTWR(out lowValue).ToString();
                highValueStage = rocket.HighestMaxTWR(out highValue).ToString();
                break;

            default:
                break;
            }
            return("↑: (" +
                   Truncate(highValueStage.ToString(), 6) + ") " +
                   Truncate(highValue.ToString(), 6) + "<br/>↓: (" +
                   Truncate(lowValueStage.ToString(), 6) + ") " +
                   Truncate(lowValue.ToString(), 6) + "<br/>↕: " +
                   Truncate(averageValue.ToString(), 6));
        }