Ejemplo n.º 1
0
        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;
                }
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        private void getDataFromOutside(CPOutside cp, Outside outside)
        {
            cp.SignalLevelIndex = outside.SignalLevel;
            cp.NoiseTypeIndex = outside.NoiseType;
            cp.Volume = outside.Volume;
            cp.RoomTypeIndex = outside.RoomType;
            cp.Distance = outside.Distance;
            cp.SoundFadingIndex = outside.SoundFading;
            cp.AngleIndex = outside.Angle;
            cp.Microphone = outside.Microphone;
            cp.MicrophoneText = outside.MicrophoneValue;
            cp.NoiseReduction = outside.NoiseReduction;

            cp.reflectorsList = outside.Reflectors;
            cp.absorbersList = outside.Absorbers;
            cp.consumersList = outside.Consumers;

            cp.Results = outside.Result;
        }