|
|
|
|
@ -32,6 +32,8 @@
|
|
|
|
|
#include "AmSession.h"
|
|
|
|
|
#include "log.h"
|
|
|
|
|
|
|
|
|
|
#include "AmSessionContainer.h"
|
|
|
|
|
#include "ampi/MonitoringAPI.h"
|
|
|
|
|
|
|
|
|
|
DSMStateDiagram::DSMStateDiagram(const string& name)
|
|
|
|
|
: name(name) {
|
|
|
|
|
@ -205,7 +207,7 @@ bool DSMStateEngine::init(AmSession* sess, const string& startDiagram,
|
|
|
|
|
ERROR("initializing with start diag '%s'\n",
|
|
|
|
|
startDiagram.c_str());
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DBG("run init event...\n");
|
|
|
|
|
runEvent(sess, init_event, NULL);
|
|
|
|
|
@ -301,6 +303,7 @@ void DSMStateEngine::runEvent(AmSession* sess,
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
DBG("changing to new state '%s'\n", target_st->name.c_str());
|
|
|
|
|
MONITORING_LOG(sess->getLocalTag().c_str(), "dsm_state", target_st->name.c_str());
|
|
|
|
|
current = target_st;
|
|
|
|
|
|
|
|
|
|
// execute pre-actions
|
|
|
|
|
@ -344,6 +347,9 @@ bool DSMStateEngine::jumpDiag(const string& diag_name, AmSession* sess,
|
|
|
|
|
diag_name.c_str());
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
MONITORING_LOG2(sess->getLocalTag().c_str(),
|
|
|
|
|
"dsm_diag", diag_name.c_str(),
|
|
|
|
|
"dsm_state", current->name.c_str());
|
|
|
|
|
|
|
|
|
|
// execute pre-actions
|
|
|
|
|
DBG("running %zd pre_actions of init state '%s'\n",
|
|
|
|
|
@ -370,6 +376,11 @@ bool DSMStateEngine::returnDiag(AmSession* sess) {
|
|
|
|
|
current_diag = stack.back().first;
|
|
|
|
|
current = stack.back().second;
|
|
|
|
|
stack.pop_back();
|
|
|
|
|
|
|
|
|
|
MONITORING_LOG2(sess->getLocalTag().c_str(),
|
|
|
|
|
"dsm_diag", current_diag->getName().c_str(),
|
|
|
|
|
"dsm_state", current->name.c_str());
|
|
|
|
|
|
|
|
|
|
DBG("returned to diag '%s' state '%s'\n",
|
|
|
|
|
current_diag->getName().c_str(),
|
|
|
|
|
current->name.c_str());
|
|
|
|
|
|