Use invokeMethod() on m_appControl-pointer to call getCurrentProgramMode().

This commit is contained in:
Gerhard Hoffmann 2023-11-13 13:50:46 +01:00
parent dfba8e3807
commit af72ad43a4

View File

@ -513,8 +513,15 @@ int VMC::SendVersion(QString VersionString) {
int VMC::SendCurrentState()
{
QByteArray message(QByteArray::fromHex("3E1132"));
message.append(static_cast<char>(main->getCurrentProgramMode()));
PROGRAM_MODE currentMode;
if (QMetaObject::invokeMethod(m_appControl,
"getCurrentProgramMode",
Qt::DirectConnection,
Q_RETURN_ARG(PROGRAM_MODE, currentMode))) {
message.append(static_cast<char>(currentMode));
SendMessage(message);
}
return 1;
}