ToolInterface.cpp 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #include "Tool.h"
  2. #include "../../Common/DllToolCommon.h"
  3. DLL_TOOL_DESC m_Description;
  4. ///////////////////////////////////////////////////////////////////
  5. // 获取工具描述
  6. const DLL_TOOL_DESC& ToolImpl::Description()
  7. {
  8. // 生成dll描述
  9. m_Description.Type = TOOL_TYPE::TOOL_TYPE_STANDARD;
  10. m_Description.strCategory = (CATEGORY_TOOL_HARDWARE);
  11. m_Description.strName = ("ReadImage");
  12. m_Description.strAliasName = "ReagImage";
  13. m_Description.strVersion = ("1.3");
  14. m_Description.strInfo = ("This Info");
  15. return m_Description;
  16. }
  17. /////////////////////////////////////////////////
  18. // 生成默认的接口描述
  19. void ToolImpl::InitDefaultInterfaces(bool withValue)
  20. {
  21. // 接口
  22. DLL_INF inf;
  23. inf.strName = ("HImage");
  24. inf.Direction = INF_DIRECTION::INF_DIR_OUT;
  25. inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE;
  26. inf.value.type = VALUE_TYPE::Type_HImage;
  27. if (withValue)
  28. {
  29. inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_Image;
  30. }
  31. m_Interfaces.push_back(inf);
  32. inf.reset();//////////////////////////////////////////////////////////////////////////
  33. inf.strName = ("AcqIndex");
  34. inf.Direction = INF_DIRECTION::INF_DIR_OUT;
  35. inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE;
  36. inf.value.type = VALUE_TYPE::Type_Int;
  37. inf.Discard = INF_DISCARD::INF_MARK_DISCARD;
  38. if (withValue)
  39. {
  40. inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_nAcqIndex;
  41. }
  42. m_Interfaces.push_back(inf);
  43. inf.reset();//////////////////////////////////////////////////////////////////////////
  44. inf.strName = ("ImageName");
  45. inf.Direction = INF_DIRECTION::INF_DIR_OUT;
  46. inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE;
  47. inf.value.type = VALUE_TYPE::Type_String;
  48. if (withValue)
  49. {
  50. inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_strName;
  51. }
  52. m_Interfaces.push_back(inf);
  53. inf.reset();//////////////////////////////////////////////////////////////////////////
  54. inf.strName = ("ImagePath");
  55. inf.Direction = INF_DIRECTION::INF_DIR_OUT;
  56. inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE;
  57. inf.value.type = VALUE_TYPE::Type_String;
  58. if (withValue)
  59. {
  60. inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_strPath;
  61. }
  62. m_Interfaces.push_back(inf);
  63. inf.reset();//////////////////////////////////////////////////////////////////////////
  64. // 增加Event类型的接口
  65. inf.strName = ("Event");
  66. inf.Direction = INF_DIRECTION::INF_DIR_OUT;
  67. inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE;
  68. inf.Type = INF_TYPE::INF_TYPE_EVENT;
  69. if (withValue)
  70. {
  71. // 初始化event名字
  72. ((ToolDialogImpl*)m_pDlgTool)->m_eventOut.setName(m_strPouName, this->m_strInstanceName + "." + inf.strName);
  73. inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_eventOut;
  74. }
  75. m_Interfaces.push_back(inf);
  76. inf.reset();//////////////////////////////////////////////////////////////////////////
  77. }