Page MenuHomePhorge

inAgentsRegistrations.cpp
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

inAgentsRegistrations.cpp

#include "inAgentsRegistrations.h"
#include "rlutil.h"
using namespace rlutil;
bool registerSlaveAgentAsInputVariableInStateHandler(Agent* masteragent, Channel* channel) {
if(masteragent != NULL, channel != NULL) {
SlaveAgentSlotOfAgent* slot = masteragent->get_slaveAgentHandlerOfAgent()->get_slaveAgentSlotAddress(channel);
if(slot != NULL) {
if(masteragent->get_stateHandler()->addInputVariable(slot)){
printf(" > Channel ");
setColor(LIGHTCYAN);
printf("%s ", channel->getName().c_str());
setColor(GREY);
printf("(id: %03u) ", channel->getId());
setColor(LIGHTGREEN);
printf("registered ");
setColor(GREY);
printf("as ");
setColor(LIGHTGREEN);
printf("Input Variable ");
setColor(GREY);
printf("in stateHandler of ");
setColor(LIGHTCYAN);
printf("%s ", masteragent->getName().c_str());
setColor(GREY);
printf("(id: %03u)\n", masteragent->getId());
return true;
}
else {
setColor(LIGHTRED);
printf(" > Channel %s (id: %03u) is not connected to Agent %s (id: %03u)\n", channel->getName().c_str(), channel->getId(), masteragent->getName().c_str(), masteragent->getId());
}
}
else {
setColor(LIGHTRED);
printf(" > Channel %s (id: %03u) is not connected to Agent %s (id: %03u)\n", channel->getName().c_str(), channel->getId(), masteragent->getName().c_str(), masteragent->getId());
}
}
else {
setColor(LIGHTRED);
printf(" > Agent or Channel is not valid\n");
}
return false;
}
bool registerSlaveAgentAsOutputVariableInStateHandler(Agent* masteragent, Channel* channel) {
if (masteragent != NULL, channel != NULL) {
SlaveAgentSlotOfAgent* slot = masteragent->get_slaveAgentHandlerOfAgent()->get_slaveAgentSlotAddress(channel);
if (slot != NULL) {
if (masteragent->get_stateHandler()->addOutputVariable(slot)) {
printf(" > Channel ");
setColor(LIGHTCYAN);
printf("%s ", channel->getName().c_str());
setColor(GREY);
printf("(id: %03u) ", channel->getId());
setColor(LIGHTGREEN);
printf("registered ");
setColor(GREY);
printf("as ");
setColor(LIGHTGREEN);
printf("Output Variable ");
setColor(GREY);
printf("in stateHandler of ");
setColor(LIGHTCYAN);
printf("%s ", masteragent->getName().c_str());
setColor(GREY);
printf("(id: %03u)\n", masteragent->getId());
return true;
}
else {
setColor(LIGHTRED);
printf(" > Channel %s (id: %03u) is not connected to Agent %s (id: %03u)\n", channel->getName().c_str(), channel->getId(), masteragent->getName().c_str(), masteragent->getId());
}
}
else {
setColor(LIGHTRED);
printf(" > Channel %s (id: %03u) is not connected to Agent %s (id: %03u)\n", channel->getName().c_str(), channel->getId(), masteragent->getName().c_str(), masteragent->getId());
}
}
else {
setColor(LIGHTRED);
printf(" > Agent or Channel is not valid\n");
}
return false;
}

File Metadata

Mime Type
text/x-c
Expires
Sun, Mar 1, 10:18 PM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
289221
Default Alt Text
inAgentsRegistrations.cpp (2 KB)

Event Timeline