Digitalisierte Elektroverteilung zur permanenten Verbraucherüberwachung
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DataAcquisition.h 923B

3 years ago
1234567891011121314151617181920212223242526272829303132333435363738
  1. #pragma once
  2. #include "DataModel.h"
  3. #include "PublisherInterface.h"
  4. #include <memory>
  5. #include <vector>
  6. #include <thread>
  7. #include "ts_queue.h"
  8. #include "modbus_interface_lib.h"
  9. class DataAcquisition
  10. {
  11. private:
  12. std::unique_ptr<DataModel>& dataModel;
  13. //Modbus Connections for POC and Bender, can be serial or IP
  14. std::vector<std::unique_ptr<PublisherInterface>> publishers;
  15. //Modbus thread
  16. std::vector<std::thread> modbusThread;
  17. ts_queue<ParameterSpecification> modbusAccessQueue;
  18. public:
  19. DataAcquisition();
  20. ~DataAcquisition();
  21. void startModbusThread();
  22. ts_queue<ParameterSpecification>& getModbusQueue() { return modbusAccessQueue; }
  23. //void registerPublisher(Publisher* publisher);
  24. void registerPublisher(std::unique_ptr<PublisherInterface> publisher);
  25. std::vector<std::unique_ptr<PublisherInterface>>& getPublishers() { return publishers; }
  26. void enqueuePublisherRegister();
  27. };