Esempio n. 1
0
        public ResultShow(List <ResultRow> report)
        {
            InitializeComponent();
            this.report            = report;
            ReportGrid.ItemsSource = report;

            reportInfo       = new PreCheckReportInfo(report);
            SummaryText.Text = reportInfo.GenerateSummary();
        }
Esempio n. 2
0
        /// <summary>
        /// 模型预检查
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void doPreCheck(object sender, DoWorkEventArgs e)
        {
            DateTime before = System.DateTime.Now;



            String modelPath = _parentWindow.GetOpenedModelFileName();

            if (modelPath == null)
            {
                MessageBox.Show("请载入模型文件", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
            String normSelector = GetSelectedNorm();

            if (normSelector.Equals(""))
            {
                MessageBox.Show("请选择规则", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }
            normFilter(normSelector);



            Dispatcher.BeginInvoke(new Action(delegate
            {
                HashSet <string> TargetIfcSet = GenerateIfcFromRules();
                PropertyExtract extractHelper = new PropertyExtract(_parentWindow.Model, _parentWindow.GetContext());


                //通过规则生成中间文件
                IFCFile file = extractHelper.getFilterIfcProperty(TargetIfcSet);
                List <ResultRow> resultRows = new List <ResultRow>();
                foreach (var rule in preRules)
                {
                    resultRows.Add(CheckSingleRule(file, rule));
                }
                showResultForPreCheck(resultRows);

                //生成结果赋值
                result = resultRows;

                //生成总体描述
                PreCheckReportInfo report = new PreCheckReportInfo(resultRows);
                ResultSummary.Text        = report.GenerateSummary();
            }));

            DateTime after = System.DateTime.Now;
            TimeSpan ts    = after.Subtract(before);

            CheckLog.Logger("[precheck时间]" + ts);
        }