31 std::queue< CAsyncNotification *> m_Q;
34 static std::string m_InstrToConnect;
39 std::lock_guard<std::mutex> l_LG(m_QLock);
44 std::lock_guard<std::mutex> l_LG(m_QLock);
55 : m_Cat(rCat), m_ASNotifier(&
CMyApplication::l_PushNewAsyncNotification, this)
66 m_InstrToConnect =
"USB0::0x1BFA::0x07EA::0000001::INSTR";
87 m_Cat.
oError.Subscribe(m_ASNotifier);
92 std::string l_InterfaceStr =
"Unknown";
93 switch (l_InstrInterface)
96 l_InterfaceStr =
"Ethernet";
99 l_InterfaceStr =
"Serial";
102 l_InterfaceStr =
"USB";
108 return l_InterfaceStr;
113 bool l_Operate =
true;
118 if (
nullptr == l_pNot)
122 std::this_thread::sleep_for(std::chrono::milliseconds(100));
134 std::cout <<
"New Instrument List" << std::endl;
136 for (
int i = 0; i < l_pVal->size(); i++)
138 std::cout <<
"Instrument num " << i <<
" : UniqueID = " << l_pVal->at(i).UniqueID <<
" , Label = " << l_pVal->at(i).Label <<
" , Inteface = " << GetInterfaceString(l_pVal->at(i).Interface) << std::endl;
140 std::cout << std::endl;
142 for (CInstrumentCatalog::tInstrumentList::const_iterator it= l_pVal->begin(); it != l_pVal->end(); it++)
144 if (m_InstrToConnect == it->UniqueID)
147 std::cout <<
"Trying to connect to default Instrument:" <<
" : UniqueID = " << it->UniqueID <<
" , Label = " << it->Label <<
" , Inteface = " << GetInterfaceString(it->Interface) << std::endl;
154 std::cout <<
"New Probe-Array Information received" << std::endl;
158 std::cout <<
"Probe-Array connected. Start a NMR search operation." << std::endl;
171 std::cout <<
"No Probe-Array connected." << std::endl;
200 std::string CMyApplication::m_InstrToConnect;
205 wchar_t l_ExePath[MAX_PATH];
206 GetModuleFileName(NULL, l_ExePath, MAX_PATH);
207 std::wstring l_AppPath(l_ExePath);
208 std::string l_AppDir(l_AppPath.begin(), l_AppPath.end());
209 return l_AppDir.substr(0, l_AppDir.find_last_of(
'\\'));
223 CMFCManager l_MFCMan(l_Catalog, l_AppDir +
"/../../../../InstrumentCatalog/MFC/ExternalFiles/DefaultCommandScript.scs", l_AppDir +
"/../../../../InstrumentCatalog/MFC/ExternalFiles");