Beispiel #1
0
        /// <summary>
        /// 计算节点相交处相应单元的轴力向量
        /// </summary>
        /// <param name="node">节点号</param>
        /// <param name="ele">单元号(必须为FrameElement)</param>
        /// <param name="com">荷载组合</param>
        /// <returns>轴力向量</returns>
        public Vector3 GetNodeForceVec(int node, int ele, BLoadComb com)
        {
            Vector3      Res = new Vector3();
            FrameElement fme = MM.elements[ele] as FrameElement;

            //如果节点不在单元上则返回0向量
            if (fme.iNs.Contains(node) == false)
            {
                return(new Vector3());
            }
            ElemForce Force = MM.CalElemForceComb(com, ele);

            if (fme.I == node)
            {
                Res = MM.getFrameVec(ele);
                Res.Normalize();//归一化
                Res = Res * Force.Force_i.N;
            }
            else
            {
                Res = -MM.getFrameVec(ele);
                Res.Normalize();//归一化
                Res = Res * Force.Force_j.N;
            }
            return(Res);
        }
Beispiel #2
0
        private void 显示单元设计参数ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            List <int> eles = SelectCollection.StringToList(this.cb_selectEle.Text);

            MidasGenModel.model.Bmodel cm;
            //如果单元选择数为0,作出提示
            if (eles.Count == 0)
            {
                MessageTool.Tb_out.AppendText(Environment.NewLine + "*Error*:未选择单元!");
                return;
            }
            if (!this.HasToolWindow(_modelKey))
            {
                MessageBox.Show("请先新建模型", "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            else
            {
                cm = ModelForm.CurModel;
            }
            foreach (int ele in eles)
            {
                FrameElement cele = cm.elements[ele] as FrameElement;
                string       outs = string.Format("++++++单元号:{0}++++++", ele);
                MessageTool.Tb_out.AppendText(Environment.NewLine + outs);
                MessageTool.Tb_out.AppendText(Environment.NewLine + cele.DPs.ToString());
            }
        }
Beispiel #3
0
 private void 测试用命令ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     #region 测试荷载组合功能
     List <int> eles = SelectCollection.StringToList(this.cb_selectEle.Text);
     MidasGenModel.model.Bmodel cm;
     //如果单元选择数为0,作出提示
     if (eles.Count == 0)
     {
         MessageTool.Tb_out.AppendText(Environment.NewLine + "*Error*:未选择单元!");
         return;
     }
     if (!this.HasToolWindow(_modelKey))
     {
         MessageBox.Show("请先新建模型", "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
         return;
     }
     else
     {
         cm = ModelForm.CurModel;
     }
     string    com   = "SRSS3";//组合名
     BLoadComb myCom = cm.LoadCombTable.getLoadComb(LCKind.STEEL, com);
     foreach (int ele in eles)
     {
         FrameElement cele = cm.elements[ele] as FrameElement;
         string       outs = string.Format("++++++单元号:{0}  组合:{1}++++++", ele, com);
         MessageTool.Tb_out.AppendText(Environment.NewLine);
         MessageTool.Tb_out.AppendText(outs);
         ElemForce EFcom = cm.CalElemForceComb(myCom, ele);
         MessageTool.Tb_out.AppendText(Environment.NewLine + "[i]--" + EFcom.Force_i.ToString());
         MessageTool.Tb_out.AppendText(Environment.NewLine + "[4/8]--" + EFcom.Force_48.ToString());
         MessageTool.Tb_out.AppendText(Environment.NewLine + "[j]--" + EFcom.Force_j.ToString());
     }
     #endregion
 }
Beispiel #4
0
        /// <summary>
        /// Adds an individual frame element of the graph tree to the current graph vertex collections as a series of vertices
        /// </summary>
        /// <param name="element">the element to add to the canvas vertex data</param>
        public void AddFrameElement(FrameElement element)
        {
            //Add the vertex to the graphs
            DataVolume.VertexData.Add(new Vector2(element.Offset, element.TotalData));
            PacketCount.VertexData.Add(new Vector2(element.Offset, element.TotalPackets));

            for (int k = 0; k < MatchingCount.Count; k++)
            {
                MatchingCount[k].VertexData.Add(new Vector2(element.Offset, element.FilterCounts[k]));
            }

            //update the graph scale object to reflect the new vertices
            ScaleData.Update(element.TotalPackets, element.TotalData, element.FilterCounts);

            //Add axis zeros. These are necessary for filled graphs, and are skipped over when drawing line graphs.
            //This allows graph types to be swapped by simply modifying the shader attributes of the vertex buffer.
            //Shader attributes are automatically adjusted when the graph type attribute is changed.
            DataVolume.VertexData.Add(new Vector2(element.Offset, 0));
            PacketCount.VertexData.Add(new Vector2(element.Offset, 0));

            for (int k = 0; k < MatchingCount.Count; k++)
            {
                MatchingCount[k].VertexData.Add(new Vector2(element.Offset, 0));
            }
        }
Beispiel #5
0
        public static void Initialise(ViewFormSetup setup, ViewForm ui)
        {
            //DateTime begin = DateTime.Now;
            Size viewportSize = ui.ViewPortSize;

            SimpleShader2D = new SimpleShader2D();
            ControlWidth   = viewportSize.Width;
            ControlHeight  = viewportSize.Height;
            BorderSize     = 20;
            TickSize       = 10;
            TextSize       = 100;
            SetViewportTransfrom();

            GL.MatrixMode(MatrixMode.Projection);
            GL.LoadIdentity();
            _projection = Matrix4.CreateOrthographicOffCenter(-1, 1, -1, 1, -10, 10);
            //0, _graph.Bounds.X, 0, _graph.Bounds.Y, -10, 10);
            GL.MultMatrix(ref _projection);

            ServerSocket = new ServerSocket(setup.Socket);
            FileManager  = new FileManager(setup.Project);

            Initialised = true;
            int filterCount = setup.Project.FilterFiles.Count;

            TimeTree = new TimeFrameTree(FileManager, filterCount);
            TimeTree.Fill();

            FrameElement tmp = TimeTree;

            while (tmp.Children.Count == 1 && tmp.Level != FrameNodeLevel.Minute)
            {
                tmp = tmp.Children[0];
                tmp.Fill();
            }

            MajorTickDepth = (FrameNodeLevel)(((int)tmp.Level) + 1);
            if ((int)MajorTickDepth >= (int)FrameNodeLevel.Minute)
            {
                RenderUnit = FrameNodeLevel.Second;
            }
            else if ((int)MajorTickDepth <= (int)FrameNodeLevel.Month)
            {
                RenderUnit = (FrameNodeLevel)(((int)MajorTickDepth) + 2);
            }
            else
            {
                RenderUnit = (FrameNodeLevel)(((int)MajorTickDepth) + 1);
            }

            var start = TimeTree.StartTime;
            var end   = TimeTree.EndTime;

            //CurrentCanvasData = TimeTree.GetCanvasData(new DateTime(start.Year, start.Month, 1), new DateTime(start.Year, start.Month + 1, 1), FrameNodeLevel.Day, FrameNodeLevel.Month);
            CurrentCanvasData = TimeTree.GetCanvasData(start, end, RenderUnit, FrameNodeLevel.Root);

            // TimeSpan total = DateTime.Now.Subtract(begin);
            // MessageBox.Show("Setup Time (ms): " + total.TotalMilliseconds);
        }
Beispiel #6
0
        /// <summary>
        /// 按单元更新截面设计参数
        /// </summary>
        /// <param name="iEle">单元号</param>
        public void UpdataDesignPara(int iEle)
        {
            Bmodel   MM = CurModel;
            CheckRes CR = CheckTable;

            int         num      = iEle;//单元号
            double      len_y    = Convert.ToDouble(tb_leng1.Text);
            double      len_z    = Convert.ToDouble(tb_leng2.Text);
            double      Net_r    = Convert.ToDouble(tb_Net_r.Text);
            double      Gamma_y  = Convert.ToDouble(tb_gamma1.Text);
            double      Gamma_z  = Convert.ToDouble(tb_gamma2.Text);
            double      Betla_my = Convert.ToDouble(tb_betla1.Text);
            double      Betal_mz = Convert.ToDouble(tb_betla2.Text);
            double      Betal_ty = Convert.ToDouble(tb_betla3.Text);
            double      Betal_tz = Convert.ToDouble(tb_betla4.Text);
            double      Phi_by   = Convert.ToDouble(tb_phibx.Text);
            double      Phi_bz   = Convert.ToDouble(tb_phiby.Text);
            double      F        = Convert.ToDouble(tb_f.Text);       //强度设计值
            double      Gamma_re = Convert.ToDouble(tb_GammaRe.Text); //承载力调整系数
            double      Xita     = Convert.ToDouble(tb_Xita.Text);    //截面影响系数
            SecCategory cat      = SecCategory.b;

            switch (comboBox1.SelectedIndex)
            {
            case 0: cat = SecCategory.a; break;

            case 1: cat = SecCategory.b; break;

            case 2: cat = SecCategory.c; break;

            case 3: cat = SecCategory.d; break;

            default: break;
            }


            //更新其它参数
            FrameElement fele = CurModel.elements[num] as FrameElement;

            fele.DPs.SecCat_y   = cat;//截面类别
            fele.DPs.SecCat_z   = cat;
            fele.DPs.Ratio_Anet = Net_r;
            fele.DPs.Gamma_y    = Gamma_y;
            fele.DPs.Gamma_z    = Gamma_z;
            fele.DPs.Belta_my   = Betla_my;
            fele.DPs.Belta_mz   = Betal_mz;
            fele.DPs.Belta_ty   = Betal_ty;
            fele.DPs.Belta_tz   = Betal_tz;
            fele.DPs.fy         = F;//强度设计值
            fele.DPs.Gamma_re_1 = Gamma_re;
            fele.DPs.Gamma_re_2 = Gamma_re;
            fele.DPs.Yita       = Xita;//截面影响系数

            //更新长细比
            CodeCheck.CalDesignPara_lemda(ref MM, num, len_y, len_z);
            //更新受压稳定系数
            CodeCheck.CalDesignPara_phi(ref MM, num, 1);
            CodeCheck.CalDesignPara_phi(ref MM, num, 2);
        }
Beispiel #7
0
        private static void ConvertJointFrame(JointFrame jfDest, string jointName, FrameElement srcFrame)
        {
            Matrix3D matrix;

            switch (jointName)
            {
                case "hip":
                    matrix = jfDest.Matrix;
                    JointFrame jfRoot = srcFrame.GetJointFrame("root");
                    Matrix3D rootMatrix = jfRoot.Matrix;
                    rootMatrix.OffsetX *= 4;
                    rootMatrix.OffsetY *= 4;
                    rootMatrix.OffsetZ *= 4;
                    rootMatrix.OffsetY += 12;
                    matrix.Append(rootMatrix);
                    jfDest.Matrix = matrix;
                    break;
                case "abdomen":
                    matrix = jfDest.Matrix;
                    JointFrame jfLower = srcFrame.GetJointFrame("lower_body");
                    Matrix3D lowerMatrix = jfLower.Matrix;
                    lowerMatrix.Invert();
                    matrix.Append(lowerMatrix);
                    jfDest.Matrix = matrix;
                    break;
                case "chest":
                    matrix = jfDest.Matrix;
                    //JointFrame jfUpper = srcFrame.GetJointFrame("upper_body");
                    //Matrix3D upperMatrix = jfUpper.Matrix;
                    //matrix.Append(upperMatrix);
                    jfDest.Matrix = matrix;
                    break;
                case "lShldr":
                    matrix = jfDest.Matrix;
                    matrix.RotatePrepend(new Quaternion(new Vector3D(0, 0, 1), -35));
                    jfDest.Matrix = matrix;
                    break;
                case "lForeArm":
                case "lHand":
                    matrix = jfDest.Matrix;
                    matrix.RotatePrepend(new Quaternion(new Vector3D(0, 0, 1), -35));
                    matrix.Rotate(new Quaternion(new Vector3D(0, 0, 1), 35));
                    jfDest.Matrix = matrix;
                    break;
                case "rShldr":
                    // jfDest.AddValue("Zrotation", 35);
                    matrix = jfDest.Matrix;
                    matrix.RotatePrepend(new Quaternion(new Vector3D(0, 0, 1), 35));
                    jfDest.Matrix = matrix;
                    break;
                case "rForeArm":
                case "rHand":
                    matrix = jfDest.Matrix;
                    matrix.RotatePrepend(new Quaternion(new Vector3D(0, 0, 1), 35));
                    matrix.Rotate(new Quaternion(new Vector3D(0, 0, 1), -35));
                    jfDest.Matrix = matrix;
                    break;
            }
        }
Beispiel #8
0
        private void Render()
        {
            //初始化屏幕
            //1.清理屏幕
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
            GL.ClearColor(0, 0, 0, 0);           //背景为黑
            //2.设置矩阵模式:GL_Projection或者GL_Modelview
            GL.MatrixMode(MatrixMode.Modelview); //指定当前矩阵模型视图矩阵
            //3.加载当前矩阵模式
            GL.LoadIdentity();                   //将当前矩阵转为单位矩阵

            if (glControl1.Focused)
            {
                GL.Color3(Color.Yellow);
            }
            else
            {
                GL.Color3(Color.SeaGreen);
            }
            //视口设置
            //4.视口设置
            Matrix4 lookat = Matrix4.LookAt(-Eye_distance, -Eye_distance,
                                            Eye_distance, 0, 0, 0, 0, 0, 1);

            GL.LoadMatrix(ref lookat);//加载视口矩阵
            //GL.Rotate(angle.X, 1, 0, 0);//旋转物体
            //GL.Rotate(angle.Y, 0, 0, 1);

            _ArcBall.TransformMatrix();//更新轨迹球
            //显示设置
            //5.显示设置

            //绘图
            if (hasAxis)
            {
                DrawAxis();//画坐标轴
            }
            if (hasElem)
            {
                //循环显示每个线单元
                foreach (KeyValuePair <int, Element> elem in CurModel.elements)
                {
                    if (elem.Value.TYPE != ElemType.BEAM)
                    {
                        continue;
                    }
                    FrameElement bm  = elem.Value as FrameElement;
                    Point3d      pt1 = CurModel.nodes[bm.I].Location;
                    Point3d      pt2 = CurModel.nodes[bm.J].Location;
                    //显示单元
                    DrawElem((float)pt1.X, (float)pt1.Y, (float)pt1.Z,
                             (float)pt2.X, (float)pt2.Y, (float)pt2.Z);
                }
            }
            //绘图最后:swapBuffers()
            glControl1.SwapBuffers();//调换缓存
        }
Beispiel #9
0
        private void InitFrameElement(int width, int length, int height, SceneElement parent)
        {
            var folder = new SharpGL.SceneGraph.Primitives.Folder()
            {
                Name = "Frame"
            };

            parent.AddChild(folder);

            var frame = new FrameElement(width, length, height);

            folder.AddChild(frame);
        }
Beispiel #10
0
        /// <summary>
        /// 显示验算截面参数
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bt_ShowCheckPara_Click(object sender, EventArgs e)
        {
            int          num = Convert.ToInt32(textBox12.Text);//单元号
            FrameElement fe  = CurModel.elements[num] as FrameElement;

            if (fe != null)
            {
                MessageBox.Show(fe.DPs.ToString(), "单元号:" + num.ToString());
            }
            else
            {
                MessageBox.Show("指定单元号不是线单元!");
            }
        }
Beispiel #11
0
        /// <inheritdoc />
        protected override string GetAttributeValueImpl(string attributeName)
        {
            switch (attributeName.ToLowerInvariant())
            {
            case "url":
                return(Url);

            case "href":
                return(Url);

            default:
                return(FrameElement.GetAttributeValue(attributeName));
            }
        }
Beispiel #12
0
        private void button5_Click(object sender, EventArgs e)
        {
            BLoadComb    com = CurModel.LoadCombTable.getLoadComb(LCKind.STEEL, "sGen2");
            ElemForce    ef  = CurModel.CalElemForceComb(com, 4);
            SecForce     sf  = ef.Force_i;
            FrameElement fe  = CurModel.elements[4] as FrameElement;
            BSections    sec = CurModel.sections[fe.iPRO];
            double       s1  = CodeCheck.CalPointStrength_YW(sf, sec, 1, fe.DPs);
            double       s2  = CodeCheck.CalPointStrength_YW(sf, sec, 2, fe.DPs);
            double       s3  = CodeCheck.CalPointStrength_YW(sf, sec, 3, fe.DPs);
            double       s4  = CodeCheck.CalPointStrength_YW(sf, sec, 4, fe.DPs);

            return;
        }
Beispiel #13
0
 internal FrameWindow(Interop.IHTMLWindow2 window, MSHTMLSite relatedSite, HtmlEditor htmlEditor)
 {
     this._relatedSite          = relatedSite;
     this.window                = window;
     this.doc                   = (Interop.IHTMLDocument2)window.document;
     this.url                   = ((Interop.IHTMLLocation)((Interop.IHTMLWindow2)doc.GetParentWindow()).location).href;
     this.body                  = (Interop.IHTMLElement3)doc.GetBody();
     this.framebase             = ((Interop.IHTMLWindow4)window).frameElement;
     this.htmlFormatter         = new HtmlFormatter();
     this.CommandTarget         = (Interop.IOleCommandTarget)doc;
     this.winEvents             = new FrameEvents(window, htmlEditor);
     this.winEvents.Activate   += new EventHandler(winEvents_Activate);
     this.winEvents.DeActivate += new EventHandler(winEvents_DeActivate);
     this.nativeElement         = (FrameElement)htmlEditor.GenericElementFactory.CreateElement(framebase as Interop.IHTMLElement);
 }
Beispiel #14
0
 private void GlControlMouseMove(object sender, MouseEventArgs e)
 {
     if (_loaded && _bound)
     {
         FrameElement tmp = _graph.SetMousePosition(new Vector2(e.X, e.Y));
         if (tmp != null && tmp != _currentSelection)
         {
             _currentSelection = tmp;
             if (SelectionChanged != null)
             {
                 SelectionChanged(_currentSelection);
             }
         }
         glControl.Invalidate();
     }
 }
        public override FunctionServiceResult Process(byte[] frame)
        {
            if (frame.Length != FrameLength)
            {
                return(new FunctionServiceResult(error: $"Frame length was {frame.Length}. Expected {FrameLength}."));
            }

            ushort address = frame.GetRegister(2);

            ushort value = frame.GetRegister(4);

            var elements = new FrameElement[]
            {
                new FrameElement("Address", $"{address}"),
                new FrameElement("Value", $"{value}"),
            };

            return(new FunctionServiceResult(frame[0], "Read / Write Single Register", elements));
        }
Beispiel #16
0
        public BVH Convert()
        {
            BVH dest = SLTemplate();

            dest.Frames.Value = m_src.Frames.Value + 1;
            dest.FrameTime.Value = m_src.FrameTime.Value;
            dest.FrameList.Clear();

            FrameElement firstFrame = new FrameElement(dest);
            firstFrame.GetJointFrame("hip").SetValue("Yposition", 43.5285);
            dest.FrameList.Add(firstFrame);

            foreach (FrameElement frame in m_src.FrameList)
            {
                dest.FrameList.Add(ConvertFrame(dest, frame));
            }

            return dest;
        }
Beispiel #17
0
        /// <summary>
        /// 按节点号查得相交单元
        /// </summary>
        /// <param name="nn">节点号</param>
        /// <param name="Elems">单元集合</param>
        /// <returns>共节点的单元(从指定的单元集中选择)</returns>
        public List <int> FindNodeElems(int nn, List <int> Elems)
        {
            List <int> Res = new List <int>();

            foreach (int ee in Elems)
            {
                if ((MM.elements[ee] is FrameElement) == false)
                {
                    continue;
                }
                FrameElement fme = MM.elements[ee] as FrameElement;
                if (fme.iNs.Contains(nn))
                {
                    Res.Add(ee);
                }
            }

            return(Res);
        }
        /// <summary>
        /// 读取单元信息表1
        /// </summary>
        public void ReadElem1(Worksheet Esheet0, ref Bmodel MyModel)
        {
            int iFrow = Esheet0.Cells.FirstRowIndex;
            int iLrow = Esheet0.Cells.LastRowIndex;

            //材料信息读取
            for (int i = iFrow + 1; i <= iLrow; i++)
            {
                Row    CurRow = Esheet0.Cells.GetRow(i);
                int    imat   = int.Parse(CurRow.GetCell(4).StringValue); //材料性质id
                string Cursec = CurRow.GetCell(7).StringValue;            //截面名称

                int       iele    = int.Parse(CurRow.GetCell(0).StringValue);
                int       ieleI   = int.Parse(CurRow.GetCell(1).StringValue);
                int       ieleJ   = int.Parse(CurRow.GetCell(2).StringValue);
                int       MaxProp = MyModel.sections.Count > 0 ? MyModel.sections.Keys.Max() : 0; //记录最大截面号
                int       iProp   = 1;                                                            //当前截面号
                bool      hasSec  = false;                                                        //指示是否有当前截面
                BMaterial mat     = new BMaterial(imat, MatType.USER, "Mat_" + imat.ToString());
                foreach (KeyValuePair <int, BSections> ss in MyModel.sections)
                {
                    if (ss.Value.Name == Cursec)
                    {
                        iProp  = ss.Key;
                        hasSec = true;//有当前截面
                        break;
                    }
                }
                //如果没有当前截面,则添加一个新的截面
                if (hasSec == false)
                {
                    iProp = MaxProp + 1;     //新的截面号
                    SectionGeneral sec = new SectionGeneral(iProp, Cursec);
                    MyModel.AddSection(sec); //添加入库
                }

                MyModel.AddMat(mat);//添加料号入库
                //最后添加单元入数据库
                FrameElement ee = new FrameElement(iele, ElemType.BEAM, imat, iProp, ieleI, ieleJ);
                MyModel.AddElement(ee);
            }
        }
Beispiel #19
0
        /// <summary>
        /// 对某单元按指定的计算长度计算长细比
        /// </summary>
        /// <param name="mm">模型对像</param>
        /// <param name="iElem">单元号,必须为梁单元FrameElement</param>
        /// <param name="l_0y">平面内计算长度</param>
        /// <param name="l_0z">平面外计算长度</param>
        public static void CalDesignPara_lemda(ref Bmodel mm, int iElem, double l_0y, double l_0z)
        {
            FrameElement ele    = mm.elements[iElem] as FrameElement;
            int          iSec   = ele.iPRO;                                                  //截面号
            BSections    curSec = mm.sections[iSec];                                         //当前截面
            double       i_y    = Math.Sqrt(mm.sections[iSec].Iyy / mm.sections[iSec].Area); //回转半径
            double       i_z    = Math.Sqrt(mm.sections[iSec].Izz / mm.sections[iSec].Area);

            ele.DPs.Lemda_y = l_0y / i_y; //计算长细比
            ele.DPs.Lemda_z = l_0z / i_z; //计算长细比

            //形心到剪心的矩离
            double e0       = Math.Sqrt(Math.Pow(curSec.Sy - curSec.Cy, 2) + Math.Pow(curSec.Sz - curSec.Cz, 2));
            double i02      = Math.Pow(e0, 2) + Math.Pow(i_y, 2) + Math.Pow(i_z, 2);
            double Lemda_z2 = 0;//扭转屈曲的换算长细比

            //如果截面上下不对称
            if (Math.Abs(curSec.CzM - curSec.CzP) > 0.002)
            {
                //扭转屈曲的换算长细比
                Lemda_z2 = i02 * curSec.Area / (curSec.Ixx / 25.7 + curSec.Iw / Math.Pow(l_0z, 2));
                double temp1 = Math.Pow(ele.DPs.Lemda_z, 2) + Lemda_z2;
                double temp2 = temp1 + Math.Sqrt(Math.Pow(temp1, 2) - 4 * (1 - Math.Pow(e0, 2) / i02) *
                                                 Math.Pow(ele.DPs.Lemda_z, 2) * Lemda_z2);
                ele.DPs.Lemda_yz = Math.Sqrt(temp2) / Math.Sqrt(2);
            }
            else if (Math.Abs(curSec.CyM - curSec.CyP) > 0.002)
            {
                //扭转屈曲的换算长细比
                Lemda_z2 = i02 * curSec.Area / (curSec.Ixx / 25.7 + curSec.Iw / Math.Pow(l_0y, 2));
                double temp1 = Math.Pow(ele.DPs.Lemda_y, 2) + Lemda_z2;
                double temp2 = temp1 + Math.Sqrt(Math.Pow(temp1, 2) - 4 * (1 - Math.Pow(e0, 2) / i02) *
                                                 Math.Pow(ele.DPs.Lemda_y, 2) * Lemda_z2);
                ele.DPs.Lemda_yz = Math.Sqrt(temp2) / Math.Sqrt(2);
            }

            double eleLeng = mm.getFrameLength(iElem); //单元长度

            ele.DPs.Lk_y = l_0y / eleLeng;             //计算长度系数(单元长度的倍数)
            ele.DPs.Lk_z = l_0z / eleLeng;
        }
Beispiel #20
0
        /// <summary>
        /// 输出所有截面验算参数设置
        /// </summary>
        /// <param name="mm"></param>
        /// <param name="cr"></param>
        /// <param name="FileOut"></param>
        public static void WriteCheckPara(ref Bmodel mm, ref CheckRes cr, string FileOut)
        {
            FileStream   stream = File.Open(FileOut, FileMode.Create);
            StreamWriter writer = new StreamWriter(stream);

            writer.WriteLine("截面号\t截面名称\t平面内计算长度\t平面外计算长度\t材料设计强度\t净毛面积比\t塑性发展系数γx\t" +
                             "塑性发展系数γy\t等效弯矩系数βmx\t等效弯矩系数βmy\t等效弯矩系数βtx\t等效弯矩系数βty\t" +
                             "受弯稳定系数ψbx\t受弯稳定系数ψby\t平面内长细比\t平面外长细比" +
                             "\t截面类别\t抗震承力调整系数γre\t截面影响系数η");

            foreach (BSections sec in mm.sections.Values)
            {
                List <int> tempElem = mm.getElemBySec(sec.Num);
                if (tempElem.Count == 0)
                {
                    continue;
                }
                int              eNum  = tempElem[0];
                double           eLeng = mm.getFrameLength(eNum);
                FrameElement     fe    = mm.elements[eNum] as FrameElement;
                DesignParameters DP    = fe.DPs;
                double           ly    = DP.Lk_y * eLeng;
                double           lz    = DP.Lk_z * eLeng;
                writer.Write("{0}\t{1}\t{2}\t{3}", sec.Num.ToString(), sec.Name, ly.ToString("0.00"), lz.ToString("0.00"));
                writer.Write("\t{0}\t{1}\t{2}", DP.fy.ToString("0"), DP.Ratio_Anet.ToString("0.00"), DP.Gamma_y.ToString("0.00"));
                writer.Write("\t{0}\t{1}\t{2}", DP.Gamma_z.ToString("0.00"), DP.Belta_my.ToString("0.00"),
                             DP.Belta_mz.ToString("0.00"));
                writer.Write("\t{0}\t{1}", DP.Belta_ty.ToString("0.00"), DP.Belta_tz.ToString("0.00"));
                writer.Write("\t{0}\t{1}", DP.Phi_by.ToString("0.00"), DP.Phi_bz.ToString("0.00"));
                writer.Write("\t{0}\t{1}", DP.Lemda_y.ToString("0.00"), DP.Lemda_z.ToString("0.00"));
                writer.Write("\t{0}\t{1}", DP.SecCat.ToString(), DP.Gamma_re.ToString("0.00"));
                writer.Write("\t{0}", DP.Yita.ToString("0.00"));
                writer.Write("\n");
            }

            writer.Close();
            stream.Close();
        }
Beispiel #21
0
        private void getFe1Fe2Path_Click(object sender, EventArgs e)
        {
            ResetOutput();

            if (fe1.SelectedItem == null)
            {
                MessageBox.Show("Please select FE 1");
                return;
            }

            if (fe2.SelectedItem == null)
            {
                MessageBox.Show("Please select FE 2");
                return;
            }

            FrameElement sourceFE = fe1.SelectedItem as FrameElement;
            FrameElement destFE   = fe2.SelectedItem as FrameElement;
            Set <Frame.FrameRelation>  searchRelations = new Set <Frame.FrameRelation>(SelectedRelations.ToArray());
            List <FrameElement>        fePath;
            List <Frame.FrameRelation> relationPath;

            if (sourceFE.GetShortestPathTo(destFE, searchRelations, SelectedRelationDirection, int.MaxValue, out fePath, out relationPath))
            {
                StringBuilder path = new StringBuilder();
                for (int i = 0; i < fePath.Count; ++i)
                {
                    path.Append(fePath[i] + (relationPath.Count > i ? " -- " + relationPath[i] + " --> " : ""));
                }

                AddItem(path.ToString());
            }
            else
            {
                MessageBox.Show("No path exists");
            }
        }
Beispiel #22
0
        public GraphControl()
        {
            _loaded      = false;
            _bound       = false;
            _sleep       = false;
            this.Resize += GraphControlResize;
            SuspendLayout();
            this.glControl            = new OpenTK.GLControl(new GraphicsMode(new ColorFormat(32), 24, 8, 16));
            glControl.Load           += GlControlLoad;
            glControl.Paint          += GlControlPaint;
            glControl.PreviewKeyDown += GlControlPreviewKeyDown;
            glControl.MouseMove      += new MouseEventHandler(GlControlMouseMove);
            glControl.DoubleClick    += new EventHandler(GlControlDoubleClick);
            glControl.Size            = this.Size;
            glControl.Location        = Point.Empty;

            this.Controls.Add(glControl);
            glControl.MakeCurrent();
            ResumeLayout();

            InitializeComponent();
            _screenCap        = false;
            _currentSelection = null;
        }
Beispiel #23
0
 public void MarkSelection(FrameElement selection)
 {
     //DateTime start = new DateTime(selection.StartTime.Ticks, DateTimeKind.Utc);
     //Everything is UTC - change to allow for different time zones
     _background.AddSelectionMark(selection.StartTime, selection.EndTime);
 }
Beispiel #24
0
        private HtmlElement CreateFor(XElement element)
        {
            HtmlElement result;

            switch (element.Name.LocalName.ToLower())
            {
            case "form":
                result = new FormElement(element);
                break;

            case "input":
                string type = element.GetAttribute("type") ?? "";
                switch (type.ToLower())
                {
                case "radio":
                    result = new RadioInputElement(element);
                    break;

                case "checkbox":
                    result = new CheckboxInputElement(element);
                    break;

                case "submit":
                case "image":
                case "button":
                    string buttonType = element.GetAttribute("type");
                    result = new ButtonInputElement(element);
                    break;

                case "file":
                    result = new FileUploadElement(element);
                    break;

                default:
                    result = new InputElement(element);
                    break;
                }
                break;

            case "textarea":
                result = new TextAreaElement(element);
                break;

            case "select":
                result = new SelectElement(element);
                break;

            case "option":
                result = new OptionElement(element);
                break;

            case "iframe":
            case "frame":
                result = new FrameElement(element);
                break;

            case "a":
                result = new AnchorElement(element);
                break;

            case "label":
                result = new LabelElement(element);
                break;

            case "button":
                result = new ButtonInputElement(element);
                break;

            default:
                result = new HtmlElement(element);
                break;
            }
            _allActiveElements.Add(result);
            return(result);
        }
Beispiel #25
0
 public virtual void SetAttributeValue(string attributeName, string value)
 {
     FrameElement.SetAttributeValue(attributeName, value);
 }
Beispiel #26
0
 /// <summary>
 /// Add a frame element to the collection. This member supports the NetRix infrastructure and is used to
 /// support the <see cref="System.Windows.Forms.PropertyGrid"/>.
 /// </summary>
 /// <param name="o"></param>
 public void Add(FrameElement o)
 {
     base.List.Add(o);
 }
Beispiel #27
0
        private FrameElement ConvertFrame(BVH dest, FrameElement srcFrame)
        {
            FrameElement destFrame = new FrameElement(dest);
            foreach (CompositeElement joint in dest.JointList)
            {
                JointFrame jfDest = destFrame.GetJointFrame(joint.Name);
                JointFrame jfSrc = srcFrame.GetJointFrame(GetSrcJointName(joint.Name));
                if (jfSrc == null)
                    continue;

                foreach (string channel in new string[]{"Zrotation", "Xrotation", "Yrotation"})
                {
                    jfDest.SetValue(channel, jfSrc.GetValue(channel));
                }

                ConvertJointFrame(jfDest, joint.Name, srcFrame);
            }
            return destFrame;
        }
Beispiel #28
0
 /// <summary>
 /// Checks if the given frame element is already part of the collection. This member supports the NetRix infrastructure and is used to
 /// support the <see cref="System.Windows.Forms.PropertyGrid"/>.
 /// </summary>
 /// <param name="o">The frame element</param>
 /// <returns>True if the element is already part of the collection.</returns>
 public bool Contains(FrameElement o)
 {
     return(List.Contains(o));
 }
Beispiel #29
0
        internal static HtmlElement CreateFor(XElement element)
        {
            HtmlElement result = null;

            switch (element.Name.LocalName.ToLower())
            {
            case "form":
                result = new FormElement(element);
                break;

            case "input":
                string type = element.GetAttribute("type") ?? "";
                switch (type.ToLower())
                {
                case "radio":
                    result = new RadioInputElement(element);
                    break;

                case "checkbox":
                    result = new CheckboxInputElement(element);
                    break;

                case "image":
                    result = new ImageInputElement(element);
                    break;

                case "submit":
                case "button":
                    result = new ButtonInputElement(element);
                    break;

                case "file":
                    result = new FileUploadElement(element);
                    break;

                case "email":
                    result = new EmailInputElement(element);
                    break;

                case "url":
                    result = new UrlInputElement(element);
                    break;

                case "datetime-local":
                case "date":
                case "month":
                case "week":
                case "time":
                    result = new DateTimeInputElement(element);
                    break;

                case "number":
                case "range":
                    result = new NumberInputElement(element);
                    break;

                case "color":
                    result = new ColorInputElement(element);
                    break;

                default:
                    result = new InputElement(element);
                    break;
                }
                break;

            case "textarea":
                result = new TextAreaElement(element);
                break;

            case "select":
                result = new SelectElement(element);
                break;

            case "option":
                result = new OptionElement(element);
                break;

            case "iframe":
            case "frame":
                var src = element.GetAttributeCI("src");
                if (!string.IsNullOrWhiteSpace(src))
                {
                    result = new FrameElement(element);
                }
                else
                {
                    result = default(HtmlElement);
                }
                break;

            case "a":
                result = new AnchorElement(element);
                break;

            case "label":
                result = new LabelElement(element);
                break;

            case "button":
                result = new ButtonInputElement(element);
                break;

            default:
                result = new HtmlElement(element);
                break;
            }
            return(result);
        }
Beispiel #30
0
 /// <summary>
 /// Remove the given frame element from the collection. This member supports the NetRix infrastructure and is used to
 /// support the <see cref="System.Windows.Forms.PropertyGrid"/>.
 /// </summary>
 /// <param name="o"></param>
 public void Remove(FrameElement o)
 {
     base.List.Remove(o);
 }
Beispiel #31
0
 public void Apply(int frame, FrameElement element)
 {
     throw new NotImplementedException();
 }
Beispiel #32
0
 public virtual void Setup(int totalFrames, FrameElement initialState = null)
 {
     throw new NotImplementedException();
 }
Beispiel #33
0
        /// <summary>
        /// 验算单个单元
        /// </summary>
        /// <param name="mm">模型对像</param>
        /// <param name="iElem">单元号</param>
        public void CheckElemByNum(ref Bmodel mm, int iElem)
        {
            EleCheckResData EleData = new EleCheckResData(iElem); //单元组合验算表

            List <string> coms = mm.LoadCombTable.ComSteel;

            foreach (string com in coms)
            {
                double gamma_re = 1.0;//承载力抗震调整系数
                //如果未激活则不验算
                if (mm.LoadCombTable[com].bACTIVE == false)
                {
                    continue;
                }
                FrameElement ele = mm.elements[iElem] as FrameElement;

                //若为地震组合则取存储的承载力抗震调整系数
                if (mm.LoadCombTable[com].hasLC_ANAL(ANAL.ES) ||
                    mm.LoadCombTable[com].hasLC_ANAL(ANAL.RS))
                {
                    gamma_re = ele.DPs.Gamma_re;
                }

                //先进行单元内力组合
                ElemForce EFcom = mm.CalElemForceComb(mm.LoadCombTable[com], iElem);

                //计算强度
                double Strength_i = CodeCheck.CalSecMaxStrength_YW(EFcom.Force_i,
                                                                   mm.sections[ele.iPRO],
                                                                   ele.DPs) * gamma_re;//i截面计算强度
                double Strength_2 = CodeCheck.CalSecMaxStrength_YW(EFcom.Force_48,
                                                                   mm.sections[ele.iPRO],
                                                                   ele.DPs) * gamma_re;
                double Strength_j = CodeCheck.CalSecMaxStrength_YW(EFcom.Force_j,
                                                                   mm.sections[ele.iPRO],
                                                                   ele.DPs) * gamma_re;
                //计算稳定性强度
                //double Stability_i = CodeCheck.CalStability_YW(EFcom.Force_i, mm.sections[ele.iPRO],
                //    ele.DPs, mm.mats[ele.iMAT].Elast)*gamma_re;
                //double Stability_2 =CodeCheck. CalStability_YW(EFcom.Force_48, mm.sections[ele.iPRO],
                //    ele.DPs, mm.mats[ele.iMAT].Elast)*gamma_re;
                //double Stability_j =CodeCheck. CalStability_YW(EFcom.Force_j, mm.sections[ele.iPRO],
                //    ele.DPs, mm.mats[ele.iMAT].Elast)*gamma_re;
                double Stability_i = CodeCheck.CalSecMaxStability_YW(EFcom.Force_i, mm.sections[ele.iPRO],
                                                                     ele.DPs, mm.mats[ele.iMAT].Elast) * gamma_re;
                double Stability_2 = CodeCheck.CalSecMaxStability_YW(EFcom.Force_48, mm.sections[ele.iPRO],
                                                                     ele.DPs, mm.mats[ele.iMAT].Elast) * gamma_re;
                double Stability_j = CodeCheck.CalSecMaxStability_YW(EFcom.Force_j, mm.sections[ele.iPRO],
                                                                     ele.DPs, mm.mats[ele.iMAT].Elast) * gamma_re;

                double Ratio   = Math.Max(Strength_i, Stability_i) / ele.DPs.fy;
                double Ratio_2 = Math.Max(Strength_2, Stability_2) / ele.DPs.fy;
                double Ratio_j = Math.Max(Strength_j, Stability_j) / ele.DPs.fy;

                //加入到数据库
                SingleEleCheckResData Secrd =
                    new SingleEleCheckResData("I", com, EFcom.Force_i.N, EFcom.Force_i.My, EFcom.Force_i.Mz,
                                              Strength_i, Stability_i, Ratio);
                SingleEleCheckResData Secrd_2 =
                    new SingleEleCheckResData("1/2", com, EFcom.Force_48.N, EFcom.Force_48.My, EFcom.Force_48.Mz,
                                              Strength_2, Stability_2, Ratio_2);
                SingleEleCheckResData Secrd_j =
                    new SingleEleCheckResData("J", com, EFcom.Force_j.N, EFcom.Force_j.My, EFcom.Force_j.Mz,
                                              Strength_j, Stability_j, Ratio_j);

                Secrd = Secrd.TheMaxRatio(Secrd_2);//取得控制内力
                Secrd = Secrd.TheMaxRatio(Secrd_j);

                EleData.Add(com, Secrd);//添加到单元验算结果数据中
            }

            //添加到数据表
            if (this._CheckResTable.ContainsKey(iElem))
            {
                this._CheckResTable.Remove(iElem);
                this._CheckResTable.Add(iElem, EleData);
            }
            else
            {
                this._CheckResTable.Add(iElem, EleData);
            }
        }
Beispiel #34
0
        /// <summary>
        /// 读入截面验算的设置参数
        /// </summary>
        /// <param name="mm"></param>
        /// <param name="cr"></param>
        /// <param name="FileIn"></param>
        public static void ReadCheckPara(ref Bmodel mm, ref CheckRes cr, string FileIn)
        {
            string line = null;      //行文本

            string[] curdata = null; //当前行数据变量
            int      curNum  = 0;    //当前截面号

            FileStream   stream = File.Open(FileIn, FileMode.Open, FileAccess.Read);
            StreamReader reader = new StreamReader(stream);

            line = reader.ReadLine();

            for (line = reader.ReadLine(); line != null; line = reader.ReadLine())
            {
                curdata = line.Split("\t".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); //字符串分割
                curNum  = Convert.ToInt32(curdata[0]);                                           //当前截面号

                List <int> eles = mm.getElemBySec(curNum);                                       //当前截面的单元集
                foreach (int ele in eles)
                {
                    if (!(mm.elements[ele] is FrameElement))
                    {
                        continue;
                    }
                    FrameElement fe = mm.elements[ele] as FrameElement;

                    double      len_y    = Convert.ToDouble(curdata[2]);
                    double      len_z    = Convert.ToDouble(curdata[3]);
                    double      Net_r    = Convert.ToDouble(curdata[5]);
                    double      Gamma_y  = Convert.ToDouble(curdata[6]);
                    double      Gamma_z  = Convert.ToDouble(curdata[7]);
                    double      Betla_my = Convert.ToDouble(curdata[8]);
                    double      Betal_mz = Convert.ToDouble(curdata[9]);
                    double      Betal_ty = Convert.ToDouble(curdata[10]);
                    double      Betal_tz = Convert.ToDouble(curdata[11]);
                    double      Phi_by   = Convert.ToDouble(curdata[12]);
                    double      Phi_bz   = Convert.ToDouble(curdata[13]);
                    double      F        = Convert.ToDouble(curdata[4]);  //强度设计值
                    double      Gamma_re = Convert.ToDouble(curdata[17]); //承载力调整系数
                    SecCategory cat      = SecCategory.b;
                    switch (curdata[16])
                    {
                    case "a": cat = SecCategory.a; break;

                    case "b": cat = SecCategory.b; break;

                    case "c": cat = SecCategory.c; break;

                    case "d": cat = SecCategory.d; break;

                    default: cat = SecCategory.b; break;
                    }
                    double Yita = Convert.ToDouble(curdata[18]);//截面影响系数


                    //更新长细比
                    CodeCheck.CalDesignPara_lemda(ref mm, ele, len_y, len_z);
                    //更新受压稳定系数
                    CodeCheck.CalDesignPara_phi(ref mm, ele, 1, cat);
                    CodeCheck.CalDesignPara_phi(ref mm, ele, 2, cat);

                    fe.DPs.SecCat     = cat;
                    fe.DPs.Ratio_Anet = Net_r;
                    fe.DPs.Gamma_y    = Gamma_y;
                    fe.DPs.Gamma_z    = Gamma_z;
                    fe.DPs.Belta_my   = Betla_my;
                    fe.DPs.Belta_mz   = Betal_mz;
                    fe.DPs.Belta_ty   = Betal_ty;
                    fe.DPs.Belta_tz   = Betal_tz;
                    fe.DPs.fy         = F;//强度设计值
                    fe.DPs.Gamma_re   = Gamma_re;
                    fe.DPs.Yita       = Yita;
                }
            }

            reader.Close();
        }
Beispiel #35
0
        /// <summary>
        /// 计算受压构件的稳定系数phi
        /// GB50017 附表C公式
        /// </summary>
        /// <param name="mm">模型对像</param>
        /// <param name="iElem">单元号</param>
        /// <param name="iYZ">指示计算当前截面哪个方向的稳定系数 1:phi_y;2:phi_z</param>
        /// <param name="Cat">截面类别</param>
        public static void CalDesignPara_phi(ref Bmodel mm, int iElem, int iYZ, SecCategory Cat)
        {
            FrameElement ele  = mm.elements[iElem] as FrameElement;
            int          iSec = ele.iPRO;                //截面号
            double       E    = mm.mats[ele.iMAT].Elast; //弹性模量
            double       Fy   = mm.mats[ele.iMAT].Fy;    //屈服强度

            double lemda = 0;
            double a1    = 0;
            double a2    = 0;
            double a3    = 0;
            double phi   = 1;//稳定系数

            if (iYZ == 1)
            {
                //如果截面左右不对称
                if (Math.Abs(mm.sections[iSec].CyM - mm.sections[iSec].CyP) > 0.002)
                {
                    lemda = ele.DPs.Lemda_yz;
                }
                else
                {
                    lemda = ele.DPs.Lemda_y;
                }
            }
            else if (iYZ == 2)
            {
                //如果截面上下不对称
                if (Math.Abs(mm.sections[iSec].CzM - mm.sections[iSec].CzP) > 0.002)
                {
                    lemda = ele.DPs.Lemda_yz;
                }
                else
                {
                    lemda = ele.DPs.Lemda_z;
                }
            }

            double lemda_n = lemda * Math.Sqrt(Fy / E) / Math.PI; //正则长细比

            TableC_5(Cat, lemda_n, out a1, out a2, out a3);       //查表C-5

            if (lemda_n <= 0.215)
            {
                phi = 1 - a1 * Math.Pow(lemda_n, 2);
            }
            else
            {
                double temp1 = a2 + a3 * lemda_n + Math.Pow(lemda_n, 2);
                double temp2 = Math.Pow(lemda_n, 2);
                phi = (temp1 - Math.Sqrt(Math.Pow(temp1, 2) - 4 * temp2)) / (2 * temp2);
            }

            //存储
            if (iYZ == 1)
            {
                ele.DPs.Phi_y = phi;
            }
            else if (iYZ == 2)
            {
                ele.DPs.Phi_z = phi;
            }
        }