DdcInterop.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using Ips.Library.Entity;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Runtime.InteropServices;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace Ips.AdcAlgorithm
  9. {
  10. public static class DdcInterop
  11. {
  12. const string DLLNAME = @"AppData\ddc\DigitaDownConvert.dll";
  13. /////
  14. ///// 初始化ddc
  15. ///// samplingRate 采样率
  16. ///// fileIn 输入文件
  17. ///// opa 输出目录
  18. ///// 返回值:
  19. /////
  20. //__declspec(dllexport) void* InitDDC(int64_t samplingRate, char* fileIn, char* opa);
  21. /////
  22. ///// 添加信号
  23. ///// ffcs 频偏列表
  24. ///// multis 抽取倍数列表
  25. ///// len 信号个数
  26. /////
  27. //__declspec(dllexport) bool AddSignals(void* ptr, int64_t* ffcs, int* multis, int len);
  28. /////
  29. ///// 启动
  30. /////
  31. //__declspec(dllexport) void Start(void* ptr);
  32. /////
  33. ///// 完毕后销毁处理对象
  34. /////
  35. //__declspec(dllexport) void FreeDDC(void* ptr);
  36. [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
  37. public static extern IntPtr InitDDC(long samplingRate, string fileIn, string opa);
  38. [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
  39. public static extern bool AddSignals(IntPtr ptr, long[] ffcs, int[] multis, int len);
  40. [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
  41. public static extern void Start(IntPtr ptr);
  42. [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, SetLastError = true)]
  43. public static extern void FreeDDC(IntPtr ptr);
  44. }
  45. public class DdcSignalItem
  46. {
  47. public DdcSignalItem(AdcSigOptions sigOption, long ffc, int mutil)
  48. {
  49. SigOption = sigOption;
  50. this.Ffc = ffc;
  51. Mutil = mutil;
  52. }
  53. public AdcSigOptions SigOption { get; set; }
  54. public long Ffc { get; set; }
  55. public int Mutil { get; set; }
  56. public bool IsTpdx { get; set; }
  57. public AdcDxSigOptions DxSigOption { get; set; }
  58. }
  59. }