DDC.TypeSafeMethod.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. using System;
  2. using System.Runtime.InteropServices;
  3. using System.Text;
  4. using TDMS.Common;
  5. namespace TDMS.Externals
  6. {
  7. internal partial class DDC : DIAdemConnectivity
  8. {
  9. #region Channel-Data
  10. #region Set Data
  11. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetDataValuesUInt8")]
  12. public static extern Error SetDataValuesUInt8(IntPtr channel, byte[] values, uint numValues);
  13. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetDataValuesInt16")]
  14. public static extern Error SetDataValuesInt16(IntPtr channel, short[] values, uint numValues);
  15. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetDataValuesInt32")]
  16. public static extern Error SetDataValuesInt32(IntPtr channel, int[] values, uint numValues);
  17. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetDataValuesFloat")]
  18. public static extern Error SetDataValuesFloat(IntPtr channel, float[] values, uint numValues);
  19. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetDataValuesDouble")]
  20. public static extern Error SetDataValuesDouble(IntPtr channel, double[] values, uint numValues);
  21. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetDataValuesString")]
  22. public static extern Error SetDataValuesString(IntPtr channel, string[] values, uint numValues);
  23. #endregion
  24. #region Append Data
  25. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_AppendDataValuesUInt8")]
  26. public static extern Error AppendDataValuesUInt8(IntPtr channel, byte[] values, uint numValues);
  27. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_AppendDataValuesInt16")]
  28. public static extern Error AppendDataValuesInt16(IntPtr channel, short[] values, uint numValues);
  29. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_AppendDataValuesInt32")]
  30. public static extern Error AppendDataValuesInt32(IntPtr channel, int[] values, uint numValues);
  31. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_AppendDataValuesFloat")]
  32. public static extern Error AppendDataValuesFloat(IntPtr channel, float[] values, uint numValues);
  33. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_AppendDataValuesDouble")]
  34. public static extern Error AppendDataValuesDouble(IntPtr channel, double[] values, uint numValues);
  35. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_AppendDataValuesString")]
  36. public static extern Error AppendDataValuesString(IntPtr channel, string[] values, uint numValues);
  37. #endregion
  38. #region Replace Data
  39. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_ReplaceDataValuesUInt8")]
  40. public static extern Error ReplaceDataValuesUInt8(IntPtr channel,
  41. uint indexOfFirstValueToReplace,
  42. byte[] values,
  43. uint numValues);
  44. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_ReplaceDataValuesInt16")]
  45. public static extern Error ReplaceDataValuesInt16(IntPtr channel,
  46. uint indexOfFirstValueToReplace,
  47. short[] values,
  48. uint numValues);
  49. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_ReplaceDataValuesInt32")]
  50. public static extern Error ReplaceDataValuesInt32(IntPtr channel,
  51. uint indexOfFirstValueToReplace,
  52. int[] values,
  53. uint numValues);
  54. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_ReplaceDataValuesFloat")]
  55. public static extern Error ReplaceDataValuesFloat(IntPtr channel,
  56. uint indexOfFirstValueToReplace,
  57. float[] values,
  58. uint numValues);
  59. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_ReplaceDataValuesDouble")]
  60. public static extern Error ReplaceDataValuesDouble(IntPtr channel,
  61. uint indexOfFirstValueToReplace,
  62. double[] values,
  63. uint numValues);
  64. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_ReplaceDataValuesString")]
  65. public static extern Error ReplaceDataValuesString(IntPtr channel,
  66. uint indexOfFirstValueToReplace,
  67. string[] values,
  68. uint numValues);
  69. #endregion
  70. #region GetDataValues
  71. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetDataValuesUInt8")]
  72. public static extern Error GetDataValuesUInt8(IntPtr channel,
  73. uint indexOfFirstValueToGet,
  74. uint numValuesToGet,
  75. byte[] values);
  76. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetDataValuesInt16")]
  77. public static extern Error GetDataValuesInt16(IntPtr channel,
  78. uint indexOfFirstValueToGet,
  79. uint numValuesToGet,
  80. short[] values);
  81. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetDataValuesInt32")]
  82. public static extern Error GetDataValuesInt32(IntPtr channel,
  83. uint indexOfFirstValueToGet,
  84. uint numValuesToGet,
  85. int[] values);
  86. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetDataValuesFloat")]
  87. public static extern Error GetDataValuesFloat(IntPtr channel,
  88. uint indexOfFirstValueToGet,
  89. uint numValuesToGet,
  90. float[] values);
  91. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetDataValuesDouble")]
  92. public static extern Error GetDataValuesDouble(IntPtr channel,
  93. uint indexOfFirstValueToGet,
  94. uint numValuesToGet,
  95. double[] values);
  96. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetDataValuesString")]
  97. public static extern Error GetDataValuesString(IntPtr channel,
  98. uint indexOfFirstValueToGet,
  99. uint numValuesToGet,
  100. IntPtr[] values);
  101. #endregion
  102. #endregion
  103. #region FileProperty
  104. #region CreateFileProperty
  105. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateFilePropertyUInt8")]
  106. public static extern Error CreateFilePropertyUInt8(IntPtr file, string property, byte value);
  107. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateFilePropertyInt16")]
  108. public static extern Error CreateFilePropertyInt16(IntPtr file, string property, short value);
  109. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateFilePropertyInt32")]
  110. public static extern Error CreateFilePropertyInt32(IntPtr file, string property, int value);
  111. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateFilePropertyFloat")]
  112. public static extern Error CreateFilePropertyFloat(IntPtr file, string property, float value);
  113. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateFilePropertyDouble")]
  114. public static extern Error CreateFilePropertyDouble(IntPtr file, string property, double value);
  115. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateFilePropertyString")]
  116. public static extern Error CreateFilePropertyString(IntPtr file, string property, string value);
  117. #endregion
  118. #region SetFileProperty
  119. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetFilePropertyUInt8")]
  120. public static extern Error SetFilePropertyUInt8(IntPtr file, string property, byte value);
  121. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetFilePropertyInt16")]
  122. public static extern Error SetFilePropertyInt16(IntPtr file, string property, short value);
  123. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetFilePropertyInt32")]
  124. public static extern Error SetFilePropertyInt32(IntPtr file, string property, int value);
  125. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetFilePropertyFloat")]
  126. public static extern Error SetFilePropertyFloat(IntPtr file, string property, float value);
  127. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetFilePropertyDouble")]
  128. public static extern Error SetFilePropertyDouble(IntPtr file, string property, double value);
  129. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetFilePropertyString")]
  130. public static extern Error SetFilePropertyString(IntPtr file, string property, string value);
  131. #endregion
  132. #region GetFileProperty
  133. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetFilePropertyUInt8")]
  134. public static extern Error GetFilePropertyUInt8(IntPtr file, string property, out byte value);
  135. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetFilePropertyInt16")]
  136. public static extern Error GetFilePropertyInt16(IntPtr file, string property, out short value);
  137. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetFilePropertyInt32")]
  138. public static extern Error GetFilePropertyInt32(IntPtr file, string property, out int value);
  139. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetFilePropertyFloat")]
  140. public static extern Error GetFilePropertyFloat(IntPtr file, string property, out float value);
  141. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetFilePropertyDouble")]
  142. public static extern Error GetFilePropertyDouble(IntPtr file, string property, out double value);
  143. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetFilePropertyString")]
  144. public static extern Error GetFilePropertyString(IntPtr file, string property, StringBuilder value, uint valueSize);
  145. #endregion
  146. #endregion
  147. #region ChannelGroupProperty
  148. #region CreateChannelGroupProperty
  149. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateChannelGroupPropertyUInt8")]
  150. public static extern Error CreateChannelGroupPropertyUInt8(IntPtr file, string property, byte value);
  151. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateChannelGroupPropertyInt16")]
  152. public static extern Error CreateChannelGroupPropertyInt16(IntPtr file, string property, short value);
  153. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateChannelGroupPropertyInt32")]
  154. public static extern Error CreateChannelGroupPropertyInt32(IntPtr file, string property, int value);
  155. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateChannelGroupPropertyFloat")]
  156. public static extern Error CreateChannelGroupPropertyFloat(IntPtr file, string property, float value);
  157. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateChannelGroupPropertyDouble")]
  158. public static extern Error CreateChannelGroupPropertyDouble(IntPtr file, string property, double value);
  159. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateChannelGroupPropertyString")]
  160. public static extern Error CreateChannelGroupPropertyString(IntPtr file, string property, string value);
  161. #endregion
  162. #region SetChannelGroupProperty
  163. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetChannelGroupPropertyUInt8")]
  164. public static extern Error SetChannelGroupPropertyUInt8(IntPtr file, string property, byte value);
  165. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetChannelGroupPropertyInt16")]
  166. public static extern Error SetChannelGroupPropertyInt16(IntPtr file, string property, short value);
  167. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetChannelGroupPropertyInt32")]
  168. public static extern Error SetChannelGroupPropertyInt32(IntPtr file, string property, int value);
  169. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetChannelGroupPropertyFloat")]
  170. public static extern Error SetChannelGroupPropertyFloat(IntPtr file, string property, float value);
  171. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetChannelGroupPropertyDouble")]
  172. public static extern Error SetChannelGroupPropertyDouble(IntPtr file, string property, double value);
  173. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetChannelGroupPropertyString")]
  174. public static extern Error SetChannelGroupPropertyString(IntPtr file, string property, string value);
  175. #endregion
  176. #region GetChannelGroupProperty
  177. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetChannelGroupPropertyUInt8")]
  178. public static extern Error GetChannelGroupPropertyUInt8(IntPtr file, string property, out byte value);
  179. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetChannelGroupPropertyInt16")]
  180. public static extern Error GetChannelGroupPropertyInt16(IntPtr file, string property, out short value);
  181. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetChannelGroupPropertyInt32")]
  182. public static extern Error GetChannelGroupPropertyInt32(IntPtr file, string property, out int value);
  183. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetChannelGroupPropertyFloat")]
  184. public static extern Error GetChannelGroupPropertyFloat(IntPtr file, string property, out float value);
  185. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetChannelGroupPropertyDouble")]
  186. public static extern Error GetChannelGroupPropertyDouble(IntPtr file, string property, out double value);
  187. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetChannelGroupPropertyString")]
  188. public static extern Error GetChannelGroupPropertyString(IntPtr file, string property, StringBuilder value, uint valueSize);
  189. #endregion
  190. #endregion
  191. #region ChannelProperty
  192. #region CreateChannelProperty
  193. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateChannelPropertyUInt8")]
  194. public static extern Error CreateChannelPropertyUInt8(IntPtr file, string property, byte value);
  195. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateChannelPropertyInt16")]
  196. public static extern Error CreateChannelPropertyInt16(IntPtr file, string property, short value);
  197. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateChannelPropertyInt32")]
  198. public static extern Error CreateChannelPropertyInt32(IntPtr file, string property, int value);
  199. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateChannelPropertyFloat")]
  200. public static extern Error CreateChannelPropertyFloat(IntPtr file, string property, float value);
  201. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateChannelPropertyDouble")]
  202. public static extern Error CreateChannelPropertyDouble(IntPtr file, string property, double value);
  203. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateChannelPropertyString")]
  204. public static extern Error CreateChannelPropertyString(IntPtr file, string property, string value);
  205. #endregion
  206. #region SetChannelProperty
  207. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetChannelPropertyUInt8")]
  208. public static extern Error SetChannelPropertyUInt8(IntPtr file, string property, byte value);
  209. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetChannelPropertyInt16")]
  210. public static extern Error SetChannelPropertyInt16(IntPtr file, string property, short value);
  211. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetChannelPropertyInt32")]
  212. public static extern Error SetChannelPropertyInt32(IntPtr file, string property, int value);
  213. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetChannelPropertyFloat")]
  214. public static extern Error SetChannelPropertyFloat(IntPtr file, string property, float value);
  215. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetChannelPropertyDouble")]
  216. public static extern Error SetChannelPropertyDouble(IntPtr file, string property, double value);
  217. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetChannelPropertyString")]
  218. public static extern Error SetChannelPropertyString(IntPtr file, string property, string value);
  219. #endregion
  220. #region GetChannelProperty
  221. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetChannelPropertyUInt8")]
  222. public static extern Error GetChannelPropertyUInt8(IntPtr file, string property, out byte value);
  223. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetChannelPropertyInt16")]
  224. public static extern Error GetChannelPropertyInt16(IntPtr file, string property, out short value);
  225. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetChannelPropertyInt32")]
  226. public static extern Error GetChannelPropertyInt32(IntPtr file, string property, out int value);
  227. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetChannelPropertyFloat")]
  228. public static extern Error GetChannelPropertyFloat(IntPtr file, string property, out float value);
  229. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetChannelPropertyDouble")]
  230. public static extern Error GetChannelPropertyDouble(IntPtr file, string property, out double value);
  231. [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetChannelPropertyString")]
  232. public static extern Error GetChannelPropertyString(IntPtr file, string property, StringBuilder value, uint valueSize);
  233. #endregion
  234. #endregion
  235. }
  236. }