using FxpConvert.Common; namespace NIFPGA { public sealed class FPGAFXPReadProperty : FPGABaseProperty { Interop.NiFpgaDll_ReadU64 Read; private NiFpga_FxpTypeInfo _TypeInfo; private IFxpConvert _Convert; internal FPGAFXPReadProperty(FPGASession session, uint indicator, NiFpga_FxpTypeInfo typeInfo, IFxpConvert convert) : base(session, indicator, true) { _TypeInfo = typeInfo; _Convert = convert; Read = _Session.GetDelegate(); } private double GetValue() { ulong value = 0; double temp = 0; _Session.CheckResult(Read(_Session.Session, Indicator, ref value)); _Convert.FxpConvertToDouble(ref value, _TypeInfo, ref temp, 1); return temp; } public double Value => GetValue(); } }