/// <summary> /// Creates an initialized instance using enums for known values. /// </summary> /// <param name="simVar"></param> /// <param name="unit"></param> /// <param name="dataType"></param> public SimProperty(FsSimVar simVar, FsUnit unit, SIMCONNECT_DATATYPE dataType) { Name = FsSimVarFactory.GetSimVarCode(simVar); Unit = UnitFactory.GetUnitCode(unit); DataType = dataType; }
/// <summary> /// /// </summary> /// <param name="unit"></param> /// <returns></returns> public static string GetUnitCode(FsUnit unit) { return(_enumToCodeDictionary[unit]); }
/// <summary> /// Creates an initialized instance of the <see cref="SimVar"/> class. /// </summary> /// <param name="simVarName"></param> /// <param name="unitId"></param> /// <param name="dataType"></param> public SimVar(string simVarName, FsUnit unitId, SIMCONNECT_DATATYPE dataType) { Name = simVarName; Unit = FsUnitFactory.GetUnitName(unitId); DataType = dataType; }
/// <summary> /// Creates an initialized instance using enums for known values. /// </summary> /// <param name="simVarId"></param> /// <param name="unitId"></param> /// <param name="dataType"></param> public SimVar(FsSimVar simVarId, FsUnit unitId, SIMCONNECT_DATATYPE dataType) { Name = FsSimVarFactory.GetSimVarName(simVarId); Unit = FsUnitFactory.GetUnitName(unitId); DataType = dataType; }
/// <summary> /// Gets the unit name used by MSFS. /// </summary> /// <param name="unit"></param> /// <returns></returns> public static string GetUnitName(FsUnit unit) { return(_names[(int)unit]); }