public SimConnectProperty(SimConnectPropertyKey key, string name, string unit, SIMCONNECT_DATATYPE simConnectDataType) { Key = key; Name = name; Unit = unit; SimConnectDataType = simConnectDataType; }
public SimVariableWithEvent( string name, string unitName, SIMCONNECT_DATATYPE simType, DataItem <T> target, int eventRequest, string setEventName) : base(name, unitName, simType, target, eventRequest) { this.setEventName = setEventName; }
public SCStructFieldAttribute(string variable, string units, SIMCONNECT_DATATYPE type, float epsilon) { Variable = variable; Units = units; Type = type; //TODO: do we need this, or can we infer it? Epsilon = epsilon; }
public PropertyDef(string name, string displayName, string units, SIMCONNECT_DATATYPE dataType) { Name = name; DisplayName = displayName; Units = units; DataType = dataType; }
private double ConvertFSXVariableToDouble(SIMCONNECT_DATATYPE fsxType, FSXUnit fsxUnit, object value) { if (fsxUnit == FSXUnit.Frequency_BCD16) { return(bcd16todouble(Convert.ToInt32(value))); } return(Convert.ToDouble(value)); }
// This is a positional argument public SimConnectAttribute(int index, string header, string unit, SIMCONNECT_DATATYPE type = SIMCONNECT_DATATYPE.FLOAT64, float fEpsilon = 0.0f) { this._index = index; this._unit = unit; this._header = header; this._type = type; this._fEpsilon = fEpsilon; }
public SimVariable( string name, string unitName, SIMCONNECT_DATATYPE simType, ReadOnlyDataItem <T> target, int eventRequest) { this.name = name; this.unitName = unitName; this.simType = simType; this.target = target; this.EventEnum = (FakeEnum)eventRequest; }
public SimConnectPropertyValue(SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE data, SIMCONNECT_DATATYPE dataType) { if (dataType == SIMCONNECT_DATATYPE.STRING8) { SetValue(((String8)data.dwData[0]).Value); } else if (dataType == SIMCONNECT_DATATYPE.STRING64) { SetValue(((String64)data.dwData[0]).Value); } else { SetValue(data.dwData[0]); } }
private static SIMCONNECT_DATATYPE GetSimConnectDataType(Type t) { SIMCONNECT_DATATYPE res = 0; if (t == typeof(double)) { res = SIMCONNECT_DATATYPE.FLOAT64; } else if (t == typeof(bool)) { res = SIMCONNECT_DATATYPE.INT32; } else if (t == typeof(string)) { res = SIMCONNECT_DATATYPE.STRING128; } return(res); }
private void RegisterDataDefineStruct(SIMCONNECT_DATATYPE dataType, SimConnectPropertyKey key) { if (dataType == SIMCONNECT_DATATYPE.STRING8) { _simConnect.RegisterDataDefineStruct <String8>(key); } else if (dataType == SIMCONNECT_DATATYPE.STRING32) { _simConnect.RegisterDataDefineStruct <String32>(key); } else if (dataType == SIMCONNECT_DATATYPE.STRING64) { _simConnect.RegisterDataDefineStruct <String64>(key); } else if (dataType == SIMCONNECT_DATATYPE.STRING128) { _simConnect.RegisterDataDefineStruct <String128>(key); } else if (dataType == SIMCONNECT_DATATYPE.STRING256) { _simConnect.RegisterDataDefineStruct <String256>(key); } else if (dataType == SIMCONNECT_DATATYPE.STRING260) { _simConnect.RegisterDataDefineStruct <String260>(key); } else if (dataType == SIMCONNECT_DATATYPE.INT32) { _simConnect.RegisterDataDefineStruct <Int32>(key); } else if (dataType == SIMCONNECT_DATATYPE.INT64) { _simConnect.RegisterDataDefineStruct <Int64>(key); } else { _simConnect.RegisterDataDefineStruct <double>(key); } }
private int ConvertFSXVariableToInt(SIMCONNECT_DATATYPE fsxType, FSXUnit fsxUnit, object value) { return(Convert.ToInt32(value)); }
public SimVarAttribute(string variable, string?units, SIMCONNECT_DATATYPE type, float epsilon) : base(epsilon) { Variable = variable; Units = units; Type = type; //TODO: do we need this, or can we infer it? }
/// <summary> /// Creates an initialized instance of the <see cref="SimProperty"/> class. /// </summary> public SimProperty(string name, string unit, SIMCONNECT_DATATYPE dataType) { Name = name; Unit = unit; DataType = dataType; }
/// <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 of the <see cref="SimVar"/> class. /// </summary> /// <param name="simVarName"></param> /// <param name="unitName"></param> /// <param name="dataType"></param> public SimVar(string simVarName, string unitName, SIMCONNECT_DATATYPE dataType) { Name = simVarName; Unit = unitName; DataType = dataType; }
private SimConnectPropertyValue GetValue(SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE data, SIMCONNECT_DATATYPE dataType) { if (dataType == SIMCONNECT_DATATYPE.STRING8) { return(new SimConnectPropertyValue(((String8)data.dwData[0]).Value)); } else if (dataType == SIMCONNECT_DATATYPE.STRING64) { return(new SimConnectPropertyValue(((String64)data.dwData[0]).Value)); } else { return(new SimConnectPropertyValue(data.dwData[0])); } }
/// <summary> /// Creates an initialized instance of the <see cref="SimVar"/> class. /// </summary> /// <param name="simVarId"></param> /// <param name="unitName"></param> /// <param name="dataType"></param> public SimVar(FsSimVar simVarId, string unitName, SIMCONNECT_DATATYPE dataType) { Name = FsSimVarFactory.GetSimVarName(simVarId); Unit = unitName; 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> /// 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; }
private void AddToDataDefinition(DEFINITION defineId, string datumName, string?unitsName, SIMCONNECT_DATATYPE datumType = SIMCONNECT_DATATYPE.FLOAT64) { _simConnect?.AddToDataDefinition(defineId, datumName, unitsName, datumType, 0, SimConnectImpl.SIMCONNECT_UNUSED); }