ToolInterface.cpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 = ("CameraManager");
  12. m_Description.strVersion = ("1.0");
  13. m_Description.strInfo = ("相机管理工具");
  14. return m_Description;
  15. }
  16. /////////////////////////////////////////////////
  17. // 生成默认的接口描述
  18. void ToolImpl::InitDefaultInterfaces(bool withValue)
  19. {
  20. // 接口
  21. DLL_INF inf;
  22. inf.strName = ("Image");
  23. inf.Direction = INF_DIRECTION::INF_DIR_OUT;
  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;
  29. }
  30. m_Interfaces.push_back(inf);
  31. inf.reset();//////////////////////////////////////////////////////////////////////////
  32. inf.strName = ("pICamera");
  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_pIBaseCamera;
  36. if (withValue)
  37. {
  38. inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_pCamera;
  39. }
  40. m_Interfaces.push_back(inf);
  41. inf.reset();//////////////////////////////////////////////////////////////////////////
  42. // 增加Event类型的接口
  43. inf.strName = ("Pick.Event");
  44. inf.Direction = INF_DIRECTION::INF_DIR_OUT;
  45. inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE;
  46. inf.Type = INF_TYPE::INF_TYPE_EVENT;
  47. if (withValue)
  48. {
  49. // 初始化event名字
  50. ((ToolDialogImpl*)m_pDlgTool)->m_PickEvent.setName(m_strPouName, this->m_strInstanceName + "." + inf.strName);
  51. inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_PickEvent;
  52. }
  53. m_Interfaces.push_back(inf);
  54. inf.reset();//////////////////////////////////////////////////////////////////////////
  55. }