#include "Tool.h" #include "../../Common/DllToolCommon.h" DLL_TOOL_DESC m_Description; /////////////////////////////////////////////////////////////////// // 获取工具描述 const DLL_TOOL_DESC& ToolImpl::Description() { // 生成dll描述 m_Description.Type = TOOL_TYPE::TOOL_TYPE_STANDARD; m_Description.strCategory = (CATEGORY_TOOL_HARDWARE); m_Description.strName = ("ReadImage"); m_Description.strAliasName = "ReagImage"; m_Description.strVersion = ("1.3"); m_Description.strInfo = ("This Info"); return m_Description; } ///////////////////////////////////////////////// // 生成默认的接口描述 void ToolImpl::InitDefaultInterfaces(bool withValue) { // 接口 DLL_INF inf; inf.strName = ("HImage"); inf.Direction = INF_DIRECTION::INF_DIR_OUT; inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE; inf.value.type = VALUE_TYPE::Type_HImage; if (withValue) { inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_Image; } m_Interfaces.push_back(inf); inf.reset();////////////////////////////////////////////////////////////////////////// inf.strName = ("AcqIndex"); inf.Direction = INF_DIRECTION::INF_DIR_OUT; inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE; inf.value.type = VALUE_TYPE::Type_Int; inf.Discard = INF_DISCARD::INF_MARK_DISCARD; if (withValue) { inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_nAcqIndex; } m_Interfaces.push_back(inf); inf.reset();////////////////////////////////////////////////////////////////////////// inf.strName = ("ImageName"); inf.Direction = INF_DIRECTION::INF_DIR_OUT; inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE; inf.value.type = VALUE_TYPE::Type_String; if (withValue) { inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_strName; } m_Interfaces.push_back(inf); inf.reset();////////////////////////////////////////////////////////////////////////// inf.strName = ("ImagePath"); inf.Direction = INF_DIRECTION::INF_DIR_OUT; inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE; inf.value.type = VALUE_TYPE::Type_String; if (withValue) { inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_strPath; } m_Interfaces.push_back(inf); inf.reset();////////////////////////////////////////////////////////////////////////// // 增加Event类型的接口 inf.strName = ("Event"); inf.Direction = INF_DIRECTION::INF_DIR_OUT; inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE; inf.Type = INF_TYPE::INF_TYPE_EVENT; if (withValue) { // 初始化event名字 ((ToolDialogImpl*)m_pDlgTool)->m_eventOut.setName(m_strPouName, this->m_strInstanceName + "." + inf.strName); inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_eventOut; } m_Interfaces.push_back(inf); inf.reset();////////////////////////////////////////////////////////////////////////// }