add close app handling

main
Yik Teng Hie 2 years ago
parent aaba048d74
commit 6f78bc60a9

@ -80,28 +80,14 @@ struct stPackageInfo
// Light Config // Light Config
typedef struct _LIGHT_CONFIG { typedef struct _LIGHT_CONFIG {
int iRed; int iRed{ 1 };
int iAmber; int iAmber{ 1 };
int iGreen; int iGreen{ 1 };
int iBuzzer; int iBuzzer{ 0 };
int iLightOnTime; int iLightOnTime{ 500 };
int iLightOffTime; int iLightOffTime{ 500 };
int iBuzzerOnTime; int iBuzzerOnTime{ 500 };
int iBuzzerOffTime; int iBuzzerOffTime{ 500 };
// ctor
_LIGHT_CONFIG()
{
iRed = 1;
iAmber = 1;
iGreen = 1;
iBuzzer = 0;
iLightOnTime = 500;
iLightOffTime = 500;
iBuzzerOnTime = 500;
iBuzzerOffTime = 500;
};
} LIGHT_CONFIG; } LIGHT_CONFIG;

@ -26,6 +26,8 @@
#define WM_ON_SEND_SECGEM_EVENT (WM_USER + WM_USR_DEF_GAP + 19) // 2043 #define WM_ON_SEND_SECGEM_EVENT (WM_USER + WM_USR_DEF_GAP + 19) // 2043
// ems status // ems status
#define WM_ON_EMS_STATUS (WM_USER + WM_USR_DEF_GAP + 20) // 2044 #define WM_ON_EMS_STATUS (WM_USER + WM_USR_DEF_GAP + 20) // 2044
// App Close request from WPF UI
#define WM_ON_APP_CLOSE_REQ (WM_USER + WM_USR_DEF_GAP + 21) // 2045
// //
#define WM_ON_REQUEST_SEND_MESSAGE_TO_ALL_PROPERTY_PAGES (WM_USER + WM_USR_DEF_GAP + 30) // 2054 #define WM_ON_REQUEST_SEND_MESSAGE_TO_ALL_PROPERTY_PAGES (WM_USER + WM_USR_DEF_GAP + 30) // 2054

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -4,6 +4,8 @@
#pragma once #pragma once
#include <array>
#include "cmnhdr.h" #include "cmnhdr.h"
#include "RunTask.h" #include "RunTask.h"
#include "Input.h" #include "Input.h"
@ -23,7 +25,7 @@ class MCCTRDLLCLASS CCheckSwitch : public CRunTask
{ {
public: public:
bool SetOuputState(int nOutput, bool bState); bool SetOuputState(int nOutput, bool bState);
void DoorLock(bool bLock = TRUE); void DoorLock(bool bLock = true);
bool IsEngineeringBypass(); bool IsEngineeringBypass();
bool IsCurtainBypass(); bool IsCurtainBypass();
bool IsDoorBypass(); bool IsDoorBypass();
@ -31,9 +33,9 @@ public:
bool IsHardwareBypass(); bool IsHardwareBypass();
bool IsStopButtonActivated(); bool IsStopButtonActivated();
void InitParameters(); void InitParameters();
void BypassEngineering(bool bBypass = TRUE); void BypassEngineering(bool bBypass = true);
void BypassCurtain(bool bBypass = TRUE); void BypassCurtain(bool bBypass = true);
void BypassDoor(bool bBypass = TRUE); void BypassDoor(bool bBypass = true);
void SetSystemOutput(int nOutput, COutput* copOutputPt); void SetSystemOutput(int nOutput, COutput* copOutputPt);
CCheckSwitch(CRunCtrl* pRunCtrl); CCheckSwitch(CRunCtrl* pRunCtrl);
@ -57,10 +59,10 @@ private:
void GetMainApp(); void GetMainApp();
void CheckSwitch(int nSwitchNo, CInput* cipSwitch, stMSG_SEND* pMsgSend); void CheckSwitch(int nSwitchNo, CInput* cipSwitch, stMSG_SEND* pMsgSend);
bool m_bSafetySwitch[SWITCH_SYSTEM]; std::array<bool, SWITCH_SYSTEM> m_bSafetySwitch;
CInput* m_cipSwitch[SWITCH_SYSTEM]; std::array<CInput*, SWITCH_SYSTEM> m_cipSwitch;
stMSG_SEND m_stMsgSend[SWITCH_SYSTEM]; std::array < stMSG_SEND, SWITCH_SYSTEM> m_stMsgSend;
COutput* m_copSystemDoor; COutput* m_copSystemDoor;
COutput* m_copCurtainSensorReset; COutput* m_copCurtainSensorReset;

@ -3,6 +3,7 @@
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#pragma once #pragma once
#include <array>
#include <string> #include <string>
#include "TimeEquipSubState.h" #include "TimeEquipSubState.h"
@ -131,9 +132,9 @@ protected:
// CTimeEquipSubState *m_ctesEquipSubState; // CTimeEquipSubState *m_ctesEquipSubState;
int m_iEvt[MAX_EQUIP_SUB_STATE]; std::array<int, MAX_EQUIP_SUB_STATE> m_iEvt;
CTimeEquipSubState m_ctesEquipSubState[MAX_EQUIP_SUB_STATE]; std::array < CTimeEquipSubState, MAX_EQUIP_SUB_STATE> m_ctesEquipSubState;
private: private:
// prevent accidental copy // prevent accidental copy

@ -14,8 +14,8 @@ class MCCTRDLLCLASS CRunTask
{ {
public: public:
DWORD GetThreadPriority(); DWORD GetThreadPriority();
BOOL SetThreadPriority(int nPriority); bool SetThreadPriority(int nPriority);
BOOL IsTerminate(void); bool IsTerminate(void);
CRunTask(); CRunTask();
virtual ~CRunTask(); virtual ~CRunTask();

@ -13,44 +13,27 @@
// //
typedef struct _stNetAddress typedef struct _stNetAddress
{ {
std::string strIpAddress; std::string strIpAddress{ "127.0.0.1" };
int nPort; int nPort{ 400 };
// ctor
_stNetAddress()
{
strIpAddress = "127.0.0.1";
nPort = 4000;
}
} stNetAddress; } stNetAddress;
// //
typedef struct _stComSetting typedef struct _stComSetting
{ {
std::string strCommPort; std::string strCommPort{ "COM1" };
long lBaudRate; long lBaudRate{ 9600 };
std::string strParity; std::string strParity{ "None" };
int nDataBits; int nDataBits{ 8 };
double dStopBits; double dStopBits{ 1.0 };
// ctor
_stComSetting()
{
strCommPort = "COM1";
lBaudRate = 9600;
strParity = "None";
nDataBits = 8;
dStopBits = 1.0;
}
} stComSetting; } stComSetting;
class MCCTRDLLCLASS CRunComm : public CRun class MCCTRDLLCLASS CRunComm : public CRun
{ {
public: public:
int GetPortNo(bool bMaint = FALSE, int nWhichOne = 0); int GetPortNo(bool bMaint = false, int nWhichOne = 0);
std::string GetIpAddress(bool bMaint = FALSE, int nWhichOne = 0); std::string GetIpAddress(bool bMaint = false, int nWhichOne = 0);
CRunComm(int nID, std::string strName, std::vector<struct stModule>& modules, int* iSequenceModuleNo = NULL); CRunComm(int nID, std::string strName, std::vector<struct stModule>& modules, std::vector<int>& iSequenceModuleNo);
virtual ~CRunComm(); virtual ~CRunComm();
enum enum
@ -71,11 +54,11 @@ protected:
bool IsMaintenanceDisconnectPort(); bool IsMaintenanceDisconnectPort();
bool IsMaintenanceConnectPort(); bool IsMaintenanceConnectPort();
bool IsMaintenanceSendPacket(); bool IsMaintenanceSendPacket();
double GetStopBits(bool bMaint = FALSE, int nWhichOne = 0); double GetStopBits(bool bMaint = false, int nWhichOne = 0);
int GetDataBits(bool bMaint = FALSE, int nWhichOne = 0); int GetDataBits(bool bMaint = false, int nWhichOne = 0);
long GetBaudRate(bool bMaint = FALSE, int nWhichOne = 0); long GetBaudRate(bool bMaint = false, int nWhichOne = 0);
std::string GetParity(bool bMaint = FALSE, int nWhichOne = 0); std::string GetParity(bool bMaint = false, int nWhichOne = 0);
std::string GetCommPort(bool bMaint = FALSE, int nWhichOne = 0); std::string GetCommPort(bool bMaint = false, int nWhichOne = 0);
bool GetCommPortSetting(std::string csIniFile, std::string csSectionName, int nWhichOne = 0); bool GetCommPortSetting(std::string csIniFile, std::string csSectionName, int nWhichOne = 0);
bool GetNetworkPortSetting(std::string csIniFile, std::string csSectionName, int nWhichOne = 0); bool GetNetworkPortSetting(std::string csIniFile, std::string csSectionName, int nWhichOne = 0);
// send com data to modules in maintenance mode // send com data to modules in maintenance mode

@ -107,7 +107,7 @@ public:
// //
virtual void OnMcStopped(); virtual void OnMcStopped();
// //
void GetModuleEnable(std::string csFilename, std::string csSectionName, std::string csKeyName); void GetModuleEnable(const std::string& csFilename, const std::string& csSectionName, const std::string& csKeyName);
bool IsModuleEnable(); bool IsModuleEnable();
int GetMaintenanceMoveProfile(); int GetMaintenanceMoveProfile();
void MaintenanceCheckMotorComplete(); // request to start check maintenance motor move complete void MaintenanceCheckMotorComplete(); // request to start check maintenance motor move complete
@ -116,25 +116,25 @@ public:
void EndCloseLot(void); void EndCloseLot(void);
void OnCloseLot(void); void OnCloseLot(void);
void CloseLotComplete(void); void CloseLotComplete(void);
BOOL IsCloseLot(void); bool IsCloseLot(void);
BOOL IsCloseLotComplete(void); bool IsCloseLotComplete(void);
// reset close lot event // reset close lot event
void ResetCloseLot(); void ResetCloseLot();
void Warning(int nID, BOOL bDisplay = FALSE); void Warning(int nID, bool bDisplay = false);
BOOL GetCountJam(void); bool GetCountJam(void);
void PowerUpRestart(void); void PowerUpRestart(void);
void AutoRestart(void); void AutoRestart(void);
BOOL IsJamCode(void); bool IsJamCode(void);
int GetWarning(void); int GetWarning(void);
int GetJam(void); int GetJam(void);
BOOL IsWarning(void); bool IsWarning(void);
BOOL IsPowerUpComplete(void); bool IsPowerUpComplete(void);
void PowerUpComplete(void); void PowerUpComplete(void);
virtual void InitParameters(void); virtual void InitParameters(void);
CRun(int nID, std::string strName, std::vector<struct stModule>& modules, int* iSequenceModuleNo = NULL); CRun(int nID, const std::string& strName, const std::vector<struct stModule>& modules, const std::vector<int>& sequenceModuleNo);
virtual ~CRun(); virtual ~CRun();
// gary 05jun03 // gary 05jun03
@ -148,19 +148,19 @@ public:
return m_nModuleId; return m_nModuleId;
} }
virtual BOOL PowerUpOperation(void); virtual bool PowerUpOperation(void);
virtual BOOL TaskOperation(void); virtual bool TaskOperation(void);
virtual BOOL AutoOperation(void); virtual bool AutoOperation(void);
virtual BOOL MaintenanceOperation(void); virtual bool MaintenanceOperation(void);
void OnPowerUp(void); void OnPowerUp(void);
void OnStop(void); void OnStop(void);
void OnJamReset(void); void OnJamReset(void);
void OnAuto(void); void OnAuto(void);
void OnTask(void); void OnTask(void);
BOOL IsStop(void); bool IsStop(void);
BOOL IsJam(void); bool IsJam(void);
BOOL GetWarningClear(void); bool GetWarningClear(void);
// get warning code // get warning code
int GetWarningCode(); int GetWarningCode();
@ -227,7 +227,7 @@ public:
void ClearAllNoMaterial(); void ClearAllNoMaterial();
// check if jam has not been registered before // check if jam has not been registered before
BOOL IsJamNotRegistered(); bool IsJamNotRegistered();
// open lot has been trigger by GUI // open lot has been trigger by GUI
virtual void OnOpenLot(); virtual void OnOpenLot();
@ -242,13 +242,13 @@ public:
void ClearAutoRestart(); void ClearAutoRestart();
// check if machine has restart // check if machine has restart
BOOL IsAutoRestart(); bool IsAutoRestart();
// clear power up restart // clear power up restart
void ClearPowerUpRestart(); void ClearPowerUpRestart();
// check if machine has restart // check if machine has restart
BOOL IsPowerUpRestart(); bool IsPowerUpRestart();
// send com data to modules in maintenance mode // send com data to modules in maintenance mode
virtual void OnMaintenanceSendCom(LPCTSTR lpcComPort, int iBaudRate, int iDataBits, virtual void OnMaintenanceSendCom(LPCTSTR lpcComPort, int iBaudRate, int iDataBits,
@ -319,9 +319,9 @@ public:
void ClrWarn(); void ClrWarn();
protected: protected:
std::vector<stModule>& m_modules; const std::vector<stModule>& m_modules;
HWND m_hwndMainApp; HWND m_hwndMainApp{nullptr};
int* m_iSequenceModuleNo; // integer array to keep track which module belong to which sequence const std::vector<int>& m_sequenceModuleNo; // integer array to keep track which module belong to which sequence
// get the module ID // get the module ID
int GetModuleId(); int GetModuleId();
@ -370,14 +370,14 @@ private:
std::set<int> m_setWarn; std::set<int> m_setWarn;
// Gary 03jun03 start // Gary 03jun03 start
BOOL m_bWarningClear; bool m_bWarningClear;
BOOL m_bCountJam; bool m_bCountJam;
BOOL m_bJamCode; bool m_bJamCode;
BOOL m_bWarning; bool m_bWarning;
BOOL m_bPowerUpComplete; bool m_bPowerUpComplete;
BOOL m_bJamflag; bool m_bJamflag;
BOOL m_bAutoRestart; bool m_bAutoRestart;
BOOL m_bPowerUpRestart; bool m_bPowerUpRestart;
int m_nMode; int m_nMode;
int m_nPrevMode; int m_nPrevMode;
int m_nState; int m_nState;
@ -392,7 +392,7 @@ private:
int m_state; int m_state;
std::string m_strName; std::string m_strName;
BOOL m_bCloseLotComplete; bool m_bCloseLotComplete;
bool m_bMaintenanceHmMtr; // true = Home Motor in maintenance mode bool m_bMaintenanceHmMtr; // true = Home Motor in maintenance mode

@ -9,6 +9,7 @@
// For Testing // For Testing
#pragma once #pragma once
#include <array>
#include <vector> #include <vector>
#include <string> #include <string>
#include <functional> #include <functional>
@ -54,6 +55,9 @@
#define CMD_JOG _T("JOG") #define CMD_JOG _T("JOG")
#define CMD_MOTOR _T("MOTOR") #define CMD_MOTOR _T("MOTOR")
// close app
#define CMD_CLOSEAPP ("CLOSEAPP")
#define CMD_COM _T("COM") #define CMD_COM _T("COM")
#define CMD_TCP _T("TCP") #define CMD_TCP _T("TCP")
@ -118,6 +122,9 @@ enum TCP_PARAMS
#define STRING_MSG_TASKMODE _T("TASKMODE") #define STRING_MSG_TASKMODE _T("TASKMODE")
#define STRING_MSG_TASKMODE_RESET _T("TASKMODE_RESET") #define STRING_MSG_TASKMODE_RESET _T("TASKMODE_RESET")
#define STRING_MSG_POSTWINMSG ("POSTWINMSG") // format "POSTWINMSG:1000,1,1" or "POSTWINMSG:winMsg,wp,lp"
#define NUM_PARAM_POSTWINMSG 3
#define DEFAULT_MSG_PORT "7468" #define DEFAULT_MSG_PORT "7468"
enum MACHINE_MSG_TYPE enum MACHINE_MSG_TYPE
{ {
@ -175,7 +182,7 @@ const std::string TLightState[MAX_LIGHT_MAX_STATE]{
class MCCTRDLLCLASS CRunCtrl : public CRunTask class MCCTRDLLCLASS CRunCtrl : public CRunTask
{ {
public: public:
CRunCtrl(std::vector<std::unique_ptr<CRun>>& pRuns); CRunCtrl(const std::vector<std::unique_ptr<CRun>>& pRuns, const std::vector<int>& sequenceModuleNo);
~CRunCtrl(); ~CRunCtrl();
protected: protected:
@ -239,16 +246,16 @@ public:
bool IsDoorOpen(); bool IsDoorOpen();
void SetSafetySwitch(int nSwitch, bool bSafety); void SetSafetySwitch(int nSwitch, bool bSafety);
void BypassDoor(BOOL bState); void BypassDoor(bool bState);
void BypassCurtain(BOOL bState); void BypassCurtain(bool bState);
void SetSystemOutput(int nOutput, COutput* pOutput); void SetSystemOutput(int nOutput, COutput* pOutput);
bool IsEngineeringBypass(); bool IsEngineeringBypass();
bool IsCurtainBypass(); bool IsCurtainBypass();
bool IsDoorBypass(); bool IsDoorBypass();
void SetSystemInput(int nSwitch, CInput* pInput); void SetSystemInput(int nSwitch, CInput* pInput);
void ResetPowerUpComplete(void); void ResetPowerUpComplete(void);
void SetModuleWarning(BOOL bState); void SetModuleWarning(bool bState);
void SetSystemWarning(BOOL bState); void SetSystemWarning(bool bState);
void SetIndicator(int nIndicator, COutput* output); void SetIndicator(int nIndicator, COutput* output);
void GetLightStatus(std::vector<int>& vecLight); void GetLightStatus(std::vector<int>& vecLight);
void InitParameters(void); void InitParameters(void);
@ -303,10 +310,10 @@ public:
// Utilities // Utilities
int GetMcState(); int GetMcState();
BOOL IsModified(); bool IsModified();
void DisplayMsg(CDC* pDC, std::string& msg, int xOff, int yOff, BOOL debug = false, BOOL debug_jam = false); void DisplayMsg(CDC* pDC, std::string& msg, int xOff, int yOff, bool debug = false, bool debug_jam = false);
BOOL IsAllPowerUp(void); bool IsAllPowerUp(void);
// open lot // open lot
void OpenLot(); void OpenLot();
@ -388,7 +395,7 @@ public:
void SaveLotInfo(LPCTSTR lpLotNo, LPCTSTR lpCurTime); void SaveLotInfo(LPCTSTR lpLotNo, LPCTSTR lpCurTime);
// get Lot record semie10 timing // get Lot record semie10 timing
StSemiE10 GetLotRecord(std::string csLotNo, std::string csLotStartTime); StSemiE10 GetLotRecord(const std::string& csLotNo, const std::string& csLotStartTime);
// Delete lot record // Delete lot record
void DeleteLotRecord(std::string csLotNumber, double dStartDateTime); void DeleteLotRecord(std::string csLotNumber, double dStartDateTime);
@ -442,11 +449,10 @@ public:
void MaintenanceDisconnectPort(LPCTSTR IpAddress, int iPortNo); void MaintenanceDisconnectPort(LPCTSTR IpAddress, int iPortNo);
// setup SeqRun Module Mapping // setup SeqRun Module Mapping
void SetSequenceModuleNo(const std::vector<int>& vecSeqModuleNo);
int GetSequenceModuleNo(int nModuleIndex); int GetSequenceModuleNo(int nModuleIndex);
// find Gui Window Handler // find Gui Window Handler
void FindGuiWindow(CWnd* pMainWnd = NULL); void FindGuiWindow(CWnd* pMainWnd = nullptr);
// Gui Separator // Gui Separator
void InitGuiSeparator(void); void InitGuiSeparator(void);
@ -465,9 +471,9 @@ public:
// Attributes // Attributes
int m_mcState; int m_mcState;
BOOL m_bDiagnose; bool m_bDiagnose;
BOOL* m_pbMaintenanceMode; bool* m_pbMaintenanceMode;
enum enum
{ {
@ -565,15 +571,15 @@ private:
void InitTowerlightConfig(); void InitTowerlightConfig();
void InitAuthorizationLevel(); void InitAuthorizationLevel();
void InitDisableMessageBuzzer(); void InitDisableMessageBuzzer();
BOOL IsCloseLotComplete(void); bool IsCloseLotComplete(void);
BOOL IsWarning(void); bool IsWarning(void);
// Operations // Operations
void JamResetAllRun(void); void JamResetAllRun(void);
void RestartAllRun(); void RestartAllRun();
void SuspendAllRun(); void SuspendAllRun();
bool ResumeAllRun(); bool ResumeAllRun();
inline void SetMcState(int state); inline void SetMcState(int state);
BOOL IsJam(); bool IsJam();
// Run Time Operations // Run Time Operations
void StartRunTime(); void StartRunTime();
@ -583,13 +589,13 @@ private:
void OnMcStopped(); void OnMcStopped();
// Machine State // Machine State
BOOL CheckMachineState(); bool CheckMachineState();
void SaveMachineState(); void SaveMachineState();
void TaskProcessRxMsgFn(); void TaskProcessRxMsgFn();
void TaskTcpIPServerFn(); void TaskTcpIPServerFn();
std::string ConnectionString(std::string strDbName); std::string ConnectionString(const std::string& strDbName);
void EndAllRun(void); void EndAllRun(void);
@ -669,15 +675,15 @@ private:
CMutex m_mcCtrlMutex; // mutex to synchronised machine control CMutex m_mcCtrlMutex; // mutex to synchronised machine control
// run modules // run modules
std::vector<std::unique_ptr<CRun>>& m_pRuns; const std::vector<std::unique_ptr<CRun>>& m_pRuns;
BOOL m_bCloseLot; bool m_bCloseLot;
LIGHT_CONFIG m_lightConfig[NUM_MC_STATE]; std::array<LIGHT_CONFIG, NUM_MC_STATE> m_lightConfig;
LIGHT_CONFIG m_customLightCfg[CUSTOM_LIGHT_MAX]; std::array<LIGHT_CONFIG, CUSTOM_LIGHT_MAX> m_customLightCfg;
LIGHT_CONFIG m_currentLightStatus; LIGHT_CONFIG m_currentLightStatus;
BOOL m_bBlink; bool m_bBlink;
COutput* m_copLightRed; COutput* m_copLightRed;
COutput* m_copLightAmber; COutput* m_copLightAmber;
@ -688,8 +694,8 @@ private:
COutput* m_copStopIndicator; COutput* m_copStopIndicator;
COutput* m_copResetIndicator; COutput* m_copResetIndicator;
BOOL m_bSystemWarning; bool m_bSystemWarning;
BOOL m_bModuleWarning; bool m_bModuleWarning;
bool m_bResetMaintMode; // flag to detemine reset maintenance mode bool m_bResetMaintMode; // flag to detemine reset maintenance mode
bool m_bMaintMode; // flag to determine set to maintenance mode bool m_bMaintMode; // flag to determine set to maintenance mode
@ -704,7 +710,7 @@ private:
// Gary 24Mar10, V1.13.4, change this object from private to public // Gary 24Mar10, V1.13.4, change this object from private to public
// CSemiE10RS m_SemiE10; // CSemiE10RS m_SemiE10;
bool m_bMcCtrl[MAX_MC_CTRL]; // flag to determine machine control std::array<bool, MAX_MC_CTRL> m_bMcCtrl; // flag to determine machine control
// flag to determine whether no material warning has been post to GUI before // flag to determine whether no material warning has been post to GUI before
// true = post no material warning before // true = post no material warning before
@ -835,7 +841,7 @@ private:
// add capability - in order to share with ui code using shm design, unable to use vector // add capability - in order to share with ui code using shm design, unable to use vector
// TODO: to review shm if needed // TODO: to review shm if needed
std::vector<int> m_vecSequenceModuleNo; const std::vector<int>& m_vecSequenceModuleNo;
// to store list of callback // to store list of callback
std::function<void(void)> m_fnCallback[MAX_CALLBACK_FN]; std::function<void(void)> m_fnCallback[MAX_CALLBACK_FN];

Binary file not shown.

Binary file not shown.

@ -19,33 +19,33 @@ public:
// Get FileName // Get FileName
LPCTSTR GetFileName(); LPCTSTR GetFileName();
BOOL WriteString(LPCTSTR lpKeyName, LPCTSTR lpString); bool WriteString(LPCTSTR lpKeyName, LPCTSTR lpString);
BOOL WriteLong(LPCTSTR lpKeyName, long lLong); bool WriteLong(LPCTSTR lpKeyName, long lLong);
BOOL WriteDouble(LPCTSTR lpKeyName, double dDouble); bool WriteDouble(LPCTSTR lpKeyName, double dDouble);
std::string GetString(LPCTSTR lpKeyName, LPCTSTR lpDefaultString, BOOL bCreateIfFail = TRUE); std::string GetString(LPCTSTR lpKeyName, LPCTSTR lpDefaultString, bool bCreateIfFail = true);
long GetLong(LPCTSTR lpKeyName, long lDefaultLong, BOOL bCreateIfFail = TRUE); long GetLong(LPCTSTR lpKeyName, long lDefaultLong, bool bCreateIfFail = true);
double GetDouble(LPCTSTR lpKeyName, double dDefaultDouble, BOOL bCreateIfFail = TRUE); double GetDouble(LPCTSTR lpKeyName, double dDefaultDouble, bool bCreateIfFail = true);
bool GetBool(LPCTSTR lpKeyName, LPCTSTR lpDefaultString, BOOL bCreateIfFail = TRUE); bool GetBool(LPCTSTR lpKeyName, LPCTSTR lpDefaultString, bool bCreateIfFail = true);
// write longlong value to file // write longlong value to file
BOOL WriteLongLong(LPCTSTR lpKeyName, LONGLONG lLong); bool WriteLongLong(LPCTSTR lpKeyName, LONGLONG lLong);
// get longlong value from file // get longlong value from file
LONGLONG GetLongLong(LPCTSTR lpKeyName, LONGLONG lDefaultLong, BOOL bCreateIfFail = TRUE); LONGLONG GetLongLong(LPCTSTR lpKeyName, LONGLONG lDefaultLong, bool bCreateIfFail = true);
// write longlong value to file // write longlong value to file
static BOOL WriteLongLong(LPCTSTR pszFileName, LPCTSTR pszSectionName, LPCTSTR lpKeyName, LONGLONG lLong); static bool WriteLongLong(LPCTSTR pszFileName, LPCTSTR pszSectionName, LPCTSTR lpKeyName, LONGLONG lLong);
// get long long value from file // get long long value from file
static LONGLONG GetLongLong(LPCTSTR pszFileName, LPCTSTR pszSectionName, LPCTSTR lpKeyName, LONGLONG lDefaultLong, BOOL bCreateIfFail = TRUE); static LONGLONG GetLongLong(LPCTSTR pszFileName, LPCTSTR pszSectionName, LPCTSTR lpKeyName, LONGLONG lDefaultLong, bool bCreateIfFail = true);
static BOOL WriteString(LPCTSTR pszFileName, LPCTSTR pszSectionName, LPCTSTR lpKeyName, LPCTSTR lpString); static bool WriteString(LPCTSTR pszFileName, LPCTSTR pszSectionName, LPCTSTR lpKeyName, LPCTSTR lpString);
static BOOL WriteLong(LPCTSTR pszFileName, LPCTSTR pszSectionName, LPCTSTR lpKeyName, long lLong); static bool WriteLong(LPCTSTR pszFileName, LPCTSTR pszSectionName, LPCTSTR lpKeyName, long lLong);
static BOOL WriteDouble(LPCTSTR pszFileName, LPCTSTR pszSectionName, LPCTSTR lpKeyName, double dDouble); static bool WriteDouble(LPCTSTR pszFileName, LPCTSTR pszSectionName, LPCTSTR lpKeyName, double dDouble);
static std::string GetString(LPCTSTR pszFileName, LPCTSTR pszSectionName, LPCTSTR lpKeyName, LPCTSTR lpDefaultString, BOOL bCreateIfFail = TRUE); static std::string GetString(LPCTSTR pszFileName, LPCTSTR pszSectionName, LPCTSTR lpKeyName, LPCTSTR lpDefaultString, bool bCreateIfFail = true);
static long GetLong(LPCTSTR pszFileName, LPCTSTR pszSectionName, LPCTSTR lpKeyName, long lDefaultLong, BOOL bCreateIfFail = TRUE); static long GetLong(LPCTSTR pszFileName, LPCTSTR pszSectionName, LPCTSTR lpKeyName, long lDefaultLong, bool bCreateIfFail = true);
static double GetDouble(LPCTSTR pszFileName, LPCTSTR pszSectionName, LPCTSTR lpKeyName, double dDefaultDouble, BOOL bCreateIfFail = TRUE); static double GetDouble(LPCTSTR pszFileName, LPCTSTR pszSectionName, LPCTSTR lpKeyName, double dDefaultDouble, bool bCreateIfFail = true);
static bool GetBool(LPCTSTR pszFileName, LPCTSTR pszSectionName, LPCTSTR lpKeyName, LPCTSTR lpDefaultString, BOOL bCreateIfFail = TRUE); static bool GetBool(LPCTSTR pszFileName, LPCTSTR pszSectionName, LPCTSTR lpKeyName, LPCTSTR lpDefaultString, bool bCreateIfFail = true);
// attributes // attributes
private: private:

@ -27,8 +27,8 @@ public:
LPVOID Open(DWORD dwTimeout = INFINITE); // SM must be opened before use. The pointer LPVOID Open(DWORD dwTimeout = INFINITE); // SM must be opened before use. The pointer
// returns must be type casted to it type // returns must be type casted to it type
// Returns NULL if the SM was not created ot failed // Returns NULL if the SM was not created ot failed
BOOL Close(); // SM should be closed after use so that others can open the SM bool Close(); // SM should be closed after use so that others can open the SM
BOOL IsOpen() bool IsOpen()
{ {
return m_bOpen; return m_bOpen;
} // Check if SM is opened } // Check if SM is opened
@ -52,7 +52,7 @@ private:
HANDLE m_hMutex; HANDLE m_hMutex;
LPVOID m_pvData; LPVOID m_pvData;
HANDLE m_hMapping; HANDLE m_hMapping;
BOOL m_bOpen; bool m_bOpen;
DWORD m_dwLength; DWORD m_dwLength;
bool m_bUnMappedOnDeleted; bool m_bUnMappedOnDeleted;
}; };

@ -16,7 +16,7 @@ public:
void InsertTrigger(HANDLE handle); void InsertTrigger(HANDLE handle);
// void InsertInput(CInput* pInput, BOOL bState, DWORD dwDebounce, DWORD dwTimeout); // void InsertInput(CInput* pInput, BOOL bState, DWORD dwDebounce, DWORD dwTimeout);
DWORD Wait(DWORD dwTimeOut = INFINITE); DWORD Wait(DWORD dwTimeOut = INFINITE);
BOOL WaitForAll(DWORD dwTimeOut = INFINITE); bool WaitForAll(DWORD dwTimeOut = INFINITE);
void Reset(); void Reset();
protected: protected:

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save