Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "carinaguard.h"
- #include "guard.hpp"
- #include <thread>
- CarinaGuard::CarinaGuard(Interfaces * const interfaces) : QObject(), m_interfaces(interfaces) {
- while(Guard<Interfaces::Device::CARINA>::instance().load()) {
- std::this_thread::sleep_for(std::chrono::milliseconds(5));
- }
- Guard<Interfaces::Device::CARINA>::instance().busy();
- QTimer::singleShot(100, this, &CarinaGuard::updateBusy);
- }
- CarinaGuard::~CarinaGuard() {
- Guard<Interfaces::Device::CARINA>::instance().available();
- m_interfaces->setCarinaBusy(false);
- }
- void CarinaGuard::updateBusy()
- {
- m_interfaces->setCarinaBusy(true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement