stdafx.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. // stdafx.h : 标准系统包含文件的包含文件,
  2. // 或是经常使用但不常更改的
  3. // 特定于项目的包含文件
  4. //
  5. #pragma once
  6. #include "targetver.h"
  7. #define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的信息
  8. // Windows 头文件:
  9. #include <functional>
  10. #include <map>
  11. #include <list>
  12. #include <algorithm>
  13. #include "common_api.h"
  14. #include "LocalConfig.h"
  15. // TODO: 在此处引用程序需要的其他头文件
  16. //条件常量
  17. #pragma region "StateMachineDevicePool.h"
  18. //mqtt定义
  19. #define ClientType_Notify "StateMachine_Notify"
  20. #define ClientType_Action "StateMachine_Action"
  21. #define ClientPath_Root "ccosChannel"
  22. //话题定义
  23. #define ClientTopic_NotifyInterval "/Notify/"
  24. #define ClientTopic_ActionInterval "/Action/"
  25. #pragma endregion
  26. #pragma region "ExpressionTranslation.h"
  27. //表达式主要符号定义
  28. #define OperatorType_Relational_Big ">" //大于
  29. #define OperatorType_Relational_BigAnd ">=" //大于等于
  30. #define OperatorType_Relational_Small "<" //小于
  31. #define OperatorType_Relational_SmallAnd "<=" //小于等于
  32. #define OperatorType_Relational_Equal "=" //等于
  33. #define OperatorType_Relational_NotEqual "!=" //不等于
  34. #define OperatorType_Relational_IN "<>" //在集合中,包含左右极限值,例如:2.2<>2,3,4,5 结果为:false
  35. #define OperatorType_Relational_NotIN "<!>" //不在集合中,不包含左右极限值,例如:6<!>2,3,4,5 结果为:true
  36. #define OperatorType_Relational_Between "[]" //在之间,包含左右极限值,例如:2.3[]2,5 结果为:true
  37. #define OperatorType_Relational_NotBetween "[!]" //不在之间,不包含左右极限值,例如:3[!]2,5 结果为:false
  38. #define OperatorType_Logical_EndOfExpression '#' //标识表达式解析结束
  39. #define OperatorType_Logical_LeftBracket '(' //左括号
  40. #define OperatorType_Logical_RightBracket ')' //右括号
  41. #define OperatorType_Logical_And '&' //逻辑与
  42. #define OperatorType_Logical_Or '|' //逻辑或
  43. #define OperatorType_Arithmetic_Add '+' //加
  44. #define OperatorType_Arithmetic_Subtract '-' //减
  45. #define OperatorType_Arithmetic_Multiply '*' //乘
  46. #define OperatorType_Arithmetic_Divide '/' //除
  47. #pragma endregion
  48. //工作流配置定义
  49. #define ConfItem_delim ':' //key、value分隔符
  50. #define ConfItem_split ',' //数值集合分隔符
  51. #define ConfItem_MachineName "MachineName" //工作流名称
  52. #define ConfItem_Variable "Variable" //系统变量
  53. #define ConfItem_DevList "DeviceList" //设备集
  54. #define ConfItem_States "States" //状态集
  55. #define ConfItem_Events "Events" //事件集
  56. #define ConfItem_Begin "Begin" //头事件
  57. #define ConfItem_End "End" //尾事件
  58. #define ConfItem_Actions "Actions" //动作集
  59. #define ConfItem_Type "Type" //事件类型
  60. #define ConfItem_From "From" //事件触发源头
  61. #define ConfItem_To "To" //事件触发目标
  62. #define ConfItem_Value "Value" //值
  63. #define ConfItem_CONTEXT "CONTEXT" //
  64. //事件类型
  65. #define EventType_Conditions "Conditions" //条件型事件
  66. #define EventType_Timeout "Timeout" //超时事件
  67. #define EventType_External "External" //直接跳转事件
  68. //设备类型
  69. #define DeviceType_Generator "Generator" //
  70. #define DeviceType_Detector "Detector" //
  71. #define DeviceType_SynBox "SynBox" //
  72. #define DeviceType_Mechanical "Machine" //
  73. #define DeviceType_Collimator "Collimator" //
  74. #define DeviceType_DAP "DAP" //
  75. #define DeviceType_ImageSave "ImageSave" //
  76. #define DeviceType_ImageView "ImageView" //
  77. #define DeviceType_Subsystem "Subsystem" //
  78. #define DeviceType_AGD "AGD" //
  79. //状态机常量
  80. #define STATEMACHINE_MaxWaitEventList 40 //最大64
  81. #define STATEMACHINE_DefState_TIMEOUT (2500)
  82. #define STATEMACHINE_Action_TIMEOUT (2000)
  83. //公共的功能型方法
  84. vector<string> stringSplit(const string& str, char delim); //字符串分割
  85. bool IsDigit(const string& str); //判断是否是数字