Added CLI

This commit is contained in:
TraYali 2024-03-20 11:28:43 +01:00
parent b63bd9ae42
commit 70b27a0c07
8 changed files with 151 additions and 32 deletions

View file

@ -1,6 +1,7 @@
// #include <thread>
#include <iostream>
#include <memory>
#include <string>
#include "modbus.h"
@ -27,6 +28,14 @@ void Microinverter::updatePorts() {
// }
}
void Microinverter::updatePorts(std::vector<std::string> &parametersToGet) {
std::vector<Port>::iterator portsIterator = this->ports.begin();
while(portsIterator != this->ports.end()) {
portsIterator->updateParameters(parametersToGet);
portsIterator++;
}
}
void Microinverter::printPorts() {
std::cout << "Microinverter: " << this->serialNumber << std::endl;
@ -36,4 +45,15 @@ void Microinverter::printPorts() {
std::cout << std::endl;
portsIterator++;
}
}
void Microinverter::printPorts(std::vector<std::string> &parametersToGet) {
std::cout << "Microinverter: " << this->serialNumber << std::endl;
std::vector<Port>::iterator portsIterator = this->ports.begin();
while(portsIterator != this->ports.end()) {
portsIterator->printParameters(parametersToGet);
std::cout << std::endl;
portsIterator++;
}
}