Tool.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #pragma once
  2. #include <QtCore/qglobal.h>
  3. #include "ToolDialog.h"
  4. #ifndef BUILD_STATIC
  5. # if defined(CST_VISIONPLUS_TOOL_LIB)
  6. # define CST_VISIONPLUS_TOOL_EXPORT Q_DECL_EXPORT
  7. # else
  8. # define CST_VISIONPLUS_TOOL_EXPORT Q_DECL_IMPORT
  9. # endif
  10. #else
  11. # define CST_VISIONPLUS_TOOL_EXPORT
  12. #endif
  13. class ToolImpl : public DllTool
  14. {
  15. public:
  16. ToolImpl();
  17. virtual ~ToolImpl();
  18. public:
  19. // 不带参数初始化
  20. virtual int InitTool();
  21. // 初始化
  22. virtual int InitTool(QWidget* pParent, QString strPouName, QString strInstanceName, QObject* pEventTarget = nullptr);
  23. virtual const DLL_TOOL_DESC& Description();
  24. /// <summary>
  25. /// 序列化至文件
  26. /// </summary>
  27. virtual bool SerializedToDoc(QDataStream& out);
  28. /// <summary>
  29. /// 从文件反序列化
  30. /// </summary>
  31. virtual bool SerializedFromDoc(QDataStream& in);
  32. //// 动态增加接口
  33. //virtual void AddInterface(const DLL_INF& dll_inf);
  34. //// 绑定变量。用于动态添加端口的变量绑定
  35. virtual bool bindValuePtrByName(const QString strName, const int nIndex);
  36. protected:
  37. virtual void InitDefaultInterfaces(bool withValue = false);
  38. };