Commit dc85310a authored by Marc R.'s avatar Marc R.

multivaractor: added request queue debug output

parent 6c636f8f
......@@ -1379,6 +1379,26 @@ bool MNWPActorVariable::hasData()
}
QString MNWPActorVariable::debugOutputAsString()
{
QString str = QString("==================\nNWPActorVariable :: "
"%1 of %2:\n").arg(variableName).arg(dataSourceID);
str += QString("Number of pending requests: %1\n").arg(pendingRequests.size());
str += QString("Entries in the queue of pending requests:\n");
for (int i = 0; i < pendingRequestsQueue.size(); i++)
{
str += QString(" ++ entry #%1: available=%2, request=%2").arg(i)
.arg(pendingRequestsQueue[i].available)
.arg(pendingRequestsQueue[i].request);
}
str += QString("==================\n");
return str;
}
/******************************************************************************
*** PUBLIC SLOTS ***
*******************************************************************************/
......
......@@ -171,6 +171,8 @@ public:
*/
bool hasData();
QString debugOutputAsString();
/* Data loader and variable specifications. */
QString dataSourceID;
MWeatherPredictionDataSource *dataSource;
......
......@@ -383,6 +383,22 @@ bool MNWPMultiVarActor::isConnectedTo(MActor *actor)
}
void MNWPMultiVarActor::printDebugOutputOnUserRequest()
{
QString str = QString("\n==================\nNWPMultiVarActor :: "
"%1\n\n").arg(getName());
for (MNWPActorVariable* var : variables)
{
str += var->debugOutputAsString();
}
str += QString("==================\n");
LOG4CPLUS_DEBUG(mlog, str.toStdString());
}
/******************************************************************************
*** PUBLIC SLOTS ***
*******************************************************************************/
......
......@@ -136,6 +136,8 @@ public:
bool isConnectedTo(MActor *actor) override;
void printDebugOutputOnUserRequest();
protected:
friend class MNWPActorVariable;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment