Add support for sendCOMM method
Credits go to user @angelsware, I just did a copy/paste from #120
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "XPLMDataAccess.h"
|
||||
#include "XPLMGraphics.h"
|
||||
#include "XPLMUtilities.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
@@ -791,6 +792,21 @@ namespace XPC
|
||||
Set(DREF_FlapActual, value);
|
||||
}
|
||||
|
||||
void DataManager::Execute(const std::string& comm)
|
||||
{
|
||||
Log::FormatLine(LOG_INFO, "DMAN", "Executing command (value:%s)", comm.c_str());
|
||||
|
||||
XPLMCommandRef xcref = XPLMFindCommand(comm.c_str());
|
||||
if (!xcref)
|
||||
{
|
||||
// COMM does not exist
|
||||
Log::FormatLine(LOG_ERROR, "DMAN", "ERROR: invalid COMM %s", comm.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
XPLMCommandOnce(xcref);
|
||||
}
|
||||
|
||||
float DataManager::GetDefaultValue()
|
||||
{
|
||||
return -998.0F;
|
||||
|
||||
Reference in New Issue
Block a user