diff --git a/bin/FFA320Connector/64/mac.xpl b/bin/FFA320Connector/64/mac.xpl index cc6dc9d..17e0635 100644 Binary files a/bin/FFA320Connector/64/mac.xpl and b/bin/FFA320Connector/64/mac.xpl differ diff --git a/bin/FFA320Connector/64/win.xpl b/bin/FFA320Connector/64/win.xpl index bf67b1d..749de85 100644 Binary files a/bin/FFA320Connector/64/win.xpl and b/bin/FFA320Connector/64/win.xpl differ diff --git a/bin/FFA320Connector/config.cfg b/bin/FFA320Connector/config.cfg index cc8d064..47fb395 100644 --- a/bin/FFA320Connector/config.cfg +++ b/bin/FFA320Connector/config.cfg @@ -111,9 +111,15 @@ DATAREF;INT;Aircraft.Cockpit.Overhead.LightBeacon.Target;-1;sim/cockpit/electric DATAREF;INT;Aircraft.Cockpit.Overhead.LightLogo.Target;-1;sim/cockpit/electrical/nav_lights_on;INT;DEFAULT;1;=;0;0; DATAREF;INT;Aircraft.Cockpit.Overhead.LightLogo.Target;-1;sim/cockpit/electrical/nav_lights_on;INT;DEFAULT;1;>=;1;1; -# Sync Landing lights (Won't work until released by A320) -DATAREF;INT;Aircraft.Cockpit.Overhead.LightLandL.Target;-1;sim/cockpit/electrical/landing_lights_on;INT;DEFAULT;1;=;0;0; -DATAREF;INT;Aircraft.Cockpit.Overhead.LightLandL.Target;-1;sim/cockpit/electrical/landing_lights_on;INT;DEFAULT;1;>=;1;1; +# Sync Landing lights +DATAREF;INT;Aircraft.Cockpit.Overhead.LightLandL.Target;-1;sim/cockpit/electrical/landing_lights_on;INT;DEFAULT;1;<;2;0; +DATAREF;INT;Aircraft.Cockpit.Overhead.LightLandL.Target;-1;sim/cockpit/electrical/landing_lights_on;INT;DEFAULT;1;>=;2;1; + +DATAREF;INT;Aircraft.Cockpit.Overhead.LightLandL.Target;-1;sim/cockpit2/switches/landing_lights_switch[1];FLOAT;DEFAULT;1;<;2;0; +DATAREF;INT;Aircraft.Cockpit.Overhead.LightLandL.Target;-1;sim/cockpit2/switches/landing_lights_switch[1];FLOAT;DEFAULT;1;=;2;1; + +DATAREF;INT;Aircraft.Cockpit.Overhead.LightLandR.Target;-1;sim/cockpit2/switches/landing_lights_switch[2];FLOAT;DEFAULT;1;<;2;0; +DATAREF;INT;Aircraft.Cockpit.Overhead.LightLandR.Target;-1;sim/cockpit2/switches/landing_lights_switch[2];FLOAT;DEFAULT;1;=;2;1; # Sync N1 Values DATAREF;FLOAT;Aircraft.PowerPlant.EngineL.RateLP1;-1;sim/flightmodel/engine/ENGN_N1_[0];FLOAT; diff --git a/src/FFA320Connector.cpp b/src/FFA320Connector.cpp index 901e79d..a7a38f8 100644 --- a/src/FFA320Connector.cpp +++ b/src/FFA320Connector.cpp @@ -1159,7 +1159,7 @@ void ffAPIUpdateCallback(double step, void *tag) { XPLMSetDatai(iDataObjects->DREF, (int)(size_t)curval * iDataObjects->DataRefMultiplier); } else { - int idata = (int)curval * iDataObjects->DataRefMultiplier; + int idata = (int)(size_t)curval * iDataObjects->DataRefMultiplier; XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); } } @@ -1175,7 +1175,7 @@ void ffAPIUpdateCallback(double step, void *tag) { XPLMSetDataf(iDataObjects->DREF, (float)icurval * iDataObjects->DataRefMultiplier); } else { - float idata = (float)icurval * iDataObjects->DataRefMultiplier; + float idata = (float)(size_t)icurval * iDataObjects->DataRefMultiplier; XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); } } @@ -1203,43 +1203,139 @@ void ffAPIUpdateCallback(double step, void *tag) { if (iDataObjects->DatarefCondition == CONDITION_EQUALS) { if ((int)(size_t)curval == iDataObjects->DatarefConditionValue) { - if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); - if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); + } + else { + int idata = iDataObjects->Value * iDataObjects->DataRefMultiplier; + XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } + if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + } + else { + float idata = iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier; + XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } } } if (iDataObjects->DatarefCondition == CONDITION_GREATER) { if ((int)(size_t)curval > iDataObjects->DatarefConditionValue) { - if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); - if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); + } + else { + int idata = iDataObjects->Value * iDataObjects->DataRefMultiplier; + XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } + if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + } + else { + float idata = iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier; + XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } } } if (iDataObjects->DatarefCondition == CONDITION_LOWER) { if ((int)(size_t)curval < iDataObjects->DatarefConditionValue) { - if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); - if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); + } + else { + int idata = iDataObjects->Value * iDataObjects->DataRefMultiplier; + XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } + if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + } + else { + float idata = iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier; + XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } } } if (iDataObjects->DatarefCondition == CONDITION_NOTEQUAL) { if ((int)(size_t)curval != iDataObjects->DatarefConditionValue) { - if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); - if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); + } + else { + int idata = iDataObjects->Value * iDataObjects->DataRefMultiplier; + XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } + if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + } + else { + float idata = iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier; + XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } } } if (iDataObjects->DatarefCondition == CONDITION_GREATER_EQUAL) { if ((int)(size_t)curval >= iDataObjects->DatarefConditionValue) { - if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); - if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); + } + else { + int idata = iDataObjects->Value * iDataObjects->DataRefMultiplier; + XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } + if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + } + else { + float idata = iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier; + XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } } } if (iDataObjects->DatarefCondition == CONDITION_LOWER_EQUAL) { if ((int)(size_t)curval <= iDataObjects->DatarefConditionValue) { - if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); - if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); + } + else { + int idata = iDataObjects->Value * iDataObjects->DataRefMultiplier; + XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } + if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + } + else { + float idata = iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier; + XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } } } diff --git a/src_vs2013/FFA320Connector.cpp b/src_vs2013/FFA320Connector.cpp index 901e79d..a7a38f8 100644 --- a/src_vs2013/FFA320Connector.cpp +++ b/src_vs2013/FFA320Connector.cpp @@ -1159,7 +1159,7 @@ void ffAPIUpdateCallback(double step, void *tag) { XPLMSetDatai(iDataObjects->DREF, (int)(size_t)curval * iDataObjects->DataRefMultiplier); } else { - int idata = (int)curval * iDataObjects->DataRefMultiplier; + int idata = (int)(size_t)curval * iDataObjects->DataRefMultiplier; XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); } } @@ -1175,7 +1175,7 @@ void ffAPIUpdateCallback(double step, void *tag) { XPLMSetDataf(iDataObjects->DREF, (float)icurval * iDataObjects->DataRefMultiplier); } else { - float idata = (float)icurval * iDataObjects->DataRefMultiplier; + float idata = (float)(size_t)icurval * iDataObjects->DataRefMultiplier; XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); } } @@ -1203,43 +1203,139 @@ void ffAPIUpdateCallback(double step, void *tag) { if (iDataObjects->DatarefCondition == CONDITION_EQUALS) { if ((int)(size_t)curval == iDataObjects->DatarefConditionValue) { - if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); - if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); + } + else { + int idata = iDataObjects->Value * iDataObjects->DataRefMultiplier; + XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } + if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + } + else { + float idata = iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier; + XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } } } if (iDataObjects->DatarefCondition == CONDITION_GREATER) { if ((int)(size_t)curval > iDataObjects->DatarefConditionValue) { - if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); - if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); + } + else { + int idata = iDataObjects->Value * iDataObjects->DataRefMultiplier; + XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } + if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + } + else { + float idata = iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier; + XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } } } if (iDataObjects->DatarefCondition == CONDITION_LOWER) { if ((int)(size_t)curval < iDataObjects->DatarefConditionValue) { - if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); - if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); + } + else { + int idata = iDataObjects->Value * iDataObjects->DataRefMultiplier; + XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } + if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + } + else { + float idata = iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier; + XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } } } if (iDataObjects->DatarefCondition == CONDITION_NOTEQUAL) { if ((int)(size_t)curval != iDataObjects->DatarefConditionValue) { - if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); - if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); + } + else { + int idata = iDataObjects->Value * iDataObjects->DataRefMultiplier; + XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } + if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + } + else { + float idata = iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier; + XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } } } if (iDataObjects->DatarefCondition == CONDITION_GREATER_EQUAL) { if ((int)(size_t)curval >= iDataObjects->DatarefConditionValue) { - if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); - if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); + } + else { + int idata = iDataObjects->Value * iDataObjects->DataRefMultiplier; + XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } + if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + } + else { + float idata = iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier; + XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } } } if (iDataObjects->DatarefCondition == CONDITION_LOWER_EQUAL) { if ((int)(size_t)curval <= iDataObjects->DatarefConditionValue) { - if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); - if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); + } + else { + int idata = iDataObjects->Value * iDataObjects->DataRefMultiplier; + XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } + if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + } + else { + float idata = iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier; + XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } } } diff --git a/src_vs2013/FFA320Connector.sdf b/src_vs2013/FFA320Connector.sdf index be58b93..8de94cf 100644 Binary files a/src_vs2013/FFA320Connector.sdf and b/src_vs2013/FFA320Connector.sdf differ diff --git a/src_vs2013/FFA320Connector.v12.suo b/src_vs2013/FFA320Connector.v12.suo index f228218..3b8e927 100644 Binary files a/src_vs2013/FFA320Connector.v12.suo and b/src_vs2013/FFA320Connector.v12.suo differ diff --git a/src_vs2013/Release/64/Custom-Command-with-Custom-DataRef.exp b/src_vs2013/Release/64/Custom-Command-with-Custom-DataRef.exp index a00992d..7aec1b2 100644 Binary files a/src_vs2013/Release/64/Custom-Command-with-Custom-DataRef.exp and b/src_vs2013/Release/64/Custom-Command-with-Custom-DataRef.exp differ diff --git a/src_vs2013/Release/64/Custom-Command-with-Custom-DataRef.lib b/src_vs2013/Release/64/Custom-Command-with-Custom-DataRef.lib index 4e9d986..5e5f1ac 100644 Binary files a/src_vs2013/Release/64/Custom-Command-with-Custom-DataRef.lib and b/src_vs2013/Release/64/Custom-Command-with-Custom-DataRef.lib differ diff --git a/src_vs2013/Release/64/FFA320Connector.log b/src_vs2013/Release/64/FFA320Connector.log index 51ec01f..d77791f 100644 --- a/src_vs2013/Release/64/FFA320Connector.log +++ b/src_vs2013/Release/64/FFA320Connector.log @@ -1,4 +1,4 @@ -Der Buildvorgang wurde am 03.12.2017 22:27:51 gestartet. +Der Buildvorgang wurde am 04.12.2017 11:44:07 gestartet. 1>Projekt "E:\FFA320Connector\src_vs2013\FFA320Connector.vcxproj" auf Knoten "2", Rebuild Ziel(e). 1>ClCompile: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\CL.exe /c /ISDK\CHeaders\XPLM /ISDK\CHeaders\Widgets /Zi /nologo /W3 /WX- /O2 /Ob1 /D WIN32 /D NDEBUG /D _WINDOWS /D _USRDLL /D SIMDATA_EXPORTS /D IBM=1 /D XPLM200=1 /D XPLM210=1 /D _CRT_SECURE_NO_WARNINGS /D _VC80_UPGRADE=0x0600 /D _WINDLL /D _MBCS /GF /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Fo".\Release\64\\" /Fd".\Release\64\vc120.pdb" /Gd /TP /errorReport:prompt FFA320Connector.cpp @@ -7,12 +7,18 @@ Befehlszeilenargumente: siehe vorherige Definition von "XPLM200" 1>FFA320Connector.cpp(1159): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust 1>FFA320Connector.cpp(1162): warning C4244: 'Initialisierung': Konvertierung von 'float' in 'int', möglicher Datenverlust - 1>FFA320Connector.cpp(1206): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust - 1>FFA320Connector.cpp(1213): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust - 1>FFA320Connector.cpp(1220): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust - 1>FFA320Connector.cpp(1227): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust - 1>FFA320Connector.cpp(1234): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust - 1>FFA320Connector.cpp(1241): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust + 1>FFA320Connector.cpp(1208): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust + 1>FFA320Connector.cpp(1211): warning C4244: 'Initialisierung': Konvertierung von 'float' in 'int', möglicher Datenverlust + 1>FFA320Connector.cpp(1231): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust + 1>FFA320Connector.cpp(1234): warning C4244: 'Initialisierung': Konvertierung von 'float' in 'int', möglicher Datenverlust + 1>FFA320Connector.cpp(1254): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust + 1>FFA320Connector.cpp(1257): warning C4244: 'Initialisierung': Konvertierung von 'float' in 'int', möglicher Datenverlust + 1>FFA320Connector.cpp(1277): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust + 1>FFA320Connector.cpp(1280): warning C4244: 'Initialisierung': Konvertierung von 'float' in 'int', möglicher Datenverlust + 1>FFA320Connector.cpp(1300): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust + 1>FFA320Connector.cpp(1303): warning C4244: 'Initialisierung': Konvertierung von 'float' in 'int', möglicher Datenverlust + 1>FFA320Connector.cpp(1323): warning C4244: 'Argument': Konvertierung von 'float' in 'int', möglicher Datenverlust + 1>FFA320Connector.cpp(1326): warning C4244: 'Initialisierung': Konvertierung von 'float' in 'int', möglicher Datenverlust Link: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:PROMPT /OUT:"..\bin\FFA320Connector\64\win.xpl" /INCREMENTAL:NO /NOLOGO /LIBPATH:SDK\Libraries\Win Opengl32.lib odbc32.lib odbccp32.lib XPLM_64.lib XPWidgets_64.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST:NO /PDB:"..\bin\FFA320Connector\64\win.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\Release\64\Custom-Command-with-Custom-DataRef.lib" /MACHINE:X64 /DLL .\Release\64\FFA320Connector.obj Bibliothek ".\Release\64\Custom-Command-with-Custom-DataRef.lib" und Objekt ".\Release\64\Custom-Command-with-Custom-DataRef.exp" werden erstellt. @@ -21,4 +27,4 @@ Build erfolgreich. -Verstrichene Zeit 00:00:01.15 +Verstrichene Zeit 00:00:01.50 diff --git a/src_vs2013/Release/64/FFA320Connector.obj b/src_vs2013/Release/64/FFA320Connector.obj index 721c86c..392e2e5 100644 Binary files a/src_vs2013/Release/64/FFA320Connector.obj and b/src_vs2013/Release/64/FFA320Connector.obj differ diff --git a/src_vs2013/Release/64/vc120.pdb b/src_vs2013/Release/64/vc120.pdb index 6a40772..8494e1e 100644 Binary files a/src_vs2013/Release/64/vc120.pdb and b/src_vs2013/Release/64/vc120.pdb differ diff --git a/src_xcode3.2/DerivedData/FFA320Connector/Build/Intermediates/FFA320Connector.build/Release/FFA320Connector.build/Objects-normal/x86_64/FFA320Connector.dia b/src_xcode3.2/DerivedData/FFA320Connector/Build/Intermediates/FFA320Connector.build/Release/FFA320Connector.build/Objects-normal/x86_64/FFA320Connector.dia index 966ce10..79e97ef 100644 Binary files a/src_xcode3.2/DerivedData/FFA320Connector/Build/Intermediates/FFA320Connector.build/Release/FFA320Connector.build/Objects-normal/x86_64/FFA320Connector.dia and b/src_xcode3.2/DerivedData/FFA320Connector/Build/Intermediates/FFA320Connector.build/Release/FFA320Connector.build/Objects-normal/x86_64/FFA320Connector.dia differ diff --git a/src_xcode3.2/DerivedData/FFA320Connector/Build/Intermediates/FFA320Connector.build/Release/FFA320Connector.build/Objects-normal/x86_64/FFA320Connector.o b/src_xcode3.2/DerivedData/FFA320Connector/Build/Intermediates/FFA320Connector.build/Release/FFA320Connector.build/Objects-normal/x86_64/FFA320Connector.o index b8d98a5..6e229d7 100644 Binary files a/src_xcode3.2/DerivedData/FFA320Connector/Build/Intermediates/FFA320Connector.build/Release/FFA320Connector.build/Objects-normal/x86_64/FFA320Connector.o and b/src_xcode3.2/DerivedData/FFA320Connector/Build/Intermediates/FFA320Connector.build/Release/FFA320Connector.build/Objects-normal/x86_64/FFA320Connector.o differ diff --git a/src_xcode3.2/DerivedData/FFA320Connector/Build/Intermediates/FFA320Connector.build/Release/FFA320Connector.build/Objects-normal/x86_64/mac_dependency_info.dat b/src_xcode3.2/DerivedData/FFA320Connector/Build/Intermediates/FFA320Connector.build/Release/FFA320Connector.build/Objects-normal/x86_64/mac_dependency_info.dat index de0e6ba..38599d8 100644 Binary files a/src_xcode3.2/DerivedData/FFA320Connector/Build/Intermediates/FFA320Connector.build/Release/FFA320Connector.build/Objects-normal/x86_64/mac_dependency_info.dat and b/src_xcode3.2/DerivedData/FFA320Connector/Build/Intermediates/FFA320Connector.build/Release/FFA320Connector.build/Objects-normal/x86_64/mac_dependency_info.dat differ diff --git a/src_xcode3.2/DerivedData/FFA320Connector/Build/Intermediates/FFA320Connector.build/Release/FFA320Connector.build/dgph b/src_xcode3.2/DerivedData/FFA320Connector/Build/Intermediates/FFA320Connector.build/Release/FFA320Connector.build/dgph index ef43943..af9dc6a 100644 Binary files a/src_xcode3.2/DerivedData/FFA320Connector/Build/Intermediates/FFA320Connector.build/Release/FFA320Connector.build/dgph and b/src_xcode3.2/DerivedData/FFA320Connector/Build/Intermediates/FFA320Connector.build/Release/FFA320Connector.build/dgph differ diff --git a/src_xcode3.2/DerivedData/FFA320Connector/Build/Intermediates/FFA320Connector.build/Release/FFA320Connector.build/dgph~ b/src_xcode3.2/DerivedData/FFA320Connector/Build/Intermediates/FFA320Connector.build/Release/FFA320Connector.build/dgph~ index e5e7494..af9dc6a 100644 Binary files a/src_xcode3.2/DerivedData/FFA320Connector/Build/Intermediates/FFA320Connector.build/Release/FFA320Connector.build/dgph~ and b/src_xcode3.2/DerivedData/FFA320Connector/Build/Intermediates/FFA320Connector.build/Release/FFA320Connector.build/dgph~ differ diff --git a/src_xcode3.2/DerivedData/FFA320Connector/Build/Products/Release/mac.xpl b/src_xcode3.2/DerivedData/FFA320Connector/Build/Products/Release/mac.xpl index cc6dc9d..17e0635 100644 Binary files a/src_xcode3.2/DerivedData/FFA320Connector/Build/Products/Release/mac.xpl and b/src_xcode3.2/DerivedData/FFA320Connector/Build/Products/Release/mac.xpl differ diff --git a/src_xcode3.2/DerivedData/FFA320Connector/Index/Release/macosx10.12-x86_64/FFA320Connector.xcindex/db.xcindexdb b/src_xcode3.2/DerivedData/FFA320Connector/Index/Release/macosx10.12-x86_64/FFA320Connector.xcindex/db.xcindexdb index 8877540..cbf96a0 100644 Binary files a/src_xcode3.2/DerivedData/FFA320Connector/Index/Release/macosx10.12-x86_64/FFA320Connector.xcindex/db.xcindexdb and b/src_xcode3.2/DerivedData/FFA320Connector/Index/Release/macosx10.12-x86_64/FFA320Connector.xcindex/db.xcindexdb differ diff --git a/src_xcode3.2/DerivedData/FFA320Connector/Index/Release/macosx10.12-x86_64/FFA320Connector.xcindex/db.xcindexdb.strings-res b/src_xcode3.2/DerivedData/FFA320Connector/Index/Release/macosx10.12-x86_64/FFA320Connector.xcindex/db.xcindexdb.strings-res index 24b8ccb..6e701c5 100644 Binary files a/src_xcode3.2/DerivedData/FFA320Connector/Index/Release/macosx10.12-x86_64/FFA320Connector.xcindex/db.xcindexdb.strings-res and b/src_xcode3.2/DerivedData/FFA320Connector/Index/Release/macosx10.12-x86_64/FFA320Connector.xcindex/db.xcindexdb.strings-res differ diff --git a/src_xcode3.2/DerivedData/FFA320Connector/Index/Release/macosx10.12-x86_64/FFA320Connector.xcindex/db.xcindexdb.strings-sym b/src_xcode3.2/DerivedData/FFA320Connector/Index/Release/macosx10.12-x86_64/FFA320Connector.xcindex/db.xcindexdb.strings-sym index 4bd240c..eed0bf1 100644 Binary files a/src_xcode3.2/DerivedData/FFA320Connector/Index/Release/macosx10.12-x86_64/FFA320Connector.xcindex/db.xcindexdb.strings-sym and b/src_xcode3.2/DerivedData/FFA320Connector/Index/Release/macosx10.12-x86_64/FFA320Connector.xcindex/db.xcindexdb.strings-sym differ diff --git a/src_xcode3.2/DerivedData/FFA320Connector/Logs/Build/5491F8D3-0B27-4BC3-9E75-168657F29752.xcactivitylog b/src_xcode3.2/DerivedData/FFA320Connector/Logs/Build/5491F8D3-0B27-4BC3-9E75-168657F29752.xcactivitylog deleted file mode 100644 index 1a6d688..0000000 Binary files a/src_xcode3.2/DerivedData/FFA320Connector/Logs/Build/5491F8D3-0B27-4BC3-9E75-168657F29752.xcactivitylog and /dev/null differ diff --git a/src_xcode3.2/DerivedData/FFA320Connector/Logs/Build/77B64239-A361-4556-87A0-02D5FA0EC337.xcactivitylog b/src_xcode3.2/DerivedData/FFA320Connector/Logs/Build/77B64239-A361-4556-87A0-02D5FA0EC337.xcactivitylog new file mode 100644 index 0000000..c1d71bc Binary files /dev/null and b/src_xcode3.2/DerivedData/FFA320Connector/Logs/Build/77B64239-A361-4556-87A0-02D5FA0EC337.xcactivitylog differ diff --git a/src_xcode3.2/DerivedData/FFA320Connector/Logs/Build/8B9B6764-E5B2-485D-A125-AD32F6914B23.xcactivitylog b/src_xcode3.2/DerivedData/FFA320Connector/Logs/Build/8B9B6764-E5B2-485D-A125-AD32F6914B23.xcactivitylog deleted file mode 100644 index d5506eb..0000000 Binary files a/src_xcode3.2/DerivedData/FFA320Connector/Logs/Build/8B9B6764-E5B2-485D-A125-AD32F6914B23.xcactivitylog and /dev/null differ diff --git a/src_xcode3.2/DerivedData/FFA320Connector/Logs/Build/93DBCA37-89E5-4399-9A85-24B5B0C7B4CC.xcactivitylog b/src_xcode3.2/DerivedData/FFA320Connector/Logs/Build/93DBCA37-89E5-4399-9A85-24B5B0C7B4CC.xcactivitylog new file mode 100644 index 0000000..8e64745 Binary files /dev/null and b/src_xcode3.2/DerivedData/FFA320Connector/Logs/Build/93DBCA37-89E5-4399-9A85-24B5B0C7B4CC.xcactivitylog differ diff --git a/src_xcode3.2/DerivedData/FFA320Connector/Logs/Build/Cache.db b/src_xcode3.2/DerivedData/FFA320Connector/Logs/Build/Cache.db index f9fda51..7e27a79 100644 Binary files a/src_xcode3.2/DerivedData/FFA320Connector/Logs/Build/Cache.db and b/src_xcode3.2/DerivedData/FFA320Connector/Logs/Build/Cache.db differ diff --git a/src_xcode3.2/DerivedData/FFA320Connector/Logs/Issues/6A023608-1AE6-4F0C-9012-4400F261CB01.xcactivitylog b/src_xcode3.2/DerivedData/FFA320Connector/Logs/Issues/6A023608-1AE6-4F0C-9012-4400F261CB01.xcactivitylog deleted file mode 100644 index 8dd02b6..0000000 Binary files a/src_xcode3.2/DerivedData/FFA320Connector/Logs/Issues/6A023608-1AE6-4F0C-9012-4400F261CB01.xcactivitylog and /dev/null differ diff --git a/src_xcode3.2/DerivedData/FFA320Connector/Logs/Issues/Cache.db b/src_xcode3.2/DerivedData/FFA320Connector/Logs/Issues/Cache.db index 643c9ab..16df20a 100644 Binary files a/src_xcode3.2/DerivedData/FFA320Connector/Logs/Issues/Cache.db and b/src_xcode3.2/DerivedData/FFA320Connector/Logs/Issues/Cache.db differ diff --git a/src_xcode3.2/DerivedData/FFA320Connector/Logs/Issues/D785CD42-2487-4F2B-888E-13A715FD619B.xcactivitylog b/src_xcode3.2/DerivedData/FFA320Connector/Logs/Issues/D785CD42-2487-4F2B-888E-13A715FD619B.xcactivitylog new file mode 100644 index 0000000..d73f7ed Binary files /dev/null and b/src_xcode3.2/DerivedData/FFA320Connector/Logs/Issues/D785CD42-2487-4F2B-888E-13A715FD619B.xcactivitylog differ diff --git a/src_xcode3.2/DerivedData/FFA320Connector/TextIndex/text-filter.idx b/src_xcode3.2/DerivedData/FFA320Connector/TextIndex/text-filter.idx index d406479..5cf5431 100644 Binary files a/src_xcode3.2/DerivedData/FFA320Connector/TextIndex/text-filter.idx and b/src_xcode3.2/DerivedData/FFA320Connector/TextIndex/text-filter.idx differ diff --git a/src_xcode3.2/DerivedData/FFA320Connector/info.plist b/src_xcode3.2/DerivedData/FFA320Connector/info.plist index 6b5012c..3a3aa20 100644 --- a/src_xcode3.2/DerivedData/FFA320Connector/info.plist +++ b/src_xcode3.2/DerivedData/FFA320Connector/info.plist @@ -3,7 +3,7 @@ LastAccessedDate - 2017-11-19T18:04:25Z + 2017-12-04T10:47:25Z WorkspacePath ../../FFA320Connector.xcodeproj diff --git a/src_xcode3.2/FFA320Connector.cpp b/src_xcode3.2/FFA320Connector.cpp index 901e79d..a7a38f8 100644 --- a/src_xcode3.2/FFA320Connector.cpp +++ b/src_xcode3.2/FFA320Connector.cpp @@ -1159,7 +1159,7 @@ void ffAPIUpdateCallback(double step, void *tag) { XPLMSetDatai(iDataObjects->DREF, (int)(size_t)curval * iDataObjects->DataRefMultiplier); } else { - int idata = (int)curval * iDataObjects->DataRefMultiplier; + int idata = (int)(size_t)curval * iDataObjects->DataRefMultiplier; XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); } } @@ -1175,7 +1175,7 @@ void ffAPIUpdateCallback(double step, void *tag) { XPLMSetDataf(iDataObjects->DREF, (float)icurval * iDataObjects->DataRefMultiplier); } else { - float idata = (float)icurval * iDataObjects->DataRefMultiplier; + float idata = (float)(size_t)icurval * iDataObjects->DataRefMultiplier; XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); } } @@ -1203,43 +1203,139 @@ void ffAPIUpdateCallback(double step, void *tag) { if (iDataObjects->DatarefCondition == CONDITION_EQUALS) { if ((int)(size_t)curval == iDataObjects->DatarefConditionValue) { - if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); - if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); + } + else { + int idata = iDataObjects->Value * iDataObjects->DataRefMultiplier; + XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } + if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + } + else { + float idata = iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier; + XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } } } if (iDataObjects->DatarefCondition == CONDITION_GREATER) { if ((int)(size_t)curval > iDataObjects->DatarefConditionValue) { - if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); - if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); + } + else { + int idata = iDataObjects->Value * iDataObjects->DataRefMultiplier; + XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } + if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + } + else { + float idata = iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier; + XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } } } if (iDataObjects->DatarefCondition == CONDITION_LOWER) { if ((int)(size_t)curval < iDataObjects->DatarefConditionValue) { - if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); - if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); + } + else { + int idata = iDataObjects->Value * iDataObjects->DataRefMultiplier; + XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } + if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + } + else { + float idata = iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier; + XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } } } if (iDataObjects->DatarefCondition == CONDITION_NOTEQUAL) { if ((int)(size_t)curval != iDataObjects->DatarefConditionValue) { - if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); - if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); + } + else { + int idata = iDataObjects->Value * iDataObjects->DataRefMultiplier; + XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } + if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + } + else { + float idata = iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier; + XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } } } if (iDataObjects->DatarefCondition == CONDITION_GREATER_EQUAL) { if ((int)(size_t)curval >= iDataObjects->DatarefConditionValue) { - if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); - if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); + } + else { + int idata = iDataObjects->Value * iDataObjects->DataRefMultiplier; + XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } + if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + } + else { + float idata = iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier; + XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } } } if (iDataObjects->DatarefCondition == CONDITION_LOWER_EQUAL) { if ((int)(size_t)curval <= iDataObjects->DatarefConditionValue) { - if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); - if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + if (iDataObjects->DataRefValueType == VALUE_TYPE_INT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDatai(iDataObjects->DREF, iDataObjects->Value * iDataObjects->DataRefMultiplier); + } + else { + int idata = iDataObjects->Value * iDataObjects->DataRefMultiplier; + XPLMSetDatavi(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } + if (iDataObjects->DataRefValueType == VALUE_TYPE_FLOAT) { + if (iDataObjects->DataRefOffset < 0) { + XPLMSetDataf(iDataObjects->DREF, iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier); + } + else { + float idata = iDataObjects->ValueFloat * iDataObjects->DataRefMultiplier; + XPLMSetDatavf(iDataObjects->DREF, &idata, iDataObjects->DataRefOffset, 1); + } + } } } diff --git a/src_xcode3.2/FFA320Connector.xcodeproj/project.xcworkspace/xcuserdata/john.xcuserdatad/UserInterfaceState.xcuserstate b/src_xcode3.2/FFA320Connector.xcodeproj/project.xcworkspace/xcuserdata/john.xcuserdatad/UserInterfaceState.xcuserstate index 0f04617..96ac656 100644 Binary files a/src_xcode3.2/FFA320Connector.xcodeproj/project.xcworkspace/xcuserdata/john.xcuserdatad/UserInterfaceState.xcuserstate and b/src_xcode3.2/FFA320Connector.xcodeproj/project.xcworkspace/xcuserdata/john.xcuserdatad/UserInterfaceState.xcuserstate differ