DDC.Properties-Channel-Group.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. using System;
  2. using System.Runtime.InteropServices;
  3. using TDMS.Common;
  4. namespace TDMS.Externals
  5. {
  6. internal partial class DDC : DIAdemConnectivity
  7. {
  8. [DllImport(DLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "DDC_SetChannelGroupProperty")]
  9. public static extern Error SetChannelGroupProperty(IntPtr channelGroup, string property, __arglist);
  10. [DllImport(DLL, CallingConvention = CallingConvention.StdCall,
  11. EntryPoint = "DDC_SetChannelGroupPropertyTimestampComponents")]
  12. public static extern Error SetChannelGroupPropertyTimestampComponents(IntPtr channelGroup,
  13. string property,
  14. uint year,
  15. uint month,
  16. uint day,
  17. uint hour,
  18. uint minute,
  19. uint second,
  20. double milliSecond);
  21. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetChannelGroupPropertyV")]
  22. public static extern Error SetChannelGroupPropertyV(IntPtr channelGroup, string property, IntPtr args);
  23. /// <summary>
  24. ///
  25. /// </summary>
  26. /// <param name="channelGroup"></param>
  27. /// <param name="propertyName">通道组属性的名称。您可以指定内置属性或由DDC_CreateChannelGroupProperty创建的属性。</param>
  28. /// <param name="value"></param>
  29. /// <param name="valueSizeInBytes">由value参数指定的内存位置大小,单位为字节。该参数仅在指定的属性为字符串类型时使用。如果指定的属性是另一种类型,则应该为该参数传递0。</param>
  30. /// <returns></returns>
  31. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetChannelGroupProperty")]
  32. public static extern Error GetChannelGroupProperty(IntPtr channelGroup,
  33. string propertyName,
  34. ref byte value,
  35. uint valueSizeInBytes);
  36. [DllImport(DLL, CallingConvention = CallingConvention.StdCall,
  37. EntryPoint = "DDC_GetChannelGroupPropertyTimestampComponents")]
  38. public static extern Error GetChannelGroupPropertyTimestampComponents(IntPtr channelGroup,
  39. string property,
  40. out uint year,
  41. out uint month,
  42. out uint day,
  43. out uint hour,
  44. out uint minute,
  45. out uint second,
  46. out double milliSecond,
  47. out uint weekDay);
  48. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetChannelGroupStringPropertyLength")]
  49. public static extern Error GetChannelGroupStringPropertyLength(IntPtr channelGroup, string property, out uint length);
  50. [DllImport(DLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "DDC_CreateChannelGroupProperty")]
  51. public static extern Error CreateChannelGroupProperty(IntPtr channelGroup,
  52. string property,
  53. TDMSDataType dataType,
  54. __arglist);
  55. [DllImport(DLL, CallingConvention = CallingConvention.StdCall,
  56. EntryPoint = "DDC_CreateChannelGroupPropertyTimestampComponents")]
  57. public static extern Error CreateChannelGroupPropertyTimestampComponents(IntPtr channelGroup,
  58. string property,
  59. uint year,
  60. uint month,
  61. uint day,
  62. uint hour,
  63. uint minute,
  64. uint second,
  65. double milliSecond);
  66. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateChannelGroupPropertyV")]
  67. public static extern Error CreateChannelGroupPropertyV(IntPtr channelGroup,
  68. string property,
  69. TDMSDataType dataType,
  70. IntPtr args);
  71. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_ChannelGroupPropertyExists")]
  72. public static extern Error ChannelGroupPropertyExists(IntPtr channelGroup, string property, out bool exists);
  73. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetNumChannelGroupProperties")]
  74. public static extern Error CountChannelGroupProperties(IntPtr channelGroup, out uint numProperties);
  75. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetChannelGroupPropertyNames")]
  76. public static extern Error GetChannelGroupPropertyNames(IntPtr channelGroup,
  77. IntPtr[] propertyNames,
  78. uint numPropertyNames);
  79. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetChannelGroupPropertyType")]
  80. public static extern Error GetChannelGroupPropertyType(IntPtr channelGroup, string property, out TDMSDataType dataType);
  81. }
  82. }