#include "DryDemoStates.h" #include "ApplicationController.h" DryDemoStates::DryDemoStates(drydemoXMLstates *parent) : drydemoXMLstates(parent) { //start(); // Why cannot I start the state machine here? } void DryDemoStates::onMsgReceived(QString msg) { // TODO call the state machine qDebug() << "Msg Received" << msg; if (!isRunning()) { start(); // TODO why cannot start the state machine somewhere else? // TODO How to leave this function? } //connectToState("Idle", onEntry([&]() { // qDebug() << "In onEntry" << activeStateNames(); // submitEvent("Tx_Start_Rqst");})); connectToState("Idle", onEntry([&]() { qDebug() << "In onEntry" << activeStateNames(); })); qDebug() << "New state" << activeStateNames(); QVariantList list; list.append(static_cast(0x2A00)); list.append(Can_Id::eChlid_HD_UI); list.append(68); list.append(34.56); emit _ApplicationController.didActionTransmit(list); }