Polymorphism "works"
This commit is contained in:
parent
b0e50c140e
commit
d0f8e5b885
10 changed files with 274 additions and 287 deletions
20
src/hoymiles/microinverter.cpp
Normal file
20
src/hoymiles/microinverter.cpp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#include "microinverter.h"
|
||||
#include "port.h"
|
||||
|
||||
Microinverter::Microinverter(modbus_t *modbus_context) {
|
||||
this->modbus_context = modbus_context;
|
||||
|
||||
this->populatePorts();
|
||||
}
|
||||
|
||||
void Microinverter::populatePorts() {
|
||||
Port port{this->modbus_context, 0x1000};
|
||||
|
||||
this->ports.push_back(port);
|
||||
}
|
||||
|
||||
void Microinverter::updatePorts() {
|
||||
for(Port port : this->ports){
|
||||
port.updateParameters();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue