Canguro.Controller.ItemTextBuilder.getLineDesignInfo C# (CSharp) Метод

getLineDesignInfo() приватный Метод

private getLineDesignInfo ( LineElement l, float xPos ) : string
l Canguro.Model.LineElement
xPos float
Результат string
        private string getLineDesignInfo(LineElement l, float xPos)
        {
            string smallDistance = units.UnitName(Canguro.Model.UnitSystem.Units.SmallDistance);
            string area = units.UnitName(Canguro.Model.UnitSystem.Units.Area);
            string distance = units.UnitName(Canguro.Model.UnitSystem.Units.Distance);

            string ret;
            Model.Section.FrameSection sec = ((StraightFrameProps)l.Properties).Section;

            if (sec.Material.DesignProperties is Canguro.Model.Material.SteelDesignProps)
            {
                ret = Culture.Get("CanguroViewReportsSteelDesignWrapper") + "\n\n";

                Model.Results.SteelDesignSummary designSum = model.Results.DesignSteelSummary[l.Id];
                Model.Results.SteelDesignPMMDetails designPMM = model.Results.DesignSteelPMMDetails[l.Id];
                Model.Results.SteelDesignShearDetails designShear = model.Results.DesignSteelShearDetails[l.Id];

                // Steel Design Summary
                ret = "\n";
                if (!string.IsNullOrEmpty(designSum.Status) && !designSum.Status.Equals("No Messages"))
                    ret += designSum.Status + "\n";
                if (!string.IsNullOrEmpty(designSum.ErrMsg))
                    ret += designSum.ErrMsg + "\n";
                if (!string.IsNullOrEmpty(designSum.WarnMsg))
                    ret += designSum.WarnMsg + "\n";
                ret += Culture.Get("CanguroViewReportsSteelDesignWrapperRatio") + ": " + designSum.Ratio.ToString("F5");

                // Steel Design PMM Details
                ret += "\n\n" + Culture.Get("CanguroViewReportsSteelDesignPMMWrapper") + "\n\n";
                if (!string.IsNullOrEmpty(designPMM.Status) && !designPMM.Status.Equals("No Messages"))
                    ret += designPMM.Status + "\n";
                if (!string.IsNullOrEmpty(designPMM.ErrMsg))
                    ret += designPMM.ErrMsg + "\n";
                if (!string.IsNullOrEmpty(designPMM.WarnMsg))
                    ret += designPMM.WarnMsg + "\n";
                ret += Culture.Get("CanguroViewReportsSteelDesignPMMWrapperTotalRatio") + ": " + designPMM.TotalRatio.ToString("F5") + "\n";
                ret += Culture.Get("CanguroViewReportsSteelDesignPMMWrapperPRatio") + ": " + designPMM.PRatio.ToString("F5") + "\n";
                ret += Culture.Get("CanguroViewReportsSteelDesignPMMWrapperMMajRatio") + ": " + designPMM.MMajRatio.ToString("F5") + "\n";
                ret += Culture.Get("CanguroViewReportsSteelDesignPMMWrapperMMinRatio") + ": " + designPMM.MMinRatio.ToString("F5") + "\n";

                // Steel Design Shear Details
                ret += "\n\n" + Culture.Get("CanguroViewReportsSteelDesignShearWrapper") + "\n\n";
                if (!string.IsNullOrEmpty(designShear.Status) && !designShear.Status.Equals("No Messages"))
                    ret += designShear.Status + "\n";
                if (!string.IsNullOrEmpty(designShear.ErrMsg))
                    ret += designShear.ErrMsg + "\n";
                if (!string.IsNullOrEmpty(designShear.WarnMsg))
                    ret += designShear.WarnMsg + "\n";
                ret += Culture.Get("CanguroViewReportsSteelDesignShearWrapperVMajorRatio") + ": " + designShear.VMajorRatio.ToString("F5") + "\n";
                ret += Culture.Get("CanguroViewReportsSteelDesignShearWrapperVMinorRatio") + ": " + designShear.VMinorRatio.ToString("F5");
            }
            else
            {
                ret = Culture.Get("CanguroViewReportsConcreteBeamDesignWrapper") + "\n\n";

                // Concrete Design
                if (sec.ConcreteProperties is Model.Section.ConcreteBeamSectionProps)
                {
                    Model.Results.ConcreteBeamDesign design = model.Results.DesignConcreteBeam[l.Id];

                    ret = "\n";
                    if (!string.IsNullOrEmpty(design.Status) && !design.Status.Equals("No Messages"))
                        ret += design.Status + "\n";
                    if (!string.IsNullOrEmpty(design.ErrMsg))
                        ret += design.ErrMsg + "\n";
                    if (!string.IsNullOrEmpty(design.WarnMsg))
                        ret += design.WarnMsg + "\n";
                    ret += Culture.Get("CanguroViewReportsConcreteBeamDesignWrapperBottomRebarArea") + ": " + units.FromInternational(design.FBotArea, Canguro.Model.UnitSystem.Units.Area).ToString("G3") + area + "\n";
                    ret += Culture.Get("CanguroViewReportsConcreteBeamDesignWrapperTopRebarArea") + ": " + units.FromInternational(design.FTopArea, Canguro.Model.UnitSystem.Units.Area).ToString("G3") + area + "\n";
                    ret += Culture.Get("CanguroViewReportsConcreteBeamDesignWrapperVRebar") + ": " + units.FromInternational(units.Convert(design.VRebar, Canguro.Model.UnitSystem.Units.Distance, Canguro.Model.UnitSystem.Units.SmallDistance), Canguro.Model.UnitSystem.Units.SmallDistance).ToString("G3") + smallDistance + "2/" + distance;

                }
                else if (sec.ConcreteProperties is Model.Section.ConcreteColumnSectionProps)
                {
                    Model.Results.ConcreteColumnDesign design = model.Results.DesignConcreteColumn[l.Id];

                    ret = "\n";
                    if (!string.IsNullOrEmpty(design.Status) && !design.Status.Equals("No Messages"))
                        ret += design.Status + "\n";
                    if (!string.IsNullOrEmpty(design.ErrMsg))
                        ret += design.ErrMsg + "\n";
                    if (!string.IsNullOrEmpty(design.WarnMsg))
                        ret += design.WarnMsg + "\n";

                    Model.Section.ConcreteColumnSectionProps cProps = (Model.Section.ConcreteColumnSectionProps)sec.ConcreteProperties;
                    float rebarArea = cProps.NumberOfBars * Model.Section.BarSizes.Instance.GetArea(cProps.BarSize);

                    ret += Culture.Get("CanguroViewReportsConcreteColumnDesignWrapperPMMArea") + ": " + units.FromInternational(design.PMMArea, Canguro.Model.UnitSystem.Units.Area).ToString("G3") + area + " (" + (rebarArea / design.PMMArea).ToString("F") + "%)\n";
                    ret += Culture.Get("CanguroViewReportsConcreteColumnDesignWrapperPMMRatio") + ": " + design.PMMRatio + "\n";
                    ret += Culture.Get("CanguroViewReportsConcreteColumnDesignWrapperVMajRebar") + ": " + units.FromInternational(units.Convert(design.VMajRebar, Canguro.Model.UnitSystem.Units.Distance, Canguro.Model.UnitSystem.Units.SmallDistance), Canguro.Model.UnitSystem.Units.SmallDistance).ToString("G3") + smallDistance + "^2/" + distance + "\n";
                    ret += Culture.Get("CanguroViewReportsConcreteColumnDesignWrapperVMinRebar") + ": " + units.FromInternational(units.Convert(design.VMinRebar, Canguro.Model.UnitSystem.Units.Distance, Canguro.Model.UnitSystem.Units.SmallDistance), Canguro.Model.UnitSystem.Units.SmallDistance).ToString("G3") + smallDistance + "^2/" + distance + "\n";
                }
            }

            return ret;
        }