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

@ -512,11 +512,18 @@ int VMC::SendVersion(QString VersionString) {
*/
int VMC::SendCurrentState()
{
QByteArray message(QByteArray::fromHex("3E1132"));
message.append(static_cast<char>(main->getCurrentProgramMode()));
SendMessage(message);
QByteArray message(QByteArray::fromHex("3E1132"));
return 1;
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;
}
/* Send lic plate String to VMC