diff --git a/dll/commdll.dll b/dll/commdll.dll index aa520aa..90c870a 100644 Binary files a/dll/commdll.dll and b/dll/commdll.dll differ diff --git a/dll/commdllD.dll b/dll/commdllD.dll index 1f39abd..862146f 100644 Binary files a/dll/commdllD.dll and b/dll/commdllD.dll differ diff --git a/dll/iodll.dll b/dll/iodll.dll index 7c0462b..84e3e68 100644 Binary files a/dll/iodll.dll and b/dll/iodll.dll differ diff --git a/dll/iodllD.dll b/dll/iodllD.dll index 712baf9..deac690 100644 Binary files a/dll/iodllD.dll and b/dll/iodllD.dll differ diff --git a/dll/mcctrdll.dll b/dll/mcctrdll.dll index bd73b71..99ee5bb 100644 Binary files a/dll/mcctrdll.dll and b/dll/mcctrdll.dll differ diff --git a/dll/mcctrdllD.dll b/dll/mcctrdllD.dll index 7f78e4f..a4751e7 100644 Binary files a/dll/mcctrdllD.dll and b/dll/mcctrdllD.dll differ diff --git a/dll/secsgemdll.dll b/dll/secsgemdll.dll index 2091732..7e77332 100644 Binary files a/dll/secsgemdll.dll and b/dll/secsgemdll.dll differ diff --git a/dll/secsgemdllD.dll b/dll/secsgemdllD.dll index 8ead453..307cfc5 100644 Binary files a/dll/secsgemdllD.dll and b/dll/secsgemdllD.dll differ diff --git a/dll/utility.dll b/dll/utility.dll index 1338123..dbb8388 100644 Binary files a/dll/utility.dll and b/dll/utility.dll differ diff --git a/dll/utilityD.dll b/dll/utilityD.dll index f1ee670..560ecb4 100644 Binary files a/dll/utilityD.dll and b/dll/utilityD.dll differ diff --git a/iodll/Include/HardwareIni.h b/iodll/Include/HardwareIni.h index d565bf4..3cc7da3 100644 --- a/iodll/Include/HardwareIni.h +++ b/iodll/Include/HardwareIni.h @@ -290,9 +290,9 @@ public: void RegisterAxisHandle(const CMtrProfile& mtrProfile, UINT_PTR hAxis); UINT_PTR GetAxisHandle(const CMtrProfile& mtrProfile); - bool m_bTraceData; + bool m_bTraceData{ false }; - bool m_bBenchDebug; + bool m_bBenchDebug{ false }; protected: // for 8134 diff --git a/iodll/Include/Input.h b/iodll/Include/Input.h index 6b65d4d..08ab3e1 100644 --- a/iodll/Include/Input.h +++ b/iodll/Include/Input.h @@ -15,27 +15,15 @@ class IODLLCLASS CInputSetting { public: - // configuration - // CInputSetting() : - // m_szName(nullptr), - // m_szModuleName(nullptr), - // m_bLogic(FALSE), - // m_nPointNo(0), - // m_nSlaveID(0), - // m_nPtrNo(0), - // m_nBoardType(0), - // m_nCardNo(0) - //{ - //} std::string m_strName; std::string m_strModuleName; - BOOL m_bLogic; - int m_nPointNo; - int m_nSlaveID; - int m_nPtrNo; - int m_nBoardType; - int m_nCardNo; + BOOL m_bLogic{FALSE}; + int m_nPointNo{ 0 }; + int m_nSlaveID{ 0 }; + int m_nPtrNo{ 0 }; + int m_nBoardType{ 0 }; + int m_nCardNo{ 0 }; }; class IODLLCLASS CInput : public CCard @@ -92,5 +80,5 @@ public: unsigned long ReadCounter(); private: - CInputBase* m_inputBase; + CInputBase* m_inputBase{ nullptr }; }; diff --git a/iodll/Include/InputBase.h b/iodll/Include/InputBase.h index 253d6d8..b236fbc 100644 --- a/iodll/Include/InputBase.h +++ b/iodll/Include/InputBase.h @@ -89,17 +89,17 @@ public: BOOL Wait(BOOL bState, DWORD dwDebounce, DWORD dwTimeout); - CEvent m_evtCheck; - CEvent m_evtKillThread; - DWORD m_dwDebounce; - DWORD m_dwTimeout; - BOOL m_bWaitState; + CEvent m_evtCheck{ FALSE, TRUE, NULL, NULL }; + CEvent m_evtKillThread{ FALSE, TRUE, NULL, NULL }; + DWORD m_dwDebounce{ 0 }; + DWORD m_dwTimeout{ 0 }; + BOOL m_bWaitState{ FALSE }; // input ON event when using thread to wait upon ON State - CEvent m_evtOn; + CEvent m_evtOn{ FALSE, TRUE, NULL, NULL }; // input OFF event when using thread to wait upon OFF State - CEvent m_evtOff; + CEvent m_evtOff{ FALSE, TRUE, NULL, NULL }; std::string GetName(void); @@ -137,9 +137,9 @@ protected: // the input card ID int m_nCardID; - CWinThread* m_pThread; - BOOL m_bAbortCheck; - BOOL m_bThreadChecking; + CWinThread* m_pThread{ nullptr }; + BOOL m_bAbortCheck{ FALSE }; + BOOL m_bThreadChecking{ FALSE }; // currently these 2 functions are for 9112 and 9222 cards bool IsDigitalInput(int nPt); diff --git a/iodll/Include/InputController.h b/iodll/Include/InputController.h index 272eec7..8bfa830 100644 --- a/iodll/Include/InputController.h +++ b/iodll/Include/InputController.h @@ -3,11 +3,12 @@ ////////////////////////////////////////////////////////////////////// #pragma once +#include +#include + #include "hardwareini.h" #include "InputControllerBase.h" -#include - #ifdef BUILD_IODLL #define IODLLCLASS __declspec(dllexport) #else @@ -75,18 +76,18 @@ public: return m_bsimIo; } - bool m_bsimIo; // m_bsimIo - simIo + bool m_bsimIo{ false }; // m_bsimIo - simIo private: - CInputControllerBase* m_inputControllerBase[MAX_INPUT_CARD_TYPE]; + std::array m_inputControllerBase{}; - int m_nNoOfCardType; + int m_nNoOfCardType{ 0 }; CHardwareIni m_iniHardware; std::vector m_vecCard; static CInputController* instance; - CWinThread* m_pThread; + CWinThread* m_pThread{ nullptr }; CEvt m_evtTerminate; - CEvt m_evtStartUpdate; + CEvt m_evtStartUpdate{ "INPUT CONTROLLER START UPDATE" }; }; diff --git a/iodll/Include/MotionController.h b/iodll/Include/MotionController.h index 2b3ea81..eda4693 100644 --- a/iodll/Include/MotionController.h +++ b/iodll/Include/MotionController.h @@ -41,8 +41,8 @@ public: friend UINT MotionThreadFn(LPVOID pParam); // static void SetGalilMotionInt(int nAxisNo); - BOOL IsInPosition(CMtrProfile mtrProfile); - unsigned short GetMotionIOStatus(CMtrProfile mtrProfile); + BOOL IsInPosition(const CMtrProfile& mtrProfile); + unsigned short GetMotionIOStatus(const CMtrProfile& mtrProfile); CMotionController(); virtual ~CMotionController(); @@ -51,31 +51,31 @@ public: // check if negative limit hit // BOOL IsNegLimHit(int iMotorNo); - BOOL IsNegLimHit(CMtrProfile mtrProfile); + BOOL IsNegLimHit(const CMtrProfile& mtrProfile); // check if positive limit hit // BOOL IsPosLimHit(int iMotorNo); - BOOL IsPosLimHit(CMtrProfile mtrProfile); + BOOL IsPosLimHit(const CMtrProfile& mtrProfile); // check if motor at home position // BOOL IsHomed(int iMotorNo); - BOOL IsHomed(CMtrProfile mtrProfile); + BOOL IsHomed(const CMtrProfile& mtrProfile); // check if servo ready // BOOL IsServoReady(int iMotorNo); - BOOL IsServoReady(CMtrProfile mtrProfile); + BOOL IsServoReady(const CMtrProfile& mtrProfile); // check if servo alarm // BOOL IsServoAlarm(int iMotorNo); - BOOL IsServoAlarm(CMtrProfile mtrProfile); + BOOL IsServoAlarm(const CMtrProfile& mtrProfile); // get Motor Pos value // double GetMtrPos(int iMotorNo); - double GetMtrPos(CMtrProfile mtrProfile); + double GetMtrPos(const CMtrProfile& mtrProfile); // get Motion status of motor // int GetMotionStatus(int iMotorNo); - int GetMotionStatus(CMtrProfile mtrProfile); + int GetMotionStatus(const CMtrProfile& mtrProfile); // get proportional gain value double GetPValue(int iMotorNo); @@ -88,10 +88,10 @@ public: // get position error value // double GetPosErr(int iMotorNo); - double GetPosErr(CMtrProfile mtrProfile); + double GetPosErr(const CMtrProfile& mtrProfile); // check if Motor type is servo motor - BOOL IsServoMtrType(CMtrProfile mtrProfile); + BOOL IsServoMtrType(const CMtrProfile& mtrProfile); // copy all motor status void CopyMtrStatus(); @@ -103,7 +103,7 @@ public: bool IsMtrOnOffStateChanged(int iMtrNo, bool& bOnOffState); // check if motor is on - BOOL IsMtrOn(CMtrProfile mtrProfile); + BOOL IsMtrOn(const CMtrProfile& mtrProfile); /* Return Motor(specify by iMtrNo) on or off state. Function Return true = Motor specify by iMtrNo Is On, else return false = Motor is off */ @@ -129,16 +129,16 @@ private: CMtrOnOff m_mtrOnOff; // object to keep track of current motor On/Off States std::vector m_vecMtrCurPos; // array to store motor position before maintenance mode std::vector m_vecMtrCurOnOff; // array to store motor On/Off States before maintenance mode - int m_iNoOfMtr; // total no of motor - int m_nNoOfCardType; + int m_iNoOfMtr{ 0 }; // total no of motor + int m_nNoOfCardType{ 0 }; CHardwareIni m_iniHardware; bool m_bBenchDebugWithActualHardware; static CMotionController* m_pInstance; - CWinThread* m_pThread; + CWinThread* m_pThread{ nullptr }; CEvt m_evtTerminate; - CEvt m_evtStartUpdate; + CEvt m_evtStartUpdate{ "MOTION CONTROLLER START UPDATE" }; }; diff --git a/iodll/Include/Motor.h b/iodll/Include/Motor.h index d945ca3..ec303c2 100644 --- a/iodll/Include/Motor.h +++ b/iodll/Include/Motor.h @@ -241,8 +241,6 @@ private: int m_iMtrNo; // keep track motor number - // CMemoryState msBeforeCall, msAfterCall, memDifference; - enum { NO_SPECIFIC_MOTOR = -1, diff --git a/iodll/Include/Output.h b/iodll/Include/Output.h index 063f3ab..3e3d39e 100644 --- a/iodll/Include/Output.h +++ b/iodll/Include/Output.h @@ -15,29 +15,15 @@ class IODLLCLASS COutputSetting { public: - // configuration - // COutputSetting() : - // m_szName(nullptr), - // m_szModuleName(nullptr), - // m_bLogic(FALSE), - // m_nPointNo(0), - // m_nSlaveID(0), - // m_nPtrNo(0), - // m_nBoardType(0), - // m_bEnableCheck(FALSE), - // m_nCardNo(0) - //{ - //} - std::string m_strName; std::string m_strModuleName; - BOOL m_bLogic; - int m_nPointNo; - int m_nSlaveID; - int m_nPtrNo; - int m_nBoardType; - BOOL m_bEnableCheck; - int m_nCardNo; + BOOL m_bLogic{ FALSE }; + int m_nPointNo{ 0 }; + int m_nSlaveID{ 0 }; + int m_nPtrNo{ 0 }; + int m_nBoardType{ 0 }; + BOOL m_bEnableCheck{ FALSE }; + int m_nCardNo{ 0 }; }; class IODLLCLASS COutput : public CCard diff --git a/iodll/Include/OutputController.h b/iodll/Include/OutputController.h index af289fc..c3965d1 100644 --- a/iodll/Include/OutputController.h +++ b/iodll/Include/OutputController.h @@ -3,6 +3,7 @@ ////////////////////////////////////////////////////////////////////// #pragma once +#include #include #include @@ -59,7 +60,7 @@ public: std::vector m_vecOutputArray; // to keep track output state array size - int m_iOutputStateArraySize; + int m_iOutputStateArraySize{ 0 }; CMutex m_OutputMutex; @@ -84,16 +85,16 @@ public: bool m_bsimIo; // m_bsimIo - simIo private: - COutputControllerBase* m_outputControllerBase[MAX_OUTPUT_CARD_TYPE]; + std::array m_outputControllerBase{}; - int m_nNoOfCardType; + int m_nNoOfCardType{ 0 }; CHardwareIni m_iniHardware; std::vector m_vecCard; static COutputController* instance; - CWinThread* m_pThread; + CWinThread* m_pThread{ nullptr }; CEvt m_evtTerminate; - CEvt m_evtStartUpdate; + CEvt m_evtStartUpdate{ "OUTPUT CONTROLLER START UPDATE" }; }; diff --git a/iodll/lib/iodll.lib b/iodll/lib/iodll.lib index 76ccedb..055b03a 100644 Binary files a/iodll/lib/iodll.lib and b/iodll/lib/iodll.lib differ diff --git a/iodll/lib/iodllD.lib b/iodll/lib/iodllD.lib index 4057142..5bc7ba4 100644 Binary files a/iodll/lib/iodllD.lib and b/iodll/lib/iodllD.lib differ diff --git a/mcctrdll/Include/EquipState.h b/mcctrdll/Include/EquipState.h index 206557c..51441b2 100644 --- a/mcctrdll/Include/EquipState.h +++ b/mcctrdll/Include/EquipState.h @@ -8,14 +8,6 @@ #include "TimeEquipSubState.h" -/* - #ifdef BUILD_MCCTRDLL - #define MCCTRDLLCLASS __declspec(dllexport) - #else - #define MCCTRDLLCLASS __declspec(dllimport) - #endif - - class MCCTRDLLCLASS CEquipState*/ class CEquipState { public: @@ -91,8 +83,8 @@ public: START_ALL_TIMER_EVT, // Possible to start all timer? need to have this event? }; - static std::string m_csKeyName[MAX_EQUIPMENT_SUBSTATE]; // key name of debug info file - static const char* sSectionName[MAX_EQUIP_STATE]; // Section name of debug info file + static std::array m_csKeyName; // key name of debug info file + static std::array sSectionName; // Section name of debug info file protected: // set equipment state time @@ -128,13 +120,9 @@ protected: // add equipment SubState time virtual void AddEquipSubStateTime(int iEquipSubStateNo, LONGLONG lTimeSpan); - // int *m_iEvt; - - // CTimeEquipSubState *m_ctesEquipSubState; - std::array m_iEvt; - std::array < CTimeEquipSubState, MAX_EQUIP_SUB_STATE> m_ctesEquipSubState; + std::array m_ctesEquipSubState; private: // prevent accidental copy diff --git a/mcctrdll/Include/SemiE10.h b/mcctrdll/Include/SemiE10.h index b0c8c9d..6bac286 100644 --- a/mcctrdll/Include/SemiE10.h +++ b/mcctrdll/Include/SemiE10.h @@ -10,62 +10,41 @@ #include "IniFile.h" #include "DllDefines.h" +/* +* @brief csTimeName formerly used for monolithic UI +*/ class StTime { public: - StTime() - { - dTime = 0.0; - } - - char csTimeName[50]{ 0 }; - double dTime; + std::string csTimeName{}; + double dTime{ 0.0 }; }; class StRamTime { public: - StRamTime() - { - dTime = 0.0; - } - - char csTimeName[50]{ 0 }; - double dTime; + std::string csTimeName{}; + double dTime{ 0.0 }; }; class StInterrupt { public: - StInterrupt() - { - dInterruptTime = 0.0; - } - - char csInterruptName[50]{ 0 }; - double dInterruptTime; + std::string csInterruptName{}; + double dInterruptTime{ 0.0 }; }; class StLong { public: - StLong() - { - lCount = 0; - } - - char csTimeName[50]; - long lCount; + std::string csTimeName{}; + long lCount{ 0 }; }; class StOleDateTime { public: - StOleDateTime() - { - } - - char csTimeName[50]{ 0 }; + std::string csTimeName{ }; COleDateTime odtDateTime; }; @@ -119,13 +98,13 @@ public: OLE_DATE_TIME, }; - StTime stTime[CEquipState::MAX_EQUIPMENT_SUBSTATE]; - StTime stEquipStateTime[CEquipState::MAX_EQUIP_STATE]; - StRamTime stRamTime[MAX_RAM_MEASUREMENT]; + std::array stTime; + std::array stEquipStateTime; + std::array stRamTime; - StInterrupt stInterrupt[MAX_INTERRUPT]; - StLong stLong[MAX_CNT]; - StOleDateTime stOleDateTime[MAX_OLE_DATE_TIME]; + std::array stInterrupt; + std::array stLong; + std::array stOleDateTime; }; class MCCTRDLLCLASS CSemiE10 diff --git a/mcctrdll/lib/mcctrdll.lib b/mcctrdll/lib/mcctrdll.lib index 4852940..4518994 100644 Binary files a/mcctrdll/lib/mcctrdll.lib and b/mcctrdll/lib/mcctrdll.lib differ diff --git a/mcctrdll/lib/mcctrdllD.lib b/mcctrdll/lib/mcctrdllD.lib index 61682f0..7748deb 100644 Binary files a/mcctrdll/lib/mcctrdllD.lib and b/mcctrdll/lib/mcctrdllD.lib differ diff --git a/secsgemdll/lib/secsgemdll.lib b/secsgemdll/lib/secsgemdll.lib index ed599c7..9325fc3 100644 Binary files a/secsgemdll/lib/secsgemdll.lib and b/secsgemdll/lib/secsgemdll.lib differ