ScriptObject.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #if !defined _SCRIPTOBJECT_H_
  2. #define _SCRIPTOBJECT_H_
  3. #include "computer.h"
  4. // 定义一个脚本存储结构体
  5. class ScriptParam: public CObject
  6. {
  7. public:
  8. CRealComputer m_calc; // 用来计算脚本条件的计算器
  9. BOOL m_bValid; // 是否投入运行
  10. BOOL m_bCircle; // 是否循环运行
  11. BOOL m_bCondition; // 是否条件运行
  12. int m_curcleTime; // 循环时间
  13. CString m_strExpression; // 条件表达式
  14. CString m_strScript; // 脚本
  15. SYSTEMTIME m_stLastRunTime; //上次运行时间
  16. public:
  17. BOOL ShouldRun(); // 是否应该运行
  18. ScriptParam();
  19. };
  20. typedef CTypedPtrList<CObList, ScriptParam*> ScriptParamList;
  21. // 脚本执行类
  22. class CScriptObject : public CCmdTarget
  23. {
  24. DECLARE_DYNCREATE(CScriptObject)
  25. CScriptObject();
  26. // Attributes
  27. public:
  28. // Operations
  29. public:
  30. // Overrides
  31. // ClassWizard generated virtual function overrides
  32. //{{AFX_VIRTUAL(CScriptObject)
  33. public:
  34. virtual void OnFinalRelease();
  35. //}}AFX_VIRTUAL
  36. // Implementation
  37. public:
  38. virtual ~CScriptObject();
  39. // Generated message map functions
  40. //{{AFX_MSG(CScriptObject)
  41. // NOTE - the ClassWizard will add and remove member functions here.
  42. //}}AFX_MSG
  43. protected:
  44. DECLARE_MESSAGE_MAP()
  45. // Generated OLE dispatch map functions
  46. //{{AFX_DISPATCH(CScriptObject)
  47. afx_msg double GetYCValue(LPCTSTR varName);
  48. afx_msg void SetYCValue(LPCTSTR varName, double value);
  49. afx_msg short GetYXValue(LPCTSTR varName);
  50. afx_msg void SetYXValue(LPCTSTR varName, short value);
  51. afx_msg double ShowResult(LPCTSTR prompt);
  52. afx_msg void Sleeps(short mSeconds);
  53. //}}AFX_DISPATCH
  54. DECLARE_DISPATCH_MAP()
  55. DECLARE_INTERFACE_MAP()
  56. };
  57. /////////////////////////////////////////////////////////////////////////////
  58. //{{AFX_INSERT_LOCATION}}
  59. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  60. #endif // _SCRIPTOBJECT_H_