| | |
| | | } |
| | | } |
| | | |
| | | private static bool isBusy = false; |
| | | |
| | | /// <summary> |
| | | /// 创建Mpt |
| | | /// </summary> |
| | |
| | | |
| | | try |
| | | { |
| | | if (isBusy) throw new Exception("已有一个生成Mpt的任务正在执行"); |
| | | |
| | | isBusy = true; |
| | | string targetPath = Path.Combine(Tools.TempDir, time); |
| | | if (!Directory.Exists(targetPath)) Directory.CreateDirectory(targetPath); |
| | | |
| | |
| | | string cmd = string.Format("\"C:\\Program Files\\Skyline\\TerraBuilder\\TerraBuilder.exe\" -script \"{0}\"", js); // -DisablePrint |
| | | ReloadTB(); |
| | | err = Tools.ExecCmd(cmd, false, false); |
| | | if (File.Exists(MptPath)) |
| | | { |
| | | return MoveMpt(MptPath, sourcePath); |
| | | } |
| | | isBusy = false; |
| | | |
| | | return null; |
| | | return File.Exists(MptPath) ? MoveMpt(MptPath, sourcePath) : null; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogOut.Error(ex.Message + "\r\n" + ex.StackTrace); |
| | | err = ex.Message; |
| | | isBusy = false; |
| | | return null; |
| | | } |
| | | finally |
| | |
| | | { |
| | | List<string> list = new List<string>(); |
| | | list.Add("taskkill /f /t /im TerraBuilder.exe"); |
| | | list.Add("taskkill /f /t /im TBFuser.exe"); |
| | | list.Add("start /d \"C:\\Program Files\\Skyline\\TerraBuilder Fuser\" TBFuser.exe"); |
| | | //list.Add("taskkill /f /t /im TBFuser.exe"); |
| | | //list.Add("start /d \"C:\\Program Files\\Skyline\\TerraBuilder Fuser\" TBFuser.exe /b"); |
| | | |
| | | Tools.ExecCmd(list, false); |
| | | } |
| | |
| | | if (null != dem) MoveFile(dem, Path.Combine(sourcePath, "数字高程模型")); |
| | | |
| | | MoveFolder(Path.Combine(path, "shp"), Path.Combine(sourcePath, "中线裁剪范围")); |
| | | |
| | | Directory.Delete(path, true); |
| | | } |
| | | catch (Exception ex) |
| | | { |