using System; using System.Text; using System.Runtime.InteropServices; namespace Deltares.RtcTools.Net { internal class RtcToolsDllNative { private const string Pathdllfile = @"RTCTools.dll"; // do not change! When deploying RTCTools for use // with other software RTCTools.dll is expected to // sit next to Deltares.RtcTools.Net.dll [DllImport(Pathdllfile)] public static extern void LoadRtcToolsDll(); [DllImport(Pathdllfile)] public static extern IntPtr CreateOmiAccessableRtcToolsClass(IntPtr schemaLocation); [DllImport(Pathdllfile)] public static extern void OmiInitialize(IntPtr @class); [DllImport(Pathdllfile)] public static extern void FinishOmiAccessableRtcToolsClass(IntPtr @class); [DllImport(Pathdllfile)] public static extern void PrepareOmiAccessableRtcToolsClass(IntPtr @class); [DllImport(Pathdllfile)] public static extern void DisposeOmiAccessableRtcToolsClass(IntPtr @class); [DllImport(Pathdllfile)] public static extern IntPtr OmiGetStartTimeString(IntPtr @class); [DllImport(Pathdllfile)] public static extern IntPtr OmiGetEndTimeString(IntPtr @class); [DllImport(Pathdllfile)] public static extern IntPtr OmiGetCurrentTimeString(IntPtr @class); [DllImport(Pathdllfile)] public static extern int OmiGetInputExchangeItemCount(IntPtr @class); [DllImport(Pathdllfile)] public static extern int OmiGetOutputExchangeItemCount(IntPtr @class); [DllImport(Pathdllfile)] public static extern IntPtr OmiInputExchangeItemGetElementId(IntPtr @class, int index); [DllImport(Pathdllfile)] public static extern IntPtr OmiOutputExchangeItemGetElementId(IntPtr @class, int index); [DllImport(Pathdllfile)] public static extern IntPtr OmiInputExchangeItemGetQuantityId(IntPtr @class, int index); [DllImport(Pathdllfile)] public static extern IntPtr OmiOutputExchangeItemGetQuantityId(IntPtr @class, int index); [DllImport(Pathdllfile)] public static extern IntPtr OmiInputExchangeItemGetUnit(IntPtr @class, int index); [DllImport(Pathdllfile)] public static extern IntPtr OmiOutputExchangeItemGetUnit(IntPtr @class, int index); [DllImport(Pathdllfile)] public static extern void OmiSetInputValue(IntPtr @class, int index, double value, int timeStepCount); [DllImport(Pathdllfile)] public static extern double OmiGetOutputValue(IntPtr @class, int index); [DllImport(Pathdllfile)] public static extern void OmiPerformTimeStep(IntPtr @class, int timeStepCount); [DllImport(Pathdllfile)] public static extern void OmiWriteStateFile(IntPtr @class, IntPtr filepath, IntPtr filename); } }