Page MenuHomePhorge

attach_modulesToTestbench.cpp
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

attach_modulesToTestbench.cpp

#include "attach_modulesToTestbench.h"
//#include "rlutil.h"
#include "SensorSlotOfTestbench.h"
// using namespace rlutil;
bool attach_csvReaderModuleToSensorSlotInAgent(
Testbench *testbench, Sensor *sensor, CSVreaderModule *csvReaderModule) {
if (testbench != NULL && sensor != NULL && csvReaderModule != NULL) {
SensorSlotOfTestbench *sensorSlot =
testbench->get_sensorSlotAddressOfTestbench(sensor);
if (sensorSlot != NULL) {
printf(" > CSV-Reader ");
// setColor(TXTCOLOR_LIGHTCYAN);
printf("%s ", csvReaderModule->get_name());
// setColor(TXTCOLOR_GREY);
printf("(id: %03u) ", csvReaderModule->get_id());
if (sensorSlot->set_csvReaderModule(csvReaderModule)) {
// setColor(TXTCOLOR_LIGHTGREEN);
printf("attached ");
// setColor(TXTCOLOR_GREY);
printf("to Sensor ");
// setColor(TXTCOLOR_LIGHTCYAN);
printf("%s ", sensor->get_name());
// setColor(TXTCOLOR_GREY);
printf("(id: %03u) in Testbench ", sensor->get_id());
// setColor(TXTCOLOR_LIGHTCYAN);
printf("%s ", testbench->get_name());
// setColor(TXTCOLOR_GREY);
printf("(id: %03u)\n", testbench->get_id());
return true;
} else {
// setColor(TXTCOLOR_LIGHTRED);
printf("Couldn't attach the CSVreaderModule!\n");
// setColor(TXTCOLOR_GREY);
}
} else {
// setColor(TXTCOLOR_LIGHTRED);
printf(" > Couldn't attach the CSVreaderModule because Sensor isn't "
"registered in %s (id: %03u)!\n",
testbench->get_name(), testbench->get_id());
// setColor(TXTCOLOR_GREY);
}
} else {
// setColor(TXTCOLOR_LIGHTRED);
printf(" > Couldn't attach the CSVreaderModule because Testbench, "
"Sensorm or CSVreaderModule is not valid!\n");
// setColor(TXTCOLOR_GREY);
}
return false;
}

File Metadata

Mime Type
text/x-c
Expires
Sun, Mar 1, 6:42 PM (1 d, 6 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
283048
Default Alt Text
attach_modulesToTestbench.cpp (1 KB)

Event Timeline