Beispiel #1
0
        public static A_Raud mergeTwoRebar(A_Raud one, A_Raud two)
        {
            G.Line a        = one.makeLine();
            G.Line b        = two.makeLine();
            G.Line new_line = G.Line.merge(a, b);

            A_Raud raud = new A_Raud(new_line, one.Number, one.Diameter, one.Materjal);

            return(raud);
        }
Beispiel #2
0
 public bool Equals(A_Raud other)
 {
     if (other == null)
     {
         return(false);
     }
     return(this.A == other.A &&
            this.Diameter == other.Diameter &&
            this.Materjal == other.Materjal);
 }
        private bool A_handler_replace(R.A_Raud a, R.A_Raud b)
        {
            R.A_Raud new_reinf = R.A_Raud.mergeTwoRebar(a, b);
            if (denier(new_reinf.makeLine()))
            {
                return(false);
            }
            keep_replace(new_reinf, a, b);

            return(true);
        }
Beispiel #4
0
        public void A_Raud_class_test()
        {
            G.Point start = new G.Point(0.0, 0.0);
            G.Point end   = new G.Point(10.0, 0.0);
            G.Line  line  = new G.Line(start, end);

            R.A_Raud reinf = new R.A_Raud(line, 2, 8, "B500B");

            Assert.IsTrue(reinf is R.Raud);
            Assert.IsTrue(reinf is R.A_Raud);
        }
        //DEBUG
        private bool A_handler_debug(G.Point mainPoint, G.Point mainEnd)
        {
            G.Line main = new G.Line(mainPoint, mainEnd);

            reinf_geometry_debug.Add(main);

            R.A_Raud reinf = new R.A_Raud(main, _V_.X_REINFORCEMENT_NUMBER, _V_.X_REINFORCEMENT_MAIN_DIAMETER, _V_.X_REINFORCEMENT_MARK);
            keep(reinf, null, null, null);

            return(true);
        }
Beispiel #6
0
        private void remove_short_A()
        {
            List <R.Raud> onlyA = knownReinforcement.Where(x => x is R.A_Raud).ToList();

            for (int i = onlyA.Count - 1; i >= 0; i--)
            {
                R.A_Raud a = knownReinforcement[i] as R.A_Raud;

                if (a.Length < _V_.X_REINFORCEMENT_REMOVE_A_LENGTH)
                {
                    A_remover(a);
                }
            }
        }
        //A HANDLE
        public bool A_handler(G.Point mainPoint, G.Point mainEnd, G.Edge e, G.Corner c, int d)
        {
            G.Line main = new G.Line(mainPoint, mainEnd);
            //Debugerrint(main.ToString());
            //reinf_geometry_debug.Add(main);

            R.A_Raud reinf = new R.A_Raud(main, _V_.X_REINFORCEMENT_NUMBER, d, _V_.X_REINFORCEMENT_MARK);
            if (denier(reinf.makeLine()))
            {
                return(false);
            }
            keep(reinf, e, c, null);

            return(true);
        }
Beispiel #8
0
        public void A_Raud_Init_test3()
        {
            G.Point start = new G.Point(10.0, 10.0);
            G.Point end   = new G.Point(0.0, 0.0);
            G.Line  line  = new G.Line(start, end);

            R.A_Raud reinf = new R.A_Raud(line, 2, 8, "B500B");

            Assert.AreEqual(reinf.StartPoint.X, 8.535533, 0.001);
            Assert.AreEqual(reinf.StartPoint.Y, 8.535533, 0.001);
            Assert.AreEqual(reinf.Rotation, Math.PI + Math.PI / 4, 0.001);

            Assert.AreEqual(reinf.A, 10, 0.001);      // ROUNDED

            Assert.AreEqual(reinf.Length, 10, 0.001); // ROUNDED
            Assert.AreEqual(reinf.Diameter, 8, 0.001);
            Assert.AreEqual(reinf.Materjal, "B500B");
        }
Beispiel #9
0
        public void A_Raud_Init_test0()
        {
            G.Point start = new G.Point(100.0, 100.0);
            G.Point end   = new G.Point(-2100.0, 2100.0);
            G.Line  line  = new G.Line(start, end);

            R.A_Raud reinf = new R.A_Raud(line, 2, 8, "B500B");

            Assert.AreEqual(reinf.StartPoint.X, 98.8110, 0.001);
            Assert.AreEqual(reinf.StartPoint.Y, 101.0809, 0.001);
            Assert.AreEqual(reinf.Rotation, 2.4037, 0.001);

            Assert.AreEqual(reinf.A, 2970, 0.001);      // ROUNDED

            Assert.AreEqual(reinf.Length, 2970, 0.001); // ROUNDED
            Assert.AreEqual(reinf.Diameter, 8, 0.001);
            Assert.AreEqual(reinf.Materjal, "B500B");
        }
        private bool AB_handler_replace_main(R.A_Raud a, R.B_Raud b)
        {
            G.Line t1 = a.makeLine();
            G.Line t2 = b.makeMainLine();
            G.Line t3 = b.makeSideLine();

            G.Line new_a_line = new G.Line(b.IP, a.EndPoint);

            G.Point new_b_side_point = t3.Start.move(_V_.Y_CONCRETE_COVER_DELTA, (-1) * t3.getDirectionVector());
            G.Point new_b_start      = t3.End.move(_V_.Y_CONCRETE_COVER_DELTA, (-1) * t3.getDirectionVector());

            G.Point new_b_end = new_b_start.move(_V_.X_REINFORCEMENT_MAIN_ANCHOR_LENGTH, t2.getDirectionVector());

            G.Line new_b_side_line = new G.Line(new_b_side_point, new_b_start);
            G.Line new_b_main_line = new G.Line(new_b_start, new_b_end);

            R.A_Raud new_A = new R.A_Raud(new_a_line, a.Number, a.Diameter, a.Materjal);
            R.B_Raud new_B = new R.B_Raud(new_b_main_line, new_b_side_line, b.Number, b.Diameter, b.Materjal);

            if (denier(new_A.makeLine()))
            {
                return(false);
            }
            if (denier(new_B.makeSideLine()))
            {
                return(false);
            }
            if (denier(new_B.makeMainLine()))
            {
                return(false);
            }

            keep_replace(new_A, new_B, a, b);

            return(true);
        }
Beispiel #11
0
        private void setBendingBlockParameters(_Db.AttributeReference ar, R.Raud _ALFA_)
        {
            if (ar != null)
            {
                if (ar.Tag == "Teraseklass")
                {
                    ar.TextString = _ALFA_.Materjal.ToString();
                }
                if (ar.Tag == "Positsioon")
                {
                    ar.TextString = _ALFA_.ToStringNoCount();
                }

                if (_ALFA_ is R.A_Raud)
                {
                    R.A_Raud _BETA_ = _ALFA_ as R.A_Raud;
                    if (ar.Tag == "A")
                    {
                        ar.TextString = _BETA_.A.ToString();
                    }
                }

                if (_ALFA_ is R.B_Raud)
                {
                    R.B_Raud _BETA_ = _ALFA_ as R.B_Raud;
                    if (ar.Tag == "A")
                    {
                        ar.TextString = _BETA_.A.ToString();
                    }
                    else if (ar.Tag == "B")
                    {
                        ar.TextString = _BETA_.B.ToString();
                    }
                }

                if (_ALFA_ is R.C_Raud)
                {
                    R.C_Raud _BETA_ = _ALFA_ as R.C_Raud;
                    if (ar.Tag == "A")
                    {
                        ar.TextString = _BETA_.A.ToString();
                    }
                    else if (ar.Tag == "B")
                    {
                        ar.TextString = _BETA_.B.ToString();
                    }
                    else if (ar.Tag == "U")
                    {
                        ar.TextString = ((int)Math.Round(G.Converter.ToDeg(_BETA_.U), 0)).ToString();
                    }
                }

                if (_ALFA_ is R.D_Raud)
                {
                    R.D_Raud _BETA_ = _ALFA_ as R.D_Raud;
                    if (ar.Tag == "A")
                    {
                        ar.TextString = _BETA_.A.ToString();
                    }
                    else if (ar.Tag == "B")
                    {
                        ar.TextString = _BETA_.B2.ToString(); // parand magic
                    }
                    else if (ar.Tag == "C")
                    {
                        ar.TextString = _BETA_.C.ToString();
                    }
                }

                if (_ALFA_ is R.E_Raud)
                {
                    R.E_Raud _BETA_ = _ALFA_ as R.E_Raud;
                    if (ar.Tag == "A")
                    {
                        ar.TextString = _BETA_.A.ToString();
                    }
                    else if (ar.Tag == "B")
                    {
                        ar.TextString = _BETA_.B2.ToString(); // parand magic
                    }
                    else if (ar.Tag == "C")
                    {
                        ar.TextString = _BETA_.C.ToString();
                    }
                    else if (ar.Tag == "U")
                    {
                        ar.TextString = ((int)Math.Round(G.Converter.ToDeg(_BETA_.U), 0)).ToString();
                    }
                    else if (ar.Tag == "V")
                    {
                        ar.TextString = ((int)Math.Round(G.Converter.ToDeg(_BETA_.V), 0)).ToString();
                    }
                    else if (ar.Tag == "X")
                    {
                        ar.TextString = ((int)_BETA_.X).ToString();
                    }
                    else if (ar.Tag == "Y")
                    {
                        ar.TextString = ((int)_BETA_.Y).ToString();
                    }
                }

                if (_ALFA_ is R.U_Raud)
                {
                    R.U_Raud _BETA_ = _ALFA_ as R.U_Raud;
                    if (ar.Tag == "A")
                    {
                        ar.TextString = _BETA_.A.ToString();
                    }
                    else if (ar.Tag == "B")
                    {
                        ar.TextString = _BETA_.B.ToString();
                    }
                    else if (ar.Tag == "C")
                    {
                        ar.TextString = _BETA_.C.ToString();
                    }
                }
            }
        }
Beispiel #12
0
        private void setReinforcementBlockParameters(_Db.BlockReference newBlockReference, R.Raud _ALFA_)
        {
            _Db.DynamicBlockReferencePropertyCollection aa = newBlockReference.DynamicBlockReferencePropertyCollection;
            foreach (_Db.DynamicBlockReferenceProperty a in aa)
            {
                if (a != null)
                {
                    if (_ALFA_ is R.A_Raud)
                    {
                        R.A_Raud _BETA_ = _ALFA_ as R.A_Raud;
                        if (a.PropertyName == "A")
                        {
                            a.Value = _BETA_.A;
                        }
                    }

                    else if (_ALFA_ is R.B_Raud)
                    {
                        R.B_Raud _BETA_ = _ALFA_ as R.B_Raud;
                        if (a.PropertyName == "A")
                        {
                            a.Value = _BETA_.A;
                        }
                        else if (a.PropertyName == "B")
                        {
                            a.Value = _BETA_.B;
                        }
                    }

                    else if (_ALFA_ is R.C_Raud)
                    {
                        R.C_Raud _BETA_ = _ALFA_ as R.C_Raud;
                        if (a.PropertyName == "A")
                        {
                            a.Value = _BETA_.A;
                        }
                        else if (a.PropertyName == "B")
                        {
                            a.Value = _BETA_.B;
                        }
                        else if (a.PropertyName == "U")
                        {
                            a.Value = Math.PI - _BETA_.U;                             // HERE
                        }
                    }

                    else if (_ALFA_ is R.D_Raud)
                    {
                        R.D_Raud _BETA_ = _ALFA_ as R.D_Raud;
                        if (a.PropertyName == "A")
                        {
                            a.Value = _BETA_.A;
                        }
                        else if (a.PropertyName == "B")
                        {
                            a.Value = _BETA_.B;
                        }
                        else if (a.PropertyName == "C")
                        {
                            a.Value = _BETA_.C;
                        }

                        else if (a.PropertyName == "A/C")
                        {
                            a.Value = _BETA_.A;
                        }
                    }

                    else if (_ALFA_ is R.E_Raud)
                    {
                        R.E_Raud _BETA_ = _ALFA_ as R.E_Raud;

                        if (a.PropertyName == "A")
                        {
                            a.Value = _BETA_.A;
                        }
                        else if (a.PropertyName == "B")
                        {
                            a.Value = _BETA_.B;
                        }
                        else if (a.PropertyName == "C")
                        {
                            a.Value = _BETA_.C;
                        }
                        else if (a.PropertyName == "U")
                        {
                            a.Value = Math.PI - _BETA_.U;                             // HERE
                        }
                        else if (a.PropertyName == "V")
                        {
                            if (_BETA_.B > 6000)
                            {
                                a.Value = _BETA_.V + Math.PI;
                            }
                            else
                            {
                                a.Value = _BETA_.V;
                            }
                        }
                        else if (a.PropertyName == "X")
                        {
                            a.Value = _BETA_.X;
                        }
                        else if (a.PropertyName == "Y")
                        {
                            a.Value = _BETA_.Y;
                        }
                    }
                    else if (_ALFA_ is R.U_Raud)
                    {
                        R.U_Raud _BETA_ = _ALFA_ as R.U_Raud;
                        if (a.PropertyName == "A")
                        {
                            a.Value = _BETA_.A;
                        }
                        else if (a.PropertyName == "B")
                        {
                            a.Value = _BETA_.B;
                        }
                        else if (a.PropertyName == "C")
                        {
                            a.Value = _BETA_.C;
                        }
                    }
                }
            }
        }
 private void A_remover(R.A_Raud a)
 {
     keep_remove(a);
 }