#include "stdafx.h"
|
#include "ObserverInterface.h"
|
|
CObserverInterface::CObserverInterface(void)
|
{
|
}
|
|
CObserverInterface::~CObserverInterface(void)
|
{
|
ClearAllObserverVector();
|
}
|
|
void CObserverInterface::ClearAllObserverVector()
|
{
|
m_obsUpdateProcessStatus.clear();
|
m_obsUpdateCameraControl.clear();
|
m_obsUpdateMotorPosition.clear();
|
m_obsUpdateMotorStatus.clear();
|
m_obsUpdatePCControlIOSignal.clear();
|
m_obsUpdateDefectFilter.clear();
|
m_obsUpdateConnectionStatus.clear();
|
m_obsUpdateReviewResult.clear();
|
m_obsUpdateThetaMotorInfo.clear();
|
m_obsUpdateSelectedModuleIndex.clear();
|
m_obsUpdateReviewProcessStatus.clear();
|
}
|
|
// Map Option
|
void CObserverInterface::UpdateDefectFilter(const SDefectFilter* pDefectFilter)
|
{
|
if (pDefectFilter==NULL) return;
|
|
for (ObserverUpdateDefectFilterIt it = m_obsUpdateDefectFilter.begin(); it != m_obsUpdateDefectFilter.end(); it++)
|
{
|
IUpdateDefectFilter* const pIU = static_cast<IUpdateDefectFilter*>(*it);
|
|
if (pIU)
|
{
|
pIU->UpdateDefectFilter(pDefectFilter);
|
}
|
}
|
}
|
|
void CObserverInterface::AddObserverUpdateDefectFilter(IUpdateDefectFilter* const pIU)
|
{
|
m_obsUpdateDefectFilter.push_back(pIU);
|
}
|
|
|
// Process Status
|
void CObserverInterface::UpdateProcessStatus(int nLineType, int nMachineType, int nProcessStatus, const CGlassResult* pGlassResult)
|
{
|
if (pGlassResult==NULL) return;
|
|
for (ObserverUpdateProcessStatusIt it = m_obsUpdateProcessStatus.begin(); it != m_obsUpdateProcessStatus.end(); it++)
|
{
|
IUpdateProcessStatus* const pIU = static_cast<IUpdateProcessStatus*>(*it);
|
|
if (pIU)
|
{
|
pIU->UpdateProcessStatus(nLineType, nMachineType, nProcessStatus, pGlassResult);
|
}
|
}
|
}
|
|
void CObserverInterface::AddObserverUpdateProcessStatus(IUpdateProcessStatus* const pIU)
|
{
|
m_obsUpdateProcessStatus.push_back(pIU);
|
}
|
|
// Review Result
|
void CObserverInterface::UpdateReviewResult(int nModuleIndex, const CGlassResult* pGlassResult, int nPlanIndex)
|
{
|
if (pGlassResult==NULL) return;
|
|
for (ObserverUpdateReviewResultIt it = m_obsUpdateReviewResult.begin(); it != m_obsUpdateReviewResult.end(); it++)
|
{
|
IUpdateReviewResult* const pIU = static_cast<IUpdateReviewResult*>(*it);
|
|
if (pIU)
|
{
|
pIU->UpdateReviewResult(nModuleIndex, pGlassResult, nPlanIndex);
|
}
|
}
|
}
|
|
void CObserverInterface::AddObserverUpdateReviewResult(IUpdateReviewResult* const pIU)
|
{
|
m_obsUpdateReviewResult.push_back(pIU);
|
}
|
|
|
// camera status
|
void CObserverInterface::UpdateCameraControl(int nModuleIndex, const SCameraControl *pCameraControl, const SCameraInfo* pCameraInfo)
|
{
|
if (pCameraControl==NULL) return;
|
|
for (ObserverUpdateCameraControlIt it = m_obsUpdateCameraControl.begin(); it != m_obsUpdateCameraControl.end(); it++)
|
{
|
IUpdateCameraControl* const pIU = static_cast<IUpdateCameraControl*>(*it);
|
|
if (pIU)
|
{
|
pIU->UpdateCameraControl(nModuleIndex, pCameraControl, pCameraInfo);
|
}
|
}
|
}
|
|
void CObserverInterface::AddObserverUpdateCameraControl(IUpdateCameraControl* const pIU)
|
{
|
m_obsUpdateCameraControl.push_back(pIU);
|
int nCount = (int)m_obsUpdateCameraControl.size();
|
}
|
|
// motor position
|
void CObserverInterface::UpdateMotorPosition(int nModuleIndex, BOOL bSelected, const SMotorPosition *pMotorPosition)
|
{
|
if (pMotorPosition==NULL) return;
|
|
for (ObserverUpdateMotorPositionIt it = m_obsUpdateMotorPosition.begin(); it != m_obsUpdateMotorPosition.end(); it++)
|
{
|
IUpdateMotorPosition* const pIU = static_cast<IUpdateMotorPosition*>(*it);
|
|
if (pIU)
|
{
|
pIU->UpdateMotorPosition(nModuleIndex, bSelected, pMotorPosition);
|
}
|
}
|
}
|
|
void CObserverInterface::AddObserverUpdateMotorPosition(IUpdateMotorPosition* const pIU)
|
{
|
m_obsUpdateMotorPosition.push_back(pIU);
|
}
|
|
|
// motor status
|
void CObserverInterface::UpdateMotorStatus(int nModuleIndex, const SMotorStatus *pMotorStatus)
|
{
|
if (pMotorStatus==NULL) return;
|
|
for (ObserverUpdateMotorStatusIt it = m_obsUpdateMotorStatus.begin(); it != m_obsUpdateMotorStatus.end(); it++)
|
{
|
IUpdateMotorStatus* const pIU = static_cast<IUpdateMotorStatus*>(*it);
|
|
if (pIU)
|
{
|
pIU->UpdateMotorStatus(nModuleIndex, pMotorStatus);
|
}
|
}
|
}
|
|
void CObserverInterface::AddObserverUpdateMotorStatus(IUpdateMotorStatus* const pIU)
|
{
|
m_obsUpdateMotorStatus.push_back(pIU);
|
}
|
|
// PCControl IO signal
|
void CObserverInterface::UpdateSignalIOStatus(const SSignalIOStatus *pSignalIOStatus)
|
{
|
if (pSignalIOStatus==NULL) return;
|
|
for (ObserverUpdatePCControlIOSignalIt it = m_obsUpdatePCControlIOSignal.begin(); it != m_obsUpdatePCControlIOSignal.end(); it++)
|
{
|
IUpdatePCControlIOSignal* const pIU = static_cast<IUpdatePCControlIOSignal*>(*it);
|
|
if (pIU)
|
{
|
pIU->UpdateSignalIOStatus(pSignalIOStatus);
|
}
|
}
|
}
|
|
void CObserverInterface::AddObserverUpdatePCControlIOSignal(IUpdatePCControlIOSignal* const pIU)
|
{
|
m_obsUpdatePCControlIOSignal.push_back(pIU);
|
}
|
|
|
// connection status
|
void CObserverInterface::UpdateConnectionStatus(const CConnectionStatus* pConnectionStatus)
|
{
|
if (pConnectionStatus==NULL) return;
|
|
for (ObserverUpdateConnectionStatusIt it = m_obsUpdateConnectionStatus.begin(); it != m_obsUpdateConnectionStatus.end(); it++)
|
{
|
IUpdateConnectionStatus* const pIU = static_cast<IUpdateConnectionStatus*>(*it);
|
|
if (pIU)
|
{
|
pIU->UpdateConnectionStatus(pConnectionStatus);
|
}
|
}
|
}
|
|
void CObserverInterface::AddObserverUpdateConnectionStatus(IUpdateConnectionStatus* const pIU)
|
{
|
m_obsUpdateConnectionStatus.push_back(pIU);
|
}
|
|
// selected module index
|
void CObserverInterface::UpdateSelectedModuleIndex(int nModuleIndex, const CModuleStatus* pModuleStatus)
|
{
|
if (pModuleStatus==NULL) return;
|
|
for (ObserverUpdateSelectedModuleIndexIt it = m_obsUpdateSelectedModuleIndex.begin(); it != m_obsUpdateSelectedModuleIndex.end(); it++)
|
{
|
IUpdateSelectedModuleIndex* const pIU = static_cast<IUpdateSelectedModuleIndex*>(*it);
|
|
if (pIU)
|
{
|
pIU->UpdateSelectedModuleIndex(nModuleIndex, pModuleStatus);
|
}
|
}
|
}
|
|
void CObserverInterface::AddObserverUpdateSelectedModuleIndex(IUpdateSelectedModuleIndex* const pIU)
|
{
|
m_obsUpdateSelectedModuleIndex.push_back(pIU);
|
}
|
|
|
// theta motor info
|
void CObserverInterface::UpdateThetaMotorInfo(const SThetaMotorInfo* pThetaMotorInfo)
|
{
|
if (pThetaMotorInfo==NULL) return;
|
|
for (ObserverUpdateThetaMotorInfoIt it = m_obsUpdateThetaMotorInfo.begin(); it != m_obsUpdateThetaMotorInfo.end(); it++)
|
{
|
IUpdateThetaMotorInfo* const pIU = static_cast<IUpdateThetaMotorInfo*>(*it);
|
|
if (pIU)
|
{
|
pIU->UpdateThetaMotorInfo(pThetaMotorInfo);
|
}
|
}
|
}
|
|
void CObserverInterface::AddObserverUpdateThetaMotorInfo(IUpdateThetaMotorInfo* const pIU)
|
{
|
m_obsUpdateThetaMotorInfo.push_back(pIU);
|
}
|
|
// review process
|
void CObserverInterface::UpdateReviewProcessStatus(int nReviewStatus, int nPlanIndex)
|
{
|
for (ObserverUpdateReviewProcessStatusIt it = m_obsUpdateReviewProcessStatus.begin(); it != m_obsUpdateReviewProcessStatus.end(); it++)
|
{
|
IUpdateReviewProcessStatus* const pIU = static_cast<IUpdateReviewProcessStatus*>(*it);
|
|
if (pIU)
|
{
|
pIU->UpdateReviewProcessStatus(nReviewStatus, nPlanIndex);
|
}
|
}
|
}
|
|
void CObserverInterface::AddObserverUpdateReviewProcessStatus(IUpdateReviewProcessStatus* const pIU)
|
{
|
m_obsUpdateReviewProcessStatus.push_back(pIU);
|
}
|
|
|
// review process20190819chm
|
void CObserverInterface::UpdateDefocusList()
|
{
|
for (ObserverUpdateDefocusListIt it = m_obsUpdateDefocusList.begin(); it != m_obsUpdateDefocusList.end(); it++)
|
{
|
IUpdateDefocusList* const pIU = static_cast<IUpdateDefocusList*>(*it);
|
|
if (pIU)
|
{
|
pIU->UpdateDefocusList();
|
}
|
}
|
}
|
//20190819chm
|
void CObserverInterface::AddObserverUpdateDefocusList(IUpdateDefocusList* const pIU)
|
{
|
m_obsUpdateDefocusList.push_back(pIU);
|
}
|