Added functions to set TACAN and radio frequencies

This commit is contained in:
Pax1601
2023-04-13 08:09:15 +02:00
parent 7eee469bed
commit 4a90193426
9 changed files with 138 additions and 27 deletions

View File

@@ -8,4 +8,5 @@ void DllExport LogError(lua_State* L, string message);
void DllExport Log(lua_State* L, string message, int level);
int DllExport dostring_in(lua_State* L, string target, string command);
map<int, json::value> DllExport getAllUnits(lua_State* L);
int DllExport TACANChannelToFrequency(int channel, wstring XY);

View File

@@ -94,7 +94,6 @@ exit:
return units;
}
int dostring_in(lua_State* L, string target, string command)
{
lua_getglobal(L, "net");
@@ -102,4 +101,10 @@ int dostring_in(lua_State* L, string target, string command)
lua_pushstring(L, target.c_str());
lua_pushstring(L, command.c_str());
return lua_pcall(L, 2, 0, 0);
}
int TACANChannelToFrequency(int channel, wstring XY)
{
int basef = (XY == L"X" && channel > 63) || (XY == L"Y" && channel < 64) ? 1087000000 : 961000000;
return basef + 1000000 * channel;
}