Ejemplo n.º 1
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() + "个截面数据输出完成。");
            }
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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);
            }
        }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
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);
            }
        }
Ejemplo n.º 7
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);
            }
        }