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.

inputbusiness.cpp 500B

1234567891011121314151617181920212223
  1. #include <time.h>
  2. #include "inputbusiness.h"
  3. InputBusiness::InputBusiness(InputManager *input, const QList<QVariant> &channels, ServerManager *server)
  4. : m_input(input)
  5. , m_channels(channels)
  6. , m_server(server)
  7. {
  8. }
  9. InputBusiness::~InputBusiness()
  10. {
  11. }
  12. void InputBusiness::readAndSend()
  13. {
  14. QList<QVariant> values;
  15. quint64 timestamp = time(nullptr);
  16. foreach (auto channel, m_channels)
  17. values.append(m_input->read(channel));
  18. m_server->sendData(values, timestamp);
  19. }