Commit 1b969731 authored by Alessio Netti's avatar Alessio Netti
Browse files

Analytics: small changes

- When a unit cannot be built, UnitGenerator does not abort anymore;
error log messages are produced, and it proceeds with the next unit
parent 3d72b599
......@@ -35,6 +35,7 @@
#include "sensornavigator.h"
#include "UnitTemplate.h"
#include "mqttchecker.h"
#include "logging.h"
using namespace std;
......@@ -215,9 +216,12 @@ public:
try {
unitObjects->push_back(_generateUnit(u, inputs, outputs, inputMode, mqttPrefix, relaxed));
} catch( const exception& e) {
delete units;
delete unitObjects;
throw;
//delete units;
//delete unitObjects;
//throw;
LOG(error) << e.what();
LOG(error) << "UnitGenerator: cannot build unit " << u << "!";
continue;
}
}
......@@ -442,6 +446,9 @@ protected:
return unPtr;
}
// Logger object
boost::log::sources::severity_logger<boost::log::trivial::severity_level> lg;
//Internal SensorNavigator object
shared_ptr<SensorNavigator> _navi;
......
......@@ -43,7 +43,7 @@ private:
void sensorBase(AggregatorSensorBase& s, CFG_VAL config) override;
void operatorAttributes(PerSystSqlOperator& op, CFG_VAL config) override;
bool unit(UnitTemplate<AggregatorSensorBase>& u) override;
bool readUnits(PerSystSqlOperator& op, std::vector<shared_ptr<AggregatorSensorBase>>& protoInputs, std::vector<shared_ptr<AggregatorSensorBase>>& protoOutputs, inputMode_t inputMode);
bool readUnits(PerSystSqlOperator& op, std::vector<shared_ptr<AggregatorSensorBase>>& protoInputs, std::vector<shared_ptr<AggregatorSensorBase>>& protoOutputs, inputMode_t inputMode) override;
};
extern "C" OperatorConfiguratorInterface* create() {
......
Supports Markdown
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