Пример #1
0
        private void structureSetBtn_Click(object sender, EventArgs e)
        {
            RiverSimulationProfile p = RiverSimulationProfile.profile;

            if (!ConvertStructureSetNumber())
            {
                return;
            }

            if (p.tBarNumber + p.bridgePierNumber + p.groundsillWorkNumber + p.sedimentationWeirNumber == 0)
            {
                MessageBox.Show("請設置結構物數量!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            bool alreadyShow = false;

            RiverSimulationProfile.StructureChangeType tp = p.CheckStructurerChanged(p.tBarSet, ref p.tBarSets, p.tBarNumber, true);
            if (!alreadyShow && tp == RiverSimulationProfile.StructureChangeType.SelectionAndDataNoMatch)
            {
                MessageBox.Show("結構物數量或設置已變更,請重新設定結構物!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                alreadyShow = true;
            }

            tp = p.CheckStructurerChanged(p.bridgePierSet, ref p.bridgePierSets, p.bridgePierNumber, true);
            if (!alreadyShow && tp == RiverSimulationProfile.StructureChangeType.SelectionAndDataNoMatch)
            {
                MessageBox.Show("結構物數量或設置已變更,請重新設定結構物!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                alreadyShow = true;
            }
            tp = p.CheckStructurerChanged(p.groundsillWorkSet, ref p.groundsillWorkSets, p.groundsillWorkNumber, true);
            if (!alreadyShow && tp == RiverSimulationProfile.StructureChangeType.SelectionAndDataNoMatch)
            {
                MessageBox.Show("結構物數量或設置已變更,請重新設定結構物!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                alreadyShow = true;
            }
            tp = p.CheckStructurerChanged(p.sedimentationWeirSet, ref p.sedimentationWeirSets, p.sedimentationWeirNumber, true);
            if (!alreadyShow && tp == RiverSimulationProfile.StructureChangeType.SelectionAndDataNoMatch)
            {
                MessageBox.Show("結構物數量或設置已變更,請重新設定結構物!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                alreadyShow = true;
            }

            p.ResizeStructureSets(p.tBarNumber, p.bridgePierNumber, p.groundsillWorkNumber, p.sedimentationWeirNumber);
            StructureSetForm form = new StructureSetForm();

            form.SetFormMode(structureSetGrp.Text,
                             (p.tBarSet) ? p.tBarNumber : 0, tBarSetChk.Text,
                             (p.bridgePierSet) ? p.bridgePierNumber : 0, bridgePierSetChk.Text,
                             (p.groundsillWorkSet) ? p.groundsillWorkNumber : 0, groundsillWorkSetChk.Text,
                             (p.sedimentationWeirSet) ? p.sedimentationWeirNumber : 0, sedimentationWeirSetChk.Text);

            DialogResult r = form.ShowDialog();

            NoticeStructureChange();
            structFirstSetting = true;
        }
Пример #2
0
        private void selInputBtn_Click(object sender, EventArgs e)
        {
            RiverSimulationProfile p    = RiverSimulationProfile.profile;
            StructureSetForm       form = new StructureSetForm();

            form.SetFormMode(selInputBtn.Text, -1, "", -1, "", -1, "", -1, "");

            DialogResult r = form.ShowDialog();

            if (DialogResult.OK == r)
            {
                foreach (Point pt in form.selectedPl)
                {
                    dataGridView[pt.Y, pt.X].Value = form.selectedValue;
                }
            }
        }
Пример #3
0
        private void structureSetBtn_Click(object sender, EventArgs e)
        {
            RiverSimulationProfile p = RiverSimulationProfile.profile;
            if (!ConvertStructureSetNumber())
            {
                return;
            }

            if (p.tBarNumber + p.bridgePierNumber + p.groundsillWorkNumber + p.sedimentationWeirNumber == 0)
            {
                MessageBox.Show("請設置結構物數量!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            bool alreadyShow = false;
            RiverSimulationProfile.StructureChangeType tp = p.CheckStructurerChanged(p.tBarSet, ref p.tBarSets, p.tBarNumber, true);
            if (!alreadyShow && tp == RiverSimulationProfile.StructureChangeType.SelectionAndDataNoMatch)
            {
                MessageBox.Show("結構物數量或設置已變更,請重新設定結構物!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                alreadyShow = true;
            }

            tp = p.CheckStructurerChanged(p.bridgePierSet, ref p.bridgePierSets, p.bridgePierNumber, true);
            if (!alreadyShow && tp == RiverSimulationProfile.StructureChangeType.SelectionAndDataNoMatch)
            {
                MessageBox.Show("結構物數量或設置已變更,請重新設定結構物!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                alreadyShow = true;
            }
            tp = p.CheckStructurerChanged(p.groundsillWorkSet, ref p.groundsillWorkSets, p.groundsillWorkNumber, true);
            if (!alreadyShow && tp == RiverSimulationProfile.StructureChangeType.SelectionAndDataNoMatch)
            {
                MessageBox.Show("結構物數量或設置已變更,請重新設定結構物!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                alreadyShow = true;
            }
            tp = p.CheckStructurerChanged(p.sedimentationWeirSet, ref p.sedimentationWeirSets, p.sedimentationWeirNumber, true);
            if (!alreadyShow && tp == RiverSimulationProfile.StructureChangeType.SelectionAndDataNoMatch)
            {
                MessageBox.Show("結構物數量或設置已變更,請重新設定結構物!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                alreadyShow = true;
            }

            p.ResizeStructureSets(p.tBarNumber, p.bridgePierNumber, p.groundsillWorkNumber, p.sedimentationWeirNumber);
            StructureSetForm form = new StructureSetForm();
            form.SetFormMode(structureSetGrp.Text,
                (p.tBarSet) ? p.tBarNumber : 0, tBarSetChk.Text,
                (p.bridgePierSet) ? p.bridgePierNumber : 0, bridgePierSetChk.Text,
                (p.groundsillWorkSet) ? p.groundsillWorkNumber : 0, groundsillWorkSetChk.Text,
                (p.sedimentationWeirSet) ? p.sedimentationWeirNumber : 0, sedimentationWeirSetChk.Text);

            DialogResult r = form.ShowDialog();
            if (DialogResult.OK == r)
            {
                //p.separateArray = (double[])form.SeparateData().Clone();
                //ShowGridMap(PicBoxType.Sprate);
                //DrawPreview();
            }
        }