From f13c7a874af0fbfca66695a42860167f95b38fe9 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期一, 13 三月 2023 17:27:14 +0800 Subject: [PATCH] 1 --- ExportMap/cs/ExportUtil.cs | 9 +--- ExportMap/cs/SGUtil.cs | 55 +++++++++++++++++++++++++++ ExportMap/cs/XYZUtil.cs | 31 +++++++++++++++ ExportMap/Controllers/ExportController.cs | 3 - ExportMap/ExportMap.csproj | 2 + 5 files changed, 91 insertions(+), 9 deletions(-) diff --git a/ExportMap/Controllers/ExportController.cs b/ExportMap/Controllers/ExportController.cs index 711aec2..cc47167 100644 --- a/ExportMap/Controllers/ExportController.cs +++ b/ExportMap/Controllers/ExportController.cs @@ -1,5 +1,4 @@ 锘縰sing ExportMap.cs; -using LFServer.cs; using LFServer.Models; using System; using System.Collections.Generic; @@ -8,7 +7,7 @@ using System.Net.Http; using System.Web.Http; -namespace LFServer.Controllers +namespace ExportMap.Controllers { public class ExportController : ApiController { diff --git a/ExportMap/ExportMap.csproj b/ExportMap/ExportMap.csproj index 8c12b42..95b2909 100644 --- a/ExportMap/ExportMap.csproj +++ b/ExportMap/ExportMap.csproj @@ -137,7 +137,9 @@ <Compile Include="cs\ExportUtil.cs" /> <Compile Include="cs\LogOut.cs" /> <Compile Include="cs\NoBufferPolicySelector.cs" /> + <Compile Include="cs\SGUtil.cs" /> <Compile Include="cs\Tool.cs" /> + <Compile Include="cs\XYZUtil.cs" /> <Compile Include="db\ModelHandler.cs" /> <Compile Include="db\PostgreHelper.cs" /> <Compile Include="db\SQLiteHelper.cs" /> diff --git a/ExportMap/cs/ExportUtil.cs b/ExportMap/cs/ExportUtil.cs index 117a64b..571ac85 100644 --- a/ExportMap/cs/ExportUtil.cs +++ b/ExportMap/cs/ExportUtil.cs @@ -11,15 +11,10 @@ using System.Text; using System.Web; -namespace LFServer.cs +namespace ExportMap.cs { public static class ExportUtil { - /// <summary> - /// 鍩虹洰褰� - /// </summary> - public static readonly string BaseDir = AppDomain.CurrentDomain.BaseDirectory; - /// <summary> /// 鏈�澶ф枃浠舵暟 /// </summary> @@ -36,7 +31,7 @@ { if (string.IsNullOrEmpty(sourcesPath)) { - sourcesPath = Path.Combine(BaseDir, "Sources"); + sourcesPath = Path.Combine(Tool.BaseDir, "Sources"); } return sourcesPath; diff --git a/ExportMap/cs/SGUtil.cs b/ExportMap/cs/SGUtil.cs new file mode 100644 index 0000000..3590407 --- /dev/null +++ b/ExportMap/cs/SGUtil.cs @@ -0,0 +1,55 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using System.Web; + +namespace ExportMap.cs +{ + public class SGUtil + { + /// <summary> + /// Mpt鐩綍 + /// </summary> + public static string MptPath + { + get + { + return ConfigurationManager.AppSettings["mptFolder"]; + } + } + + /// <summary> + /// 3DML鐩綍 + /// </summary> + public static string D3mlFolder + { + get + { + return ConfigurationManager.AppSettings["3dmlFolder"]; + } + } + + /// <summary> + /// 寤婂潑鏁版嵁鐩綍 + /// </summary> + public static string LFData + { + get + { + return ConfigurationManager.AppSettings["lfData"]; + } + } + + /// <summary> + /// SG鐨凞B搴� + /// </summary> + public static string SGDB + { + get + { + return ConfigurationManager.AppSettings["sgDB"]; + } + } + } +} diff --git a/ExportMap/cs/XYZUtil.cs b/ExportMap/cs/XYZUtil.cs new file mode 100644 index 0000000..f642adf --- /dev/null +++ b/ExportMap/cs/XYZUtil.cs @@ -0,0 +1,31 @@ +锘縰sing System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Web; + +namespace ExportMap.cs +{ + public class XYZUtil + { + + private static string pyFile; + + /// <summary> + /// 鑾峰彇Python鏂囦欢 + /// </summary> + public static string PyFile + { + get + { + if (string.IsNullOrWhiteSpace(pyFile)) + { + pyFile = Path.Combine(ExportUtil.SourcesPath, "render.py"); + } + + return pyFile; + } + } + + } +} -- Gitblit v1.9.3