コード例 #1
0
        public static WP.Paragraph ReffEccentricityParagraph(Bar bar, float e, float m)
        {
            var p          = new WP.Paragraph();
            var officeMath = new OfficeMath();

            officeMath.Append(
                GenerateRunWithText("m = e ∙ "),
                CreateFraction(
                    new List <OpenXmlElement> {
                GenerateRunWithText("A")
            },
                    new List <OpenXmlElement> {
                GenerateRunWithText("W")
            }),
                GenerateRunWithText($" = {e} ∙ "),
                CreateFraction(
                    new List <OpenXmlElement> {
                GenerateRunWithText($"{bar.Section.Area}")
            },
                    new List <OpenXmlElement> {
                GenerateRunWithText($"{bar.Section.SectionModulusX}")
            }),
                GenerateRunWithText($" = {m}")
                );
            p.AppendChild(officeMath);
            return(p);
        }
コード例 #2
0
        public static WP.Paragraph GenerateParagraphWithAxialTensionFormula(Bar bar, float Ry)
        {
            var p          = new WP.Paragraph();
            var officeMath = new OfficeMath();

            var fractionFormula = CreateFraction(
                new List <OpenXmlElement> {
                GenerateRunWithText("N")
            },
                new List <OpenXmlElement> {
                GenerateRunWithText("A∙"), Index("R", "y")
            });

            var fraction = CreateFraction(
                new List <OpenXmlElement> {
                GenerateRunWithText($"{Math.Abs(bar.ActualForce)}")
            },
                new List <OpenXmlElement> {
                GenerateRunWithText($"{bar.Section.Area}∙{Ry}∙"), Power("10", "2")
            });


            officeMath.Append(
                fractionFormula,
                new Run(new Text(" = ")),
                fraction,
                new Run(new Text($" = {bar.CalcResult} " + (bar.CalcResult <= 1 ? "≤" : ">") + " 1")));
            p.AppendChild(officeMath);
            return(p);
        }
コード例 #3
0
        public static WP.Paragraph EccentricityParagraph(Bar bar, float ecc)
        {
            var p          = new WP.Paragraph();
            var officeMath = new OfficeMath();

            officeMath.Append(
                GenerateRunWithText($"e = "),
                CreateFraction(
                    new List <OpenXmlElement> {
                GenerateRunWithText($"M")
            },
                    new List <OpenXmlElement> {
                GenerateRunWithText($"N")
            }),
                GenerateRunWithText(" = "),
                CreateFraction(
                    new List <OpenXmlElement> {
                GenerateRunWithText($"{bar.ActualMoment}∙ 100")
            },
                    new List <OpenXmlElement> {
                GenerateRunWithText($"{Math.Abs(bar.ActualForce)}")
            }),
                GenerateRunWithText($" = {ecc * 100} cм")
                );
            p.AppendChild(officeMath);
            return(p);
        }
コード例 #4
0
        public static WP.Paragraph LambdaParagraph(Bar bar, float lambda)
        {
            var p          = new WP.Paragraph();
            var officeMath = new OfficeMath();

            officeMath.Append(
                GenerateRunWithText($"λ = "),
                CreateFraction(
                    new List <OpenXmlElement> {
                Index("l", "x"), GenerateRunWithText($"∙"), Index("μ", "x")
            },
                    new List <OpenXmlElement> {
                Index("i", "x")
            }),
                GenerateRunWithText(" = "),
                CreateFraction(
                    new List <OpenXmlElement> {
                GenerateRunWithText($"{bar.Length} ∙ 1")
            },
                    new List <OpenXmlElement> {
                GenerateRunWithText($"{bar.Section.RadiusOfGyrationX} ∙ 10")
            }),
                GenerateRunWithText($" = {lambda}")
                );
            p.AppendChild(officeMath);
            return(p);
        }
コード例 #5
0
        public static WP.Paragraph MefParagraph(float m, float etta, float mef)
        {
            var p          = new WP.Paragraph();
            var officeMath = new OfficeMath();

            officeMath.Append(
                Index("m", "ef"),
                GenerateRunWithText($" = m ∙ η = {m} ∙ {etta} = {mef}"));
            p.AppendChild(officeMath);
            return(p);
        }
コード例 #6
0
        public static WP.Paragraph LambdaRefParagraph(float lambda, float lambdaRef, float Ry, float E)
        {
            var p          = new WP.Paragraph();
            var officeMath = new OfficeMath();

            var bar           = new DocumentFormat.OpenXml.Math.Bar();
            var barProperties = new BarProperties();
            var position      = new Position()
            {
                Val = VerticalJustificationValues.Top
            };

            barProperties.Append(position);

            var bas = new Base(new Run(new Text("λ")));

            bar.Append(barProperties, bas);

            officeMath.Append(
                bar,
                GenerateRunWithText(" = λ ∙ "),
                CreateRadical(
                    CreateFraction(
                        new List <OpenXmlElement> {
                Index("R", "y")
            },
                        new List <OpenXmlElement> {
                GenerateRunWithText("E")
            })),
                GenerateRunWithText($" = {lambda} "),

                CreateRadical(
                    CreateFraction(
                        new List <OpenXmlElement> {
                GenerateRunWithText($"{Ry}")
            },
                        new List <OpenXmlElement> {
                GenerateRunWithText($"{E}")
            })),
                GenerateRunWithText(" = "),
                GenerateRunWithText($" = {lambdaRef}")
                );
            p.AppendChild(officeMath);
            return(p);
        }
コード例 #7
0
        public static WP.Paragraph AreaFractionParagraph(Bar bar, float afaw)
        {
            var p          = new WP.Paragraph();
            var officeMath = new OfficeMath();

            officeMath.Append(
                CreateFraction(
                    new List <OpenXmlElement> {
                Index("A", "f")
            },
                    new List <OpenXmlElement> {
                Index("A", "w")
            }),
                GenerateRunWithText(" = "),

                CreateFraction(
                    new List <OpenXmlElement> {
                Index("b", "f"), GenerateRunWithText(" ∙ "), Index("t", "f")
            },
                    new List <OpenXmlElement> {
                GenerateRunWithText("2 ∙ "), Index("h", "w"), GenerateRunWithText(" ∙ "), Index("t", "w")
            }),
                GenerateRunWithText(" = "),

                CreateFraction(
                    new List <OpenXmlElement> {
                GenerateRunWithText($"{bar.Section.Width} ∙{bar.Section.Thickness}")
            },
                    new List <OpenXmlElement> {
                GenerateRunWithText($"2 ∙ {bar.Section.Height} ∙ {bar.Section.Thickness}")
            }),
                GenerateRunWithText($" = {afaw}")
                );
            p.AppendChild(officeMath);
            return(p);
        }