PDUConfigurator.cpp 1.01 KB
Newer Older
1
2
3
4
5
6
7
8
9
/*
 * PDUConfigurator.cpp
 *
 *  Created on: 24.02.2018
 *      Author: Micha Mueller
 */

#include "PDUConfigurator.h"

10
#include <iostream>
11
#include <sstream>
12

13
14
15
16
17
PDUConfigurator::PDUConfigurator() {
	_entityName = "pdu";
	_groupName = "group";
	_baseName = "sensor";
}
18

19
PDUConfigurator::~PDUConfigurator() {}
20

21
22
23
void PDUConfigurator::sensorBase(PDUSensorBase& s, CFG_VAL config) {
	ADD {
		ATTRIBUTE("path", setXMLPath);
24
	}
25
26
}

27
28
29
void PDUConfigurator::sensorGroup(PDUSensorGroup& s, CFG_VAL config) {
	ADD {
		//no group attributes currently
30
	}
31
32
}

33
34
35
36
37
38
void PDUConfigurator::sensorEntity(PDUUnit& s, CFG_VAL config) {
	ADD {
		ATTRIBUTE("TTL", setTTL);
		ATTRIBUTE("host", setHost);
		ATTRIBUTE("request", setRequest);
		//TODO add support for mqttPart if required
39
	}
40
}
41

42
43
44
bool PDUConfigurator::isEntityOfGroup(PDUUnit& e, PDUSensorGroup& g) {
	return (g.getPdu() == &e);
}
45

46
47
void PDUConfigurator::setEntityForGroup(PDUUnit& e, PDUSensorGroup& g) {
	g.setPdu(&e);
48
49
}

50
51
52
void PDUConfigurator::finalizeGroup(PDUSensorGroup& g) {
	//nothing to finalize
}