#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 = ("数学工具");
m_Description.strName = ("Arithmetic");
m_Description.strVersion = ("3.0");
m_Description.strInfo = ("数学运算");
return m_Description;
}
/////////////////////////////////////////////////
// 生成默认的接口描述
// 2021-8-3备注,其实 withValue 参数没有任何意义,因为目前的设计里exe是不会保存tool中的任何值的
// 全部的数据都保存在dll自身中
void ToolImpl::InitDefaultInterfaces(bool withValue)
{
m_Interfaces.clear();
// 接口
DLL_INF inf;
inf.strName = ("Value1");
inf.Direction = INF_DIRECTION::INF_DIR_IN;
inf.Type = INF_TYPE::INF_TYPE_STANDARD;
inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE;
inf.value.type = VALUE_TYPE::Type_Float;
if (withValue)
{
inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_fInPutValue1;
}
// inf.bSmartLink = true;
m_Interfaces.push_back(inf);
inf.reset();//////////////////////////////////////////////////////////////////////////
inf.strName = ("Value2");
inf.Direction = INF_DIRECTION::INF_DIR_IN;
inf.Type = INF_TYPE::INF_TYPE_STANDARD;
inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE;
inf.value.type = VALUE_TYPE::Type_Float;
if (withValue)
{
inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_fInPutValue2;
}
// inf.bSmartLink = true;
m_Interfaces.push_back(inf);
inf.reset();//////////////////////////////////////////////////////////////////////////
inf.strName = ("Value");
inf.Direction = INF_DIRECTION::INF_DIR_OUT;
inf.Type = INF_TYPE::INF_TYPE_STANDARD;
inf.value.passMode = VALUE_PASS_MODE::PASS_BY_VALUE;
inf.value.type = VALUE_TYPE::Type_Float;
if (withValue)
{
inf.value.Ptr = (void**)&((ToolDialogImpl*)m_pDlgTool)->m_fOutPutValue;
}
// inf.bSmartLink = true;
m_Interfaces.push_back(inf);
inf.reset();//////////////////////////////////////////////////////////////////////////
}