Exemplo n.º 1
0
        private string GetUnit(FieldInfo fieldInfo, SimVarAttribute attr)
        {
            if (attr != null && attr.UnitId != FsUnit.Undefined)
            {
                return(FsUnitFactory.GetUnitName(attr.UnitId));
            }

            if (!string.IsNullOrEmpty(attr?.Unit))
            {
                return(attr.Unit);
            }

            return("");
        }
Exemplo n.º 2
0
 /// <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;
 }
Exemplo n.º 3
0
 /// <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;
 }
Exemplo n.º 4
0
 /// <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     = FsUnitFactory.GetUnitName(unit);
     DataType = dataType;
 }