Exemplo n.º 1
0
        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);
            }
        }