#pragma once #pragma execution_character_set("utf-8") #include #include #include #include #include #include #include #include #include "QDesktopWidget" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "VPGlobal.h" //// 为了处理M_PI未识别Error(仅Qt5需要) //// #define _USE_MATH_DEFINES //#include #include "../Common/DataStructure.h" #include "../Common/DataStructureInner.h" #include "../Common/DllToolCommon.h" #include "../Common/Utility.h" //// 输出debug信息,并且写入log //#define LOG_DEBUG(msg) {qDebug() << msg; LOG(msg);} // 应用程序当前执行全路径 #define CURRENT_FULL_PATH QCoreApplication::applicationDirPath() // 工具的默认保存路径 #define DEFAULT_TOOL_PATH CURRENT_FULL_PATH + ("/toolbox/") #define CONFIGFOLDER ("/config/") // 窗体的默认初始化大小 #define DEFAULT_WIDTH 1280 #define DEFAULT_HEIGHT 768 // Port绑定接口的后缀名 #define PORT_INF_POSTFIX (".Q") // 动态库文件在不同系统下的扩展名 #ifdef Q_OS_WIN #define TOOL_EXT ".dll" #else #define TOOL_EXT ".so" #endif // 存档临时文件的扩展名 #define TMP_POSTFIX QString(".tmp") // 存档文件的扩展名 #define DOC_POSTFIX QString(".vpp") // 硬件组态存档的默认文件名 #define DOC_HARDWARE_FULLPATH CURRENT_FULL_PATH + QString("/default.hw") // UI设计页面中,主页面的后缀 #define UI_MAINPAGE_POSTFIX QString("(Main)") #define POU_POSTFIX QString("(Pou)") #define GVL_BASIC_POSTFIX QString("(Basic)") #define GVL_STANDARD_POSTFIX QString("(Dtandard)") #define GVL_DB_POSTFIX QString("(DataBase)") // 全局变量和局部变量的分组名称 #define GROUP_GLOBAL_VARIABLE QString("Global Variables") #define GROUP_LOCAL_VARIABLE QString("Local Variables") // 释放指针 #define RELEASE(x) if(x!=nullptr) { delete x; x= nullptr;} // 使用 utf8 编码 #if _MSC_VER >= 1600 #pragma execution_character_set("utf-8") #endif // 系统内置定时器频率(100ms) #define SYS_TIMER 100 // 主窗体中各子窗体序号 // Runtime页面 #define MAIN_VIEW_RUNTIME 0 // App页面 #define MAIN_VIEW_APP 1 // App页面中ResourceManager的宽度 #define APP_RM_WIDTH 200 // Pou变量分组的后缀 #define VAR_SUFFIX QString(".Variables") // Pou内部变量名字 - 执行总时长(ms) #define INTERNALVAR_NAME_EXECTIME "ExeTime" #define INTERNALVAR_CHNAME_EXECTIME "执行总时长(ms)" // Pou内部变量名字 - 执行次数 #define INTERNALVAR_NAME_EXECCOUNT "ExeCount" #define INTERNALVAR_CHNAME_EXECCOUNT "执行次数" // Pou内部变量名字 - 错误次数 #define INTERNALVAR_NAME_ERRORCOUNT "ErrorCount" #define INTERNALVAR_CHNAME_ERRORCOUNT "错误计数" // 系统变量名字 - 系统时间 #define SYSTEMVAR_NAME_TIME "SystemTime" #define SYSTEMVAR_CHNAME_TIME "系统时间" // 系统变量名字 - 系统运行计数 #define SYSTEMVAR_NAME_EXECCOUNT "SysExeCount" #define SYSTEMVAR_CHNAME_EXECCOUNT "系统运行计数" // 系统变量名字 - 开机时长 #define SYSTEMVAR_NAME_RUNTIME "RunTime" #define SYSTEMVAR_CHNAME_RUNTIME "开机时长" // 系统变量名字 - 项目名称 #define SYSTEMVAR_NAME_PROJECTNAME "ProjectName" #define SYSTEMVAR_CHNAME_PROJECTNAME "项目名称" // 系统变量名字 - 项目路径 #define SYSTEMVAR_NAME_PROJECTPATH "ProjectPath" #define SYSTEMVAR_CHNAME_PROJECTPATH "项目路径" // Port接口的默认名字(尚未绑定的情况下) #define DEFAULT_INPUT_PORT_NAME "input" #define DEFAULT_OUTPUT_PORT_NAME "output" // 同时执行的并行工具最大数量限制(100个) #define MAX_PARALLEL_TOOL_COUNT 0x64 // 工具被加入并行组之后,显示的字母标识 #define TOOL_PARALLEL_LOGO "P" // 读取存档文件时的关键字 #define LOAD_DOC_KEYWORDS "Done" // UI界面的默认尺寸 #define DEFAULT_UIVIEW_WIDTH 1500 #define DEFAULT_UIVIEW_HEIGHT 1000 // POU界面的默认尺寸 #define POU_VIEW_WIDTH 4000 #define POU_VIEW_HEIGHT 3000 // bool的对应字符串 #define STRING_TRUE "true" #define STRING_FALSE "false" // 是否打开GVL调试开关(界面自动填充测试数据) //#define DEBUG_ON_GVL // 自定义警告信息 #define vDebug() qDebug() << "[" << __FUNCTION__ << ":" << __LINE__ << "]" #define vWarning() qWarning() << "[" << __FUNCTION__ << ":" << __LINE__ << "]" const unsigned char g_revision_date[12] = __DATE__; const unsigned char g_revision_time[16] = __TIME__;