ToolInterface.cpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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 = ("测量工具");
  11. m_Description.strName = ("Measure");
  12. m_Description.strVersion = ("1.3");
  13. m_Description.strInfo = ("This Info");
  14. return m_Description;
  15. }
  16. /////////////////////////////////////////////////
  17. // 生成默认的接口描述
  18. void ToolImpl::InitDefaultInterfaces(bool withValue)
  19. {
  20. // 接口
  21. DLL_INF inf;
  22. inf.strName = ("Image.in");
  23. inf.Direction = INF_DIRECTION::INF_DIR_IN;
  24. inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE;
  25. inf.value.type = VALUE_TYPE::Type_HImage;
  26. if (withValue)
  27. {
  28. inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_Image;// int *m_Value
  29. }
  30. m_Interfaces.push_back(inf);
  31. inf.reset();//////////////////////////////////////////////////////////////////////////
  32. inf.strName = ("Image.out");
  33. inf.Direction = INF_DIRECTION::INF_DIR_OUT;
  34. inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE;
  35. inf.value.type = VALUE_TYPE::Type_HImage;
  36. if (withValue)
  37. {
  38. inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_Image;
  39. }
  40. m_Interfaces.push_back(inf);
  41. inf.reset();//////////////////////////////////////////////////////////////////////////
  42. inf.strName = ("HObject_Obj");
  43. inf.Direction = INF_DIRECTION::INF_DIR_OUT;
  44. inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE;
  45. inf.value.type = VALUE_TYPE::Type_HObject;
  46. if (withValue)
  47. {
  48. inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_hoROI;
  49. }
  50. m_Interfaces.push_back(inf);
  51. inf.reset();//////////////////////////////////////////////////////////////////////////
  52. inf.strName = ("HTuple_Msg");
  53. inf.Direction = INF_DIRECTION::INF_DIR_OUT;
  54. inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE;
  55. inf.value.type = VALUE_TYPE::Type_HTuple;
  56. if (withValue)
  57. {
  58. inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_hvMsg;
  59. }
  60. m_Interfaces.push_back(inf);
  61. inf.reset();//////////////////////////////////////////////////////////////////////////
  62. inf.strName = ("QString_Msg");
  63. inf.Direction = INF_DIRECTION::INF_DIR_OUT;
  64. inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE;
  65. inf.value.type = VALUE_TYPE::Type_String;
  66. if (withValue)
  67. {
  68. inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_strMsg;
  69. }
  70. m_Interfaces.push_back(inf);
  71. inf.reset();//////////////////////////////////////////////////////////////////////////
  72. // 2021-12-18 增加复杂控件的索引接口供测试
  73. inf.strName = ("Index.Int");
  74. inf.Direction = INF_DIRECTION::INF_DIR_OUT;
  75. inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE;
  76. inf.value.type = VALUE_TYPE::Type_Int;
  77. if (withValue)
  78. {
  79. inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_nIndex;
  80. }
  81. m_Interfaces.push_back(inf);
  82. inf.reset();
  83. }