Doing some prevention
This commit is contained in:
parent
0b29fb881d
commit
266dcefdfd
3 changed files with 7 additions and 1 deletions
|
|
@ -33,6 +33,8 @@ class Dtu {
|
|||
|
||||
void setStatusMicroinverters(uint16_t value, std::string statusName, std::vector<long long>& microinvertersToSet);
|
||||
|
||||
bool empty();
|
||||
|
||||
~Dtu();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -142,3 +142,7 @@ void Dtu::setStatusMicroinverters(uint16_t value, std::string statusName, std::v
|
|||
microinvertersToSetIterator++;
|
||||
}
|
||||
}
|
||||
|
||||
bool Dtu::empty() {
|
||||
return this->microinverters.empty();
|
||||
}
|
||||
|
|
@ -88,7 +88,7 @@ int main(int argc, char **argv) {
|
|||
std::cout << "DTU construction time: " << std::chrono::duration_cast<std::chrono::milliseconds>(endTime - startTime).count() << "ms" << std::endl;
|
||||
std::cout << std::endl << std::endl;
|
||||
|
||||
while (!writeMode && ((dtu.isConnected() || ignoreNotConnected) && (!parametersToGet.empty() || allParameters))) {
|
||||
while (!writeMode && (!dtu.empty() && ((dtu.isConnected() || ignoreNotConnected) && (!parametersToGet.empty() || allParameters)))) {
|
||||
time_t now = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
|
||||
|
||||
startTime = std::chrono::high_resolution_clock::now();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue