#include "StateController.h" #include "ApplicationController.h" StateController::StateController(QObject *parent) : QObject(parent) {} void StateController::init() { connect(&_ApplicationController, SIGNAL(didUnhandledMsgAppController(const QVariantList &)), this , SLOT(onStateControllerUnhandledMsgReceived(const QVariantList &))); } void StateController::quit() { // TODo fill up } void StateController::onStateControllerUnhandledMsgReceived(const QVariantList &msg) { qDebug() << "Message With new" << msg[0]; if (!_dryDemo.isRunning()) { _dryDemo.start(); // TODO why cannot start the state machine somewhere else? } switch(msg[0].toUInt()) { case 2500: // TODO enum for this qDebug() << "Right here"; _dryDemo.connectToState("Idle", _dryDemo.onEntry([&]() { qDebug() << "In onEntry" << _dryDemo.activeStateNames();})); qDebug() << "New state" << _dryDemo.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); break; } qDebug() << "Msg Received" << msg; }