C++Instrument Catalog MFC 1.2
Metrolab C++InstrumentCatalog for MFC
Loading...
Searching...
No Matches
USBRemoteBoxController.h
Go to the documentation of this file.
1
5
6#pragma once
7
8// Personal includes
9#include "USBRemoteBox.h"
10#include "Exception.h"
11#include "Helpers.h"
12#include "Synchronization.h"
13#include "ThreadedMailbox.h"
14#include "MFCManagerCatalog.h"
15
16using namespace MTL;
17using namespace MTL::Instrument;
18using namespace MTL::ThreadedMailbox;
19
20namespace MTL {
21
22 //--------------------------------------------------------------------------//
23 // Remote Box
24 //--------------------------------------------------------------------------//
33 class CUSBRemoteBoxController : private CThreadedMailBox<sUSBRemoteBoxControllerMailBoxMsg>
34 {
35 //----------------------------------------------------------------------//
36 // Constants
37 private:
38 static const std::string RSRC_FILTER;
39 static const int REFRESH_RATE_MS;
40
41 //----------------------------------------------------------------------//
42 // Attributes
43 private:
44 CVISAResourceManager & m_rRsrcMan;
46 CAsyncSnaphsotNotifier m_ASManagerNotifier;
47 CUSBRemoteBox * m_pRemoteBox;
48 CTimer m_Timer;
51
52 //----------------------------------------------------------------------//
53 // Methods
54 public:
55 //----------------------------------------------------------------------//
56 // Constructors / Destructors
59
60 //----------------------------------------------------------------------//
61 // Start and stop control
62 void Operate();
63 void Terminate();
64
65 // Lives in the timer thread
66 private:
67 void l_PostTimerEvent(); // Called when timer elapses. Adds timer event to queue.
68 // Lives in the Manager thread
69 private:
70 void l_PostManagerNotification(CAsyncNotification * pASNot); // Called when a subscribed observer is touched. Adds notification to queue.
71
72 private:
73 //----------------------------------------------------------------------//
74 // Internal
75 void l_ThreadTask(CThreadedMailBox::eEventType EvtType, sUSBRemoteBoxControllerMailBoxMsg * pMsg);
76 void l_AsyncManagerNotificationHandler(CAsyncNotification * pASNot);
77 void l_Refresh();
78 void l_SetBusyState(bool Busy);
79 };
80
81} // namespace MTL
Exception handling utilities.
Collection of utility macros for error messages.
Synchronization primitives.
sUSBRemoteBoxControllerMailBoxMsg(eMsgType MT, CAsyncNotification *pNot)
enum MTL::sUSBRemoteBoxControllerMailBoxMsg::eMsgType MsgType
CUSBRemoteBoxController(CVISAResourceManager &rRM, CMFCManagerCatalog &rCatInstance)
VISA Resource Manager class.