//using DQ.Construction.Util; using System; using System.Diagnostics; using System.Runtime.InteropServices; namespace Construction.BatchCreateMap { public class StructureAnalyze3 { public bool Calculate(string inputFile, string outputFile, string statisticFile, AnylizeCalculateParameter par , string faultLayerName = "断层", string contourLayerName = "等值线") { // 执行计算 try { string strFault = faultLayerName; if (string.IsNullOrEmpty(strFault)) { strFault = "断层"; } string strCurve = contourLayerName; if (string.IsNullOrEmpty(strCurve)) { strCurve = "等值线"; } StructAnylizeParameter structPara = par.ToStruct(); CreateMicroStructure(inputFile, outputFile, statisticFile, ref structPara, strFault, strCurve); } catch (Exception ex) { Trace.WriteLine(ex.Message); } return true; } #if DEBUG //const string DLL_FILE = @"C:\GeoIntelligent\Code\dirgdf\bin\Debug\WellCalibrate.dll"; const string DLL_FILE = "MicroStructurePP.dll"; #else const string DLL_FILE = "MicroStructurePP.dll"; #endif [DllImport(DLL_FILE, EntryPoint = "CreateMicroStructureOld", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)] public static extern void CreateMicroStructureOld(string curveFile, string faultFile, string gridFile, string ResultFile, ref StructAnylizeParameter par); [DllImport(DLL_FILE, EntryPoint = "CreateMicroStructure", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)] public static extern void CreateMicroStructure(string intputFile, string resultFile, string statisticFile, ref StructAnylizeParameter par , string faultLayerName, string contourLayerName); } }