Advertisement
Guest User

Untitled

a guest
Apr 4th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 0.64 KB | None | 0 0
  1. #include "carinaguard.h"
  2. #include "guard.hpp"
  3. #include <thread>
  4.  
  5. CarinaGuard::CarinaGuard(Interfaces * const interfaces) : QObject(), m_interfaces(interfaces) {
  6.     while(Guard<Interfaces::Device::CARINA>::instance().load()) {
  7.         std::this_thread::sleep_for(std::chrono::milliseconds(5));
  8.     }
  9.     Guard<Interfaces::Device::CARINA>::instance().busy();
  10.     QTimer::singleShot(100, this, &CarinaGuard::updateBusy);
  11. }
  12.  
  13. CarinaGuard::~CarinaGuard() {
  14.     Guard<Interfaces::Device::CARINA>::instance().available();
  15.     m_interfaces->setCarinaBusy(false);
  16. }
  17.  
  18. void CarinaGuard::updateBusy()
  19. {
  20.     m_interfaces->setCarinaBusy(true);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement