管道基础大数据平台系统开发-【CS】-ExportMap
13693261870
2024-07-18 0a70f99e51b0ea0c83288213e3b1f7904d78ede0
SimuTools/FrmMain.cs
@@ -17,6 +17,16 @@
        private void FrmMain_Load(object sender, EventArgs e)
        {
            LogOut.Info("启动程序...");
            try
            {
                GdalHelper gdal = GdalHelper.Instance;
                LogOut.Info("> 初始化GDAL完成 <");
            }
            catch (Exception ex)
            {
                LogOut.Error(ex.StackTrace);
                ShowErr("GDAL初始化出错:" + ex.Message);
            }
        }
        private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
@@ -77,11 +87,17 @@
        private void btnRun_Click(object sender, EventArgs e)
        {
            string serviceName = this.txtServiceName.Text.Trim();
            string terrainFile = this.txtTerrainPath.Text.Trim();
            string waterPath = this.txtWaterPath.Text.Trim();
            string flowPath = this.txtFlowPath.Text.Trim();
            string outPath = this.txtOutPath.Text.Trim();
            if (string.IsNullOrEmpty(serviceName))
            {
                ShowErr("服务名称,要求必填!");
                return;
            }
            if (!File.Exists(terrainFile))
            {
                ShowErr("地形文件,要求必须存在!");
@@ -98,9 +114,18 @@
            {
                flag = true;
                LogOut.Info("开始运行 >>");
                outPath = Path.Combine(outPath, serviceName);
                if (!Directory.Exists(outPath))
                {
                    Directory.CreateDirectory(outPath);
                }
                Tools.Handle.Run(terrainFile, waterPath, flowPath, outPath);
                LogOut.Info("运行结束 >>");
                flag = false;
                LogOut.Info("运行结束 <<");
                MessageBox.Show("运行结束!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {