private void btnAddAcousticKT_Click(object sender, EventArgs e) { FormAddAcoustickKT form = new FormAddAcoustickKT(); DialogResult res = form.ShowDialog(); if (res == System.Windows.Forms.DialogResult.OK) { //lstAcousticList.Items.Add(form.KTName); switch (form.Type) { case KTType.Outside: Outside outside = new Outside(); outside.ShowDialog(); CPOutside cp = new CPOutside(form.KTName); getDataFromOutside(cp, outside); currentResearch.CheckPoints.Add(cp); researchUpdated(); break; case KTType.Neighbor: FormNeigborRooms neighbor = new FormNeigborRooms(); neighbor.ShowDialog(); CPNeighbor cpn = new CPNeighbor(form.KTName); getDataFromNeighbor(cpn, neighbor); currentResearch.CheckPoints.Add(cpn); researchUpdated(); break; case KTType.Vent: FormVent vent = new FormVent(); vent.ShowDialog(); CPVent cpVent = new CPVent(form.KTName); getDataFromVent(cpVent, vent); currentResearch.CheckPoints.Add(cpVent); researchUpdated(); break; case KTType.Vibro: FormVibro vibro = new FormVibro(); vibro.ShowDialog(); CPVibro cpVibro = new CPVibro(form.KTName); getDataFromVibro(cpVibro, vibro); currentResearch.CheckPoints.Add(cpVibro); researchUpdated(); break; } } }
private void lstAcousticList_DoubleClick(object sender, EventArgs e) { if (lstAcousticList.SelectedIndex == -1) return; Type type = currentResearch.CheckPoints[lstAcousticList.SelectedIndex].GetType(); if (type == Type.GetType("Diplom.Data.CPOutside")) { CPOutside cp = (CPOutside)currentResearch.CheckPoints[lstAcousticList.SelectedIndex]; Outside outside = new Outside(cp); outside.ShowDialog(); getDataFromOutside(cp, outside); } else if (type == Type.GetType("Diplom.Data.CPVibro")) { CPVibro cp = (CPVibro)currentResearch.CheckPoints[lstAcousticList.SelectedIndex]; FormVibro outside = new FormVibro(cp); outside.ShowDialog(); getDataFromVibro(cp, outside); } else if (type == Type.GetType("Diplom.Data.CPVent")) { CPVent cp = (CPVent)currentResearch.CheckPoints[lstAcousticList.SelectedIndex]; FormVent vent = new FormVent(cp); vent.ShowDialog(); getDataFromVent(cp, vent); } else if (type == Type.GetType("Diplom.Data.CPNeighbor")) { CPNeighbor cp = (CPNeighbor)currentResearch.CheckPoints[lstAcousticList.SelectedIndex]; FormNeigborRooms outside = new FormNeigborRooms(cp); outside.ShowDialog(); getDataFromNeighbor(cp, outside); } }
private void getDataFromVibro(CPVibro cp, FormVibro outside) { cp.SignalLevelIndex = outside.SignalLevel; cp.absorbersList = outside.Absorbers; cp.consumersList = outside.Consumers; cp.Volume = outside.Volume; cp.RoomTypeIndex = outside.RoomType; cp.Distance = outside.Distance; cp.MaterialIndex = outside.Material; cp.SignalPlaceIndex = outside.SignalPlace; cp.Results = outside.Result; }