in test measurement cycle we currently use a boolean to tell the file system write cache to also output to serial. It would fit our pattern better to instead have a special OutputDevice that is handed to the cache that writes to both outputs. OutputDevices should define how output is written, and not at the WriteCache level.
void Datalogger::testMeasurementCycle()
{
initializeMeasurementCycle();
fileSystemWriteCache->setOutputToSerial(true); // another way to do this would be to set a special write cache
while(processReadingsCycle()){
fileSystemWriteCache->flushCache();
outputLastMeasurement();
}
fileSystemWriteCache->flushCache(); // instead of using a boolean in this particular write cache
fileSystemWriteCache->setOutputToSerial(false);// and then set it back to the original writecache here
}
in test measurement cycle we currently use a boolean to tell the file system write cache to also output to serial. It would fit our pattern better to instead have a special OutputDevice that is handed to the cache that writes to both outputs. OutputDevices should define how output is written, and not at the WriteCache level.