SPQR-Team-2019-REVAMPED/src/ds_ctrl.cpp

37 lines
703 B
C++
Executable File

#include "ds_ctrl.h"
using namespace std;
DataSourceCtrl::DataSourceCtrl() {}
DataSourceCtrl::DataSourceCtrl(vector<DataSource*> ds_){
this->ds = ds_;
}
void DataSourceCtrl::read(){
for(DataSource* d : ds){
d->readSensor();
}
}
void DataSourceCtrl::update(){
read();
postProcess();
}
void DataSourceCtrl::postProcess(){
for(DataSource* d : ds){
d->postProcess();
}
}
int DataSourceCtrl::getValue(int i){
return this->ds[i]->getValue();
}
void DataSourceCtrl::test(){
DEBUG.println("========================================");
for(DataSource* d : ds){
d->test();
}
DEBUG.println("========================================");
}