123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- // stdafx.h : 标准系统包含文件的包含文件,
- // 或是经常使用但不常更改的
- // 特定于项目的包含文件
- //
- #pragma once
- #include "targetver.h"
- #define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的信息
- // Windows 头文件:
- #include <functional>
- #include <map>
- #include <list>
- #include <algorithm>
- #include "common_api.h"
- #include "LocalConfig.h"
- // TODO: 在此处引用程序需要的其他头文件
- //条件常量
- #pragma region "StateMachineDevicePool.h"
- //mqtt定义
- #define ClientType_Notify "StateMachine_Notify"
- #define ClientType_Action "StateMachine_Action"
- #define ClientPath_Root "ccosChannel"
- //话题定义
- #define ClientTopic_NotifyInterval "/Notify/"
- #define ClientTopic_ActionInterval "/Action/"
- #pragma endregion
- #pragma region "ExpressionTranslation.h"
- //表达式主要符号定义
- #define OperatorType_Relational_Big ">" //大于
- #define OperatorType_Relational_BigAnd ">=" //大于等于
- #define OperatorType_Relational_Small "<" //小于
- #define OperatorType_Relational_SmallAnd "<=" //小于等于
- #define OperatorType_Relational_Equal "=" //等于
- #define OperatorType_Relational_NotEqual "!=" //不等于
- #define OperatorType_Relational_IN "<>" //在集合中,包含左右极限值,例如:2.2<>2,3,4,5 结果为:false
- #define OperatorType_Relational_NotIN "<!>" //不在集合中,不包含左右极限值,例如:6<!>2,3,4,5 结果为:true
- #define OperatorType_Relational_Between "[]" //在之间,包含左右极限值,例如:2.3[]2,5 结果为:true
- #define OperatorType_Relational_NotBetween "[!]" //不在之间,不包含左右极限值,例如:3[!]2,5 结果为:false
- #define OperatorType_Logical_EndOfExpression '#' //标识表达式解析结束
- #define OperatorType_Logical_LeftBracket '(' //左括号
- #define OperatorType_Logical_RightBracket ')' //右括号
- #define OperatorType_Logical_And '&' //逻辑与
- #define OperatorType_Logical_Or '|' //逻辑或
- #define OperatorType_Arithmetic_Add '+' //加
- #define OperatorType_Arithmetic_Subtract '-' //减
- #define OperatorType_Arithmetic_Multiply '*' //乘
- #define OperatorType_Arithmetic_Divide '/' //除
- #pragma endregion
- //工作流配置定义
- #define ConfItem_delim ':' //key、value分隔符
- #define ConfItem_split ',' //数值集合分隔符
- #define ConfItem_MachineName "MachineName" //工作流名称
- #define ConfItem_Variable "Variable" //系统变量
- #define ConfItem_DevList "DeviceList" //设备集
- #define ConfItem_States "States" //状态集
- #define ConfItem_Events "Events" //事件集
- #define ConfItem_Begin "Begin" //头事件
- #define ConfItem_End "End" //尾事件
- #define ConfItem_Actions "Actions" //动作集
- #define ConfItem_Type "Type" //事件类型
- #define ConfItem_From "From" //事件触发源头
- #define ConfItem_To "To" //事件触发目标
- #define ConfItem_Value "Value" //值
- #define ConfItem_CONTEXT "CONTEXT" //
- //事件类型
- #define EventType_Conditions "Conditions" //条件型事件
- #define EventType_Timeout "Timeout" //超时事件
- #define EventType_External "External" //直接跳转事件
- //设备类型
- #define DeviceType_Generator "Generator" //
- #define DeviceType_Detector "Detector" //
- #define DeviceType_SynBox "SynBox" //
- #define DeviceType_Mechanical "Machine" //
- #define DeviceType_Collimator "Collimator" //
- #define DeviceType_DAP "DAP" //
- #define DeviceType_ImageSave "ImageSave" //
- #define DeviceType_ImageView "ImageView" //
- #define DeviceType_Subsystem "Subsystem" //
- #define DeviceType_AGD "AGD" //
- //状态机常量
- #define STATEMACHINE_MaxWaitEventList 40 //最大64
- #define STATEMACHINE_DefState_TIMEOUT (2500)
- #define STATEMACHINE_Action_TIMEOUT (2000)
- //公共的功能型方法
- vector<string> stringSplit(const string& str, char delim); //字符串分割
- bool IsDigit(const string& str); //判断是否是数字
|