public void Expect_the_Tx_to_be_removed_from_the_TxTable()
 {
     TxTable.ContainsKey(Stx.GetId()).Should().BeFalse();
 }
 public void Expect_the_TxTable_to_contain_the_Id()
 {
     TxTable.ContainsKey(Ctx.GetId()).Should().BeTrue();
 }
 public void Expect_the_the_transaction_to_be_in_the_TxTable()
 {
     TxTable.ContainsKey(Stx.GetId()).Should().BeTrue();
 }
Ejemplo n.º 4
0
 public void Expect_TxTable_to_be_empty()
 {
     TxTable.ContainsKey(Stx.GetId()).Should().BeFalse();
 }
Ejemplo n.º 5
0
        /// <summary>
        /// 获取参数表,需先绘制梁图
        /// </summary>
        /// <returns></returns>
        public bool GetParamTable(out TxTable tableParam)
        {
            if (!isDrawn)
                throw new Exception("尚未绘图");
            tableParam = TxTable.CreateTable(5, 2);
            tableParam.tb.Cells[0, 0].Value = "板长L";
            tableParam.tb.Cells[1, 0].Value = "板左宽Bl";
            tableParam.tb.Cells[2, 0].Value = "板右宽Br";
            tableParam.tb.Cells[3, 0].Value = "板左夹角θ1";
            tableParam.tb.Cells[4, 0].Value = "板右夹角θ2";

            if (user_curveZX == null || user_cvBoardUp == null || user_cvBoardDn == null || user_pierline1 == null || user_pierline2 == null)
            {
                System.Windows.Forms.MessageBox.Show("未选择线。");
                return false;
            }

            Point3d xPoint1 = AcadAssist.GetIntersectionPoint(user_curveZX, user_pierline1);
            Point3d xPoint2 = AcadAssist.GetIntersectionPoint(user_curveZX, user_pierline2);
            Vector3d vectRotate1 = xPoint1.GetVectorTo(xPoint2);
            double rotate1Angle = AcadAssist.AngleOnPlan(vectRotate1, user_curveZX);

            TxPolyline curveZX2 = AcadAssist.ConvertToTxPolyline(user_curveZX);
            TxPolyline cvBoardUp2 = AcadAssist.ConvertToTxPolyline(user_cvBoardUp);
            TxPolyline cvBoardDn2 = AcadAssist.ConvertToTxPolyline(user_cvBoardDn);
            TxLine pierline12 = (TxLine)user_pierline1.Clone();
            TxLine pierline22 = (TxLine)user_pierline2.Clone();
            curveZX2.Rotation(-rotate1Angle, Vector3d.ZAxis, xPoint1);
            cvBoardUp2.Rotation(-rotate1Angle, Vector3d.ZAxis, xPoint1);
            cvBoardDn2.Rotation(-rotate1Angle, Vector3d.ZAxis, xPoint1);
            pierline12.Rotation(-rotate1Angle, Vector3d.ZAxis, xPoint1);
            pierline22.Rotation(-rotate1Angle, Vector3d.ZAxis, xPoint1);

            List<TxLine> m_storeCLines2 = new List<TxLine>();
            for (int i = 0; i < user_storedCLines.Count; i++)
            {
                m_storeCLines2.Add((TxLine)user_storedCLines[i].Clone());
                m_storeCLines2[i].TransformBy(Matrix3d.Rotation(-rotate1Angle, Vector3d.ZAxis, xPoint1));
            }

            List<TxLine> m_hgbLines2 = new List<TxLine>();
            for (int i = 0; i < user_hgbLines.Count; i++)
            {
                m_hgbLines2.Add((TxLine)user_hgbLines[i].Clone());
                m_hgbLines2[i].TransformBy(Matrix3d.Rotation(-rotate1Angle, Vector3d.ZAxis, xPoint1));
            }

            if (curveZX2.StartPoint.X > curveZX2.EndPoint.X)
                curveZX2 = AcadAssist.ReverseTxPolyline(curveZX2);

            if (cvBoardUp2.StartPoint.X > cvBoardUp2.EndPoint.X)
                cvBoardUp2 = AcadAssist.ReverseTxPolyline(cvBoardUp2);

            if (cvBoardDn2.StartPoint.X > cvBoardDn2.EndPoint.X)
                cvBoardDn2 = AcadAssist.ReverseTxPolyline(cvBoardDn2);

            if (pierline12.StartPoint.Y > pierline12.EndPoint.Y)
                pierline12 = AcadAssist.ReverseTxLine(pierline12);

            if (pierline22.StartPoint.Y > pierline22.EndPoint.Y)
                pierline22 = AcadAssist.ReverseTxLine(pierline22);

            try
            {
                //-------------前面还有个中心线的相交-------不相交有没有处理过,是不是已经延长过了,不记得了;这个是新加上的----------
                List<Point3d> milePoints1 = AcadAssist.GetIntersectionPoints(curveZX2, pierline12);
                List<Point3d> milePoints2 = AcadAssist.GetIntersectionPoints(curveZX2, pierline22);
                if (milePoints1.Count == 0 || milePoints2.Count == 0) System.Windows.Forms.MessageBox.Show("分控线和桥梁边线没有交点");

                //---墩号---
                tableParam.tb.Cells[0, 1].Value = PierLabel1 + "~" + PierLabel2;

                List<TxLine> seamLineUp = new List<TxLine>();
                List<TxLine> seamLineDn = new List<TxLine>();
                for (int i = 0; i < sideLines.Count; i++)
                {
                    if (i % 2 == 0)
                        seamLineDn.Add(sideLines[i]);
                    else
                        seamLineUp.Add(sideLines[i]);
                }

                //梁参数
                for (int i = 0; i < BoxCount; i++)
                {
                    Vector3d vecS = cenLines[i].StartPoint.GetVectorTo(cenLines[i].EndPoint);
                    Vector3d vecEL = endLine1.StartPoint.GetVectorTo(endLine1.EndPoint);
                    Vector3d vecER = endLine2.StartPoint.GetVectorTo(endLine2.EndPoint);
                    double l = vecS.Length;
                    double BL;
                    double BR;

                    if (i == 0)
                    {
                        BL = cvBoardDnx.StartPoint.DistanceTo(seamLineDn[i].StartPoint);
                        BR = cvBoardDnx.EndPoint.DistanceTo(seamLineDn[i].EndPoint);
                    }
                    else if (i == cenLines.Count - 1)
                    {
                        BL = cvBoardUpx.StartPoint.DistanceTo(seamLineUp[i - 1].StartPoint);
                        BR = cvBoardUpx.EndPoint.DistanceTo(seamLineUp[i - 1].EndPoint);
                    }
                    else
                    {
                        BL = seamLineDn[i - 1].StartPoint.DistanceTo(seamLineUp[i].StartPoint);
                        BR = seamLineDn[i - 1].EndPoint.DistanceTo(seamLineUp[i].EndPoint);
                    }

                    double theata1 = 180 - vecS.GetAngleTo(vecEL) / Math.PI * 180;
                    double theata2 = vecS.GetAngleTo(vecER) / Math.PI * 180;
                    double rotate = AcadAssist.AngleOnPlan(cenLines[i].StartPoint.GetVectorTo(cenLines[i].EndPoint), cenLines[i]);
                    tableParam.tb.InsertColumns(tableParam.ColumnCount, 1, 1);//待调整长度
                    tableParam.tb.Cells[0, i + 1].Value = (l * 1000 / m_drawScale).ToString("{0}");
                    tableParam.tb.Cells[1, i + 1].Value = (BL * 1000 / m_drawScale).ToString("{0}");
                    tableParam.tb.Cells[2, i + 1].Value = (BR * 1000 / m_drawScale).ToString("{0}");
                    tableParam.tb.Cells[3, i + 1].Value = (theata1).ToString("{0.0}");
                    tableParam.tb.Cells[4, i + 1].Value = (theata2).ToString("{0.0}");
                }
                //湿接缝参数
                for (int i = 0; i < seamLineUp.Count; i++)
                {
                    double bL = seamLineUp[i].StartPoint.DistanceTo(seamLineDn[i].StartPoint);
                    double bR = seamLineUp[i].EndPoint.DistanceTo(seamLineDn[i].EndPoint);

                    tableParam.tb.InsertColumns(tableParam.ColumnCount, 1, 1);//待调整长度
                    tableParam.tb.Cells[0, BoxCount + i + 1].Value = "--";
                    tableParam.tb.Cells[1, BoxCount + i + 1].Value = (bL * 1000 / m_drawScale).ToString("{0}");
                    tableParam.tb.Cells[2, BoxCount + i + 1].Value = (bR * 1000 / m_drawScale).ToString("{0}");
                    tableParam.tb.Cells[3, BoxCount + i + 1].Value = "--";
                    tableParam.tb.Cells[4, BoxCount + i + 1].Value = "--";
                }
                return true;
            }
            catch
            {
                throw new Exception("获取表格失败");
            }
        }