using Ips.Library.Entity; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace Ips.AdcAlgorithm { public static class DdcInterop { const string DLLNAME = @"AppData\ddc\DigitaDownConvert.dll"; ///// ///// 初始化ddc ///// samplingRate 采样率 ///// fileIn 输入文件 ///// opa 输出目录 ///// 返回值: ///// //__declspec(dllexport) void* InitDDC(int64_t samplingRate, char* fileIn, char* opa); ///// ///// 添加信号 ///// ffcs 频偏列表 ///// multis 抽取倍数列表 ///// len 信号个数 ///// //__declspec(dllexport) bool AddSignals(void* ptr, int64_t* ffcs, int* multis, int len); ///// ///// 启动 ///// //__declspec(dllexport) void Start(void* ptr); ///// ///// 完毕后销毁处理对象 ///// //__declspec(dllexport) void FreeDDC(void* ptr); [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)] public static extern IntPtr InitDDC(long samplingRate, string fileIn, string opa); [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)] public static extern bool AddSignals(IntPtr ptr, long[] ffcs, int[] multis, int len); [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)] public static extern void Start(IntPtr ptr); [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)] public static extern void FreeDDC(IntPtr ptr); } public class DdcSignalItem { public DdcSignalItem(AdcSigOptions sigOption, long ffc, int mutil) { SigOption = sigOption; this.Ffc = ffc; Mutil = mutil; } public AdcSigOptions SigOption { get; set; } public long Ffc { get; set; } public int Mutil { get; set; } public bool IsTpdx { get; set; } public AdcDxSigOptions DxSigOption { get; set; } } }