COTSSimuControlClr.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #include "COTSSimuControlClr.h";
  2. #include "OTSControlFunExport.h"
  3. namespace OTSCLRINTERFACE
  4. {
  5. COTSHardwareMgrPtr g_ControllerMgrPtr = nullptr;
  6. CSemBasePtr g_SemBasePtr = nullptr;
  7. COTSSimuControlClr::COTSSimuControlClr()
  8. {
  9. g_ControllerMgrPtr = COTSHardwareMgrPtr(new COTSHardwareMgr);
  10. g_SemBasePtr = g_ControllerMgrPtr->GetSemControllerMgrPtr();
  11. }
  12. COTSSimuControlClr::~COTSSimuControlClr()
  13. {
  14. this->!COTSSimuControlClr();
  15. }
  16. COTSSimuControlClr::!COTSSimuControlClr()
  17. {
  18. }
  19. bool COTSSimuControlClr::Connect()
  20. {
  21. if (nullptr == g_SemBasePtr)
  22. {
  23. return false;
  24. }
  25. return g_SemBasePtr->Connect();
  26. }
  27. bool COTSSimuControlClr::DisConnect()
  28. {
  29. if (nullptr == g_SemBasePtr)
  30. {
  31. return false;
  32. }
  33. return g_SemBasePtr->Disconnect();
  34. }
  35. bool COTSSimuControlClr::SetWorkingDistance(double a_dWorkingDistance)
  36. {
  37. return g_SemBasePtr->SetWorkingDistance(a_dWorkingDistance);
  38. }
  39. bool COTSSimuControlClr::GetWorkingDistance(double% a_dWorkingDistance)
  40. {
  41. double WDistance;
  42. bool bRev = g_SemBasePtr->GetWorkingDistance(WDistance);
  43. a_dWorkingDistance = WDistance;
  44. return bRev;
  45. }
  46. bool COTSSimuControlClr::SetMagnification(double a_dMag)
  47. {
  48. return g_SemBasePtr->SetMagnification(a_dMag);
  49. }
  50. bool COTSSimuControlClr::GetMagnification(double% a_dMag)
  51. {
  52. double dMag;
  53. bool bRev = g_SemBasePtr->GetMagnification(dMag);
  54. a_dMag = dMag;
  55. return bRev;
  56. }
  57. }