From f5fa7d2058fec2342c3e3e3955089b8f9f9a630f Mon Sep 17 00:00:00 2001 From: LAPTOP-T815PCOQ\25526 <mr.liuyang@126.com> Date: 星期五, 10 一月 2025 15:02:15 +0800 Subject: [PATCH] 1. 添加IO模块 --- SourceCode/Bond/BoounionPLC/Model.h | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/SourceCode/Bond/BoounionPLC/Model.h b/SourceCode/Bond/BoounionPLC/Model.h index 5ea3814..cbdf836 100644 --- a/SourceCode/Bond/BoounionPLC/Model.h +++ b/SourceCode/Bond/BoounionPLC/Model.h @@ -16,9 +16,13 @@ int init(); int term(); void onTimer(UINT nTimerid); - std::map<std::string, CPLC*>& gtPlcMap(); + std::map<std::string, CPLC*>& getPlcMap(); int addPlc(const char* pszName, const char* pszIp, const unsigned int port); int removePlc(const char* pszName); + + // 设置/获取当前PLC + void setCurrentPlc(CPLC* pPlc); + CPLC* getCurrentPlc(); public: int notify(int code); @@ -34,15 +38,25 @@ int notifyTextAndInt(int code, const char* pszText, int exCode); int notifyMesMsg(int code, int stream, int function, const char* pszText); +private: + void readPLCDataRegularly(); + public: CConfiguration m_configuration; +private: + int m_nVelocityRatio; // 速度比 + double m_dTactTime; // 周期时间 + int m_nDayShiftCapacity; // 白班产能 + int m_nNightShiftCapacity; // 夜班产能 + bool m_bBlBtnsStates[7]; // PLC View按钮状态 private: IObservable* m_pObservable; IObservableEmitter* m_pObservableEmitter; CString m_strWorkDir; std::map<std::string, CPLC*> m_mapPlc; + std::string m_strCurrPlc; private: int m_nTimerID; -- Gitblit v1.9.3