Removed multithreading for now, corrected connected
This commit is contained in:
parent
089c7a77b5
commit
e0135b6753
4 changed files with 34 additions and 20 deletions
|
|
@ -1,4 +1,4 @@
|
|||
#include <thread>
|
||||
// #include <thread>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
|
||||
|
|
@ -18,16 +18,16 @@ Microinverter::Microinverter(std::shared_ptr<modbus_t*> modbus_context, std::mut
|
|||
}
|
||||
|
||||
void Microinverter::updatePorts() {
|
||||
std::vector<std::thread> updateThreads;
|
||||
// std::vector<std::thread> updateThreads;
|
||||
for(Port port : this->ports){
|
||||
updateThreads.push_back(std::thread(&Port::updateParameters, port));
|
||||
// port.updateParameters();
|
||||
}
|
||||
std::vector<std::thread>::iterator updateThreadsIterator = updateThreads.begin();
|
||||
while(updateThreadsIterator != updateThreads.end()) {
|
||||
updateThreadsIterator->join();
|
||||
updateThreadsIterator++;
|
||||
// updateThreads.push_back(std::thread(&Port::updateParameters, port));
|
||||
port.updateParameters();
|
||||
}
|
||||
// std::vector<std::thread>::iterator updateThreadsIterator = updateThreads.begin();
|
||||
// while(updateThreadsIterator != updateThreads.end()) {
|
||||
// updateThreadsIterator->join();
|
||||
// updateThreadsIterator++;
|
||||
// }
|
||||
}
|
||||
|
||||
void Microinverter::printPorts() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue