Beispiel #1
0
 private void openFileBtn_Click(object sender, EventArgs e)
 {
     if (!FunctionlUtility.OpenProjectFile(this, Program.GetProjectFileFullPath()))
     {
         return;
     }
     this.DialogResult = DialogResult.OK;
     this.Close();
 }
 private void openMnuItem_Click(object sender, EventArgs e)
 {
     FunctionlUtility.SaveProject(RiverSimulationProfile.profile);
     if (!FunctionlUtility.OpenProjectFile(this, Program.GetProjectFileFullPath()))
     {
         return;
     }
     UpdateStatus();
 }
Beispiel #3
0
 private void newFileBtn_Click(object sender, EventArgs e)
 {
     if (!FunctionlUtility.NewProjectFile(this, Program.GetProjectFullPath()))
     {
         return;
     }
     //RiverSimulationProfile.profile = new RiverSimulationProfile();
     //Program.projectFolder = Program.documentPath + "\\" + dlg.inputTxt.Text;
     this.DialogResult = DialogResult.OK;
     this.Close();
 }
Beispiel #4
0
 private void selectProject_Click(object sender, EventArgs e)
 {
     if (!FunctionlUtility.OpenProject(this))
     {
         return;
     }
     newFileBtn.Enabled         = true;
     openFileBtn.Enabled        = !FunctionlUtility.IsEmptyProject(Program.GetProjectFullPath());
     projectDescriptBtn.Enabled = true;
     SetProjectTitle(Program.projectName);
 }
Beispiel #5
0
 private void newProjectBtn_Click(object sender, EventArgs e)
 {
     if (!FunctionlUtility.NewProject(this))
     {
         return;
     }
     newFileBtn.Enabled         = true;
     openFileBtn.Enabled        = false;
     projectDescriptBtn.Enabled = true;
     SetProjectTitle(Program.projectName);
 }
Beispiel #6
0
        private void openFileBtn_Click(object sender, EventArgs e)
        {
            if (!FunctionlUtility.OpenProjectFile(this, Program.GetProjectFileFullPath()))
            {
                return;
            }
            //this.DialogResult = DialogResult.OK;
            //this.Close();
            RiverSimulationForm form = new RiverSimulationForm();

            if (DialogResult.OK != form.ShowDialog())
            {
                //this.Close();
            }
        }
 private void saveMnuItem_Click(object sender, EventArgs e)
 {
     FunctionlUtility.SaveProject(RiverSimulationProfile.profile);
     MessageBox.Show("檔案儲存完成。", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Information);
 }
 private void RiverSimulationForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     FunctionlUtility.SaveProject(RiverSimulationProfile.profile);
 }
 private void exitMnuItem_Click(object sender, EventArgs e)
 {
     FunctionlUtility.SaveProject(RiverSimulationProfile.profile);
     this.Close();
 }
        private void startBtn_Click(object sender, EventArgs e)
        {
            if (status == Status.Ready)
            {
                if (!DoConvert())
                {
                    return;
                }

                if (p != null)
                {
                    //string tempSave = Program.projectFolder + Program.tempSaveName;
                    //RiverSimulationProfile.SerializeBinary(p, tempSave);
                    FunctionlUtility.SaveProject(p);
                }

                p.GenerateInputFile(Program.GetProjectFileWorkingPath() + @"/resed.i");

                if (p.IsMovableBedMode())
                {
                    p.GenerateSedFile(Program.GetProjectFileWorkingPath() + @"/sed.dat");
                }

                if (p.Is3DMode())
                {
                    p.Generate3dFile(Program.GetProjectFileWorkingPath() + @"/3Dinput.dat");
                }

                if (p.groundsillWorkSet)
                {
                    p.GenerateStructureFile(p.groundsillWorkSets, Program.GetProjectFileWorkingPath() + @"/3.txt");
                }

                if (p.sedimentationWeirSet)
                {
                    p.GenerateStructureFile(p.sedimentationWeirSets, Program.GetProjectFileWorkingPath() + @"/4.txt");
                }

                if (p.IsMovableBedMode() && p.quayStableAnalysisFunction)
                {
                    p.GenerateQuayWallFile(Program.GetProjectFileWorkingPath() + @"/BANKINFO.txt");
                }
                ResetChart();
                RunSimulationMain();
                EnterSimUI(Status.Running);
            }
            else if (status == Status.Running)
            {
                if (!simProcess.HasExited)
                {
                    Utility.Suspend(simProcess);
                }
                //timer1.Stop();
                EnterSimUI(Status.Pause);
            }
            else if (status == Status.Pause)
            {
                if (!simProcess.HasExited)
                {
                    Utility.Resume(simProcess);
                }
                EnterSimUI(Status.Running);
            }
        }