MACHINE_Logical.cpp 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #include "stdafx.h"
  2. #include <map>
  3. #include "All.h"
  4. #include "MACHINE_DPC.h"
  5. #include "MACHINE_Logical.h"
  6. #include "DIOSDICOMInfo.h"
  7. CMACHINE_Logical::CMACHINE_Logical(void)
  8. {
  9. }
  10. CMACHINE_Logical::~CMACHINE_Logical(void)
  11. {
  12. }
  13. bool CMACHINE_Logical::DPCPoint(CMACHINE_DPC* pMACHINE_DPC)
  14. {
  15. m_pMACHINE_DPC = pMACHINE_DPC;
  16. return true;
  17. }
  18. RET_STATUS CMACHINE_Logical::SetTechParamsInfo(ResDataObject PARAM_IN& techParam)
  19. {
  20. return RET_SUCCEED;
  21. }
  22. RET_STATUS CMACHINE_Logical::SetupStitching(ResDataObject PARAM_IN& pParam)
  23. {
  24. STITCH_INFO m_stitchinfo;
  25. m_stitchinfo.SetVal(pParam.encode());
  26. int nInitalHeight = atoi(((string)m_stitchinfo.m_InitialHeight).c_str());
  27. int nDirection = atoi(((string)m_stitchinfo.m_Direction).c_str());
  28. int nImageCount = atoi(((string)m_stitchinfo.m_ImageCount).c_str());
  29. int nSID = atoi(((string)m_stitchinfo.m_SID).c_str());
  30. int nStepLength = atoi(((string)m_stitchinfo.m_StepLength).c_str());
  31. int nStitchLength = atoi(((string)m_stitchinfo.m_StitchLength).c_str());
  32. int nStitchType = atoi(((string)m_stitchinfo.m_StitchType).c_str());
  33. m_pMACHINE_DPC->SetupStitching(nImageCount, nDirection, nInitalHeight, nStitchLength, nStepLength, nSID, nStitchType);
  34. return RET_SUCCEED;
  35. }
  36. RET_STATUS CMACHINE_Logical::AcceptStitchingImage()
  37. {
  38. char strcommand[100]{"USA"};
  39. m_pMACHINE_DPC->SendCommandWithoutAck(strcommand);
  40. //if (m_pMACHINE_DPC->m_nImageCount == m_pMACHINE_DPC->m_nCurrentImage)
  41. // CompleteStitching();
  42. return RET_SUCCEED;
  43. }
  44. //notice the URS that the last acquired image is rejected by host. Keep current position.
  45. RET_STATUS CMACHINE_Logical::RejectStitchingImage()
  46. {
  47. char strcommand[100]{"USJ"};
  48. m_pMACHINE_DPC->SendCommandWithoutAck(strcommand);
  49. return RET_SUCCEED;
  50. }
  51. //Cancel stitching procedure.
  52. RET_STATUS CMACHINE_Logical::CancelStitching()
  53. {
  54. if (m_pMACHINE_DPC->m_bStitchingInProgress)
  55. {
  56. char strcommand[100]{"UCS"};
  57. m_pMACHINE_DPC->SendCommandWithoutAck(strcommand);
  58. }
  59. return RET_SUCCEED;
  60. }
  61. //Note the URS that stitching is finished.
  62. RET_STATUS CMACHINE_Logical::CompleteStitching()
  63. {
  64. if (m_pMACHINE_DPC->m_bStitchingInProgress)
  65. {
  66. char strcommand[100]{"USE"};
  67. m_pMACHINE_DPC->SendCommandWithoutAck(strcommand);
  68. }
  69. return RET_SUCCEED;
  70. }
  71. //New extra view, request the positioner to move to a position to take an extra image.
  72. RET_STATUS CMACHINE_Logical::NewExtraView()
  73. {
  74. if (m_pMACHINE_DPC->m_bStitchingInProgress)
  75. {
  76. char strcommand[100]{"UEX"};
  77. m_pMACHINE_DPC->SendCommandWithoutAck(strcommand);
  78. }
  79. return RET_SUCCEED;
  80. }