C++ Instrument Catalog
MFCManager.cpp
Go to the documentation of this file.
1 
6 // Standard includes
7 #include <random>
8 #include <chrono>
9 #include <algorithm>
10 // Personal includes
11 #include "MFCManager.h"
12 #include "Helpers.h"
13 #include "OSDefines.h"
14 #include "Exception.h"
15 
16 // External tools includes
17 #include "date.h"
18 
19 #define LOG(__msg__, __level__,__location__) l_Log(CInstrumentCatalog::sLogMessage(__level__, "MFCManager", __msg__, __location__))
20 
21 #define NO_SEARCH_SPR 0 // No search is being performed
22 #define SEARCH_ENDED_SPR 100 // Search progress that is notified when search has ended
23 
25 
26 
27 //--------------------------------------------------------------------------//
28 // MFC MANAGER
29 //--------------------------------------------------------------------------//
30 
31 //--------------------------------------------------------------------------//
32 // Reception of catalog events
33 void CMFCManager::l_CatalogNotificationHandler(CAsyncNotification * pANot)
34 {
35  CObserverNotifier_untyped & rNotifier = pANot->Notifier();
36  CObserver_untyped & rVar = pANot->Observer();
37 
38  if (rVar.Is(m_Cat.oInstrumentCurrent))
39  {
40  // Current instrument requested to change
41  if (rNotifier.Is(m_ADNotifier))
42  {
44  l_NewInstrumentCurrent(rCurrentInstr.ReadCurrent());
45  }
46  }
47  else if (rVar.Is(m_Cat.oMFC3045SerialPortSettings))
48  {
49  // New MFC3045 Serial Port settings
50  if (rNotifier.Is(m_ADNotifier))
51  {
53  l_NewMFC3045SerialSettings(rMFC3045SerialSett.ReadCurrent());
54  }
55  }
56  else if (rVar.Is(m_Cat.oInstrumentState))
57  {
58  // Current instrument state requested to change
59  if (rNotifier.Is(m_ADNotifier))
60  {
62  l_NewInstrumentState(rInstrState.ReadCurrent());
63  }
64  }
65  else if (rVar.Is(m_Cat.oRemoteBoxBusyLedState))
66  {
67  // Current remote box busy led state requested to change
68  if (rNotifier.Is(m_ADNotifier))
69  {
71  l_NewRBBusyLedState(rRBBusyLedState.ReadCurrent());
72  }
73  }
74  else if (rVar.Is(m_Cat.oNormalizationRequest))
75  {
76  // New Normalization request received
77  if (rNotifier.Is(m_ADNotifier))
78  {
79  CObserver<CInstrumentCatalog::sNormalization> & rNormalizationRequest = reinterpret_cast<CObserver<CInstrumentCatalog::sNormalization> &>(rVar);
80  l_NewNormalizationRequest(rNormalizationRequest.ReadCurrent());
81  }
82  }
83 
84  delete pANot;
85 }
86 
87 void CMFCManager::l_ControllerNotificationHandler(CAsyncNotification * pASNot)
88 {
89  CObserver_untyped & rVar = pASNot->Observer();
90 
91  const CAsyncSnapshotNotification * l_pASNot = static_cast<CAsyncSnapshotNotification *>(pASNot);
92 
93  if (rVar.Is(m_ContCat.oState))
94  {
95  const CMFCManagerCatalog::eControllerState * l_pVal = static_cast<const CMFCManagerCatalog::eControllerState *>(l_pASNot->DataCopy());
96  SlotControllerState(*l_pVal);
97  }
98  else if (rVar.Is(m_ContCat.oInstrumentList))
99  {
100  const CParsedResourceList * l_pVal = static_cast<const CParsedResourceList *>(l_pASNot->DataCopy());
101  SlotInstrumentList(*l_pVal);
102  }
103  else if (rVar.Is(m_ContCat.oPAInfo))
104  {
106  SlotPAInfo(*l_pVal);
107  }
108  else if (rVar.Is(m_ContCat.oInstrumentConfiguration))
109  {
111  SlotInstrConfig(*l_pVal);
112  }
113  else if (rVar.Is(m_ContCat.oSearchProgress))
114  {
115  const U8 * l_pVal = static_cast<const U8 *>(l_pASNot->DataCopy());
116  SlotSearchProgress(*l_pVal);
117  }
118  else if (rVar.Is(m_ContCat.oSearchResult))
119  {
120  const CInstrumentCatalog::sSearchResult * l_pVal = static_cast<const CInstrumentCatalog::sSearchResult *>(l_pASNot->DataCopy());
121  SlotSearchResult(*l_pVal);
122  }
123  else if (rVar.Is(m_ContCat.oMeasResults))
124  {
125  const CInstrumentCatalog::sMeasurementResults * l_pVal = static_cast<const CInstrumentCatalog::sMeasurementResults *>(l_pASNot->DataCopy());
126  SlotMeasResult(*l_pVal);
127  }
128  else if (rVar.Is(m_ContCat.oError))
129  {
130  const CMFCDevice::sMFCDeviceError * l_pVal = static_cast<const CMFCDevice::sMFCDeviceError *>(l_pASNot->DataCopy());
131  SlotControllerError(*l_pVal);
132  }
133  else if (rVar.Is(m_ContCat.oLogMessage))
134  {
135  const CInstrumentCatalog::sLogMessage * l_pVal = static_cast<const CInstrumentCatalog::sLogMessage *>(l_pASNot->DataCopy());
136  SlotControllerLogMessage(*l_pVal);
137  }
138  else if (rVar.Is(m_ContCat.oRemoteBoxStart))
139  {
140  SlotRBStart();
141  }
142  else if (rVar.Is(m_ContCat.oUSBRemoteBoxStart))
143  {
144  SlotRBStart();
145  }
146 
147  delete pASNot;
148 }
149 
150 void CMFCManager::l_ClearInstrumentInfo()
151 {
153 
154  // Fill empty probe array and instrument information and return it to catalog
155  LOG("Disconnect current instrument", CInstrumentCatalog::eLogLevel::kInfo, MTL__LOCATION__);
160 }
161 
162 void CMFCManager::l_NewInstrumentCurrent(const CInstrumentCatalog::sInstrumentConnection & rNewInstr)
163 {
166 
167  // Abort any current operation...
168  m_MFCController.Terminate();
169 
170  try
171  {
172  if(nullptr != m_pMFCDevice)
173  l_UpdateRBBusyLedState(CInstrumentCatalog::eRemoteBoxBusyLedState::kRemoteBusyLedOff); //try to turn off remote led on previous connected instrument
174  // If we are already connected to an instrument, disconnect from it
175  delete m_pMFCDevice;
176  m_pMFCDevice = nullptr;
177 
178  // If the given connection is empty, we do not connect to any instrument
179  if (rNewInstr.isEmpty())
180  {
181  l_ClearInstrumentInfo();
182  // Set controller state to scan instrument
183  m_MFCController.ScanInstruments(&m_RsrcManager);
184  }
185  else
186  {
187  // In any case of new instrument connection, send an empty Probe Array info
189  // Look for the requested Serial Port resource
190  auto l_InstrIt = m_RsrcListMap.find(rNewInstr.UniqueID);
191  if (l_InstrIt == m_RsrcListMap.end())
192  throw CMFCManagerException("Cannot find requested resource among available list", MTL__LOCATION__);
194  {
195  // Instrument is MFC3045 (MFC3045 main unit + MFC3048 probe array)
196  m_pMFCDevice = new CMFC3045Device(m_MFCController, m_RsrcManager, l_InstrIt->second.ParsedResource.Name, m_MFC3045SerialSett);
197  }
198  else
199  {
200  // Instrument is MFC2x46 (PT2026 main unit + FCA7046 + MFC9x46 probe array)
201  m_pMFCDevice = new CMFC2x46Device(m_MFCController, m_RsrcManager, l_InstrIt->second.ParsedResource.Name, m_DefaultPAConfScriptFilePath, m_CustomPAConfScriptDirectory);
202  }
203  // Try to connect to instrument and get its information
204  CMFCDevice::sMFCDeviceError l_RetError;
205  l_RetError = m_pMFCDevice->Connect(m_InstrInfo);
206  if(l_RetError.HasError())
207  {
208  throw CMFCManagerException(l_RetError.Description, l_RetError.Location);
209  }
210  m_InstrInfo.InstrumentConnection = rNewInstr;
211 
212  // Fill instrument information and return it to catalog
213  m_Cat.cInstrumentInformation.rRequestControl(m_InstrInfo);
214 
215  // Configure remote box busy led mode state on current instrument
216  if(!l_UpdateRBBusyLedState(m_RBBusyLedState))
217  throw CMFCManagerException("Fail to set remote led mode state", MTL__LOCATION__);
218 
219  // Set controller state to Scan probe array
220  m_MFCController.ScanPA(m_pMFCDevice);
221  }
222  }
223  catch (CMFCManagerException & rE)
224  {
226 
227  // Fill empty instrument information and return it to catalog
228  l_ClearInstrumentInfo();
229 
230  // Delete connected instrument if exists
231  if(nullptr != m_pMFCDevice)
232  {
233  delete m_pMFCDevice;
234  m_pMFCDevice = nullptr;
235  }
236 
237  // Set controller state to scan instrument
238  m_MFCController.ScanInstruments(&m_RsrcManager);
239  }
240 }
241 
242 // This method will set rs232 setting to use with MFC3045. If a MFC3045 is already connected, it allows to change instrument serial setting.
243 void CMFCManager::l_NewMFC3045SerialSettings(const CInstrumentCatalog::sMFC3045SerialPortSettings & rNewSerialSett)
244 {
247 
249  m_Cat.oInstrumentCurrent.rReadCurrent(l_CurrentInstr);
250  try
251  {
252  // If current connected instrument is MFC3045 and serial settings is different, change it.
253  if ((nullptr != m_pMFCDevice) && (l_CurrentInstr.Interface == CInstrumentCatalog::eConnectionInterface::kSerial) && (rNewSerialSett != m_MFC3045SerialSett))
254  {
255  // Abort any current operation...
256  m_MFCController.Terminate();
257  // Change instrument serial setting
258  LOG("Serial settings change in progress. Operation on current instrument may take a few seconds.", CInstrumentCatalog::eLogLevel::kInfo, MTL__LOCATION__);
259  CMFCDevice::sMFCDeviceError l_RetError;
260  l_RetError = m_pMFCDevice->ChangeSerialParmsOnConnectedInstr(rNewSerialSett);
261  if(l_RetError.HasError())
262  {
263  l_SendError(l_RetError);
264  if (CMFCDevice::sMFCDeviceError::eLevel::kError >= l_RetError.Level)
265  {
266  throw CMFCManagerException("Serial settings change failed. Instrument serial settings might be corrupted. Set default instrument settings by pressing remote Start button untill end of led blinking while resetting the instrument.", MTL__LOCATION__);
267  }
268  else //warning
269  throw CMFCManagerException("Serial settings change failed.", MTL__LOCATION__);
270  }
271  // Reconnect to instrument with new serial port settings
272  m_MFC3045SerialSett = rNewSerialSett;
273  LOG("Serial settings change completed. Reconnection to instrument in progress.", CInstrumentCatalog::eLogLevel::kInfo, MTL__LOCATION__);
274  l_NewInstrumentCurrent(l_CurrentInstr);
275  }
276  }
277  catch (CMFCManagerException & rE)
278  {
280  //Disconnect m_pMFCDevice, send empty PA & instrument information and restart MFCController thread with state kScanningInstruments
281  if ((nullptr != m_pMFCDevice) && (l_CurrentInstr.Interface == CInstrumentCatalog::eConnectionInterface::kSerial))
282  l_NewInstrumentCurrent(CInstrumentCatalog::sInstrumentConnection());
283  }
284  m_MFC3045SerialSett = rNewSerialSett; // In any case we store new settings for next serial instrument connection
285 }
286 
287 void CMFCManager::l_NewInstrumentState(const CInstrumentCatalog::sInstrumentState & rNewInstrState)
288 {
291 
292  // Abort any current operation...
293  m_MFCController.Terminate();
294 
295  // Prepare for new operation...
296  m_InstrState = rNewInstrState;
297 
298  // Clear Search Progress
299  l_UpdateSPR(NO_SEARCH_SPR);
300 
302  {
303  // Set controller state
304  if (nullptr != m_pMFCDevice)
305  m_MFCController.ScanPA(m_pMFCDevice);
306  else
307  m_MFCController.ScanInstruments(&m_RsrcManager);
308  }
309  else
310  {
311  // Start new operation
312  m_MFCController.SetInstrumentState(m_pMFCDevice, m_InstrState);
313  }
314 }
315 
316 void CMFCManager::l_NewNormalizationRequest(const CInstrumentCatalog::sNormalization & rNewNormalizationRequest)
317 {
320 
321  // Abort any current operation...
322  m_MFCController.Terminate();
323 
324  try
325  {
326  if (nullptr == m_pMFCDevice)
327  throw CMFCManagerException("No device connected", MTL__LOCATION__);
328 
329  // Try to connect to instrument and get its information
330  CMFCDevice::sMFCDeviceError l_RetError;
331  CInstrumentCatalog::sNormalization l_ReturnedNormalization(rNewNormalizationRequest);
333  l_RetError = m_pMFCDevice->NewNormalizationRequest(rNewNormalizationRequest, l_ReturnedNormalization);
334  if(l_RetError.HasError())
335  {
336  throw l_RetError;
337  }
338  if ((rNewNormalizationRequest.Access == CInstrumentCatalog::eNormalizationAccess::kReadRAM) || (rNewNormalizationRequest.Access == CInstrumentCatalog::eNormalizationAccess::kReadROM))
339  m_Cat.cNormalizationReturned.rRequestControl(l_ReturnedNormalization); // Return read content
340 
341  if ((rNewNormalizationRequest.Access == CInstrumentCatalog::eNormalizationAccess::kWriteROM))
342  {
343  m_MFCController.UpdateNormalizationDate();
344  }
345  }
346  catch (CMFCDevice::sMFCDeviceError & rE)
347  {
348  l_SendError(rE);
349  }
350  catch (CMFCManagerException & rE)
351  {
353  }
354 
355  // Set controller state
356  if (nullptr != m_pMFCDevice)
357  m_MFCController.ScanPA(m_pMFCDevice);
358  else
359  m_MFCController.ScanInstruments(&m_RsrcManager);
360 }
361 
362 // Set the new m_RBBusyLedState to be used for next connection or if already connected, changes remote led mode on instrument
363 void CMFCManager::l_NewRBBusyLedState(const CInstrumentCatalog::eRemoteBoxBusyLedState & rNewRBBusyLedState)
364 {
367 
368  // Abort any current operation...
369  m_MFCController.Terminate();
370  try
371  {
372  if(nullptr != m_pMFCDevice)
373  {
374  if(!l_UpdateRBBusyLedState(rNewRBBusyLedState))
375  throw CMFCManagerException("Fail to change remote led mode state", MTL__LOCATION__);
376  }
377  m_RBBusyLedState = rNewRBBusyLedState; // Update m_RBBusyLedState in any case (connected or not)
378  }
379  catch (CMFCManagerException & rE)
380  {
382  }
383  // Set controller state
384  if (nullptr != m_pMFCDevice)
385  m_MFCController.ScanPA(m_pMFCDevice);
386  else
387  m_MFCController.ScanInstruments(&m_RsrcManager);
388 }
389 
390 //--------------------------------------------------------------------------//
391 // private method
392 // Update the m_RBBusyLedState (remote box led state) on the current instrument
393 bool CMFCManager::l_UpdateRBBusyLedState(const CInstrumentCatalog::eRemoteBoxBusyLedState & rNewRBBusyLedState)
394 {
396  try
397  {
398  if (nullptr == m_pMFCDevice)
399  throw CMFCManagerException("No device connected", MTL__LOCATION__);
400 
401  CMFCDevice::sMFCDeviceError l_RetError;
402  // Change remote box busy led state mode on connected instrument
403  switch (m_InstrInfo.Type)
404  {
406  {
407  // check PT2026 ARM Firmware version
408  std::string l_Desc = m_InstrInfo.Description;
409  size_t l_Found = l_Desc.find("arm"); // Arm version is written as "armX.YY", with X = digit for major version & YY = two digits for minor version
410  if(std::string::npos!=l_Found)
411  {
412  U32 l_ArmVerMaj = std::stoul(l_Desc.substr(l_Found +3, 1));
413  U32 l_ArmVerMin = std::stoul(l_Desc.substr(l_Found +5, 2));
414  if(l_ArmVerMaj >= 1 && l_ArmVerMin >= 22) // Remote box led control is available in PT2026 with ARM firmware version >= 1.22
415  {
416  l_RetError = m_pMFCDevice->SetRBBusyLedState(rNewRBBusyLedState);
417  if(l_RetError.HasError())
418  {
419  l_SendError(CInstrumentCatalog::eErrorLevel::kWarning, "Failed to set remote box led state.", MTL__LOCATION__);
420  }
421  }
422  else
423  {
424  // Send a Warning. ARM FW version doesn't support this command
425  l_SendError(CInstrumentCatalog::eErrorLevel::kWarning, "Set remote led state not supported. Update main unit FW version.", MTL__LOCATION__);
426  }
427  }
428  break;
429  }
431  {
432  l_RetError = m_pMFCDevice->SetRBBusyLedState(rNewRBBusyLedState);
433  if(l_RetError.HasError())
434  {
435  throw l_RetError;
436  }
437  break;
438  }
439  default:
440  // send warning:
441  l_SendError(CInstrumentCatalog::eErrorLevel::kWarning, "Set remote led state not supported. Unknown Instrument type", MTL__LOCATION__);
442  break;
443  }
444  }
445  catch (CMFCManagerException & rE)
446  {
448  return false;
449  }
450  catch (CMFCDevice::sMFCDeviceError & rE)
451  {
452  l_SendError(rE);
453  return false;
454  }
455  return true;
456 }
457 
458 // Notifications to the catalog
459 void CMFCManager::l_UpdateInstrumentStatus()
460 {
462 
463  bool l_Busy = false;
464 
465  // Compute State
466  switch (m_MFCControllerState)
467  {
469  // Nothing to say but controller stopped a job
470  break;
472  l_UpdateSPR(NO_SEARCH_SPR);
474  break;
476  l_UpdateSPR(NO_SEARCH_SPR);
477  if (0 == m_Cat.cProbeArrayInformation.ReadCurrent().NbProbes())
479  else
481  break;
484  l_Busy = true;
485  break;
488  l_Busy = true;
489  break;
490  }
491 
492  // Update instrument State & SearchProgress
493  m_Cat.cInstrumentStatus.rRequestControl(m_InstrStatus);
494 
495  // Update USB Remote box busy led state
496  m_ContCat.cUSBRemoteBusyState.RequestControl(l_Busy);
497 }
498 
499 void CMFCManager::l_SendError(const CMFCDevice::sMFCDeviceError & rMFCDeviceError)
500 {
501  switch(rMFCDeviceError.Level)
502  {
503  case CMFCDevice::sMFCDeviceError::eLevel::kFatal:
505  break;
506  case CMFCDevice::sMFCDeviceError::eLevel::kError:
508  break;
509  case CMFCDevice::sMFCDeviceError::eLevel::kWarning:
511  break;
512  case CMFCDevice::sMFCDeviceError::eLevel::kNoError:
513  // No error message to send further to instrumentCatalog.
514  break;
515  }
516 }
517 
518 void CMFCManager::l_SendError(CInstrumentCatalog::eErrorLevel Level, std::string Descr, std::string Source)
519 {
521 
522  switch(Level)
523  {
525  m_Cat.cError.rRequestControl(CInstrumentCatalog::sError(Level, CInstrumentCatalog::FATAL_ERROR_CODE, Descr, Source));
526  break;
528  m_Cat.cError.rRequestControl(CInstrumentCatalog::sError(Level, CInstrumentCatalog::ERROR_CODE, Descr, Source));
529  break;
531  m_Cat.cError.rRequestControl(CInstrumentCatalog::sError(Level, CInstrumentCatalog::WARNING_ERROR_CODE, Descr, Source));
532  break;
533  }
534 }
535 
536 void CMFCManager::l_SendError(CInstrumentCatalog::sError Error)
537 {
539  m_Cat.cError.rRequestControl(Error);
540 }
541 
542 void CMFCManager::l_Log(const CInstrumentCatalog::sLogMessage & rMessage)
543 {
544  m_Cat.cLogMessage.rRequestControl(rMessage);
545 }
546 
547 void CMFCManager::l_UpdateSPR(uint8_t SearchProgress)
548 {
549  m_InstrStatus.SearchProgress = SearchProgress;
550 }
551 
552 void CMFCManager::l_ThreadTask(CThreadedMailBox::eEventType EvtType, sMFCManagerMailBoxMsg * pMsg)
553 {
554  switch (EvtType)
555  {
556  case eEventType::kExit:
557  break;
558  case eEventType::kUserMsg:
559  if (nullptr != pMsg)
560  {
561  if (nullptr != pMsg->pCatNot)
562  l_CatalogNotificationHandler(pMsg->pCatNot);
563 
564  if (nullptr != pMsg->pContrNot)
565  l_ControllerNotificationHandler(pMsg->pContrNot);
566  }
567  break;
568  }
569 }
570 
572 {
573  CThreadedMailBox::l_SendMsg(sMFCManagerMailBoxMsg(pANot, nullptr));
574 }
575 
577 {
578  CThreadedMailBox::l_SendMsg(sMFCManagerMailBoxMsg(nullptr, pASNot));
579 }
580 
581 
582 
583 //--------------------------------------------------------------------------//
584 // Reception of external events
585 //--------------------------------------------------------------------------//
587 {
588  m_MFCController.ScanInstruments(&m_RsrcManager);
589 }
590 
592 {
594 
596  {
597  switch (m_MFCControllerState)
598  {
600  break;
602  break;
604  break;
606  m_MFCController.ScanPA(m_pMFCDevice);
607  break;
609  m_MFCController.ScanPA(m_pMFCDevice);
610  break;
611  default:
612  break;
613  }
614  }
615  m_MFCControllerState = State;
616 
617  // Compute new status
618  l_UpdateInstrumentStatus();
619 }
620 
622 {
624 
625  //Parse resource list and create user-friendly names when possible
626  // USB0::0x1BFA::0xC7EA::PT2026_00012::INSTR => PT2026 00012
627  // ASRLx::INSTR => INSTR - COMx (x correspond to port COM number) , we can't have any instrument information yet
628  m_RsrcListMap = l_PrettyResourceNameList(NewResourceList);
629 
630  // Convert list type
631  m_PrettyInstrList.clear();
632  for (auto & l_it : m_RsrcListMap)
633  {
635  l_InsCon.Label = l_it.second.PrettyName; // "Pretty name"
636  l_InsCon.UniqueID = l_it.first; // VISA resource name is a unique ID
637  switch (l_it.second.ParsedResource.Info.Type())
638  {
639  case eInterfaceType::TCPIP:
641  break;
642  case eInterfaceType::USB:
644  break;
645  case eInterfaceType::ASRL:
647  break;
648  default:
650  break;
651  }
652  m_PrettyInstrList.push_back(l_InsCon);
653  }
654  m_Cat.cInstrumentList.rRequestControl(m_PrettyInstrList);
655 }
656 
658 {
660 
661  if(nullptr !=m_pMFCDevice)
662  m_Cat.cProbeArrayInformation.rRequestControl(PAInfo);
663  else // clear PA info if no main unit anymore
665  // Compute new status
666  l_UpdateInstrumentStatus();
667 }
668 
670 {
672 
673  m_Cat.cInstrumentConfiguration.rRequestControl(InstrConfig);
674 }
675 
677 {
679 
680  m_Cat.cProbeArrayAngle.rRequestControl(Angle);
681 }
682 
684 {
686 
688 }
689 
691 {
693 
694  l_UpdateSPR(Progress);
695  l_UpdateInstrumentStatus();
696 }
697 
699 {
701 
702  l_UpdateSPR(SEARCH_ENDED_SPR); // Set SPR to 100% when we have a result
703  l_UpdateInstrumentStatus();
704  m_Cat.cSearchResult.rRequestControl(SearRes);
705 }
706 
708 {
710 
711  l_UpdateSPR(SEARCH_ENDED_SPR); // Set SPR to 100% when we have a result
712  l_UpdateInstrumentStatus();
713  m_Cat.cMeasurementResults.rRequestControl(MeasRes);
714 }
715 
717 {
719 
720  // Whatever the error, broadcast it to instrument catalog
721  l_SendError(error);
722 
723  switch (m_MFCControllerState)
724  {
726  break;
728  if (error.Level <= CMFCDevice::sMFCDeviceError::eLevel::kFatal)
729  {
730  m_MFCController.Terminate();
731  l_SendError(CInstrumentCatalog::eErrorLevel::kFatal, "Fatal error received from MFCController", MTL__LOCATION__);
732  }
733  break;
735  switch (error.Level)
736  {
737  case CMFCDevice::sMFCDeviceError::eLevel::kFatal:
738  m_MFCController.Terminate();
739  l_ClearInstrumentInfo();
740  l_SendError(CInstrumentCatalog::eErrorLevel::kFatal, "Fatal error received from MFCController", MTL__LOCATION__);
741  break;
742  case CMFCDevice::sMFCDeviceError::eLevel::kError:
743  //Disconnect m_pMFCDevice, send empty PA & instrument information and restart MFCController thread with state kScanningInstruments
744  l_NewInstrumentCurrent(CInstrumentCatalog::sInstrumentConnection());
745  break;
746  case CMFCDevice::sMFCDeviceError::eLevel::kWarning:
747  // Error has already been reported. Nothing to do.
748  break;
749  default:
750  break;
751  }
752  break;
755  m_MFCController.ScanPA(m_pMFCDevice);
756  break;
757  default:
758  break;
759  }
760 }
761 
763 {
764  l_Log(Message);
765 }
766 
768 {
770 
771 }
773 {
775 
777 }
778 
779 
780 
781 //--------------------------------------------------------------------------//
782 // Class management
783 CMFCManager::CMFCManager(CInstrumentCatalog & rCatalog, const std::string & rDefaultPAConfScriptFilePath, const std::string & rCustomPAConfScriptDir)
784  :
785  m_Cat(rCatalog),
786  m_ContCat(m_ContCatInstance),
787  m_ADNotifier(&CMFCManager::PostCatalogNotification, this),
788  m_ASControllerNotifier(&CMFCManager::PostControllerNotification, this),
789  m_pMFCDevice(nullptr),
790  m_MFCController(m_ContCatInstance, rDefaultPAConfScriptFilePath, rCustomPAConfScriptDir),
791  m_RBController(m_RsrcManager, m_ContCatInstance),
792  m_DefaultPAConfScriptFilePath(rDefaultPAConfScriptFilePath),
793  m_CustomPAConfScriptDirectory(rCustomPAConfScriptDir)
794 {
796 
797  // Initialize variables
799 }
801 {
803 }
804 
806 {
808 
809  // Initialize controls (synchronize catalog with instrument manager)
810  //m_Cat.cInstrumentList.rRequestControl(m_PrettyInstrList);
814  m_Cat.cInstrumentStatus.rRequestControl(m_InstrStatus);
815  // SearchResults in ephemeral
816  // MeasurementResults in ephemeral
817  // Error in ephemeral
818 }
819 
821 {
823  // Read variables (synchronize catalog with instrument manager)
824  m_Cat.oInstrumentCurrent.rReadCurrent(m_Instr);
825  m_Cat.oMFC3045SerialPortSettings.rReadCurrent(m_MFC3045SerialSett);
826  m_Cat.oInstrumentState.rReadCurrent(m_InstrState);
827  m_Cat.oRemoteBoxBusyLedState.rReadCurrent(m_RBBusyLedState);
828  // Instrument calibration date is ephemeral
829  // Normalization request is ephemeral
830 }
831 
833 {
835  // Subscribe to InstrumentCatalog observers
836  m_Cat.oInstrumentCurrent.Subscribe(m_ADNotifier);
837  m_Cat.oMFC3045SerialPortSettings.Subscribe(m_ADNotifier);
838  m_Cat.oInstrumentState.Subscribe(m_ADNotifier);
839  m_Cat.oNormalizationRequest.Subscribe(m_ADNotifier);
840  m_Cat.oRemoteBoxBusyLedState.Subscribe(m_ADNotifier);
841 
842  // Subscribe to MFCController observers
843  m_ContCat.oState.Subscribe(m_ASControllerNotifier);
844  m_ContCat.oInstrumentList.Subscribe(m_ASControllerNotifier);
845  m_ContCat.oPAInfo.Subscribe(m_ASControllerNotifier);
846  m_ContCat.oInstrumentConfiguration.Subscribe(m_ASControllerNotifier);
847  m_ContCat.oSearchProgress.Subscribe(m_ASControllerNotifier);
848  m_ContCat.oSearchResult.Subscribe(m_ASControllerNotifier);
849  m_ContCat.oMeasResults.Subscribe(m_ASControllerNotifier);
850  m_ContCat.oError.Subscribe(m_ASControllerNotifier);
851  m_ContCat.oLogMessage.Subscribe(m_ASControllerNotifier);
852  m_ContCat.oRemoteBoxStart.Subscribe(m_ASControllerNotifier);
853 
854  // Subscribe to USBRemoteBoxController observer
855  m_ContCat.oUSBRemoteBoxStart.Subscribe(m_ASControllerNotifier);
856 }
857 
859 {
861 
862  // Initialize Resource Manager
863  m_RsrcManager.Initialize();
864 
865  // Start controller thread
866  m_MFCController.Operate();
867 
868  // Start USB remote box controller thread
869  m_RBController.Operate();
870 
871  // Start Catalog notification thread
872  CThreadedMailBox::ThreadStart();
873 
874  // Run first controller operation
875  m_MFCController.ScanInstruments(&m_RsrcManager);
876 }
877 
879 {
880  // Stop Catalog notification thread
881  CThreadedMailBox::ThreadStop();
882  // Stop USB Remote Box controller
883  m_RBController.Terminate();
884  // Stop MFC controller
885  m_MFCController.Terminate();
886  // Close MFC instrument (=> PT2026 or MFC3045) connection
887  delete m_pMFCDevice;
888  m_pMFCDevice = nullptr;
889 }
890 
891 CMFCManager::tResourceMap CMFCManager::l_PrettyResourceNameList(const CParsedResourceList & rRsrcList)
892 {
893  // Expected resource formats
894  // "USB0::0x1BFA::0x07EA::0000015::INSTR",
895  // "TCPIP0::pt2026_00015::inst0::INSTR",
896  // "TCPIP0::192.168.110.239::inst0::INSTR",
897  // "ASRL12::INSTR"
898 
899  CMFCManager::tResourceMap l_ReturnedList;
900 
901  std::regex l_reg("([^:]+)+");
902  std::sregex_token_iterator l_end;
903  for (auto & l_RsrcIt : rRsrcList)
904  {
905  // Tokenize resource name
906  std::sregex_token_iterator l_TokIt(l_RsrcIt.Name.begin(), l_RsrcIt.Name.end(), l_reg);
907  std::vector<std::string> l_Tokens(l_TokIt, l_end);
908  // Analyze content
909  if (l_Tokens.size() >= 2 && l_RsrcIt.Info.Class() == "INSTR" && l_Tokens.back() == "INSTR")
910  {
911  // Parse USB resource
912  if (l_Tokens[0].find("USB") == 0 && l_Tokens.size() == 5 && l_Tokens[1] == "0x1BFA" && l_Tokens[2] == "0x07EA")
913  {
914  // "PT2026 nnnnn USB"
915  std::string l_InstrName = "PT2026 " + l_Tokens[3];
916  l_ReturnedList.insert(std::pair<tUniqueID, sPrettyResource>(l_RsrcIt.Name, { l_InstrName, l_RsrcIt }));
917  }
918  // Parse TCPIP resource
919  else if (0 == l_Tokens[0].find("TCPIP") && 4 == l_Tokens.size())
920  {
921  if(std::string::npos != l_Tokens[1].find("PT2026") || std::string::npos != l_Tokens[1].find("pt2026"))
922  {
923  // "pt2026_nnnnn"
924  std::string l_InstrName = l_Tokens[1];
925  l_ReturnedList.insert(std::pair<tUniqueID, sPrettyResource>(l_RsrcIt.Name, { l_InstrName, l_RsrcIt }));
926  }
927  //otherwise we ignore IP address to avoid having all instruments on network listed in the resource list
928  }
929  // Parse ASRL resource
930  else if (l_Tokens[0].find("ASRL") == 0)
931  {
932  // "MFC3045 COMn"
933  U8 l_COMnumber = static_cast<U8>(l_RsrcIt.Info.Number()); //static_cast<U8>(std::stoul(l_Tokens[0].substr(4)));
934  std::string l_InstrName = "INSTR - COM" + std::to_string(l_COMnumber);
935  l_ReturnedList.insert(std::pair<tUniqueID, sPrettyResource>(l_RsrcIt.Name, { l_InstrName, l_RsrcIt }));
936  }
937  }
938  }
939 
940  return l_ReturnedList;
941 }
MTL::CInstrumentCatalog::eNormalizationAccess::kReadROM
@ kReadROM
MTL::CInstrumentCatalog::l_Dump
static std::string l_Dump(const tInstrumentList &rInsList)
Definition: InstrumentCatalog.h:340
MTL::CInstrumentCatalog::sInstrumentConnection::Interface
eConnectionInterface Interface
Definition: InstrumentCatalog.h:41
MTL::CMFCManagerInterface::oError
CObserver< CMFCDevice::sMFCDeviceError > oError
Definition: MFCManagerCatalog.h:70
MTL::CInstrumentCatalog::tISO8601DateTime
std::string tISO8601DateTime
Definition: InstrumentCatalog.h:28
MTL::CMFCController::Operate
void Operate()
Definition: MFCController.cpp:353
MTL::CInstrumentCatalog::eNormalizationAccess::kReadRAM
@ kReadRAM
MTL::CMFCManager::SlotRemoteBoxTriggerEvent
void SlotRemoteBoxTriggerEvent()
Definition: MFCManager.cpp:683
MTL::CInstrManCatalogInterface::cInstrumentStatus
CControl< CInstrumentCatalog::sInstrumentStatus > cInstrumentStatus
Definition: InstrumentCatalog.h:630
MTL::InstrumentCatalogInterface::CObserver
Definition: Catalog.h:11
MTL::CMFCManagerCatalog::eControllerState::kSearching
@ kSearching
MTL::CInstrManCatalogInterface::cInstrumentConfiguration
CControl< CInstrumentCatalog::sInstrumentConfiguration > cInstrumentConfiguration
Definition: InstrumentCatalog.h:624
MTL::CInstrumentCatalog::eInstrumentState::kReady
@ kReady
MTL::CInstrumentCatalog::eErrorLevel
eErrorLevel
Definition: InstrumentCatalog.h:289
MTL::InstrumentCatalogInterface::CAsyncSnapshotNotification
Definition: CatalogInterface.h:180
MTL::CInstrumentCatalog::eConnectionInterface::kUnknown
@ kUnknown
NO_SEARCH_SPR
#define NO_SEARCH_SPR
Definition: MFCManager.cpp:21
MTL::CInstrumentCatalog::sInstrumentStatus
Definition: InstrumentCatalog.h:229
MTL::CInstrManCatalogInterface::oInstrumentCurrent
CObserver< CInstrumentCatalog::sInstrumentConnection > oInstrumentCurrent
Definition: InstrumentCatalog.h:619
MTL::CMFCManagerInterface::oLogMessage
CObserver< CInstrumentCatalog::sLogMessage > oLogMessage
Definition: MFCManagerCatalog.h:71
MTL::CMFC3045Device
Definition: MFC3045Device.h:50
MTL::CInstrManCatalogInterface::cMeasurementResults
CControl< CInstrumentCatalog::sMeasurementResults > cMeasurementResults
Definition: InstrumentCatalog.h:636
MTL::CMFCManager::SyncObservers
void SyncObservers()
Definition: MFCManager.cpp:820
MTL::CInstrumentCatalog::eRemoteBoxTrigger::kRemoteBoxTrigger
@ kRemoteBoxTrigger
MTL::CInstrManCatalogInterface::oNormalizationRequest
CObserver< CInstrumentCatalog::sNormalization > oNormalizationRequest
Definition: InstrumentCatalog.h:639
MTL::CInstrManCatalogInterface::oInstrumentState
CObserver< CInstrumentCatalog::sInstrumentState > oInstrumentState
Definition: InstrumentCatalog.h:629
MTL::CMFCController::SetInstrumentState
void SetInstrumentState(CMFCDevice *pMFCDevice, CInstrumentCatalog::sInstrumentState InsState)
Definition: MFCController.cpp:415
MTL::CInstrManCatalogInterface::oRemoteBoxBusyLedState
CObserver< CInstrumentCatalog::eRemoteBoxBusyLedState > oRemoteBoxBusyLedState
Definition: InstrumentCatalog.h:632
MTL::CMFCManager::SlotInstrumentList
void SlotInstrumentList(CParsedResourceList List)
Definition: MFCManager.cpp:621
MTL::CInstrManCatalogInterface::oMFC3045SerialPortSettings
CObserver< CInstrumentCatalog::sMFC3045SerialPortSettings > oMFC3045SerialPortSettings
Definition: InstrumentCatalog.h:620
MTL::CMFCManagerInterface::oInstrumentList
CObserver< CParsedResourceList > oInstrumentList
Definition: MFCManagerCatalog.h:64
MTL::CMFCManager::PostCatalogNotification
void PostCatalogNotification(CAsyncNotification *pANot)
Definition: MFCManager.cpp:571
MTL::CMFCManager::SlotControllerThreadIsReady
void SlotControllerThreadIsReady()
Definition: MFCManager.cpp:586
MTL::CInstrumentCatalog::sMeasurementResults
Definition: InstrumentCatalog.h:267
MTL::InstrumentCatalogInterface::CObserver::rReadCurrent
void rReadCurrent(DataType &rReturnedValue)
Definition: CatalogInterface.h:113
MTL::CInstrumentCatalog::sSearchResult
Definition: InstrumentCatalog.h:250
MTL::sMFCManagerMailBoxMsg
Definition: MFCManager.h:31
MTL::CMFCManager::SlotControllerError
void SlotControllerError(CMFCDevice::sMFCDeviceError error)
Definition: MFCManager.cpp:716
MTL::CInstrumentCatalog::sInstrumentConnection::Label
tInstrumentLabel Label
Definition: InstrumentCatalog.h:39
MTL::CInstrumentCatalog::eErrorLevel::kFatal
@ kFatal
SEARCH_ENDED_SPR
#define SEARCH_ENDED_SPR
Definition: MFCManager.cpp:22
MTL::CInstrumentCatalog::sInstrumentStatus::State
eInstrumentState State
Definition: InstrumentCatalog.h:230
MTL::CMFCManager::CMFCManager
CMFCManager(CInstrumentCatalog &rCatalog, const std::string &rDefaultPAConfScriptFilePath, const std::string &rCustomPAConfScriptDir)
Definition: MFCManager.cpp:783
MTL::ThreadedMailbox::CThreadedMailBox::eEventType
eEventType
Definition: ThreadedMailbox.h:228
MTL::CMFCManager::SlotProbeArrayAngle
void SlotProbeArrayAngle(CInstrumentCatalog::sProbeArrayAngle Angle)
Definition: MFCManager.cpp:676
MTL::CException::message
const char * message() const noexcept
Return the message.
Definition: Exception.h:40
MTL::CUSBRemoteBoxController::Terminate
void Terminate()
Definition: USBRemoteBoxController.cpp:46
MTL::CMFCManager::~CMFCManager
virtual ~CMFCManager()
Definition: MFCManager.cpp:800
MTL::CInstrumentCatalog::eInstrumentState::kWaitingForPA
@ kWaitingForPA
MTL::InstrumentCatalogInterface::CObserver::ReadCurrent
DataType ReadCurrent(void)
Definition: CatalogInterface.h:105
MTL::CInstrumentCatalog::eConnectionInterface::kEthernet
@ kEthernet
MTL::CInstrumentCatalog::eErrorLevel::kWarning
@ kWarning
MTL::CInstrumentCatalog::sInstrumentInformation::Description
std::string Description
Definition: InstrumentCatalog.h:110
MTL::CMFCController::ScanPA
void ScanPA(CMFCDevice *pMFCDevice)
Definition: MFCController.cpp:388
MTL::CInstrumentCatalog::eLogLevel::kDebug
@ kDebug
MTL::sMFCManagerMailBoxMsg::pCatNot
CAsyncNotification * pCatNot
Definition: MFCManager.h:32
MTL::CInstrumentCatalog::eErrorLevel::kError
@ kError
MTL::CInstrumentCatalog::sInstrumentStatus::SearchProgress
U8 SearchProgress
Definition: InstrumentCatalog.h:231
MTL::CMFCManager::Subscribe
void Subscribe()
Definition: MFCManager.cpp:832
MTL::CInstrumentCatalog::sNormalization::Access
eNormalizationAccess Access
Definition: InstrumentCatalog.h:283
MTL::CInstrumentCatalog::sLogMessage
Definition: InstrumentCatalog.h:323
MTL::CMFCManagerInterface::oUSBRemoteBoxStart
CObserver< bool > oUSBRemoteBoxStart
Definition: MFCManagerCatalog.h:78
MTL::CMFCManager::SyncControls
void SyncControls()
Definition: MFCManager.cpp:805
MFCManager.h
MTL::CMFCManager::SlotMeasResult
void SlotMeasResult(CInstrumentCatalog::sMeasurementResults MeasRes)
Definition: MFCManager.cpp:707
MTL::CMFCController::Terminate
void Terminate()
Definition: MFCController.cpp:358
Helpers.h
Collection of utility macros for error messages.
MTL::CMFCManagerInterface::oState
CObserver< CMFCManagerCatalog::eControllerState > oState
Definition: MFCManagerCatalog.h:63
MTL::CInstrumentCatalog::sError
Definition: InstrumentCatalog.h:298
MTL::CInstrumentCatalog::eInstrumentState::kSearching
@ kSearching
MTL::CInstrumentCatalog::eInstrumentState::kMeasuring
@ kMeasuring
MTL::CMFCManagerCatalog::eControllerState::kScanningInstruments
@ kScanningInstruments
MTL::CInstrumentCatalog::sInstrumentState
Definition: InstrumentCatalog.h:212
MTL::CMFCManager::SlotRBStart
void SlotRBStart()
Definition: MFCManager.cpp:772
MTL::CInstrumentCatalog::eOperatingMode::kIdle
@ kIdle
MTL::CMFCManager::SlotSearchResult
void SlotSearchResult(CInstrumentCatalog::sSearchResult SearRes)
Definition: MFCManager.cpp:698
MTL::CMFCManager::SlotRBReset
void SlotRBReset()
Definition: MFCManager.cpp:767
MTL::CMFCDevice::sMFCDeviceError
Definition: MFCDevice.h:30
MTL::CInstrumentCatalog::eRemoteBoxBusyLedState::kRemoteBusyLedOff
@ kRemoteBusyLedOff
MTL::CMFCDevice::sMFCDeviceError::Level
enum MTL::CMFCDevice::sMFCDeviceError::eLevel Level
MTL::CInstrumentCatalog::sMFC3045SerialPortSettings
Definition: InstrumentCatalog.h:81
date.h
MTL::CMFCManager::PostControllerNotification
void PostControllerNotification(CAsyncNotification *pASNot)
Definition: MFCManager.cpp:576
MTL::InstrumentCatalogInterface::CAsyncSnapshotNotification::DataCopy
const void * DataCopy() const
Definition: CatalogInterface.h:195
MTL::CMFCManager::SlotPAInfo
void SlotPAInfo(CInstrumentCatalog::sProbeArrayInformation PAInfo)
Definition: MFCManager.cpp:657
MTL::CInstrumentCatalog::WARNING_ERROR_CODE
static constexpr I32 WARNING_ERROR_CODE
Definition: InstrumentCatalog.h:294
MTL::CInstrumentCatalog::eNormalizationAccess::kWriteROM
@ kWriteROM
MTL::CInstrumentCatalog::eRemoteBoxBusyLedState
eRemoteBoxBusyLedState
Definition: InstrumentCatalog.h:242
MTL::CInstrumentCatalog::eInstrumentType::kPT2026
@ kPT2026
MTL::CMFCDevice::sMFCDeviceError::Description
std::string Description
Definition: MFCDevice.h:37
MTL::CMFCManager::SlotControllerLogMessage
void SlotControllerLogMessage(CInstrumentCatalog::sLogMessage Message)
Definition: MFCManager.cpp:762
MTL::CInstrManCatalogInterface::cInstrumentInformation
CControl< CInstrumentCatalog::sInstrumentInformation > cInstrumentInformation
Definition: InstrumentCatalog.h:623
MTL::CInstrumentCatalog::ERROR_CODE
static constexpr I32 ERROR_CODE
Definition: InstrumentCatalog.h:296
MTL::CMFCManagerCatalog::eControllerState
eControllerState
Definition: MFCManagerCatalog.h:24
MTL::InstrumentCatalogInterface::CObserver::Subscribe
void Subscribe(CObserverNotifier_untyped &rNotifier)
Definition: CatalogInterface.h:95
MTL::CInstrManCatalogInterface::cError
CControl< CInstrumentCatalog::sError > cError
Definition: InstrumentCatalog.h:641
MTL::CMFCDevice::Connect
virtual sMFCDeviceError Connect(CInstrumentCatalog::sInstrumentInformation &rInstrInfo)=0
MTL::InstrumentCatalogInterface::CControl::RequestControl
void RequestControl(const DataType NewValue)
Definition: CatalogInterface.h:28
MTL::CInstrumentCatalog::eConnectionInterface::kSerial
@ kSerial
MTL::CMFCController::ScanInstruments
void ScanInstruments(CVISAResourceManager *pRsrcManager)
Definition: MFCController.cpp:364
MTL::CInstrManCatalogInterface::cLogMessage
CControl< CInstrumentCatalog::sLogMessage > cLogMessage
Definition: InstrumentCatalog.h:642
MTL::InstrumentCatalogInterface::CAsyncNotification::Notifier
CObserverNotifier_untyped & Notifier() const
Definition: CatalogInterface.h:160
MTL::CMFCManagerInterface::oInstrumentConfiguration
CObserver< CInstrumentCatalog::sInstrumentConfiguration > oInstrumentConfiguration
Definition: MFCManagerCatalog.h:66
MTL::CMFCDevice::sMFCDeviceError::Location
std::string Location
Definition: MFCDevice.h:38
MTL::CInstrumentCatalog::sProbeArrayInformation
Definition: InstrumentCatalog.h:145
MTL::CInstrumentCatalog::sInstrumentInformation::InstrumentConnection
sInstrumentConnection InstrumentConnection
Definition: InstrumentCatalog.h:107
MTL::CMFCManagerInterface::oPAInfo
CObserver< CInstrumentCatalog::sProbeArrayInformation > oPAInfo
Definition: MFCManagerCatalog.h:65
MTL::CInstrumentCatalog::sInstrumentInformation::Type
eInstrumentType Type
Definition: InstrumentCatalog.h:108
MTL::InstrumentCatalogInterface::CObserver_untyped
Definition: CatalogInterface.h:62
MTL::CInstrManCatalogInterface::cSearchResult
CControl< CInstrumentCatalog::sSearchResult > cSearchResult
Definition: InstrumentCatalog.h:635
MTL::CInstrumentCatalog::eInstrumentType::kMFC3045
@ kMFC3045
MTL::CMFCManagerInterface::oMeasResults
CObserver< CInstrumentCatalog::sMeasurementResults > oMeasResults
Definition: MFCManagerCatalog.h:69
MTL::CInstrumentCatalog::sInstrumentConnection::UniqueID
tInstrumentUniqueID UniqueID
Definition: InstrumentCatalog.h:40
MTL::CMFCDevice::sMFCDeviceError::HasError
bool HasError()
Definition: MFCDevice.h:45
LOG
#define LOG(__msg__, __level__, __location__)
Definition: MFCManager.cpp:19
MTL::InstrumentCatalogInterface::CControl::rRequestControl
void rRequestControl(const DataType &rNewValue)
Definition: CatalogInterface.h:32
MTL::CInstrumentCatalog::eConnectionInterface::kUSB
@ kUSB
MTL::InstrumentCatalogInterface::CObserverNotifier_untyped
Definition: CatalogInterface.h:204
MTL::CMFCDevice::ChangeSerialParmsOnConnectedInstr
virtual sMFCDeviceError ChangeSerialParmsOnConnectedInstr(const CInstrumentCatalog::sMFC3045SerialPortSettings &rNewSerialSetting)=0
MTL::CException
Exception to be thrown.
Definition: Exception.h:16
MTL::InstrumentCatalogInterface::CObserverNotifier_untyped::Is
bool Is(CObserverNotifier_untyped &rNot)
Definition: CatalogInterface.h:221
MTL::CMFCDevice::SetRBBusyLedState
virtual sMFCDeviceError SetRBBusyLedState(const CInstrumentCatalog::eRemoteBoxBusyLedState &rRBBusyLedState)=0
MTL::CMFCManager::Terminate
void Terminate()
Definition: MFCManager.cpp:878
MTL::CInstrManCatalogInterface::cNormalizationReturned
CControl< CInstrumentCatalog::sNormalization > cNormalizationReturned
Definition: InstrumentCatalog.h:640
MTL::CMFCManager::SlotInstrConfig
void SlotInstrConfig(CInstrumentCatalog::sInstrumentConfiguration InstrConfig)
Definition: MFCManager.cpp:669
MTL::CInstrManCatalogInterface::cInstrumentList
CControl< CInstrumentCatalog::tInstrumentList > cInstrumentList
Definition: InstrumentCatalog.h:618
MTL::InstrumentCatalogInterface::CAsyncNotification
Definition: CatalogInterface.h:144
MTL::CInstrumentCatalog::sInstrumentState::OperatingMode
eOperatingMode OperatingMode
Definition: InstrumentCatalog.h:213
MTL::sMFCManagerMailBoxMsg::pContrNot
CAsyncNotification * pContrNot
Definition: MFCManager.h:33
MTL::CMFC2x46Device
Definition: MFC2x46Device.h:28
MTL::CMFCManager::Operate
void Operate()
Definition: MFCManager.cpp:858
MTL::CInstrumentCatalog::sInstrumentConnection::isEmpty
bool isEmpty() const
Definition: InstrumentCatalog.h:49
MTL::CMFCManager
Definition: MFCManager.h:39
MTL::CMFCManagerInterface::cUSBRemoteBusyState
CControl< bool > cUSBRemoteBusyState
Definition: MFCManagerCatalog.h:75
MTL::CMFCManagerCatalog::eControllerState::kIdle
@ kIdle
MTL::CMFCDevice::NewNormalizationRequest
virtual sMFCDeviceError NewNormalizationRequest(const CInstrumentCatalog::sNormalization &rNewNormalizationRequest, CInstrumentCatalog::sNormalization &rReturnedNormalization)=0
MTL::CInstrumentCatalog::sInstrumentInformation
Definition: InstrumentCatalog.h:106
MTL::CMFCController::UpdateNormalizationDate
void UpdateNormalizationDate()
Definition: MFCController.cpp:456
OSDefines.h
Platform Dependent Definitions.
MTL::CInstrManCatalogInterface::cProbeArrayInformation
CControl< CInstrumentCatalog::sProbeArrayInformation > cProbeArrayInformation
Definition: InstrumentCatalog.h:625
MTL::CInstrumentCatalog::FATAL_ERROR_CODE
static constexpr I32 FATAL_ERROR_CODE
Definition: InstrumentCatalog.h:297
MTL::CInstrManCatalogInterface::cRemoteBoxTriggerEvent
CControl< CInstrumentCatalog::eRemoteBoxTrigger > cRemoteBoxTriggerEvent
Definition: InstrumentCatalog.h:631
MTL::CInstrManCatalogInterface::cProbeArrayAngle
CControl< CInstrumentCatalog::sProbeArrayAngle > cProbeArrayAngle
Definition: InstrumentCatalog.h:626
Exception.h
Exception handling utilities.
MTL::CMFCManagerCatalog::eControllerState::kMeasuring
@ kMeasuring
MTL::CInstrumentCatalog
Definition: InstrumentCatalog.h:22
MTL::CMFCManager::SlotControllerState
void SlotControllerState(CMFCManagerCatalog::eControllerState State)
Definition: MFCManager.cpp:591
MTL::CException::context
const char * context() const noexcept
Return the context.
Definition: Exception.h:46
MTL::CInstrumentCatalog::sInstrumentConnection
Definition: InstrumentCatalog.h:38
MTL::CMFCManager::SlotSearchProgress
void SlotSearchProgress(U8 Progress)
Definition: MFCManager.cpp:690
MTL::CUSBRemoteBoxController::Operate
void Operate()
Definition: USBRemoteBoxController.cpp:40
MTL::CInstrumentCatalog::sProbeArrayAngle
Definition: InstrumentCatalog.h:310
MTL::CInstrumentCatalog::eLogLevel::kInfo
@ kInfo
MTL::CMFCManagerCatalog::eControllerState::kScanningPA
@ kScanningPA
MTL::CInstrumentCatalog::sInstrumentConfiguration
Definition: InstrumentCatalog.h:116
MTL::InstrumentCatalogInterface::CObserver_untyped::Is
bool Is(const CObserver_untyped &rObs)
Definition: CatalogInterface.h:70
MTL::CMFCManagerInterface::oRemoteBoxStart
CObserver< bool > oRemoteBoxStart
Definition: MFCManagerCatalog.h:72
MTL::CMFCManagerInterface::oSearchProgress
CObserver< U8 > oSearchProgress
Definition: MFCManagerCatalog.h:67
MTL::InstrumentCatalogInterface::CAsyncNotification::Observer
CObserver_untyped & Observer() const
Definition: CatalogInterface.h:162
MTL__LOCATION__
#define MTL__LOCATION__
Definition: Helpers.h:22
MTL::CInstrumentCatalog::sNormalization
Definition: InstrumentCatalog.h:282
MTL::Instrument::CParsedResourceList
Definition: VISAInstrumentTypes.h:253
MTL::CMFCManagerInterface::oSearchResult
CObserver< CInstrumentCatalog::sSearchResult > oSearchResult
Definition: MFCManagerCatalog.h:68
MTL::Instrument::CVISAResourceManager::Initialize
bool Initialize()
Definition: VISAInstrument.cpp:82
CMFCManagerException
CException< CMFCManager > CMFCManagerException
Definition: MFCManager.cpp:24