//Changes the current cross section private void listBoxCrossSecs_SelectedIndexChanged(object sender, EventArgs e) { if (listBoxCrossSecs.SelectedIndex != -1) { _projectPlugIn.CurrentBeam = _projectPlugIn.Beams[listBoxCrossSecs.SelectedIndex]; _projectPlugIn.SelectedBeamIndex = listBoxCrossSecs.SelectedIndex; if (_projectPlugIn.CurrentBeam.CrossSec is PredefinedCrossSection) { //Update dataGridviewRows DataGridViewRow r = (DataGridViewRow)dataGridViewLoads.Rows[0].Clone(); dataGridViewLoads.Rows.Clear(); int i = 0; foreach (LoadCase lc in _projectPlugIn.CurrentBeam.LoadCases) { if (lc.GetType() == typeof(ColLoadCase)) { ColLoadCase clc = (ColLoadCase)lc; r = (DataGridViewRow)r.Clone(); double NormalForce = dataGridViewLoads.Rows.Add(r); dataGridViewLoads.Rows[i].Cells[0].Value = clc.Name; dataGridViewLoads.Rows[i].Cells[1].Value = clc.N_Ed * Math.Pow(10, -3); dataGridViewLoads.Rows[i].Cells[2].Value = clc.M_EzTop * Math.Pow(10, -3); dataGridViewLoads.Rows[i].Cells[3].Value = clc.M_EzBottom * Math.Pow(10, -3); dataGridViewLoads.Rows[i].Cells[4].Value = clc.M_EyTop * Math.Pow(10, -3); dataGridViewLoads.Rows[i].Cells[5].Value = clc.M_EyBottom * Math.Pow(10, -3); i++; } } UpdatePredefinedFromCrossSection(); EnablePredefinedCrossSection(); } else { UpdateValuesGenericCrossSection(); EnableGenericCrossSection(); } ZoomToCurrentBeam(); } }
public void SetChartValues(ColLoadCase clc) { if (clc.NMCurve != null && clc.NMCurve.Count != 0) { ResultChart.Series["Strength"].Points.Clear(); foreach (Point3d pt in clc.NMCurve) { ResultChart.Series["Strength"].Points.AddXY(pt.Z * 0.001, pt.X * 0.001); } ChartManipulationTools.SetAxisIntervalAndMax(ResultChart, clc.NMCurve, Moment.Mz); if (ResultChart.Series.IndexOf("Loading") == -1) { ResultChart.Series.Add("Loading"); ResultChart.Series["Loading"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; ResultChart.Series["Loading"].Color = Color.BlueViolet; ResultChart.Series["Loading"].BorderWidth = 2; } ResultChart.Series["Loading"].Points.Clear(); clc.LoadCurve.ForEach(o => ResultChart.Series["Loading"].Points.AddXY(o.Z * 0.001, o.X * 0.001)); if (ResultChart.Series.IndexOf(clc.Name) == -1) { ChartManipulationTools.CreateNewPointChart(clc.Name, ResultChart); ResultChart.Series[clc.Name].Points.AddXY(clc.M_EdComb * 0.001, clc.N_Ed * 0.001); } else { int index = ResultChart.Series.IndexOf(clc.Name); ResultChart.Series[index].Points.Clear(); ResultChart.Series[index].Points.AddXY(clc.M_EdComb * 0.001, clc.N_Ed * 0.001); } } }