public void SetAircraft(Aircraft ap) { if (ap == null) return; //if the displayed aircraft is the one we want to change to, dont bother changing if (m_ap != null && m_ap == ap) return; this.SuspendLayout(); this.flowLayoutPanel1.Controls.Clear(); m_ap = ap; this.designLabel.Text = m_ap.Configuration_Name; //this.pictureBox1.Image = m_ap.PrimaryInstance.Geometry_Image; this.pictureBox1.Image = GeometryModeler.DrawAirplane(m_ap, GeometryModeler.Views.Isomeric); RefreshValues(); foreach (AVL_File.Surface surf in ap.Initial_AVL_File.Surfaces) { SurfaceUC suc = new SurfaceUC(surf); this.flowLayoutPanel1.Controls.Add(suc); } this.cmdPrmpButton.Visible = true; foreach (Control c in flowLayoutPanel2.Controls) c.Visible = true; this.revertButton.Enabled = m_ap.HasBackup; this.ResumeLayout(); }
private static void OnChangedSelection(SurfaceUC inst, SectionSelectEventArgs e) { if (OnUpdateSelection != null) { OnUpdateSelection(inst, e); } }
private void addSurfButton_Click(object sender, EventArgs e) { InputBox ib = new InputBox("Create a new surface for this aircraft", "Enter name for the new lifting surface:"); if (ib.ShowDialog() == DialogResult.OK) { if (ib.InputText != string.Empty) { AVL_File.Surface surf = new AVL_File.Surface(ib.InputText, m_ap.Initial_AVL_File); AVL_File.Surface.Section sec1 = new AVL_File.Surface.Section(surf); sec1.Chord = 10; AVL_File.Surface.Section sec2 = new AVL_File.Surface.Section(surf); sec2.Chord = 10; sec2.Y_LeadingEdge = 10; surf.Sections.Add(sec1); surf.Sections.Add(sec2); m_ap.Initial_AVL_File.Surfaces.Add(surf); SurfaceUC suc = new SurfaceUC(surf); this.flowLayoutPanel1.Controls.Add(suc); } } }
private void SurfaceUC_OnUpdateSelection(SurfaceUC sender, SurfaceUC.SectionSelectEventArgs e) { if (sender == null) { return; } if (m_ap.Initial_AVL_File.Surfaces.Contains(sender.DispSurface)) { selected_section = e.Selected_Section; selected_surf = sender.DispSurface.Name; this.pictureBox1.Image = GeometryModeler.DrawAirplane(m_ap, m_currentView, sender.DispSurface.Name, e.Selected_Section); } }
public void SetAircraft(Aircraft ap) { if (ap == null) { return; } //if the displayed aircraft is the one we want to change to, dont bother changing if (m_ap != null && m_ap == ap) { return; } this.SuspendLayout(); this.flowLayoutPanel1.Controls.Clear(); m_ap = ap; this.designLabel.Text = m_ap.Configuration_Name; //this.pictureBox1.Image = m_ap.PrimaryInstance.Geometry_Image; this.pictureBox1.Image = GeometryModeler.DrawAirplane(m_ap, GeometryModeler.Views.Isomeric); RefreshValues(); foreach (AVL_File.Surface surf in ap.Initial_AVL_File.Surfaces) { SurfaceUC suc = new SurfaceUC(surf); this.flowLayoutPanel1.Controls.Add(suc); } this.cmdPrmpButton.Visible = true; foreach (Control c in flowLayoutPanel2.Controls) { c.Visible = true; } this.revertButton.Enabled = m_ap.HasBackup; this.ResumeLayout(); }
private void SurfaceUC_OnUpdateSelection(SurfaceUC sender, SurfaceUC.SectionSelectEventArgs e) { if (sender == null) return; if (m_ap.Initial_AVL_File.Surfaces.Contains(sender.DispSurface)) { selected_section = e.Selected_Section; selected_surf = sender.DispSurface.Name; this.pictureBox1.Image = GeometryModeler.DrawAirplane(m_ap, m_currentView, sender.DispSurface.Name, e.Selected_Section); } }