Example #1
0
        /// <summary>
        /// Расчет инсоляции в файле
        /// </summary>
        public void Calc()
        {
            var docIns = InsCompare.GetDocumentOrOpen(calcFile);
            var dbIns  = docIns.Database;

            // Очистка инс объектов
            InsCompare.GetInsObjects(calcFile, a =>
            {
                a.UpgradeOpen();
                a.Erase();
                Debug.WriteLine($"Erase - {a}");
            });

            using (docIns.LockDocument())
                using (var t = dbIns.TransactionManager.StartTransaction())
                {
                    //InsService
                    var insModel = InsModel.LoadIns(docIns);
                    insModel.Tree.IsVisualTreeOn   = true;
                    insModel.Tree.IsVisualIllumsOn = true;
                    insModel.Front.Groups?.ToList().ForEach(g => g.IsVisualFrontOn = true);
                    insModel.Place.Places?.ToList().ForEach(p => p.IsVisualPlaceOn = true);
                    insModel.Place.IsEnableCalc = true;

                    insModel.Update(docIns);

                    // Визуализация на чертеже всех расчетов
                    insModel.Tree.DrawVisuals();
                    insModel.Front.DrawVisuals();
                    insModel.Place.DrawVisuals();

                    t.Commit();
                }
        }
        public void TestInsCompare1()
        {
            CommandStart.Start(doc =>
            {
                file1 = null;
                file2 = null;
                LoadService.LoadEntityFramework();
                LoadService.LoadMDM();

                // Выбор файлов для сравнения
                SelectFile();

                // Расчет инсоляции - file2
                CalcFile();

                var insComparer = new InsCompare(file1, file2);
                insComparer.Compare();
            });
        }