12345678910111213141516171819202122232425262728293031 |
- using FxpConvert.Common;
- namespace NIFPGA
- {
- public sealed class FPGAArrayFXPReadProperty : FPGABaseProperty
- {
- Interop.NiFpgaDll_ReadArrayU64 Read;
- private NiFpga_FxpTypeInfo _TypeInfo;
- private IFxpConvert _Convert;
- private ulong[] tempvalue = new ulong[0];
- private float[] doubles = new float[0];
- internal FPGAArrayFXPReadProperty(FPGASession session, uint indicator, uint count, NiFpga_FxpTypeInfo typeInfo, IFxpConvert convert) : base(session, indicator, true)
- {
- _Convert = convert;
- Count = count;
- tempvalue = new ulong[count];
- doubles = new float[count];
- _TypeInfo = typeInfo;
- Read = _Session.GetDelegate<Interop.NiFpgaDll_ReadArrayU64>();
- }
- private float[] GetData()
- {
- _Session.CheckResult(Read(_Session.Session, Indicator, ref tempvalue[0], Count));
- _Convert.FxpConvertToFloat(ref tempvalue[0], _TypeInfo, ref doubles[0], Count);
- return doubles;
- }
- public uint Count { get; }
- public float[] Value { get => GetData(); }
- }
- }
|