Exemplo n.º 1
0
        private List <ErrorPoint> checker(DrawingArea field)
        {
            List <ErrorPoint> errors = new List <ErrorPoint>();

            var dublicateTableRows = field._rows
                                     .GroupBy(i => i.Position)
                                     .Where(g => g.Count() > 1)
                                     .Select(j => j.First());

            foreach (TableBendingRow r in dublicateTableRows)
            {
                ErrorPoint er = new ErrorPoint(r.IP, "[VIGA] - TABEL - DUBLICATE - " + r.Position);
                errors.Add(er);
            }

            var dublicateBendings = field._bendings
                                    .GroupBy(i => i.Position)
                                    .Where(g => g.Count() > 1)
                                    .Select(j => j.First());

            foreach (BendingShape b in dublicateBendings)
            {
                ErrorPoint er = new ErrorPoint(b.IP, "[VIGA] - PAINUTUS - DUBLICATE - " + b.Position);
                errors.Add(er);
            }

            foreach (TableBendingRow r in field._rows)
            {
                if (r.Count == 0)
                {
                    ErrorPoint er = new ErrorPoint(r.IP, "[VIGA] - TABEL - KOGUS -> 0");
                    errors.Add(er);
                }
            }

            foreach (ReinforcementMark m in field._marks)
            {
                bool found = false;
                foreach (TableBendingRow r in field._rows)
                {
                    if (m.Position == r.Position)
                    {
                        found = true;
                        break;
                    }
                }

                if (found == false)
                {
                    ErrorPoint er = new ErrorPoint(m.IP, "[VIGA] - VIIDE - EI LEIA TABELIST - " + m.Position);
                    errors.Add(er);
                }
            }

            foreach (ReinforcementMark m in field._marks)
            {
                bool found = false;
                foreach (BendingShape b in field._bendings)
                {
                    if (m.Position == b.Position)
                    {
                        found = true;
                        break;
                    }
                }

                if (found == false && m.Shape != "A")
                {
                    ErrorPoint er = new ErrorPoint(m.IP, "[VIGA] - VIIDE - EI LEIA PAINUTUST - " + m.Position);
                    errors.Add(er);
                }
            }

            foreach (ReinforcementMark m in field._marks)
            {
                bool found = false;
                foreach (ReinforcementMark n in field._marks)
                {
                    if (ReferenceEquals(m, n))
                    {
                        continue;
                    }

                    if (m.IP == n.IP)
                    {
                        found = true;
                        break;
                    }
                }

                if (found == true)
                {
                    ErrorPoint er = new ErrorPoint(m.IP, "[VIGA] - VIIDE - TOPELT VIIDE - " + m.Position);
                    if (!errors.Contains(er))
                    {
                        errors.Add(er);
                    }
                }
            }

            foreach (BendingShape b in field._bendings)
            {
                bool found = false;
                foreach (TableBendingRow r in field._rows)
                {
                    if (b.Position == r.Position)
                    {
                        found = true;
                        break;
                    }
                }

                if (found == false)
                {
                    ErrorPoint er = new ErrorPoint(b.IP, "[VIGA] - PAINUTUS - EI LEIA TABELIST - " + b.Position);
                    errors.Add(er);
                }
            }

            foreach (BendingShape b in field._bendings)
            {
                bool found = false;
                foreach (ReinforcementMark m in field._marks)
                {
                    if (b.Position == m.Position)
                    {
                        found = true;
                        break;
                    }
                }

                if (found == false)
                {
                    ErrorPoint er = new ErrorPoint(b.IP, "[VIGA] - PAINUTUS - EI LEIA VIIDET - " + b.Position);
                    errors.Add(er);
                }
            }

            return(errors);
        }
Exemplo n.º 2
0
 internal void addError(ErrorPoint e)
 {
     _errors.Add(e);
 }