Beispiel #1
0
        private void AppendTablesOfRouteInformation(DocX document, EvacuationPlan plan)
        {
            var headerFormat = new Formatting()
            {
                Bold = true, Size = 12
            };
            var normalFormat = new Formatting()
            {
                Bold = false, Size = 12
            };

            foreach (var route in plan.Routes)
            {
                document.InsertParagraph(route.Title).Heading(HeadingType.Heading3);
                var rowsCount = route.Sections.Count - route.Sections.Count(x => x is FloorsConnectionSection) + 1;
                var table     = document.AddTable(rowsCount, 7);

                table.Rows[0].Cells[0].Paragraphs.First().InsertText("Участок", false, headerFormat);
                table.Rows[0].Cells[1].Paragraphs.First().InsertText("Длина, м", false, headerFormat);
                table.Rows[0].Cells[2].Paragraphs.First().InsertText("Ширина, м", false, headerFormat);
                table.Rows[0].Cells[3].Paragraphs.First().InsertText("Площадь, м2", false, headerFormat);
                table.Rows[0].Cells[4].Paragraphs.First().InsertText("Интенсивность движения людского потока, м/мин", false, headerFormat);
                table.Rows[0].Cells[5].Paragraphs.First().InsertText("Скорость движения людского потока, м/мин", false, headerFormat);
                table.Rows[0].Cells[6].Paragraphs.First().InsertText("Время прохождения участка, мин", false, headerFormat);

                var rowIndex = 1;
                foreach (var section in route.Sections)
                {
                    if (section is FloorsConnectionSection)
                    {
                        continue;
                    }
                    table.Rows[rowIndex].Cells[0].Paragraphs.First().InsertText(section.Title, false, normalFormat);
                    table.Rows[rowIndex].Cells[1].Paragraphs.First().InsertText(string.Format("{0}", Math.Round(section.Length, 3)), false, normalFormat);
                    table.Rows[rowIndex].Cells[2].Paragraphs.First().InsertText(string.Format("{0}", Math.Round(section.Width, 3)), false, normalFormat);
                    table.Rows[rowIndex].Cells[4].Paragraphs.First().InsertText(string.Format("{0}", Math.Round(section.IntensityHumanFlow, 3)), false, normalFormat);
                    table.Rows[rowIndex].Cells[5].Paragraphs.First().InsertText(string.Format("{0}", Math.Round(section.MovementSpeed, 3)), false, normalFormat);
                    table.Rows[rowIndex].Cells[6].Paragraphs.First().InsertText(string.Format("{0}", Math.Round(section.MovementTime, 3)), false, normalFormat);
                    rowIndex++;
                }

                document.InsertTable(table);
                document.InsertParagraph(string.Format("Общее время t: {0} ", TimeSpan.FromMinutes(route.MovementTime)), false, headerFormat);
            }
        }
Beispiel #2
0
        public async Task <DocX> CreateDocument(EvacuationPlan plan)
        {
            return(await Task.Factory.StartNew(() =>
            {
                var document = DocX.Create(filename, DocumentTypes.Document);
                var h = document.PageHeight;
                var w = document.PageWidth;


                document.InsertParagraph("Содержание").FontSize(15d).Bold().SpacingAfter(50d).Alignment = Alignment.center;
                document.InsertTableOfContents(null, TableOfContentsSwitches.O | TableOfContentsSwitches.U | TableOfContentsSwitches.Z | TableOfContentsSwitches.H, "Normal", 2);

                AddPageBreak(document);

                document.InsertParagraph("Наименование использованной методики").SpacingBefore(0d).Heading(HeadingType.Heading1);
                var contextMethodologies = @"Для определения расчетных величин пожарного риска на объекте защиты использована «Методика определения расчетных величин пожарного риска на производственных объектах», утвержденная приказом МЧС РФ № 404 от 10.07.2009 г";
                document.InsertParagraph(contextMethodologies).SpacingBefore(10d).Alignment = Alignment.both;

                AddPageBreak(document);

                document.InsertParagraph("Описание объекта защиты, в отношении которого проводилась оценка пожарного риска").SpacingBefore(0d).Heading(HeadingType.Heading1);
                AppendDescriptionPlan(document, plan);

                AddPageBreak(document);

                document.InsertParagraph("Результаты проведения расчетов по оценке пожарного риска").SpacingBefore(0d).Heading(HeadingType.Heading1);
                document.InsertParagraph("Результат определения расчетного времени эвакуации").SpacingBefore(10d).Heading(HeadingType.Heading2);
                AppendTablesOfRouteInformation(document, plan);
                AddPageBreak(document);

                document.InsertParagraph("Результат расчета индивидуального пожарного риска в здании").SpacingBefore(0d).Heading(HeadingType.Heading2);
                AppendResultFireRiskInformation(document);

                AddPageBreak(document);

                document.InsertParagraph("Перечень исходных данных и используемых справочных источников информации").SpacingBefore(0d).Heading(HeadingType.Heading1);
                AppendListOfInitialData(document);

                AddPageBreak(document);

                AppendConclusion(document, plan);
                return document;
            }));
        }
Beispiel #3
0
        private void AppendConclusion(DocX document, EvacuationPlan plan)
        {
            var paragraph1 = document.InsertParagraph();

            paragraph1.Append("Эвакуационные пути на проектируемом участке ");
            paragraph1.Append(plan.Param ? "обеспечивают" : "не обеспечивают").Bold();
            paragraph1.Append(" безопасную эвакуацию людей. Для обоснования проектных решений по обеспечению безопасности людей при возникновении пожара выполнены расчеты необходимого времени эвакуации. Интервал времени от момента обнаружения пожара до завершения процесса эвакуации людей не превышает необходимого времени эвакуации людей при пожаре");

            var paragraph2 = document.InsertParagraph();

            paragraph2.Append("Величина индивидуального пожарного риска в проектируемом пожарном отсеке здания составляет ");
            paragraph2.Append(plan.FireRiskValue.ToString("F8")).Bold();
            paragraph2.Append(" год-1/чел., что ");
            paragraph2.Append(plan.Param ? "не превышает" : "превышает").Bold();
            paragraph2.Append(" одной миллионной в год и соответствует требованиям части 1 статьи 93 федерального закона Российской Федерации от 22 июля 2008 г. №123-ФЗ «Технический регламент о требованиях пожарной безопасности»");

            paragraph1.Alignment = Alignment.both;
            paragraph2.Alignment = Alignment.both;
        }
Beispiel #4
0
        private void AppendDescriptionPlan(DocX document, EvacuationPlan plan)
        {
            foreach (var floor in plan.ParentBuilding.Floors)
            {
                System.Windows.Application.Current.Dispatcher.Invoke(() =>
                {
                    var planImage = floor.GetEvacuationPlanImage();

                    using (var ms = new MemoryStream(SettingsManager.GetBytesFromBitmap(planImage.BitmapValue)))
                    {
                        // double width = 0.9 * document.PageWidth;
                        double width  = 672;
                        double height = planImage.Height * width / planImage.Width;

                        var image   = document.AddImage(ms);
                        var picture = image.CreatePicture((int)height, (int)width);

                        var paragraph = document.InsertParagraph(string.Format("Схема эвакуации '{0}'", floor.Title), false);
                        paragraph.InsertPicture(picture, 0); // Insert picture into paragraph.
                    }
                });
            }
        }