You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
168 lines
4.4 KiB
C++
168 lines
4.4 KiB
C++
// Start =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
// General information section.
|
|
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
// $Author:yongkiang$ User who last changed the file
|
|
// $Date:1/2/2013 12:17:39 PM$ Date and time of last check in
|
|
// $Revision:1.0$ Visual SourceSafe version number
|
|
// $Workfile:: lotmsg.h $ Filename
|
|
// End =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
#if !defined __LOTMSG_H__
|
|
#define __LOTMSG_H__
|
|
|
|
#include <afxmt.h>
|
|
#include "LotMsgRS.h"
|
|
#include "Run.h"
|
|
#include "JamDetailRS.h"
|
|
|
|
class CMsgItem
|
|
{
|
|
// Attributes
|
|
public:
|
|
int m_id;
|
|
int m_nMsgID;
|
|
|
|
bool m_bStored;
|
|
|
|
int m_nCategory;
|
|
BOOL m_bCount;
|
|
|
|
CString m_msgID;
|
|
CString m_msg;
|
|
CString m_module;
|
|
CString m_csRemedy1;
|
|
CString m_csRemedy2;
|
|
CString m_csRemedy3;
|
|
|
|
COleDateTime m_msgTime;
|
|
CString m_csFaultFilename;
|
|
CString m_csMainDisplayFilename;
|
|
CPoint m_cpMainIndicator;
|
|
CPoint m_cpFaultIndicator;
|
|
};
|
|
|
|
#define MAX_MSG_SEMAPHORE_COUNT 50
|
|
|
|
#define MSG_JAM_STR "Jam"
|
|
#define MSG_WARNING_STR "Warning"
|
|
#define MSG_BUZZER_STR "Buzzer"
|
|
|
|
#define BUZZER 9999
|
|
#define CLEAR_ALL 0
|
|
|
|
// Read lot message
|
|
#define BeginReadLotMsg(lotMsg) \
|
|
CSingleLock semaLock(&lotMsg.m_msgSemaphore); \
|
|
semaLock.Lock();\
|
|
CSingleLock sLock(&lotMsg.m_msgMutex);\
|
|
sLock.Lock();\
|
|
|
|
|
|
#define EndReadLotMsg() \
|
|
sLock.Unlock(); \
|
|
semaLock.Unlock(); \
|
|
|
|
#define STORE_WARN true
|
|
#define DO_NOT_STORE_WARN false
|
|
|
|
#ifdef BUILD_MCCTRDLL
|
|
#define MCCTRDLLCLASS __declspec(dllexport)
|
|
#else
|
|
#define MCCTRDLLCLASS __declspec(dllimport)
|
|
#endif
|
|
|
|
class MCCTRDLLCLASS CLotMsg
|
|
{
|
|
public:
|
|
void DeleteRecord(CString csLotNumber, double dStartDateTime);
|
|
void GetWarningMsg(CPtrList *pList);
|
|
void GetJamMsg(CPtrList *pList);
|
|
CLotMsg();
|
|
~CLotMsg();
|
|
|
|
// Clear Message
|
|
void ClearAllMsg();
|
|
void ClearAllJamMsg();
|
|
//void ClearWarningMsg(int nID, COleDateTime odtWarnEndTime);
|
|
bool ClearWarningMsg(int nID, COleDateTime odtWarnEndTime);
|
|
void ClearBuzzer(CRun *pRun);
|
|
void ClearBuzzers(CRun *pRun);
|
|
|
|
// Pause and continue message logging
|
|
|
|
// Jam
|
|
//void SetJamMsg(CRun *pRun, bool bCount );
|
|
void SetJamMsg(int nID, COleDateTime odtJamStartTime, BOOL bCount );
|
|
bool HasJam() { return m_jamMsgList.GetHeadPosition() != NULL;}
|
|
|
|
// Warnings
|
|
//void SetWarningMsg(CRun *pRun);
|
|
bool SetWarningMsg(int nID, COleDateTime odtWarnTime, bool bStoreWarn = STORE_WARN);
|
|
bool HasWarning() { return m_warningMsgList.GetHeadPosition() != NULL;}
|
|
|
|
// Buzzer
|
|
void SetBuzzer(CRun *pRun);
|
|
bool HasBuzzer() { return m_buzzerList.GetHeadPosition() != NULL; }
|
|
|
|
// Message Record
|
|
void BeginMsgRecord(LPCSTR pLotNumber, CString LotStartDateTime);
|
|
void StoreMsg();
|
|
void StoreMsgList(CPtrList &pMsg);
|
|
|
|
void EndMsgRecord();
|
|
|
|
// set jam End Time
|
|
void SetJamEndTime(COleDateTime odtJamEndTime);
|
|
|
|
// set end time to list
|
|
void SetEndTimeList(CPtrList &pMsg, COleDateTime odtEndTime);
|
|
|
|
// Message changed
|
|
inline bool IsModified() { return m_bModified; }
|
|
inline void ClearModified() { m_bModified = false; }
|
|
inline bool HasMsg() { return (HasJam() || HasWarning()); }
|
|
|
|
CString GetSecGemWarningMessage(int iMsgID);//phyu 24-Sep-2012
|
|
// Attributes : Message Lists and count
|
|
|
|
private:
|
|
// Attributes
|
|
bool m_bModified;
|
|
CPtrList m_jamMsgList;
|
|
CPtrList m_warningMsgList;
|
|
CPtrList m_buzzerList;
|
|
int m_jamCount;
|
|
|
|
// Mutex
|
|
CMutex m_msgMutex;
|
|
CSemaphore m_msgSemaphore;
|
|
|
|
// Pause and continue message logging
|
|
CSingleLock *m_pPauseSemaLock[MAX_MSG_SEMAPHORE_COUNT];
|
|
|
|
// Attributes: Message Record
|
|
CLotMsgRS m_msgRec;
|
|
CString m_lotNumber;
|
|
bool m_bMsgRecordStart;
|
|
|
|
// Operations
|
|
//void AddNSaveMsg(CPtrList &pMsg, int nModuleID, CString csModuleName, int nMsgID, BOOL bCount);
|
|
void AddNSaveMsg(CPtrList &pMsg, int nID, COleDateTime odtStartTime, BOOL bCount = TRUE);
|
|
|
|
// clear waring list
|
|
// void ClearMsg(CPtrList &pMsg, int nMsgID, COleDateTime odtWarnEndTime);
|
|
bool ClearMsg(CPtrList &pMsg, int nMsgID, COleDateTime odtWarnEndTime);
|
|
void ClearMsgList(CPtrList &pMsg);
|
|
|
|
// Message Record Operations
|
|
void StoreMsgItem(CMsgItem *msg);
|
|
|
|
// post jam message to sec gem jam task thread
|
|
void PostSecGemJamMessage(CMsgItem *msg);
|
|
|
|
CString m_LotStartDateTime;
|
|
CJamDetailRS m_JamDetailRS;
|
|
};
|
|
|
|
|
|
#endif //!defined __LOTMSG_H__
|