/// <summary> /// 查询现在设计数据库,并在控件上显示 /// </summary> private void freshParaControl(int num) { MainForm mmf = this.Owner as MainForm; BCheckModel cm = mmf.ModelForm.CheckModel; if (cm.SecDP.ContainsKey(num)) { double r1 = cm.SecDP[num].RatioNet; _CurSecPara.RatioNet = r1; tb_ratioNet.Text = r1.ToString(); bool r2 = cm.SecDP[num].IsClosed; _CurSecPara.IsClosed = r2; cb_Closed.Checked = r2; SecCategory r3 = cm.SecDP[num].SecCat_y; _CurSecPara.SecCat_y = r3; cb_SecCat_y.SelectedIndex = (int)r3; SecCategory r33 = cm.SecDP[num].SecCat_z; _CurSecPara.SecCat_z = r33; cb_SecCat_z.SelectedIndex = (int)r33; double r4 = cm.SecDP[num].Gama_x; double r5 = cm.SecDP[num].Gama_y; _CurSecPara.Gama_x = r4; _CurSecPara.Gama_y = r5; tb_Gamax.Text = r4.ToString(); tb_Gamay.Text = r5.ToString(); gb_Para.BackColor = Color.PowderBlue; } else { gb_Para.BackColor = Color.FromKnownColor(KnownColor.Control); cb_SecCat_y.SelectedIndex = 1; cb_SecCat_z.SelectedIndex = 2; } }
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); } }
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); }
/// <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); } }
/// <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();//完成数据行编辑 //} } }