IIoBuffer.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Aitex.Core.RT.IOCore;
  7. namespace MECF.Framework.RT.Core.IoProviders
  8. {
  9. public enum IoType
  10. {
  11. DI,
  12. DO,
  13. AI,
  14. AO,
  15. }
  16. public class IoBlockItem
  17. {
  18. public int Offset { get; set; }
  19. public ushort Size { get; set; }
  20. public IoType Type { get; set; }
  21. public Type AIOType { get; set; }
  22. }
  23. public interface IIoBuffer
  24. {
  25. void SetBufferBlock(string provider, List<IoBlockItem> lstBlocks);
  26. void SetIoMap(string provider, int blockOffset, List<DIAccessor> ioList);
  27. void SetIoMap(string provider, int blockOffset, List<DOAccessor> ioList);
  28. void SetIoMap(string provider, int blockOffset, List<AIAccessor> ioList);
  29. void SetIoMap(string provider, int blockOffset, List<AOAccessor> ioList);
  30. void SetIoMap(string provider, Dictionary<int, string> ioMappingPathFile);
  31. void SetIoMapByModule(string provider, int offset, string ioMappingPathFile, string module);
  32. Dictionary<int, bool[]> GetDoBuffer(string source);
  33. Dictionary<int, bool[]> GetDiBuffer(string source);
  34. Dictionary<int, short[]> GetAoBuffer(string source);
  35. Dictionary<int, short[]> GetAiBuffer(string source);
  36. Dictionary<int, float[]> GetAoBufferFloat(string source);
  37. Dictionary<int, float[]> GetAiBufferFloat(string source);
  38. void SetDiBuffer(string source, int offset, bool[] buffer);
  39. void SetDoBuffer(string source, int offset, bool[] buffer);
  40. void SetAiBuffer(string source, int offset, short[] buffer, int bufferStartIndex = 0);
  41. void SetAoBuffer(string source, int offset, short[] buffer, int bufferStartIndex = 0);
  42. void SetAiBufferFloat(string source, int offset, float[] buffer, int bufferStartIndex = 0);
  43. void SetAoBufferFloat(string source, int offset, float[] buffer, int bufferStartIndex = 0);
  44. }
  45. }