예제 #1
0
        //初始化截面表控制件
        public void InitSectList()
        {
            MainForm mf = this.Owner as MainForm;
            Bmodel   mm = mf.ModelForm.CurModel;

            Dgv_sec.RowCount    = mm.sections.Count;
            Dgv_sec.ColumnCount = 3;
            //不可调整表头高度
            Dgv_sec.ColumnHeadersHeightSizeMode =
                DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
            //禁止列排序
            Dgv_sec.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
            Dgv_sec.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable;
            Dgv_sec.Columns[2].SortMode = DataGridViewColumnSortMode.NotSortable;
            int i = 0;

            foreach (BSections sec in mm.sections.Values)
            {
                Dgv_sec.CurrentCell       = Dgv_sec[0, i];
                Dgv_sec.CurrentCell.Value = sec.Num.ToString();
                Dgv_sec.CurrentCell       = Dgv_sec[1, i];
                Dgv_sec.CurrentCell.Value = sec.Name;
                Dgv_sec.CurrentCell       = Dgv_sec[2, i];
                Dgv_sec.CurrentCell.Value = sec.TYPE.ToString();
                Dgv_sec.CurrentRow.Height = 18;//设置行高
                i++;
            }
            if (Dgv_sec.Rows.Count > 0)
            {
                Dgv_sec.CurrentCell = Dgv_sec[0, 0];//选择第一行
            }
        }
예제 #2
0
        private void 显示单元设计内力ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Bmodel      curMM = this.ModelForm.CurModel;                               //模型数据
            BCheckModel curCM = this.ModelForm.CheckModel;                             //设计数据
            List <int>  eles  = SelectCollection.StringToList(this.cb_selectEle.Text); //选择单元

            if (eles.Count == 0)
            {
                MessageTool.Tb_out.AppendText(Environment.NewLine + "*Error*:未选择单元!");
                return;
            }
            TableForm tf = new TableForm();

            tf.Text  = "单元设计内力表";
            tf.Key   = "DesignForceTable";
            tf.State = ToolWindowState.Mdi;
            tf.writeDesignForce(ref curMM, ref curCM, eles);//输出数据
            if (!this.HasToolWindow("DesignForceTable"))
            {
                _LayoutManager.ToolWindows.Add(tf);
            }
            else
            {
                ToolWindow tw = _LayoutManager.ToolWindows["DesignForceTable"];
                _LayoutManager.ToolWindows.Remove(tw);
                _LayoutManager.ToolWindows.Add(tf);
            }
        }
예제 #3
0
        /// <summary>
        /// 输出所有截面的验算结果
        /// 按截面进行归并
        /// </summary>
        /// <param name="mm">模型对像</param>
        /// <param name="cr">验算结果数据对像</param>
        /// <param name="FileOut">输出文件路径</param>
        public static void WriteAllCheckRes(ref Bmodel mm, ref CheckRes cr, string FileOut)
        {
            FileStream   stream = File.Open(FileOut, FileMode.Create);
            StreamWriter writer = new StreamWriter(stream);

            writer.WriteLine("截面名称\t控制单元号(截面)\t控制组合\tN(kN)\tMy(kN*m)\tMz(kN*m)\t强度(MPa)\t稳定(MPa)\t应力比");

            foreach (BSections sec in mm.sections.Values)
            {
                List <int> curElems = cr.GetElemsBySec(ref mm, sec.Num);//当前截面信息
                if (curElems.Count == 0)
                {
                    continue;
                }
                int num_control             = cr.GetControlElem(curElems);//控制单元号
                SingleEleCheckResData secrd = cr.CheckResTable[num_control].GetControlData();

                writer.WriteLine("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}",
                                 sec.Name, num_control.ToString() + "(" + secrd.Sec_contral + ")",
                                 secrd.ComName, (secrd.N / 1e3).ToString("0.0"),
                                 (secrd.My / 1e3).ToString("0.0"), (secrd.Mz / 1e3).ToString("0.0"),
                                 (secrd.Strength / 1e6).ToString("0.0"), (secrd.Stability / 1e6).ToString("0.0"),
                                 secrd.Ratio.ToString("0.00"));
            }

            writer.Close();
            stream.Close();
        }
예제 #4
0
        //初始化荷载组合表
        public void InitLoadComForm()
        {
            MainForm       mf  = this.Owner as MainForm;
            Bmodel         mm  = mf.ModelForm.CurModel;
            BLoadCombTable lct = mm.LoadCombTable;//荷载组合表

            gv_LC.FixedColumnSplitter.Visible = false;
            gv_LC.Columns.Add(new Column("名称", typeof(string)));
            gv_LC.Columns.Add(new Column("激活", typeof(string)));
            gv_LC.Columns.Add(new Column("地震组合", typeof(string)));
            gv_LC.Columns.Add(new Column("说明", typeof(string)));

            List <string> GenCom = lct.ComGen;

            for (int i = 0; i < GenCom.Count; i++)
            {
                BLoadComb          curCom = lct.getLoadComb(LCKind.GEN, GenCom[i]);//取得荷载组合
                Xceed.Grid.DataRow Row    = gv_LC.DataRows.AddNew();
                Row.Cells[0].Value = GenCom[i];
                Row.Cells[1].Value = curCom.bACTIVE ? "激活":"钝化";
                Row.Cells[2].Value = curCom.bES ? "是":"否";
                Row.Cells[3].Value = curCom.DESC;
                Row.BackColor      = System.Drawing.Color.DarkSeaGreen;

                Row.EndEdit();
            }
            //gv_LC.ReadOnly = false;
            //gv_LC.Columns[2].CellEditorManager = new CheckBoxEditor();
            //gv_LC.Columns[2].CellEditorDisplayConditions = CellEditorDisplayConditions.Always;
        }
예제 #5
0
        private void button3_Click(object sender, EventArgs e)
        {
            Bmodel   MM     = CurModel;
            CheckRes CR     = CheckTable;
            string   Cursec = cb_secs.SelectedItem.ToString();
            int      iSec   = 5;

            if (Cursec.Contains(" "))
            {
                string temp = Cursec.Remove(Cursec.IndexOf(' '));
                iSec = Convert.ToInt32(temp);//取得截面号
            }
            FolderBrowserDialog fbd = new FolderBrowserDialog();

            fbd.Description = "请选择文件存储位置";

            if (fbd.ShowDialog() == DialogResult.OK)
            {
                string curPath = fbd.SelectedPath;
                int    i       = 0;
                foreach (BSections sec in CurModel.sections.Values)
                {
                    List <int> curElems = CheckTable.GetElemsBySec(ref MM, sec.Num);//当前截面信息
                    if (curElems.Count == 0)
                    {
                        continue;
                    }
                    string FileName = Path.Combine(curPath, sec.Name + ".txt");
                    CodeCheck.WriteSecCheckRes(ref MM, ref CR, FileName, sec.Num);
                    i++;
                }
                MessageBox.Show(i.ToString() + "个截面数据输出完成。");
            }
        }
예제 #6
0
        /// <summary>
        /// 更新当前对话框显示的截面信息
        /// </summary>
        /// <param name="SecId">截面号</param>
        public void UpdateCurentSec(int SecId)
        {
            MainForm   mmf    = this.Owner as MainForm;
            ModelForm1 mf     = mmf.ModelForm;
            Bmodel     mm     = mf.CurModel;
            BSections  curSec = mm.sections[SecId];
            string     len    = mm.unit.Length;//长度单位

            //更新截面信息
            tb_SecID.Text   = SecId.ToString();
            tb_SecName.Text = curSec.Name;


            //更新截面特性
            Dgv_SecProp.Rows.Clear();//清除行
            Dgv_SecProp.RowHeadersVisible = false;
            DataAddRow(ref Dgv_SecProp, "A", curSec.Area.ToString(), len + "^2");
            DataAddRow(ref Dgv_SecProp, "Ixx", curSec.Ixx.ToString(), len + "^4");
            DataAddRow(ref Dgv_SecProp, "Iyy", curSec.Iyy.ToString(), len + "^4");
            DataAddRow(ref Dgv_SecProp, "Izz", curSec.Izz.ToString(), len + "^4");
            DataAddRow(ref Dgv_SecProp, "Iw", curSec.Iw.ToString(), len + "^6");

            DataAddRow(ref Dgv_SecProp, "Cent:y", curSec.Cy.ToString(), len);
            DataAddRow(ref Dgv_SecProp, "Cent:z", curSec.Cz.ToString(), len);
            DataAddRow(ref Dgv_SecProp, "Shear:y", curSec.Sy.ToString(), len);
            DataAddRow(ref Dgv_SecProp, "Shear:z", curSec.Sz.ToString(), len);

            DataAddRow(ref Dgv_SecProp, "CyM", curSec.CyM.ToString(), len);
            DataAddRow(ref Dgv_SecProp, "CyP", curSec.CyP.ToString(), len);
            DataAddRow(ref Dgv_SecProp, "CzM", curSec.CzM.ToString(), len);
            DataAddRow(ref Dgv_SecProp, "CzP", curSec.CzP.ToString(), len);

            MakeEditable(ref Dgv_SecProp, 1);//使可编辑
        }
예제 #7
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);
        }
예제 #8
0
        /// <summary>
        /// 验算同一截面的所有单元
        /// </summary>
        /// <param name="mm">模型对像</param>
        /// <param name="iSec">截面号</param>
        public void CheckElemBySec(ref Bmodel mm, int iSec)
        {
            List <int> Elems = mm.getElemBySec(iSec);//单元号组

            foreach (int iEle in Elems)
            {
                CheckElemByNum(ref mm, iEle);
            }
        }
예제 #9
0
 /// <summary>
 /// 反序列化文件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Deserialize(object sender, DoWorkEventArgs e)
 {
     using (FileStream fs = File.OpenRead(_tempFileName))
     {
         Bmodel result = Utilities.Deserialize <Bmodel>(fs,
                                                        delegate(object sender2, ProgressChangedEventArgs e2)
         {
             _BackWorker.ReportProgress(e2.ProgressPercentage);
         });
         ModelForm.CurModel = result;//存储到当前模型中
     }
 }
예제 #10
0
        static float DisFar       = 160;                //景深控制远
        #endregion

        public ModelForm1()
        {
            InitializeComponent();
            CurModel   = new Bmodel();
            CheckTable = new CheckRes();
            CheckModel = new BCheckModel();
            //初始化控件
            this.State = ToolWindowState.Mdi;
            this.Key   = "Model";
            //添加鼠标中键滚动事件
            this.MouseWheel += new MouseEventHandler(this.OnMouseWheel);
        }
예제 #11
0
        /// <summary>
        /// 取得相应截面号的单元号集合
        /// </summary>
        /// <param name="mm">模型对像</param>
        /// <param name="iSec">截面号</param>
        /// <returns>单元号集合</returns>
        public List <int> GetElemsBySec(ref Bmodel mm, int iSec)
        {
            List <int> Res = new List <int>();

            foreach (int key in _CheckResTable.Keys)
            {
                if (mm.elements[key].iPRO == iSec)
                {
                    Res.Add(key);
                }
            }
            return(Res);//返回
        }
예제 #12
0
        private void TSMI_WriteEleRes_byEle_Click(object sender, EventArgs e)
        {
            Bmodel   mm = this.ModelForm.CurModel;
            CheckRes CR = this.ModelForm.CheckTable;

            string CurDir = new FileInfo(Assembly.GetExecutingAssembly().Location).DirectoryName;
            string myFile = Path.Combine(CurDir, "CodeCheck_byEle.txt");

            //输出验算结果
            CodeCheck.WriteAllCheckRes2(ref mm, ref CR, myFile);
            MessageTool.Tb_out.AppendText(Environment.NewLine + "验算文件写出到:" + myFile);
            //用记事本打开
            System.Diagnostics.Process.Start("notepad.exe", myFile);
        }
예제 #13
0
        //输出所有构件验算参数设置
        private void bt_ParaOut_Click(object sender, EventArgs e)
        {
            Bmodel         MM  = CurModel;
            CheckRes       CR  = CheckTable;
            SaveFileDialog sfd = new SaveFileDialog();

            sfd.Title  = "请输入结果文件存储位置";
            sfd.Filter = "txt 文件(*.txt)|*.txt|All files (*.*)|*.*";

            if (sfd.ShowDialog() == DialogResult.OK)
            {
                CodeCheck.WriteCheckPara(ref MM, ref CR, sfd.FileName);
            }
        }
예제 #14
0
        //读取截面设计设置参数
        private void button7_Click(object sender, EventArgs e)
        {
            Bmodel         MM  = CurModel;
            CheckRes       CR  = CheckTable;
            OpenFileDialog OPD = new OpenFileDialog();

            OPD.Title            = "选择截面验算参数文件路径";
            OPD.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);//获取我的文档
            OPD.Filter           = "txt 文件(*.txt)|*.txt|All files (*.*)|*.*";

            if (OPD.ShowDialog() == DialogResult.OK)
            {
                CodeCheck.ReadCheckPara(ref MM, ref CR, OPD.FileName);
            }
        }
예제 #15
0
        /// <summary>
        /// 读取单元信息表3:读取分层信息为单元分组
        /// </summary>
        public void ReadElem3(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    iele   = int.Parse(CurRow.GetCell(0).StringValue);
                string group  = CurRow.GetCell(1).StringValue;//组名
                MyModel.AddElemToGroup(iele, group);
            }
        }
예제 #16
0
        /// <summary>
        /// 读取节点信息表“节点”
        /// </summary>
        /// <param name="ws">工作表</param>
        /// <param name="mm">读入的数据库</param>
        public void ReadNode1(Worksheet ws, ref Bmodel mm)
        {
            int iFrow = ws.Cells.FirstRowIndex;
            int iLrow = ws.Cells.LastRowIndex;

            for (int i = iFrow + 1; i <= iLrow; i++)
            {
                Row    CurRow = ws.Cells.GetRow(i);
                int    inode  = int.Parse(CurRow.GetCell(0).StringValue);
                double x      = double.Parse(CurRow.GetCell(1).StringValue);
                double y      = double.Parse(CurRow.GetCell(2).StringValue);
                double z      = double.Parse(CurRow.GetCell(3).StringValue);
                Bnodes nn     = new Bnodes(inode, x / RaioUnit, y / RaioUnit, z / RaioUnit);//进行长度单位转换
                mm.AddNode(nn);
            }
        }
예제 #17
0
        private void button1_Click(object sender, EventArgs e)
        {
            Bmodel         MM  = CurModel;
            CheckRes       CR  = CheckTable;
            SaveFileDialog sfd = new SaveFileDialog();

            sfd.Title  = "请输入结果文件存储位置";
            sfd.Filter = "txt 文件(*.txt)|*.txt|All files (*.*)|*.*";

            if (sfd.ShowDialog() == DialogResult.OK)
            {
                int num = Convert.ToInt32(textBox12.Text);
                //UpdataDesignPara(num);//更新单元设计参数
                CodeCheck.WriteElemCheckRes(ref MM, ref CR, sfd.FileName, num);
            }
        }
예제 #18
0
        private void button1_Click(object sender, EventArgs e)
        {
            MainForm   mmf    = this.Owner as MainForm;
            ModelForm1 mf     = mmf.ModelForm;
            Bmodel     mm     = mf.CurModel;
            int        secid  = Convert.ToInt32(tb_SecID.Text);
            BSections  curSec = mm.sections[secid];

            foreach (DataGridViewRow row in Dgv_SecProp.Rows)
            {
                string Prop = row.Cells[0].Value.ToString();
                double valu = Convert.ToDouble(row.Cells[1].Value.ToString());
                switch (Prop)
                {
                case "A": curSec.Area = valu; break;

                case "Iw": curSec.Iw = valu; break;

                case "Ixx": curSec.Ixx = valu; break;

                case "Iyy": curSec.Iyy = valu; break;

                case "Izz": curSec.Izz = valu; break;

                case "Cent:y": curSec.Cy = valu; break;

                case "Cent:z": curSec.Cz = valu; break;

                case "Shear:y": curSec.Sy = valu; break;

                case "Shear:z": curSec.Sz = valu; break;

                case "CyM": curSec.CyM = valu; break;

                case "CyP": curSec.CyP = valu; break;

                case "CzM": curSec.CzM = valu; break;

                case "CzP": curSec.CzP = valu; break;

                default: break;
                }
            }

            this.Close();
        }
예제 #19
0
        /// <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);
            }
        }
예제 #20
0
 /// <summary>
 /// 写出单元设计组合内力表
 /// <param name="mm">模型数据</param>
 /// </summary>
 public void writeDesignForce(ref Bmodel mm, ref BCheckModel cm, List <int> eles)
 {
     //表头
     gc_Table.Columns.Add(new Column("单元", typeof(int)));
     gc_Table.Columns.Add(new Column("位置", typeof(string)));
     gc_Table.Columns.Add(new Column("组合", typeof(string)));
     gc_Table.Columns.Add(new Column("Fx(kN)", typeof(double)));
     gc_Table.Columns.Add(new Column("Fy(kN)", typeof(double)));
     gc_Table.Columns.Add(new Column("Fz(kN)", typeof(double)));
     gc_Table.Columns.Add(new Column("Mx(kN*m)", typeof(double)));
     gc_Table.Columns.Add(new Column("My(kN*m)", typeof(double)));
     gc_Table.Columns.Add(new Column("Mz(kN*m)", typeof(double)));
     //数据写出
     foreach (int ele in eles)
     {
         printDesignForcebyEle(ele, 0, ref mm, ref cm);
         printDesignForcebyEle(ele, 4, ref mm, ref cm);
         printDesignForcebyEle(ele, 8, ref mm, ref cm);
     }
 }
예제 #21
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;
        }
예제 #22
0
        private void button2_Click(object sender, EventArgs e)
        {
            Bmodel MM = CurModel;

            string Cursec = cb_secs.SelectedItem.ToString();
            int    iSec   = 5;

            if (Cursec.Contains(" "))
            {
                string temp = Cursec.Remove(Cursec.IndexOf(' '));
                iSec = Convert.ToInt32(temp);//取得截面号
            }
            //按选择激活相应组合
            CurModel.RSCombineActive(cb_CheckQuake.Checked);


            CheckTable.CheckElemBySec(ref MM, iSec);

            MessageBox.Show(Cursec + "截面验算完成!");
            return;
        }
예제 #23
0
        /// <summary>
        /// 按截面输出验算结构表格
        /// </summary>
        /// <param name="mm">模型对像</param>
        /// <param name="FileOut">输出文件路径</param>
        /// <param name="iSec">截面号</param>
        public static void WriteSecCheckRes(ref Bmodel mm, ref CheckRes cr, string FileOut, int iSec)
        {
            List <int>   Elems  = mm.getElemBySec(iSec);//单元号表
            FileStream   stream = File.Open(FileOut, FileMode.Create);
            StreamWriter writer = new StreamWriter(stream);

            writer.WriteLine("截面名称\t单元号(控制位置)\t控制组合\tN(kN)\tMy(kN*m)\tMz(kN*m)\t强度(MPa)\t稳定(MPa)\t应力比");

            foreach (int ele in Elems)
            {
                SingleEleCheckResData SECR = cr.CheckResTable[ele].GetControlData();
                writer.WriteLine(mm.sections[iSec].Name + "\t" + ele.ToString() + "(" + SECR.Sec_contral + ")\t" +
                                 SECR.ComName + "\t" + (SECR.N / 1e3).ToString("0.0") + "\t" + (SECR.My / 1e3).ToString("0.0") +
                                 "\t" + (SECR.Mz / 1e3).ToString("0.0") + "\t" +
                                 (SECR.Strength / 1e6).ToString("0.0") + "\t" + (SECR.Stability / 1e6).ToString("0.0") + "\t" +
                                 SECR.Ratio.ToString("0.00"));
            }

            writer.WriteLine("\n\n*********控制单元号**********: {0}", cr.GetControlElem(Elems).ToString());
            writer.Close();
            stream.Close();
        }
예제 #24
0
        /// <summary>
        /// 测试用命令函数
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            string modelpath = Path.ChangeExtension(tb_mgt.Text, ".ga1");
            string path      = Path.ChangeExtension(tb_mgt.Text, ".nl");

            MidasGenModel.model.Bmodel mm = new Bmodel();
            //MidasGenModel.Application.ReadModelBinary(modelpath,ref mm);
            mm.ReadFromMgt(tb_mgt.Text);
            mm.ReadElemForces(path);

            //存储带内力的模型
            string modelpath2 = Path.ChangeExtension(modelpath, ".ga2");

            MidasGenModel.Application.WriteModelBinary(mm, modelpath2);

            //计算组合内力
            bool      tt   = mm.LoadCombTable.ContainsKey("gStr1");
            BLoadComb comb = mm.LoadCombTable["gStr1"];
            ElemForce ef   = mm.CalElemForceComb(comb, 4);

            MessageBox.Show("OK");
        }
예제 #25
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();
        }
예제 #26
0
        /// <summary>
        /// 读取节点信息表“节点荷载”
        /// </summary>
        /// <param name="ws">工作表</param>
        /// <param name="mm">读入的数据库</param>
        public void ReadNode2(Worksheet ws, ref Bmodel mm)
        {
            int iFrow = ws.Cells.FirstRowIndex; //起始行
            int iLrow = ws.Cells.LastRowIndex;  //终止行

            for (int i = iFrow + 1; i <= iLrow; i++)
            {
                Row    CurRow = ws.Cells.GetRow(i);                          //当前行
                int    inode  = int.Parse(CurRow.GetCell(0).StringValue);
                string lc     = CurRow.GetCell(3).StringValue;               //工况名称
                double Px     = double.Parse(CurRow.GetCell(4).StringValue); //荷载数据
                double Py     = double.Parse(CurRow.GetCell(5).StringValue);
                double Pz     = double.Parse(CurRow.GetCell(6).StringValue);
                double Mx     = double.Parse(CurRow.GetCell(7).StringValue);
                double My     = double.Parse(CurRow.GetCell(8).StringValue);
                double Mz     = double.Parse(CurRow.GetCell(9).StringValue);

                BNLoad nld = new BNLoad(inode);
                nld.LC = lc;
                nld.SetLoadValue(Px, Py, Pz, Mx, My, Mz);
                mm.AddNodeLoad(nld);
            }
        }
예제 #27
0
        private void bt_run_Click(object sender, EventArgs e)
        {
            if (tb_mgt.Text == "" || tb_inp.Text == "")
            {
                MessageBox.Show("请先指定转换的文件路径!");
            }
            else
            {
                Bmodel modelinfo = new Bmodel();//局部变量,用于存储模型数据
                modelinfo.ReadFromMgt(tb_mgt.Text);
                if (modelinfo.WriteToInp(tb_inp.Text, comboBox1.SelectedIndex + 1) == true)
                {
                    if (splitContainer1.Panel2Collapsed)
                    {
                        CollapseForm();
                    }
                    tb_Out.AppendText(Environment.NewLine + "[" + System.DateTime.Now.ToString() + "]" + "恭喜,转换成功完成^_^");
                    tb_Out.AppendText(Environment.NewLine + "模型节点数:" + modelinfo.nodes.Count.ToString() +
                                      "  单元数:" + modelinfo.elements.Count.ToString());
                    tb_Out.AppendText(Environment.NewLine + "inp文件成功保存在:" + tb_inp.Text);
                }

                //如果输出结构组宏则执行
                if (cb_MacroGroup.Checked)
                {
                    if (modelinfo.WriteAnsysComponents(Path.GetDirectoryName(tb_mgt.Text)))
                    {
                        tb_Out.AppendText(Environment.NewLine + "[宏]结构组信息转化成Components成功!");
                    }
                }
                if (comboBox1.SelectedIndex + 1 == 3)
                {
                    tb_Out.AppendText(Environment.NewLine + "->所有梁单元按Beam189单元格式进行了数据处理");
                }
            }
        }
예제 #28
0
        /// <summary>
        /// 输出单个单元的验算结果表格
        /// </summary>
        /// <param name="mm">模型对像</param>
        /// <param name="FileOut">输出文件路径</param>
        /// <param name="cr">截面验算结果</param>
        /// <param name="iElem">单元号</param>
        public static void WriteElemCheckRes(ref Bmodel mm, ref CheckRes cr, string FileOut, int iElem)
        {
            FileStream   stream = File.Open(FileOut, FileMode.Create);
            StreamWriter writer = new StreamWriter(stream);

            writer.WriteLine("单元号\t截面位置\t荷载组合\tN(kN)\tMy(kN*m)\tMz(kN*m)\t强度(MPa)\t稳定(MPa)\t应力比");

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

            foreach (string com in coms)
            {
                //如果组合未激活,则跳过
                if (mm.LoadCombTable[com].bACTIVE == false)
                {
                    continue;
                }

                SingleEleCheckResData serd = cr.CheckResTable[iElem].GetCheckResByCom(com);
                writer.WriteLine("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}", iElem.ToString(), serd.Sec_contral, com,
                                 (serd.N / 1e3).ToString("0.0"), (serd.My / 1e3).ToString("0.0"),
                                 (serd.Mz / 1e3).ToString("0.0"), (serd.Strength / 1e6).ToString("0.0"),
                                 (serd.Stability / 1e6).ToString("0.0"), serd.Ratio.ToString("0.00"));
                //writer.WriteLine("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}", iElem.ToString(), "1/2", com,
                //    EFcom.Force_48.N.ToString("0.0"), EFcom.Force_48.My.ToString("0.0"),
                //    EFcom.Force_48.Mz.ToString("0.0"), Strength_2.ToString("0.0"),
                //    Stability_2.ToString("0.0"), Ratio_2.ToString("0.00"));
                //writer.WriteLine("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}", iElem.ToString(), "J", com,
                //    EFcom.Force_j.N.ToString("0.0"), EFcom.Force_j.My.ToString("0.0"),
                //    EFcom.Force_j.Mz.ToString("0.0"), Strength_j.ToString("0.0"),
                //    Stability_j.ToString("0.0"), Ratio_j.ToString("0.00"));
            }
            //输出控制组合
            writer.WriteLine("\n\n******控制组合*******: {0}", cr.CheckResTable[iElem].GetControlData().ComName);
            writer.Close();
            stream.Close();
        }
예제 #29
0
        /// <summary>
        /// 输出指定单元指定截面的设计内力
        /// </summary>
        /// <param name="iEle">单元号</param>
        /// <param name="loc">截面位置</param>
        /// <param name="mm">模型数据</param>
        /// <param name="cm">设计数据</param>
        public void printDesignForcebyEle(int iEle, int loc, ref Bmodel mm, ref BCheckModel cm)
        {
            List <string> coms = mm.LoadCombTable.ComSteel;//钢结构设计组合表
            string        sLoc = null;

            switch (loc)
            {
            case 0: sLoc = "I"; break;

            case 1: sLoc = "1/8"; break;

            case 2: sLoc = "2/8"; break;

            case 3: sLoc = "3/8"; break;

            case 4: sLoc = "4/8"; break;

            case 5: sLoc = "5/8"; break;

            case 6: sLoc = "6/8"; break;

            case 7: sLoc = "7/8"; break;

            case 8: sLoc = "J"; break;
            }
            //指定地震工况
            string        LcEx = "SRSS3";
            string        LcEy = "SRSS4";
            string        LcEz = "Ez";
            List <string> LcEs = new List <string>()
            {
                LcEx, LcEy, LcEz
            };

            foreach (string com in coms)
            {
                BLoadComb curComb = mm.LoadCombTable.getLoadComb(LCKind.STEEL, com); //正常组合
                BLoadComb Comb_N  = curComb.Clone() as BLoadComb;
                BLoadComb Comb_M  = curComb.Clone() as BLoadComb;                    //弯矩调整组合
                BLoadComb Comb_V  = curComb.Clone() as BLoadComb;                    //剪力调整组合
                if (!curComb.bACTIVE)
                {
                    continue;
                }

                ElemForce          EFcom  = mm.CalElemForceComb(curComb, iEle);
                Xceed.Grid.DataRow curRow = gc_Table.DataRows.AddNew();           //添加数据行
                if (cm.QuakeAdjustFacors.ContainsKey(iEle) & curComb.hasLC(LcEs)) //如果为地震组合且有放大
                {
                    BQuakeAdjustFactor qaf = cm.QuakeAdjustFacors[iEle];          //放大系数
                    Comb_N.magnifyLc(LcEs, qaf.N_LC);                             //组合前放大
                    Comb_N.magnifyComb(qaf.N_COM);                                //组合后放大
                    Comb_M.magnifyLc(LcEs, qaf.M_LC);                             //组合前放大
                    Comb_M.magnifyComb(qaf.M_COM);                                //组合后放大
                    Comb_V.magnifyLc(LcEs, qaf.V_LC);                             //组合前放大
                    Comb_V.magnifyComb(qaf.V_COM);                                //组合后放大
                    curRow.BackColor = Color.AliceBlue;
                }
                ElemForce EFcom_N = mm.CalElemForceComb(Comb_N, iEle);
                ElemForce EFcom_M = mm.CalElemForceComb(Comb_M, iEle);
                ElemForce EFcom_V = mm.CalElemForceComb(Comb_V, iEle);

                curRow.Cells[0].Value = iEle;
                curRow.Cells[1].Value = sLoc;
                curRow.Cells[2].Value = com;
                curRow.Cells[3].Value = Math.Round(EFcom_N[loc].N / 1000, 1);
                curRow.Cells[4].Value = Math.Round(EFcom_V[loc].Vy / 1000, 1);
                curRow.Cells[5].Value = Math.Round(EFcom_V[loc].Vz / 1000, 1);
                curRow.Cells[6].Value = Math.Round(EFcom[loc].T / 1000, 1);
                curRow.Cells[7].Value = Math.Round(EFcom_M[loc].My / 1000, 1);
                curRow.Cells[8].Value = Math.Round(EFcom_M[loc].Mz / 1000, 1);
                curRow.EndEdit();//完成数据行编辑

                //if (cm.QuakeAdjustFacors.ContainsKey(iEle) & curComb.hasLC(LcEs))//如果为地震组合且有放大
                //{
                //    //调整前数据
                //    Xceed.Grid.DataRow curRowN = gc_Table.DataRows.AddNew();//添加数据
                //    curRowN.BackColor = Color.Red;
                //    curRowN.Cells[0].Value = iEle;
                //    curRowN.Cells[1].Value = sLoc;
                //    curRowN.Cells[2].Value = com;
                //    curRowN.Cells[3].Value = EFcom[loc].N / 1000;
                //    curRowN.Cells[4].Value = EFcom[loc].Vy / 1000;
                //    curRowN.Cells[5].Value = EFcom[loc].Vz / 1000;
                //    curRowN.Cells[6].Value = EFcom[loc].T / 1000;
                //    curRowN.Cells[7].Value = EFcom[loc].My / 1000;
                //    curRowN.Cells[8].Value = EFcom[loc].Mz / 1000;
                //    curRowN.EndEdit();//完成数据行编辑
                //}
            }
        }
예제 #30
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;
            }
        }