Exemplo n.º 1
0
        private void menuGetReport_Click(object sender, RoutedEventArgs e)
        {
            if (listSections.dataGrid.Items.Count > 0)
            {
                ItemCollection sections = listSections.dataGrid.Items;
                LaTeX.LateX    newLat   = new LaTeX.LateX();
                newLat.StartDocument();

                newLat.AddSection("Model");
                LaTeX.Tabular loads = new LaTeX.Tabular();
                loads.Columns.ColumnStyle.Alignment = LaTeX.Style.HorizontalAlignment.Left;
                loads.DenseOfVertical(Model, true);
                newLat.Add(loads);

                LaTeX.Figure modelFig = new LaTeX.Figure();
                modelFig.Graphic.Path     = "C:/Users/ismailk/Documents/Visual Studio 2015/Projects/Hendese/Hendese/Icons";
                modelFig.Graphic.FileName = Model.GetType().Name.Split('.').Last() + ".png";
                modelFig.Caption          = "Model Çizimi";
                newLat.Add(modelFig);

                newLat.AddSection("Sections");
                LaTeX.Tabular newTabular = new LaTeX.Tabular();
                newTabular.Columns.Add("Name");
                newTabular.Columns.Add("A").CellType   = LaTeX.CellTypes.Double;
                newTabular.Columns["A"].Floating       = 2;
                newTabular.Columns.Add("I22").CellType = LaTeX.CellTypes.Double;
                newTabular.Columns["I22"].Floating     = 2;
                newTabular.Columns.Add("I33").CellType = LaTeX.CellTypes.Double;
                newTabular.Columns["I33"].Floating     = 2;
                newTabular.Columns.Add("W22").CellType = LaTeX.CellTypes.Double;
                newTabular.Columns["W22"].Floating     = 2;
                newTabular.Columns.Add("W33").CellType = LaTeX.CellTypes.Double;
                newTabular.Columns["W33"].Floating     = 2;
                newTabular.DenseOfObjects(sections);

                newTabular.Columns[0].Style.Alignment = LaTeX.Style.HorizontalAlignment.Left;

                newTabular.Columns.Add("IRatio");
                newTabular.Columns.Add("WRatio");
                int i = 0;
                foreach (SectionBase section in sections)
                {
                    newTabular[i, "IRatio"].Value = ((double)Model.parameters[0] / section.I33).ToString("0.00");
                    newTabular[i, "WRatio"].Value = ((double)Model.parameters[1] / section.W33).ToString("0.00");
                    i++;
                }

                //newTabular["IRatio"] = ((double)Model.parameters[0]) / newTabular["I33"];
                newLat.Add(newTabular);

                newLat.EndDocument();
                newLat.Execute("result", true);
            }
            else
            {
                MessageBox.Show("Uygun kesit bulunamadı.");
            }
        }
Exemplo n.º 2
0
        private void btnReport_Click(object sender, RoutedEventArgs e)
        {
            LaTeX.LateX newLat = new LaTeX.LateX();
            newLat.StartDocument();

            newLat.AddHeading("Yükleme", LaTeX.HeadingStyles.H3);

            LaTeX.Tabular loading = new LaTeX.Tabular();
            loading.DenseOfVertical(this.Force, true);
            newLat.Add(loading);

            newLat.AddHeading("Kesit Boyutları", LaTeX.HeadingStyles.H3);

            LaTeX.Tabular section = new LaTeX.Tabular();
            section.DenseOfVertical(this.Section, true);
            newLat.Add(section);

            newLat.AddHeading("Kesit Özellikleri", LaTeX.HeadingStyles.H3);

            LaTeX.Tabular sectionProps = new LaTeX.Tabular();
            sectionProps.Columns.Add("A").CellType   = LaTeX.CellTypes.Double;
            sectionProps.Columns["A"].Header         = "Alan {[}$cm^2${]}";
            sectionProps.Columns["A"].Floating       = 2;
            sectionProps.Columns.Add("I33").CellType = LaTeX.CellTypes.Double;
            sectionProps.Columns["I33"].Header       = "I33 {[}$cm^4${]}";
            sectionProps.Columns["I33"].Floating     = 2;
            sectionProps.Columns.Add("I22").CellType = LaTeX.CellTypes.Double;
            sectionProps.Columns["I22"].Header       = "I22 {[}$cm^4${]}";
            sectionProps.Columns["I22"].Floating     = 2;
            sectionProps.Columns.Add("W33").CellType = LaTeX.CellTypes.Double;
            sectionProps.Columns["W33"].Header       = "W33 {[}$cm^3${]}";
            sectionProps.Columns["W33"].Floating     = 2;
            sectionProps.Columns.Add("W22").CellType = LaTeX.CellTypes.Double;
            sectionProps.Columns["W22"].Header       = "W22 {[}$cm^3${]}";
            sectionProps.Columns["W22"].Floating     = 2;
            sectionProps.Rows.Add(Section.A, Section.I33, Section.I22, Section.W33, Section.W22);
            newLat.Add(sectionProps);

            newLat.AddHeading("Kesit Allowable Strengths(ASD)", LaTeX.HeadingStyles.H3);
            LaTeX.Tabular asdStrengths = new LaTeX.Tabular();
            asdStrengths.HasHeader = false;
            asdStrengths.AddColumns(2);
            asdStrengths.Columns.ColumnStyle = new LaTeX.Style.ColumnStyle {
                Alignment = LaTeX.Style.HorizontalAlignment.Left
            };
            asdStrengths.Rows.Add("Güçlü Eksen Moment", Design.Mc);
            asdStrengths.Rows.Add("Kesme", Design.Vc);
            asdStrengths.Rows.Add("Çekme", Design.Ptc);
            asdStrengths.Rows.Add("Basınç", Design.Pc);
            asdStrengths.Rows.Add("Zayıf Eksen Moment", Design.Mcy);
            newLat.Add(asdStrengths);

            newLat.EndDocument();
            newLat.Execute("sonuc", true);
        }