管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2023-08-03 0a7a732a71aed91eadae992ec26d3f4726d04df2
1
已修改7个文件
44 ■■■■ 文件已修改
ExportMap/cs/ConvertUtils.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/cs/ExportUtil.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/cs/LasUtils.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/cs/OsgbUtils.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/cs/TerraUtils.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/cs/Tools.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/cs/XYZUtils.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/cs/ConvertUtils.cs
@@ -84,8 +84,7 @@
            Process p = null;
            try
            {
                //string log = Path.Combine(ExportUtil.SourcesPath, "ns_log.txt");
                //string args = string.Format("-licensing AdLM -OpenFile \"{0}\" -ExecuteAddInPlugin \"EngineBatch_Sample.SmartEarth\" \"{1}\" -log \"{2}\" -NoGui -Exit", modelFile, configFile, log);
                //string args = string.Format("-licensing AdLM -OpenFile \"{0}\" -ExecuteAddInPlugin \"EngineBatch_Sample.SmartEarth\" \"{1}\" -log \"{2}\" -NoGui -Exit", modelFile, configFile, Path.Combine(ExportUtil.SourcesPath, "ns_log.txt"));
                string args = string.Format("-licensing AdLM -OpenFile \"{0}\" -ExecuteAddInPlugin \"EngineBatch_Sample.SmartEarth\" \"{1}\" -NoGui -Exit", modelFile, configFile);
                LogOut.Info("Args:" + args);
@@ -94,11 +93,8 @@
                task.pid = p.Id;
                task.id = TaskDBHelper.Insert(task);
                // 让组件等候相关的进程进入闲置状态
                p.WaitForInputIdle();
                // 让组件无限期地等待关联进程退出
                p.WaitForExit();
                p.WaitForInputIdle(); // 让组件等候相关的进程进入闲置状态
                p.WaitForExit(); // 让组件无限期地等待关联进程退出
                task = TaskDBHelper.SelectById(task.id);
                if (null != task && task.status < 2)
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, true);
            err = Tools.ExecCmd(null, cmd, true);
            string qptFile = Path.Combine(SourcesPath, args.qpt);
            if (File.Exists(qptFile)) File.Delete(qptFile);
ExportMap/cs/LasUtils.cs
@@ -57,7 +57,7 @@
                    int idx = args.ids.IndexOf(meta.id);
                    string cmd = string.Format("{0}\\gocesiumtiler.exe -i \"{1}\" -o \"{2}\" -e {3} -z {4} -g -s", tilerPath, lasPath, outPath, args.srids[idx], args.zs[idx]);
                    err = Tools.ExecCmd(null, cmd, false, false);
                    err = Tools.ExecCmd(null, cmd, false);
                    string jsonFile = findTileset(meta, outPath);
                    if ("laz" == meta.type && File.Exists(lasPath)) File.Delete(lasPath);
ExportMap/cs/OsgbUtils.cs
@@ -61,7 +61,7 @@
                    int idx = args.ids.IndexOf(meta.id);
                    string cmd = string.Format("{0}\\3dtile.exe -f osgb -i \"{1}\" -o \"{2}\" -c \"{{\\\"offset\\\": {3}}}\"", d3tilesPath, osgbPath, outPath, args.zs[idx]);
                    err = Tools.ExecCmd(null, cmd, false, false);
                    err = Tools.ExecCmd(null, cmd, false);
                    err = null;
                    if (null != srs) writeSRS(osgbPath, srs);
ExportMap/cs/TerraUtils.cs
@@ -174,7 +174,7 @@
                }
                string cmd = string.Format("python \"{0}\" -qgz {1} -file \"{2}\" -out \"{3}\"", PyFile, Qgz, txtFile, tifFile);
                err = Tools.ExecCmd(null, cmd, true, false);
                err = Tools.ExecCmd(null, cmd, true);
                return tifFile;
            }
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, bool isOut = false)
        public static string ExecCmd(SysTask task, string cmd, bool isPy = false)
        {
            List<string> list = new List<string>();
            if (isPy)
@@ -183,7 +183,7 @@
            }
            list.Add(cmd);
            string str = ExecCmd(task, list, isOut);
            string str = ExecCmd(task, list);
            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, bool isOut = false)
        public static string ExecCmd(SysTask task, List<string> list)
        {
            string str = null;
            try
@@ -210,10 +210,8 @@
                p.StartInfo.RedirectStandardError = true;
                p.Start();
                //p.Id;
                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));
@@ -224,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);
ExportMap/cs/XYZUtils.cs
@@ -95,8 +95,7 @@
            string cmd = string.Format("python \"{0}\" -qgz {1} -file \"{2}\" -out \"{3}\" -min {4} -max {5} -noData {6}", PyFile, Qgz, tifFile, xyzPath, args.min, args.max, args.noData);
            //err = Tools.ExecCmd(GetCmds(batFile, cmd));
            err = Tools.ExecCmd(null, cmd, true, false);
            err = Tools.ExecCmd(null, cmd, true);
            //if (File.Exists(batFile)) File.Delete(batFile);
            if (File.Exists(tifFile)) File.Delete(tifFile);
@@ -112,17 +111,6 @@
            }
            return ids;
        }
        /// <summary>
        /// 获取命令行
        /// </summary>
        private static List<string> GetCmds(string batFile, string cmd)
        {
            string str = File.ReadAllText(BaseBat) + cmd;
            File.WriteAllText(batFile, str);
            return new List<string>() { "\"" + batFile + "\"" };
        }
        /// <summary>