Common.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724
  1. #pragma once
  2. #include "DllToolCommon.h"
  3. #include "H_DLL.h"
  4. #include <unordered_map>
  5. #pragma warning( disable : 4996)
  6. //输出窗口打印信息
  7. #define OUTPUT_STRING WM_USER + 1000
  8. //由mainfrm将信息打印到输出窗口
  9. #define WNDOUTPUT WM_USER + 1001
  10. //文件数据发生变化
  11. #define DOC_CHANGE WM_USER + 1002
  12. //////////////////////////////////////////////////////////////////////////
  13. // 默认显示的任务窗体的序号
  14. #define DEFAULT_TASK_WINDOW 0
  15. #define EXECUTE_TIMEOUT 1
  16. #define NumberOfIcons 4
  17. #define LOGO_VIEW 0
  18. #define RUNTIME_VIEW 1
  19. #define TASK_VIEW 2
  20. #define OUTPUT_VIEW 3
  21. #define PORT_WIDTH 15
  22. #define HOT_REGION 4// link线条的触发区域矩形宽度
  23. #define First_Line_Interval 25 //首行间隔
  24. #define Prot_First_Line_Interval 9 //Prot首行间隔
  25. #define Trailing_Interval 1 //尾行间隔
  26. #define PROT_REGION 10// Prot的触发区域矩形宽度
  27. #define APP_INIT 0
  28. #define APP_LOAD 1
  29. #define APP_RUN 2
  30. #define APP_CLOS 3
  31. //////////////////////////////////////////////////////////////////////////
  32. #define RESSTRIDTYPE UINT
  33. #define IDS2RESIDTYPE(id) id
  34. #define _GetResString(id) GetResString(id)
  35. //////////////////////////////////////////////////////////////////////////
  36. // 释放内存
  37. #define RELEASE_BUFFER(x) {if(x!=NULL) {delete x;x=NULL;}}
  38. #define FREE_BUFFER(x) {if(x!=NULL) {free(x);x=NULL;}}
  39. #define RELEASE_HANDLE(x) {if(x!=NULL) {CloseHandle(x);x=NULL;}}
  40. #define ARRSIZE(x) (sizeof(x)/sizeof(x[0]))
  41. /////////////////////////////////////////////////////////////////
  42. // 工具的默认保存路径
  43. #define DEFAULT_TOOL_PATH _T("\\toolbox\\")
  44. #define CONFIGFOLDER _T("config\\")
  45. //定义输出窗口类型
  46. enum OUTPUT_WND
  47. {
  48. RESULT, //结果窗口
  49. VALUE, //变量窗口
  50. LOG //日志窗口
  51. };
  52. // 拖动的模式,有两种:移动模式和连线模式
  53. typedef enum _tagDragMode
  54. {
  55. DRAG_MOVE, // 移动模式
  56. DRAG_LINK, // 连线模式
  57. DRAG_NONE // 没有拖动
  58. } DRAG_MODE;
  59. // //定义输出消息
  60. typedef struct _tagOutPutMsg
  61. {
  62. MSG_WAY bWay = MSG_WAY::_INFO; // 消息类型
  63. CString strMsg = _T("NULL"); // 消息
  64. CString strSource = _T("System"); // 消息来源可以是系统,也可以是某个工具
  65. CString strUser = _T("Root"); // 当前用户名
  66. } OUTPUT_MSG;
  67. typedef enum _tagOperatingMode
  68. {
  69. CUSTOMER_MODE = 0, //客户模式 Customer mode
  70. DEVELOP_MODE = 1, //开发模式 Develop mode
  71. ENGINEERING_MODE = 2 //工程模式 Engineering mode
  72. }OPERATING_MODE;
  73. //定义任务执行模式
  74. typedef enum _tagTaskMode
  75. {
  76. MAIN_TASK = 1, // 主任务
  77. EVEN_TASK = 2, // 事件任务
  78. RUN_TASK = 3, // 运行时(运行按钮)行的任务
  79. STOP_TASK = 4 // 停止时(停止按钮)执行的任务
  80. }TASK_MODE;
  81. typedef enum _tagInterfaceDispType
  82. {
  83. IVDT_CSTRING = 1, // CString
  84. IVDT_HIMAGE = 2, // Hobject Image
  85. IVDT_OBJECT = 3,
  86. IVDT_REG = 4,
  87. IVDT_XLD = 5,
  88. IVDT_NONE
  89. }INTERFACE_DISP_TYPE;
  90. //任务
  91. typedef struct _tagTaskInfo
  92. {
  93. TASK_MODE bTaskMode = MAIN_TASK; // 任务模式
  94. CString strTaskName = _T("检测任务"); // 任务的名称
  95. int nSleepTime = 0; // 每个循环周期的任务间隔
  96. } TASK_INFO;
  97. // 工具的公共基类
  98. typedef struct _tagToolBase
  99. {
  100. CString strName; // 名称
  101. CString strAliasName; // 工具别名
  102. HTREEITEM hHandle; // 控件句柄
  103. CRect rect;
  104. _tagToolBase()
  105. {
  106. hHandle = NULL;
  107. rect.SetRectEmpty();
  108. }
  109. } TOOL_BASE;
  110. // 工具接口信息
  111. typedef struct _tagToolInterface : public TOOL_BASE
  112. {
  113. CString strParentName; // 接口父节点的名称
  114. CString strInfo; // 接口的描述信息
  115. INF_DIRECTION InfDirection; // 接口输入输出(输入、输出)
  116. INF_TYPE InfType; // 控件类型还是值类型
  117. INF_WAY InfWay; // 传值还是传引用(2019-5-3增加)
  118. VAR_TYPE VarType; // 接口的参数类型
  119. LPVOID* pValue; // 接口的值指针(除全局变量外其它工具不使用)
  120. int nIndex = 0; // 接口的序号
  121. bool bMonitor = false; // 是否启用变量监控,默认不启用,可在工具中配置默认状态
  122. bool bShow = true; // 2019-3-26 是否隐藏此接口
  123. bool bSmartLink = false; // 智能链接(添加工具到任务栏的时候,工具的输入接口自动向上搜素可用的输出端口.序列化的时候该功能不适用)
  124. int nUseCount = 0; // 工具被使用调用后,不允许删除,否则其它调用会出错
  125. _tagToolInterface()
  126. {
  127. Reset();
  128. }
  129. void Reset()
  130. {
  131. InfDirection = INF_NONE;
  132. strParentName.Empty();
  133. VarType = VAR_TYPE::ALL_Var;
  134. InfType = INF_TYPE_NONE;
  135. InfWay = INF_BY_VALUE;
  136. pValue = NULL;
  137. bMonitor = false;
  138. nIndex = -1;
  139. bShow = true;
  140. nUseCount = 0;
  141. }
  142. // 重载 =
  143. _tagToolInterface& operator =(const _tagToolInterface& inf)
  144. {
  145. if (this != &inf)
  146. {
  147. this->strParentName = inf.strParentName;
  148. this->strInfo = inf.strInfo;
  149. this->strName = inf.strName;
  150. this->strAliasName = inf.strAliasName;
  151. this->InfDirection = inf.InfDirection;
  152. this->hHandle = inf.hHandle;
  153. this->nIndex = inf.nIndex;
  154. this->rect = inf.rect;
  155. // 2018.6.4增加
  156. this->VarType = inf.VarType;
  157. this->InfType = inf.InfType;
  158. this->InfWay = inf.InfWay;
  159. this->bMonitor = inf.bMonitor;
  160. this->bShow = inf.bShow;
  161. this->nUseCount = inf.nUseCount;
  162. this->pValue = inf.pValue;
  163. }
  164. return *this;
  165. }
  166. // 重载 ==
  167. bool operator == (const _tagToolInterface& inf)
  168. {
  169. return this->strParentName == inf.strParentName
  170. && this->strName == inf.strName
  171. && this->InfDirection == inf.InfDirection
  172. && this->InfWay == inf.InfWay
  173. && this->nIndex == inf.nIndex
  174. && this->VarType == inf.VarType
  175. && this->InfType == inf.InfType;
  176. ;
  177. }
  178. // 重载 !=
  179. bool operator != (const _tagToolInterface& inf)
  180. {
  181. return this->strParentName != inf.strParentName
  182. || this->strName != inf.strName
  183. || this->InfDirection != inf.InfDirection
  184. || this->InfWay != inf.InfWay
  185. || this->nIndex != inf.nIndex
  186. || this->VarType != inf.VarType
  187. || this->InfType != inf.InfType;
  188. ;
  189. }
  190. //// 重载 <
  191. //bool operator<(const _tagToolInterface& other) const
  192. //{
  193. // if (this->strName.Compare(other.strName) < 0)
  194. // {
  195. // return true;
  196. // }
  197. // else
  198. // {
  199. // return false;
  200. // }
  201. //}
  202. } TOOL_INTERFACE, *LPTOOL_INTERFACE;
  203. //////////////////////////////////////////////////////////////////////////
  204. typedef struct _tagToolName
  205. {
  206. int nToolID = 0;
  207. CString strName;
  208. CString strAliasName;//曾用名或者别名
  209. CString strShowName;
  210. // 重载 =
  211. _tagToolName& operator =(const _tagToolName& tool)
  212. {
  213. if (this != &tool)
  214. {
  215. this->nToolID = tool.nToolID;
  216. this->strName = tool.strName;
  217. this->strAliasName = tool.strAliasName;
  218. this->strShowName = tool.strShowName;
  219. }
  220. return *this;
  221. }
  222. void Reset()
  223. {
  224. nToolID = 0;
  225. strName.Empty();
  226. strShowName.Empty();
  227. }
  228. }TOOLNAME;
  229. ////////////////////////////////////////////////////////
  230. // 工具信息结构体
  231. typedef struct _tagTool : public TOOL_BASE
  232. {
  233. TOOL_TYPE Type;
  234. CString strShowName; // 工具在界面中显示出来的名字(可能会有重名、重命名等等)
  235. CString strVersion; // 2018.6.4增加:工具的版本
  236. CString strDll; // 2018.6.4增加:实现本工具的dll
  237. CString strInfo; // 2018.6.26增加:工具的Info
  238. CString strLinkName; //
  239. //CString strFunction; // 2018.6.4增加:实现本工具的函数
  240. HINSTANCE hDllTool = NULL; // 2018.7.17增加: 保存了加载到系统的dll句柄
  241. CDllTool* pDllPtr = NULL; // 绑定的工具Dll的句柄
  242. vector<TOOL_INTERFACE> Interfaces; // 接口
  243. HICON hIcon;
  244. TOOLNAME hNextTool; // 下一个工具
  245. int nImageID = 0; // 保存当前工具图标在全局图标列表中的序号
  246. int nToolState = 0; // 工具的状态,指示工具是否可用(工具初始化错误时候,状态为不可用)
  247. int nInSleep = 0; // 进入函数时候延时
  248. int nOutSleep = 0; // 执行完函数时候延时
  249. int nExecCode = RT_NONE; // 2018.10.14修改 工具的执行返回值(默认为未执行状态)
  250. int nAbnormalCount = 0; // 异常计数,用来统计非正常的执行次数
  251. int nToolID = 0;
  252. double dFrequency = 0; // 工具执行的帧率
  253. double dRunTime = 0; // 工具运行时间
  254. double dTraggerTime = 0; // 工具触发的时间
  255. bool bIsExpand = true; // 默认展开工具
  256. bool bEnable = true; // 工具启用(不启用的工具,执行的时候会跳过)
  257. int nUseCount = 0; // 工具被使用调用后,不允许删除,否则其它调用会出错
  258. _tagTool()
  259. {
  260. Reset();
  261. }
  262. void Reset()
  263. {
  264. Type = TOOL_BY_TOOL;
  265. strShowName.Empty();
  266. strVersion.Empty();
  267. strDll.Empty();
  268. strInfo.Empty();
  269. hDllTool = NULL;
  270. pDllPtr = NULL;
  271. Interfaces.clear();
  272. hNextTool.Reset();
  273. nImageID = 0;
  274. nInSleep = 0;
  275. nOutSleep = 0;
  276. nExecCode = RT_NONE;
  277. nAbnormalCount = 0;
  278. nToolID = 0;
  279. dFrequency = 0;
  280. dRunTime = 0;
  281. dTraggerTime = 0;
  282. nToolState = TOOL_SUCCESS;
  283. bIsExpand = TRUE;
  284. bEnable = TRUE;
  285. nUseCount = 0;
  286. strLinkName.Empty();
  287. }
  288. // 重载 =
  289. _tagTool& operator =(const _tagTool& tool)
  290. {
  291. if (this != &tool)
  292. {
  293. this->Type = tool.Type;
  294. this->strName = tool.strName;
  295. this->strAliasName = tool.strAliasName;
  296. this->strShowName = tool.strShowName;
  297. this->hHandle = tool.hHandle;
  298. this->Interfaces = tool.Interfaces;
  299. this->strLinkName = tool.strLinkName;
  300. this->strDll = tool.strInfo;
  301. this->rect = tool.rect;
  302. // 2018.6.4增加
  303. this->strVersion = tool.strVersion;
  304. this->strDll = tool.strDll;
  305. this->strInfo = tool.strInfo;
  306. this->pDllPtr = tool.pDllPtr;
  307. this->hDllTool = tool.hDllTool;
  308. this->hIcon = tool.hIcon;
  309. this->hNextTool = tool.hNextTool;
  310. this->nImageID = tool.nImageID;
  311. this->nInSleep = tool.nInSleep;
  312. this->nOutSleep = tool.nOutSleep;
  313. this->nExecCode = tool.nExecCode;
  314. this->nAbnormalCount = tool.nAbnormalCount;
  315. this->nToolID = tool.nToolID;
  316. //this->nNextToolID = tool.nNextToolID;
  317. this->dFrequency = tool.dFrequency;
  318. this->dRunTime = tool.dRunTime;
  319. this->dTraggerTime = tool.dTraggerTime;
  320. this->bIsExpand = tool.bIsExpand;
  321. this->bEnable = tool.bEnable;
  322. this->nUseCount = tool.nUseCount;
  323. }
  324. return *this;
  325. }
  326. } TOOL, *LPTOOL;
  327. ////////////////////////////////////////////////////////
  328. // 工具类别信息结构体
  329. typedef struct _tagToolCategory
  330. {
  331. CString strName; // 分类的名称(如果没有名称,则说明本工具不从属于任何分类)
  332. vector<TOOL> Tools; // 本分类下的所有工具
  333. _tagToolCategory()
  334. {
  335. }
  336. } TOOL_CATEGORY, *LPTOOL_CATEGORY;
  337. ////////////////////////////////////////////////////////
  338. // Link的对应关系
  339. typedef struct _tagLinkMap
  340. {
  341. TOOL_INTERFACE source; // 连接的起点
  342. TOOL_INTERFACE dest; // 连接的终点
  343. bool bActive; // 这个连线是否被激活
  344. bool bShow; // 这个连线是否显示,默认显示(特殊工具可能不需要显示,目前是端口的输入不需要显示)
  345. // 重载 ==
  346. bool operator == (const _tagLinkMap& linkmap)
  347. {
  348. return this->source == linkmap.source
  349. && this->dest == linkmap.dest
  350. && this->bActive == linkmap.bActive;
  351. }
  352. // 重载 !=
  353. bool operator != (const _tagLinkMap& linkmap)
  354. {
  355. return this->source != linkmap.source
  356. || this->dest != linkmap.dest
  357. || this->bActive != linkmap.bActive;
  358. }
  359. _tagLinkMap()
  360. {
  361. bActive = false;
  362. bShow = true;
  363. }
  364. } LINK, *LPLINK;
  365. typedef vector<LINK> LINK_MAP;
  366. ////////////////////////////////////////////////////////
  367. // Link的4个点坐标(用于绘图)
  368. typedef struct _tagLinkPoints
  369. {
  370. CPoint ptStart;
  371. CPoint ptCorner1;
  372. CPoint ptCorner2;
  373. CPoint ptCorner3;
  374. CPoint ptCorner4;
  375. CPoint ptEnd;
  376. int nMode;
  377. } LINK_POINTS, *LPLINK_POINTS;
  378. ////////////////////////////////////////////////////////
  379. // Link的鼠标触发区域(判定鼠标命中)
  380. typedef struct _tagLinkRects
  381. {
  382. CRect rcStart;
  383. CRect rcCorner1;
  384. CRect rcCorner2;
  385. CRect rcCorner3;
  386. CRect rcEnd;
  387. } LINK_RECTS, *LPLINK_RECTS;
  388. //////////////////////////////////////////////////////////////////////////
  389. // 全局变量的数据结构
  390. typedef struct _tagGlobalLink
  391. {
  392. TOOL_INTERFACE source; // 连接的起点
  393. TOOL_INTERFACE dest; // 连接的终点
  394. int nSourecTaskIndex;
  395. int nDestTaskIndex;
  396. _tagGlobalLink()
  397. {
  398. nSourecTaskIndex = -1;
  399. nDestTaskIndex = -1;
  400. source.Reset();
  401. dest.Reset();
  402. }
  403. ~_tagGlobalLink()
  404. {
  405. nSourecTaskIndex = -1;
  406. nDestTaskIndex = -1;
  407. source.Reset();
  408. dest.Reset();
  409. }
  410. }GLOBALLINK;
  411. typedef vector<GLOBALLINK> GLOBALLINK_MAP;
  412. typedef struct _tagGlobaVar
  413. {
  414. int nTaskIndex;
  415. int nGVnIndex;
  416. CString strShowName;
  417. VAR_TYPE VarType;
  418. _tagGlobaVar()
  419. {
  420. Reset();
  421. }
  422. ~_tagGlobaVar()
  423. {
  424. Reset();
  425. }
  426. void Reset()
  427. {
  428. nTaskIndex = 0;
  429. nGVnIndex = 0;
  430. strShowName.Empty();
  431. VarType = VAR_TYPE::ALL_Var;
  432. }
  433. }GLOBALVAR;
  434. // Diagram的控件类型
  435. // 绑定的系统命令名称
  436. #define SYSTEM_ROOT _T("CMainFrame")
  437. #define SYSTEM_CMD_RUN _T("CMainFrame.OnSystemRun")
  438. #define SYSTEM_CMD_RUNONCE _T("CMainFrame.OnSystemRunOnce")
  439. #define SYSTEM_CMD_STOP _T("CMainFrame.OnSystemStop")
  440. #define SYSTEM_CMD_SAVE _T("CMainFrame.OnSystemSave")
  441. #define TASK_SYSTEM_COM 99 // 任务窗体序号(如果是系统命令,则对应窗体为99)
  442. #define TASK_SYSTEM_GV 98 // 全局变量序号(如果是系统命令,则对应窗体为98)
  443. #define TASK_INVALID -1
  444. // 各个控件采用的ID号起始编号(每增加一种控件都要增加一项)
  445. #define RESOURCE_ID_BUTTON 0x100
  446. #define RESOURCE_ID_EDITBOX 0x200
  447. #define RESOURCE_ID_LISTBOX 0x300
  448. #define RESOURCE_ID_COMBOBOX 0x400
  449. #define RESOURCE_ID_CHECKBOX 0x500
  450. #define RESOURCE_ID_INMAGE 0x600
  451. #define RESOURCE_ID_TEXT 0x700
  452. #define RESOURCE_ID_GROUPBOX 0x800
  453. #define RESOURCE_ID_STATIC 0x900
  454. // 每种类型的控件最大支持的数量(用于控件批量响应消息)
  455. #define MAX_CONTROL_COUNT 0x100
  456. // 各个控件的枚举值(每增加一种控件都要增加一项)
  457. typedef enum _tagControlTypeID
  458. {
  459. TYPE_ID_BUTTON,
  460. TYPE_ID_COMBOBOX,
  461. TYPE_ID_EDITBOX,
  462. TYPE_ID_LISTBOX,
  463. TYPE_ID_CHECKBOX,
  464. TYPE_ID_IMAGE,
  465. TYPE_ID_TEXT,
  466. TYPE_ID_GROUPBOX,
  467. TYPE_ID_STATIC,
  468. TYPE_ID_COUNT//此行永远为最后一行
  469. } CONTROL_TYPE_ID;
  470. // 控件的关联种类
  471. typedef enum _tagControlRefType
  472. {
  473. REF_INTERFACE, // 控件关联接口
  474. REF_TOOL, // 控件关联工具
  475. REF_COMMAND, // 控件关联命令
  476. REF_GV,
  477. REF_NONE, // 未绑定任何接口
  478. REF_COUNT
  479. } CONTROL_REF_TYPE;
  480. //// 控件的关联信息
  481. //typedef struct _tagControlRefInfo
  482. //{
  483. // CString strInfParentName; // 接口的父节点名称
  484. // CString strName; // 控件的名称
  485. // INF_WAY bWay; // 控件的输入输出类型
  486. // int nInfIndex; // 接口的序号
  487. //
  488. // int nRefTaskIndex; // 关联的TaskWindow的序号
  489. //
  490. // CONTROL_REF_TYPE type; // 关联的类型
  491. //
  492. // _tagControlRefInfo()
  493. // {
  494. // bWay = INF_CONTROL;
  495. // type = REF_NONE;
  496. // nInfIndex = -1;
  497. // nRefTaskIndex = TASK_INVALID;
  498. // }
  499. //
  500. // // 重载 =
  501. // _tagControlRefInfo& operator =(const _tagControlRefInfo& info)
  502. // {
  503. // if (this != &info)
  504. // {
  505. // this->strInfParentName = info.strInfParentName;
  506. // this->strName = info.strName;
  507. // this->bWay = info.bWay;
  508. // this->nInfIndex = info.nInfIndex;
  509. // this->nRefTaskIndex = info.nRefTaskIndex;
  510. // type = info.type;
  511. // }
  512. // return *this;
  513. // }
  514. //
  515. //} CONTROL_REF_INFO;
  516. ///////////////////////////////////////////////////////
  517. //控件字体
  518. typedef struct _tagControlProperty
  519. {
  520. COLORREF crText; //字体的颜色
  521. COLORREF crBackGnd; //字体的背景颜色
  522. LOGFONT lf;
  523. CString strFontName;
  524. int nNoInput; //禁止输入
  525. _tagControlProperty()
  526. {
  527. crText = RGB(0, 0, 0);
  528. crBackGnd = RGB(255, 255, 255);
  529. memset(&lf, 0, sizeof(LOGFONT));
  530. lf.lfHeight = 18;
  531. _tcscpy_s(lf.lfFaceName, LF_FACESIZE, _T("宋体"));// 将lf中的元素字体名设为“宋体”
  532. strFontName = _T("宋体");
  533. nNoInput = false;
  534. }
  535. ~_tagControlProperty()
  536. {
  537. }
  538. } CONTROL_PROPERTY;
  539. // 界面中要添加的控件信息
  540. typedef struct _tagControl
  541. {
  542. CString strEntityID; // 控件在Entity中的编号
  543. VAR_TYPE strType; // 控件类型
  544. CString strText; // 控件上的文字
  545. CONTROL_TYPE_ID nTypeID; // 控件TypeID序号
  546. CWnd* pWnd; // 控件指针
  547. CWnd* pInfWnd; // 关联的接口控件指针
  548. CRect rcRect; // 控件的尺寸
  549. TOOL_INTERFACE RefInterface; // 关联的Interface信息
  550. int nRefTaskIndex; // 关联的TaskWindow的序号
  551. CONTROL_REF_TYPE RefType; // 关联的类型(有三种)
  552. CONTROL_PROPERTY ControlProperty; // 控件属性
  553. CString strLinkName; // 链接信息
  554. CString strTooltip; // Tooltip
  555. _tagControl()
  556. {
  557. pWnd = nullptr;
  558. pInfWnd = nullptr;
  559. rcRect.SetRectEmpty();
  560. nRefTaskIndex = TASK_INVALID;
  561. RefType = REF_NONE;
  562. strLinkName.Empty();
  563. strTooltip.Empty();
  564. strType = VAR_TYPE::ALL_Var;
  565. }
  566. } CONTROL, *LPCONTROL;
  567. typedef unordered_map<UINT, CONTROL> CONTROLS;
  568. // 2018-7-30增加,显示日志信息
  569. //#define SHOWLOG(str) {((CMainFrame*)AfxGetMainWnd())->ShowOutputInfo(str, LOG);}