// SemiE10.h: interface for the CSemiE10 class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_SEMIE10_H__EA674164_EC86_401C_A8B8_6AC49BE92642__INCLUDED_) #define AFX_SEMIE10_H__EA674164_EC86_401C_A8B8_6AC49BE92642__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "NonScheduledTime.h" #include "OperationsTime.h" #include "Timer.h" struct StTime { const char *csTimeName; long double dTime; }; struct StRamTime { CString csTimeName; long double dTime; }; struct StInterrupt { CString csInterruptName; long double dInterruptTime; }; struct StLong { CString csTimeName; long lCount; }; struct StOleDateTime { CString csTimeName; COleDateTime odtDateTime; }; struct StSemiE10 { enum { MTBA, // Mean Time between Assist MTBF, // Mean Time between Failure MTBI, // Mean Time between Interrupts MTTR, // Mean Time between Repair MAX_RAM_MEASUREMENT, // Maximun Reliablity, Availability, Maintainability Measurement }; enum { UNIT_CNT, ASSIST_CNT, FAILURE_CNT, JAM_CNT, UPH, // Unit per hour MAX_CNT, }; enum { START_LOT_TIME, MAX_OLE_DATE_TIME, }; enum { ASSIST_TIME, FAILURE_TIME, MAX_INTERRUPT, }; enum { EQUIP_SUBSTATE, EQUIP_STATE, RAM_TIME, INTERRUPT, CNT, OLE_DATE_TIME, }; StTime stTime[CEquipState::MAX_EQUIPMENT_SUBSTATE]; StTime stEquipStateTime[CEquipState::MAX_EQUIP_STATE]; StRamTime stRamTime[MAX_RAM_MEASUREMENT]; StInterrupt stInterrupt[MAX_INTERRUPT]; StLong stLong[MAX_CNT]; StOleDateTime stOleDateTime[MAX_OLE_DATE_TIME]; }; #ifdef BUILD_MCCTRDLL #define MCCTRDLLCLASS __declspec(dllexport) #else #define MCCTRDLLCLASS __declspec(dllimport) #endif class MCCTRDLLCLASS CSemiE10 //class CSemiE10 { public: // default constructor CSemiE10(); // default destructor virtual ~CSemiE10(); // read save time to file time interval void ReadSaveTimeInterval(); // machine jam start jam timer and stop the rest of the timer void McJam(); // Open lot reset all timer void OpenLot(); // Machine running start regular production timer and stop the rest of the timer void StartMc(); // Machine stopped start stop machine timer and stop the rest of the timer void StopMc(); // start No material timer and stop the rest of the timer. // Return true if no material not started before // Return false if no material start before bool NoMaterial(); // Close Lot stop all timer void CloseLot(); // machine shutdown or startup void ShutdownStartup(); // check whether it is failure or assist void CheckAssistOrFailure(); // set uptime and downtime equipment state void SetEquipState(int iEvt, int iState); // Start all equipment state time. Possible to start all equipment state? void StartAllEquipState(); // Stop all equipment state time void StopAllEquipState(); // Reset all equipment state time void ResetAllEquipState(); // get equipment substate time long double GetEquipSubStateTime(int iEvt); // get total uptime and down equipment state long double GetTotalTime(); // get non scheduled time long double GetNonScheduledTime(); // get operations time long double GetOperationsTime(); // get Uptime long double GetUptime(); // get engineering time long double GetEngineeringTime(); // get manufacturing time long double GetManufacturingTime(); // get productive time long double GetProductiveTime(); // get standby time long double GetStandbyTime(); // get downtime long double GetDowntime(); // get unscheduled downtime long double GetUnscheduledDowntime(); // get scheduled downtime long double GetScheduledDowntime(); // get Mean Time between Assist double GetMTBA(); // get Mean Time between Failure double GetMTBF(); // get Mean Time between Interrupts double GetMTBI(); // get MTTR long double GetMTTR(); // get UPH long GetUPH(); // Jam Reset void JamReset(); // Set jam count void SetJamCnt(long lJamCnt); // increament jam count void IncJamCnt(long lJamCnt); // get jam count long GetJamCnt(); // get assist count long GetAssistCnt(); // get failure count long GetFailureCnt(); // Get Assist time in mins long double GetAssistTime(); // get failure time in mins long double GetFailureTime(); // save equipment substate time periodically to file void SaveTimeInfo(); // get all SemiE10 timing StSemiE10 GetCurrentTimeInfo(); /* // get mtta LONGLONG GetMTTA(); */ protected: // check if lot has been closed. If lot open, read all equipment substate time from runtime.ini CheckLotClosed(); // calculate jam count void CalJamCnt(StLong stLong[StSemiE10::MAX_CNT]); // Calculate Equipment State Time void CalEquipStateTime(); // Calculate RAM Time void CalRamTime(); CNonScheduledTime m_nonScheduledTime; // non scheduled time StSemiE10 stSemiE10; private: // write jam info to file void WriteJamInfoToFile(); // write RAM infomation to file void WriteRamInfoToFile(); // write Equipment state time to file void WriteEquStateToFile(); // read equipment timing void ReadEquTiming(); // reset jam count and write to file void ResetJamCnt(); // reset RAM Time and write to file void ResetRamTime(); // reset RAM and write to file void ResetEquTime(); CTimer m_SaveInfoTimer; COperationsTime m_operationsTime; // operations time long m_lJamCnt; // jam count long m_lPrevJamCnt; // previous jam count long m_lAssistFailureCnt; // assist and failure counter long m_lAssistCnt; // assist counter long m_lFailureCnt; // failure counter long m_lPrevAssistCnt; // previous assist counter long m_lPrevFailureCnt; // previous failure counter double m_dPrevMtba; // previous mtba before write to runtime.ini double m_dPrevMtbf; // previous mtbf before write to runtime.ini double m_dPrevMtbi; // previous mtbi before write to runtime.ini double m_dPrevMttr; // previous mttr before write to runtime.ini long double m_ldPrevTolTime; // previous Total Time long double m_ldPrevNonScheduleTime; // previous non scheduled time long double m_ldPrevOperationsTime; // previous operations time long double m_ldPrevUptime; // previous uptime long double m_ldPrevEngineeringtime; // previous Engineering Time long double m_ldPrevManufaturingTime; // previous Manufacturing Time long double m_ldPrevProductiveTime; // previous productive time long double m_ldPrevStandbyTime; // previous standby time long double m_ldPrevDownTime; // previous downtime long double m_ldPrevUnscheduledDowntime; // previous Unscheduled Downtime long double m_ldPrevScheduleTime; // previous scheduled downtime long m_lPrevUPH; // previous uph before write to runtime.ini bool m_bLotOpened; // flag to keep track of lot open status LONGLONG m_llJamStartTime; // for record jam start time LONGLONG m_llFailureTime; // Failure time LONGLONG m_llAssistTime; // Assist time LONGLONG m_llPrevFailureTime; // previous Failure time LONGLONG m_llPrevAssistTime; // previous Assist time double m_dFailureTime; // jam time above this time will be failure bool m_bTraceData; // if m_bTraceData = trace data to vc output window }; #endif // !defined(AFX_SEMIE10_H__EA674164_EC86_401C_A8B8_6AC49BE92642__INCLUDED_)