Commit 9c92d372 authored by Micha Mueller's avatar Micha Mueller
Browse files

Further fixes and improvements

parent 7cc73e39
...@@ -328,16 +328,6 @@ public: ...@@ -328,16 +328,6 @@ public:
//prints plugin specific configurator attributes and entities if present //prints plugin specific configurator attributes and entities if present
printConfiguratorConfig(ll); printConfiguratorConfig(ll);
/*
LOG_VAR(ll) << " Entities (" << _entityName << "):";
if (_sensorEntitys.size() != 0) {
for(auto e : _sensorEntitys) {
e->printConfig();
}
} else {
LOG_VAR(ll) << " No entities for this plugin";
}*/
LOG_VAR(ll) << " Groups:"; LOG_VAR(ll) << " Groups:";
for(auto g : _sensorGroups) { for(auto g : _sensorGroups) {
g->SensorGroupInterface::printConfig(ll); g->SensorGroupInterface::printConfig(ll);
...@@ -633,7 +623,6 @@ protected: ...@@ -633,7 +623,6 @@ protected:
if (_mqttPrefix[_mqttPrefix.length()-1] != '/') { if (_mqttPrefix[_mqttPrefix.length()-1] != '/') {
_mqttPrefix.append("/"); _mqttPrefix.append("/");
} }
LOG(debug) << " Using own MQTT-Prefix " << _mqttPrefix;
} else if (boost::iequals(global.first, "cacheInterval")) { } else if (boost::iequals(global.first, "cacheInterval")) {
_cacheInterval = stoul(global.second.data()); _cacheInterval = stoul(global.second.data());
_cacheInterval *= 1000; _cacheInterval *= 1000;
......
...@@ -288,19 +288,20 @@ public: ...@@ -288,19 +288,20 @@ public:
static std::string formatName(const std::string& name, int cpuID=-1) {return cpuID<0 ? name : "cpu" + std::to_string(cpuID) + "." + name;} static std::string formatName(const std::string& name, int cpuID=-1) {return cpuID<0 ? name : "cpu" + std::to_string(cpuID) + "." + name;}
virtual void printConfig(LOG_LEVEL ll, LOGGER& lg) { virtual void printConfig(LOG_LEVEL ll, LOGGER& lg) {
LOG_VAR(ll) << " Sensor " << _name; LOG_VAR(ll) << " Sensor: " << _name;
LOG_VAR(ll) << " MQTT Topic: " << _mqtt; LOG_VAR(ll) << " MQTT Topic: " << _mqtt;
LOG_VAR(ll) << " sink: " << getSinkPath();
if(_skipConstVal) { LOG_VAR(ll) << " subSampling: " << getSubsampling();
LOG_VAR(ll) << " Skipping constant values"; if(_skipConstVal) {
} else { LOG_VAR(ll) << " Skipping constant values";
LOG_VAR(ll) << " No skipping of constant values"; } else {
} LOG_VAR(ll) << " No skipping of constant values";
}
if(_delta) { if(_delta) {
LOG_VAR(ll) << " Storing delta readings"; LOG_VAR(ll) << " Storing delta readings";
} else { } else {
LOG_VAR(ll) << " Storing absolute readings"; LOG_VAR(ll) << " Storing absolute readings";
} }
} }
......
...@@ -81,7 +81,7 @@ public: ...@@ -81,7 +81,7 @@ public:
} }
virtual void printConfig(LOG_LEVEL ll) { virtual void printConfig(LOG_LEVEL ll) {
LOG_VAR(ll) << " Sensor Group " << _groupName; LOG_VAR(ll) << " Sensor Group: " << _groupName;
if (_mqttPart != "") { if (_mqttPart != "") {
LOG_VAR(ll) << " MQTT part: " << _mqttPart; LOG_VAR(ll) << " MQTT part: " << _mqttPart;
} }
......
...@@ -73,7 +73,7 @@ void BACnetConfigurator::global(CFG_VAL config) { ...@@ -73,7 +73,7 @@ void BACnetConfigurator::global(CFG_VAL config) {
} }
void BACnetConfigurator::printConfiguratorConfig(LOG_LEVEL ll) { void BACnetConfigurator::printConfiguratorConfig(LOG_LEVEL ll) {
LOG_VAR(ll) << " Not other plugin specific general attributes"; LOG_VAR(ll) << " No other plugin specific general attributes";
if (_bacClient) { if (_bacClient) {
_bacClient->printConfig(ll); _bacClient->printConfig(ll);
......
...@@ -58,11 +58,11 @@ public: ...@@ -58,11 +58,11 @@ public:
void setObjectIndex(int32_t objectIndex) { _objectIndex = objectIndex; } void setObjectIndex(int32_t objectIndex) { _objectIndex = objectIndex; }
void printConfig(LOG_LEVEL ll, LOGGER& lg) override { void printConfig(LOG_LEVEL ll, LOGGER& lg) override {
LOG_VAR(ll) << " Factor: " << _factor; LOG_VAR(ll) << " Factor: " << _factor;
LOG_VAR(ll) << " objectInstance: " << _objectInstance; LOG_VAR(ll) << " objectInstance: " << _objectInstance;
LOG_VAR(ll) << " objectType: " << _objectType; LOG_VAR(ll) << " objectType: " << _objectType;
LOG_VAR(ll) << " propertyId: " << _propertyId; LOG_VAR(ll) << " propertyId: " << _propertyId;
LOG_VAR(ll) << " objectIndex: " << _objectIndex; LOG_VAR(ll) << " objectIndex: " << _objectIndex;
} }
protected: protected:
......
...@@ -31,17 +31,6 @@ void BACnetSensorGroup::init(boost::asio::io_service& io) { ...@@ -31,17 +31,6 @@ void BACnetSensorGroup::init(boost::asio::io_service& io) {
SensorGroupTemplate::init(io); SensorGroupTemplate::init(io);
if(_bacClient) { if(_bacClient) {
_bacClient->initializeStrand(io); _bacClient->initializeStrand(io);
#ifdef DEBUG
LOG(debug) << " DeviceInstance: " << _deviceInstance;
LOG(debug) << " " << _sensors.size() << " Sensors:";
for(const auto& s : _sensors) {
LOG(debug) << " " << s->getName();
LOG(debug) << " ObjectInstance: " << s->getObjectInstance();
LOG(debug) << " ObjectType: " << s->getObjectType();
LOG(debug) << " PropertyId: " << s->getPropertyId();
}
#endif
} else { } else {
LOG(error) << "No BACnetClient set for sensor " << _groupName << "! Cannot initialize sensor."; LOG(error) << "No BACnetClient set for sensor " << _groupName << "! Cannot initialize sensor.";
} }
......
...@@ -30,7 +30,7 @@ public: ...@@ -30,7 +30,7 @@ public:
void setDeviceInstance(const std::string& deviceInstance) { _deviceInstance = stoul(deviceInstance); } void setDeviceInstance(const std::string& deviceInstance) { _deviceInstance = stoul(deviceInstance); }
uint32_t getDeviceInstance() const { return _deviceInstance; } uint32_t getDeviceInstance() const { return _deviceInstance; }
void printConfig(LOG_LEVEL ll); void printConfig(LOG_LEVEL ll) override;
private: private:
void read() override; void read() override;
......
Markdown is supported
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