|
|
|
@ -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];
|
|
|
|
|