管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2023-08-03 b8d4767bfe9c9cefafc20042cade664f0278beb3
1
已修改2个文件
12 ■■■■ 文件已修改
ExportMap/cs/ExportUtil.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/cs/Tools.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/cs/ExportUtil.cs
@@ -142,7 +142,7 @@
            CreateTemplate(args);
            string cmd = string.Format("python \"{0}\" -qgz {1} -qpt {2}", PyFile, qgz, args.qpt);
            err = Tools.ExecCmd(null, cmd, true);
            err = Tools.ExecCmd(null, cmd, true, true);
            string qptFile = Path.Combine(SourcesPath, args.qpt);
            if (File.Exists(qptFile)) File.Delete(qptFile);
ExportMap/cs/Tools.cs
@@ -171,7 +171,7 @@
        /// <param name="isPy">是否为QGIS Py脚本</param>
        /// <param name="isOut">是否输出错误</param>
        /// <returns>执行结果或出错信息</returns>
        public static string ExecCmd(SysTask task, string cmd, bool isPy = false)
        public static string ExecCmd(SysTask task, string cmd, bool isPy = false, bool isOut = false)
        {
            List<string> list = new List<string>();
            if (isPy)
@@ -183,7 +183,7 @@
            }
            list.Add(cmd);
            string str = ExecCmd(task, list);
            string str = ExecCmd(task, list, isOut);
            return str;
        }
@@ -195,7 +195,7 @@
        /// <param name="list">命令集合</param>
        /// <param name="isOut">是否输出错误</param>
        /// <returns>执行结果或出错信息</returns>
        public static string ExecCmd(SysTask task, List<string> list)
        public static string ExecCmd(SysTask task, List<string> list, bool isOut = false)
        {
            string str = null;
            try
@@ -211,7 +211,7 @@
                p.Start();
                StreamWriter si = p.StandardInput; // 标准输入流 
                //StreamReader so = isOut ? p.StandardOutput : null; // 标准输出流
                StreamReader so = isOut ? p.StandardOutput : null; // 标准输出流
                StreamReader se = p.StandardError; // 标准错误流
                LogOut.Info("cmd = " + string.Join(",", list));
@@ -222,7 +222,7 @@
                }
                si.WriteLine("exit");
                //string info = null == so ? null : so.ReadToEnd();
                string info = null == so ? null : so.ReadToEnd();
                str = se.ReadToEnd();
                //if (!string.IsNullOrEmpty(info)) LogOut.Debug(info);