Index: main.cpp =================================================================== diff -u -r5a248f0a45889844aa027f4f4a0661aa539975f0 -rad35b27c3ec3ea357b6173df5ab8793c3378af6e --- main.cpp (.../main.cpp) (revision 5a248f0a45889844aa027f4f4a0661aa539975f0) +++ main.cpp (.../main.cpp) (revision ad35b27c3ec3ea357b6173df5ab8793c3378af6e) @@ -46,14 +46,11 @@ #include "MessageDispatcher.h" #include "ApplicationController.h" #include "Logger.h" +#include "StateController.h" -//AMIR #include "Settings.h" - #include "Threads.h" -#include "drydemostates.h" - // kernel #include @@ -383,7 +380,7 @@ gActiveCANBus = value; } } - + qDebug() << "CAN int" << gActiveCANBus; if (parser.isSet(optionSendEmptyKeepAwake)) gSendEmptyKeepAwake = true; bool ok = false; @@ -534,21 +531,6 @@ signal(SIGTERM, signalhandler); #endif - drydemostates dryStates; - - dryStates.start(); - - dryStates.connectToState("Idle", QScxmlStateMachine::onEntry([&]() { - qDebug() << "In onEntry"; - QThread::sleep(4); - dryStates.submitEvent("Tx_Start_Rqst");})); - - dryStates.connectToState("Idle", QScxmlStateMachine::onExit([&] { - qDebug() << "Exiting";})); - - dryStates.connectToState("Treatment", QScxmlStateMachine::onEntry([&]() { - qDebug() << "In Treatment";})); - // setting the environment for the keyboard. qputenv("QT_IM_MODULE" , QByteArray("qtvirtualkeyboard" )); qputenv("QT_VIRTUALKEYBOARD_STYLE" , QByteArray("denali" )); @@ -623,6 +605,8 @@ //! - Initializing Main Timer _MainTimer.init(); + _StateController.init(); + int app_exec = -1; _ApplicationController.startPOST(); app_exec = app.exec();