private void bt_Accept_Click(object sender, EventArgs e) { MainForm mf = this.ParentForm as MainForm; ModelForm1 cf = mf.ModelForm; List <int> eles = mf.SelectElems; #region 输入错误判断 if (eles.Count == 0) { mf.MessageTool.Tb_out.AppendText(Environment.NewLine + "*Error*:未选择单元!"); return; } if (cf == null || cf.IsDisposed) { MessageBox.Show("请先新建模型", "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } #endregion if (rb_add.Checked)//添加数据 { double Nlc = double.Parse(tb_N_LC.Text); double Mlc = double.Parse(tb_M_LC.Text); double Vlc = double.Parse(tb_V_LC.Text); double Ncom = double.Parse(tb_N_Com.Text); double Mcom = double.Parse(tb_M_Com.Text); double Vcom = double.Parse(tb_V_Com.Text); foreach (int ele in eles) { BQuakeAdjustFactor Qaf = new BQuakeAdjustFactor(ele); Qaf.N_LC = Nlc; Qaf.M_LC = Mlc; Qaf.V_LC = Vlc; Qaf.N_COM = Ncom; Qaf.M_COM = Mcom; Qaf.V_COM = Vcom; cf.CheckModel.assignQuakeAdjustFactor(ele, Qaf); } } else if (rb_del.Checked) { foreach (int ele in eles) { cf.CheckModel.deleQuakeAdjustFactor(ele); } } }
/// <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();//完成数据行编辑 //} } }