#pragma once
|
|
#include <vector>
|
#include "CHCommonClasses/MacroFile.h"
|
|
#define PLUS_LIMIT 9999.0
|
#define MINUS_LIMIT -9999.0
|
#define MAX_MOTOR_ADDRESS_SIZE 200
|
#define MOTOR_ADDRESS_NONE -1
|
#define LIMIT_NONE -999999
|
|
#define THETAMOTOR_AXIS_INDEX 999
|
|
enum MotorStatus { MotorStatus_NotConnected=0, MotorStatus_Connected };
|
|
interface IMotorControl2Parent
|
{
|
virtual void IMC2P_DisplayMessage(int nIndex, const TCHAR* lpstrFormat, ...) = 0;
|
virtual void IMC2P_UpdatePosition(int nIndex, int nAxisIdx, double dPosition) = 0;
|
virtual void IMC2P_UpdateStatus(int nIndex, int nAxisIdx, long lStatus) = 0;
|
virtual void IMC2P_UpdateThetaPosition(int nIndex, double dPosition) = 0;
|
virtual void IMC2P_UpdateThetaStatus(int nIndex, long lStatus) = 0;
|
virtual void IMC2P_AxisMotionEnd(int nIndex, int nAxisIdx, BOOL bMotionEnd) = 0;
|
virtual void IMC2P_GantryMotionEnd(int nIndex, int nGantryIdx, BOOL bMotionEnd) = 0;
|
virtual void IMC2P_GantrySoftWareTrigger(int nIndex, int nGantryIdx, int nTrigger) = 0;
|
virtual void IMC2P_WsiGantrySoftWareTrigger(int nIndex, int nGantryIdx, int nTrigger) = 0;
|
virtual void IMC2P_UpdateAutoEnable(int nIndex, int nAutoEnable){return;};
|
virtual void IMC2P_SendMotorAliveErrorAlram() = 0;
|
virtual void IMC2P_UpdateWsiMotionEnd(int nIndex, int nGantryIdx) = 0;
|
virtual BOOL IMC2P_GetUseWsi() = 0;
|
};
|
|
class CMotorCommonAddr
|
{
|
public:
|
CMotorCommonAddr(void) { Reset(); }
|
~CMotorCommonAddr(void) { Reset(); }
|
void Reset()
|
{
|
m_strName = _T("");
|
m_nAllAutoEnableAddr = MOTOR_ADDRESS_NONE;
|
|
m_nAllAutoReviewGoAddr = MOTOR_ADDRESS_NONE;
|
m_nAllAutoReviewGoAckAddr = MOTOR_ADDRESS_NONE;
|
|
m_nAllAutoMeasureGoAddr = MOTOR_ADDRESS_NONE;
|
m_nAllAutoMeasureGoAckAddr = MOTOR_ADDRESS_NONE;
|
|
m_nAllAutoWsiGoAddr = MOTOR_ADDRESS_NONE;
|
m_nAllAutoWsiGoAckAddr = MOTOR_ADDRESS_NONE;
|
|
m_nAllAutoStopAddr = MOTOR_ADDRESS_NONE;
|
m_nAllAutoStopAckAddr = MOTOR_ADDRESS_NONE;
|
|
m_nAfDelayTimeAddr = MOTOR_ADDRESS_NONE;
|
m_nImageDelayTimeAddr = MOTOR_ADDRESS_NONE;
|
m_nWsiDelayTimeAddr = MOTOR_ADDRESS_NONE;
|
|
m_nReviewModeAddr = MOTOR_ADDRESS_NONE;
|
}
|
|
BOOL LoadInfo(CMacroFile* pFile, const CString& strItemName)
|
{
|
if (pFile==NULL) return FALSE;
|
|
CString strValue = _T("");
|
|
strValue = strItemName + _T("_NAME");
|
pFile->GetItem(strValue, m_strName, _T(""));
|
|
strValue = strItemName + _T("_AUTO_ENABLE_ADDR");
|
pFile->GetItem(strValue, m_nAllAutoEnableAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_AUTO_REVIEW_GO_ADDR");
|
pFile->GetItem(strValue, m_nAllAutoReviewGoAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_AUTO_REVIEW_GO_ACK_ADDR");
|
pFile->GetItem(strValue, m_nAllAutoReviewGoAckAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_AUTO_MEASURE_GO_ADDR");
|
pFile->GetItem(strValue, m_nAllAutoMeasureGoAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_AUTO_MEASURE_GO_ACK_ADDR");
|
pFile->GetItem(strValue, m_nAllAutoMeasureGoAckAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_AUTO_WSI_GO_ADDR");
|
pFile->GetItem(strValue, m_nAllAutoWsiGoAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_AUTO_WSI_GO_ACK_ADDR");
|
pFile->GetItem(strValue, m_nAllAutoWsiGoAckAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_AUTO_STOP_ADDR");
|
pFile->GetItem(strValue, m_nAllAutoStopAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_AUTO_STOP_ACK_ADDR");
|
pFile->GetItem(strValue, m_nAllAutoStopAckAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_AF_DELAY_TIME_ADDR");
|
pFile->GetItem(strValue, m_nAfDelayTimeAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_IMAGE_DELAY_TIME_ADDR");
|
pFile->GetItem(strValue, m_nImageDelayTimeAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_WSI_DELAY_TIME_ADDR");
|
pFile->GetItem(strValue, m_nWsiDelayTimeAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_REVIEW_MODE_ADDR");
|
pFile->GetItem(strValue, m_nReviewModeAddr, MOTOR_ADDRESS_NONE);
|
|
return TRUE;
|
}
|
|
BOOL SaveInfo(CMacroFile* pFile, const CString& strItemName)
|
{
|
if (pFile==NULL) return FALSE;
|
|
CString strValue = _T("");
|
|
strValue = strItemName + _T("_NAME");
|
pFile->SetItem(strValue, m_strName);
|
|
strValue = strItemName + _T("_AUTO_ENABLE_ADDR");
|
pFile->SetItem(strValue, m_nAllAutoEnableAddr);
|
|
strValue = strItemName + _T("_AUTO_REVIEW_GO_ADDR");
|
pFile->SetItem(strValue, m_nAllAutoReviewGoAddr);
|
|
strValue = strItemName + _T("_AUTO_REVIEW_GO_ACK_ADDR");
|
pFile->SetItem(strValue, m_nAllAutoReviewGoAckAddr);
|
|
strValue = strItemName + _T("_AUTO_MEASURE_GO_ADDR");
|
pFile->SetItem(strValue, m_nAllAutoMeasureGoAddr);
|
|
strValue = strItemName + _T("_AUTO_MEASURE_GO_ACK_ADDR");
|
pFile->SetItem(strValue, m_nAllAutoMeasureGoAckAddr);
|
|
strValue = strItemName + _T("_AUTO_WSI_GO_ADDR");
|
pFile->SetItem(strValue, m_nAllAutoWsiGoAddr);
|
|
strValue = strItemName + _T("_AUTO_WSI_GO_ACK_ADDR");
|
pFile->SetItem(strValue, m_nAllAutoWsiGoAckAddr);
|
|
strValue = strItemName + _T("_AUTO_STOP_ADDR");
|
pFile->SetItem(strValue, m_nAllAutoStopAddr);
|
|
strValue = strItemName + _T("_AUTO_STOP_ACK_ADDR");
|
pFile->SetItem(strValue, m_nAllAutoStopAckAddr);
|
|
strValue = strItemName + _T("_AF_DELAY_TIME_ADDR");
|
pFile->SetItem(strValue, m_nAfDelayTimeAddr);
|
|
strValue = strItemName + _T("_IMAGE_DELAY_TIME_ADDR");
|
pFile->SetItem(strValue, m_nImageDelayTimeAddr);
|
|
strValue = strItemName + _T("_WSI_DELAY_TIME_ADDR");
|
pFile->SetItem(strValue, m_nWsiDelayTimeAddr);
|
|
strValue = strItemName + _T("_REVIEW_MODE_ADDR");
|
pFile->SetItem(strValue, m_nReviewModeAddr);
|
|
return TRUE;
|
}
|
|
public:
|
CString m_strName; // ¸ðÅÍ À̸§
|
int m_nAllAutoEnableAddr; // ¸ðµç ÀÚµ¿µ¿ÀÛ °¡´É ÁÖ¼Ò
|
int m_nAllAutoReviewGoAddr; // ¸ðµç °ÕÆ®¸® AutoReviewGo ÁÖ¼Ò
|
int m_nAllAutoReviewGoAckAddr; // ¸ðµç °ÕÆ®¸® AutoReviewGo ÁÖ¼Ò ACK
|
int m_nAllAutoMeasureGoAddr; // ¸ðµç °ÕÆ®¸® AutoMeasureGo ÁÖ¼Ò
|
int m_nAllAutoMeasureGoAckAddr; // ¸ðµç °ÕÆ®¸® AutoMeasureGo ÁÖ¼Ò ACK
|
int m_nAllAutoWsiGoAddr; // ¸ðµç °ÕÆ®¸® AutoWSIGo ÁÖ¼Ò
|
int m_nAllAutoWsiGoAckAddr; // ¸ðµç °ÕÆ®¸® AutoWSIGo ÁÖ¼Ò ACK
|
int m_nAllAutoStopAddr; // ¸ðµç ÀÚµ¿µ¿ÀÛ ÁßÁö ÁÖ¼Ò
|
int m_nAllAutoStopAckAddr; // ¸ðµç ÀÚµ¿µ¿ÀÛ ÁßÁö ACK
|
|
int m_nAfDelayTimeAddr; // AF Delay ½Ã°£ ÁÖ¼Ò
|
int m_nImageDelayTimeAddr; // Image Delay ½Ã°£ ÁÖ¼Ò
|
int m_nWsiDelayTimeAddr; // Wsi Delay ½Ã°£ ÁÖ¼Ò
|
|
int m_nReviewModeAddr; // review mode ÁÖ¼Ò
|
};
|
|
class CMotorAxisAddr
|
{
|
public:
|
CMotorAxisAddr(void) { Reset(); }
|
~CMotorAxisAddr(void) { Reset(); }
|
void Reset()
|
{
|
m_nMovePositionAddr = MOTOR_ADDRESS_NONE;
|
m_nMovePositionCommonAddr = MOTOR_ADDRESS_NONE;
|
m_nPositionAddr = MOTOR_ADDRESS_NONE;
|
m_nStatusAddr = MOTOR_ADDRESS_NONE;
|
m_nMoveSpeedAddr = MOTOR_ADDRESS_NONE;
|
m_nAccelTimeAddr = MOTOR_ADDRESS_NONE;
|
m_nJogCommandAddr = MOTOR_ADDRESS_NONE;
|
m_nJogSpeedAddr = MOTOR_ADDRESS_NONE;
|
m_strName = _T("");
|
m_nAxisIdx = 0;
|
m_nGantryIdx = 0;
|
m_lStatus = 0;
|
m_dPosition = 0.0;
|
m_dPlusLimitPos = PLUS_LIMIT;
|
m_dMinusLimitPos = MINUS_LIMIT;
|
m_dMaxJogSpeed = 10.0;
|
m_dMinJogSpeed = 0.01;
|
}
|
|
BOOL LoadInfo(CMacroFile* pFile, const CString& strItemName)
|
{
|
if (pFile==NULL) return FALSE;
|
|
CString strValue = _T("");
|
|
strValue = strItemName + _T("_GANTRY_INDEX");
|
pFile->GetItem(strValue, m_nGantryIdx, 0);
|
|
strValue = strItemName + _T("_AXIS_INDEX");
|
pFile->GetItem(strValue, m_nAxisIdx, 0);
|
|
strValue = strItemName + _T("_NAME");
|
pFile->GetItem(strValue, m_strName, _T(""));
|
|
strValue = strItemName + _T("_MOVE_POS_ADDR");
|
pFile->GetItem(strValue, m_nMovePositionAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_MOVE_POS_COMMON_ADDR");
|
pFile->GetItem(strValue, m_nMovePositionCommonAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_POS_ADDR");
|
pFile->GetItem(strValue, m_nPositionAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_STATUS_ADDR");
|
pFile->GetItem(strValue, m_nStatusAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_MOVE_SPEED_ADDR");
|
pFile->GetItem(strValue, m_nMoveSpeedAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_ACCEL_TIME_ADDR");
|
pFile->GetItem(strValue, m_nAccelTimeAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_JOG_CMD_ADDR");
|
pFile->GetItem(strValue, m_nJogCommandAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_JOG_SPEED_ADDR");
|
pFile->GetItem(strValue, m_nJogSpeedAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_PLUS_LIMIT_POS");
|
pFile->GetItem(strValue, m_dPlusLimitPos, DBL_MAX);
|
|
strValue = strItemName + _T("_MINUS_LIMIT_POS");
|
pFile->GetItem(strValue, m_dMinusLimitPos, DBL_MIN);
|
|
strValue = strItemName + _T("_MAX_JOG_SPEED");
|
pFile->GetItem(strValue, m_dMaxJogSpeed, 0.0);
|
|
strValue = strItemName + _T("_MIN_JOG_SPEED");
|
pFile->GetItem(strValue, m_dMinJogSpeed, 0.0);
|
|
return TRUE;
|
}
|
|
BOOL SaveInfo(CMacroFile* pFile, const CString& strItemName)
|
{
|
if (pFile==NULL) return FALSE;
|
|
CString strValue = _T("");
|
|
strValue = strItemName + _T("_GANTRY_INDEX");
|
pFile->SetItem(strValue, m_nGantryIdx);
|
|
strValue = strItemName + _T("_AXIS_INDEX");
|
pFile->SetItem(strValue, m_nAxisIdx);
|
|
strValue = strItemName + _T("_NAME");
|
pFile->SetItem(strValue, m_strName);
|
|
strValue = strItemName + _T("_MOVE_POS_ADDR");
|
pFile->SetItem(strValue, m_nMovePositionAddr);
|
|
strValue = strItemName + _T("_MOVE_POS_COMMON_ADDR");
|
pFile->SetItem(strValue, m_nMovePositionCommonAddr);
|
|
strValue = strItemName + _T("_POS_ADDR");
|
pFile->SetItem(strValue, m_nPositionAddr);
|
|
strValue = strItemName + _T("_STATUS_ADDR");
|
pFile->SetItem(strValue, m_nStatusAddr);
|
|
strValue = strItemName + _T("_MOVE_SPEED_ADDR");
|
pFile->SetItem(strValue, m_nMoveSpeedAddr);
|
|
strValue = strItemName + _T("_ACCEL_TIME_ADDR");
|
pFile->SetItem(strValue, m_nAccelTimeAddr);
|
|
strValue = strItemName + _T("_JOG_CMD_ADDR");
|
pFile->SetItem(strValue, m_nJogCommandAddr);
|
|
strValue = strItemName + _T("_JOG_SPEED_ADDR");
|
pFile->SetItem(strValue, m_nJogSpeedAddr);
|
|
strValue = strItemName + _T("_PLUS_LIMIT_POS");
|
pFile->SetItem(strValue, m_dPlusLimitPos);
|
|
strValue = strItemName + _T("_MINUS_LIMIT_POS");
|
pFile->SetItem(strValue, m_dMinusLimitPos);
|
|
strValue = strItemName + _T("_MAX_JOG_SPEED");
|
pFile->SetItem(strValue, m_dMaxJogSpeed);
|
|
strValue = strItemName + _T("_MIN_JOG_SPEED");
|
pFile->SetItem(strValue, m_dMinJogSpeed);
|
|
return TRUE;
|
}
|
|
public:
|
int m_nMovePositionAddr; // À̵¿À§Ä¡
|
int m_nMovePositionCommonAddr; // À̵¿À§Ä¡ ¹è¿ ¾îµå·¹½º (for ACS)
|
int m_nPositionAddr; // ÇöÀçÀ§Ä¡
|
int m_nStatusAddr; // ÇöÀç»óÅÂ
|
int m_nMoveSpeedAddr; // ¼öµ¿À̵¿ ¼Óµµ
|
int m_nAccelTimeAddr; // ¼öµ¿À̵¿ °¡°¨¼Ó ½Ã°£
|
int m_nJogCommandAddr; // Á¶±×¸í·É
|
int m_nJogSpeedAddr; // Á¶±×¼Óµµ
|
|
CString m_strName;
|
int m_nAxisIdx;
|
int m_nGantryIdx;
|
long m_lStatus;
|
double m_dPosition;
|
double m_dPlusLimitPos; // +Limit Pos
|
double m_dMinusLimitPos; // -Limit Pos
|
double m_dMaxJogSpeed; // ÃÖ´ë Á¶±×¼Óµµ
|
double m_dMinJogSpeed; // ÃÖ¼Ò Á¶±×¼Óµµ
|
};
|
typedef std::vector<CMotorAxisAddr> VectorMotorAxisAddr;
|
typedef std::vector<CMotorAxisAddr>::iterator VectorMotorAxisAddrIt;
|
typedef std::vector<CMotorAxisAddr>::const_iterator constVectorMotorAxisAddrIt;
|
|
class AFX_EXT_CLASS CMotorGantryAddr
|
{
|
public:
|
CMotorGantryAddr(void) { Reset(); }
|
~CMotorGantryAddr(void) { Reset(); }
|
void Reset()
|
{
|
m_nManualGoAddr = MOTOR_ADDRESS_NONE;
|
m_nManualGoAckAddr = MOTOR_ADDRESS_NONE;
|
m_nCollisionXAddr = MOTOR_ADDRESS_NONE;
|
m_nCollisionYAddr = MOTOR_ADDRESS_NONE;
|
|
|
m_nAutoReviewGoAddr = MOTOR_ADDRESS_NONE;
|
m_nAutoReviewGoAckAddr = MOTOR_ADDRESS_NONE;
|
m_nReviewMoveCountAddr = MOTOR_ADDRESS_NONE;
|
m_nReviewTriggerCountAddr = MOTOR_ADDRESS_NONE;
|
m_nReviewScanEndPosAddr = MOTOR_ADDRESS_NONE;
|
m_nReviewSafePosAddr = MOTOR_ADDRESS_NONE;
|
|
m_nAutoMeasureGoAddr = MOTOR_ADDRESS_NONE;
|
m_nAutoMeasureGoAckAddr = MOTOR_ADDRESS_NONE;
|
m_nMeasureMoveCountAddr = MOTOR_ADDRESS_NONE;
|
m_nMeasureTriggerCountAddr = MOTOR_ADDRESS_NONE;
|
|
m_nAutoWsiGoAddr = MOTOR_ADDRESS_NONE;
|
m_nAutoWsiGoAckAddr = MOTOR_ADDRESS_NONE;
|
m_nWsiMoveCountAddr = MOTOR_ADDRESS_NONE;
|
m_nWsiTriggerCountAddr = MOTOR_ADDRESS_NONE;
|
m_nWsiMotionEndAddr = MOTOR_ADDRESS_NONE;
|
m_nWsiNextPosMoveAddr = MOTOR_ADDRESS_NONE;
|
|
m_nSoftwareTriggerAddr = MOTOR_ADDRESS_NONE;
|
m_nSoftwareTriggerCmdAdr = MOTOR_ADDRESS_NONE;
|
m_nImageSnapCompleteAddr = MOTOR_ADDRESS_NONE;
|
|
m_vecMotorAxisAddr.clear();
|
|
m_strName = _T("");
|
m_nGantryIdx = 0;
|
}
|
|
BOOL LoadInfo(CMacroFile* pFile, const CString& strItemName)
|
{
|
if (pFile==NULL) return FALSE;
|
|
CString strValue = _T("");
|
int temp = 0;
|
|
strValue = strItemName + _T("_GANTRY_IDX");
|
pFile->GetItem(strValue, m_nGantryIdx, 0);
|
|
strValue = strItemName + _T("_NAME");
|
pFile->GetItem(strValue, m_strName, _T(""));
|
|
strValue = strItemName + _T("_MANUAL_GO_ADDR");
|
pFile->GetItem(strValue, m_nManualGoAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_MANUAL_GO_ACK_ADDR");
|
pFile->GetItem(strValue, m_nManualGoAckAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_AUTO_REVIEW_GO_ADDR");
|
pFile->GetItem(strValue, m_nAutoReviewGoAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_AUTO_REVIEW_GO_ACK_ADDR");
|
pFile->GetItem(strValue, m_nAutoReviewGoAckAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_REVIEW_MOVE_COUNT_ADDR");
|
pFile->GetItem(strValue, m_nReviewMoveCountAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_REVIEW_TRIGGER_COUNT_ADDR");
|
pFile->GetItem(strValue, m_nReviewTriggerCountAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_REVIEW_SCAN_END_POS_ADDR");
|
pFile->GetItem(strValue, m_nReviewScanEndPosAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_REVIEW_SAFE_POS_ADDR");
|
pFile->GetItem(strValue, m_nReviewSafePosAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_AUTO_MEASURE_GO_ADDR");
|
pFile->GetItem(strValue, m_nAutoMeasureGoAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_AUTO_MEASURE_GO_ACK_ADDR");
|
pFile->GetItem(strValue, m_nAutoMeasureGoAckAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_MEASURE_MOVE_COUNT_ADDR");
|
pFile->GetItem(strValue, m_nMeasureMoveCountAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_MEASURE_TRIGGER_COUNT_ADDR");
|
pFile->GetItem(strValue, m_nMeasureTriggerCountAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_AUTO_WSI_GO_ADDR");
|
pFile->GetItem(strValue, m_nAutoWsiGoAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_AUTO_WSI_GO_ACK_ADDR");
|
pFile->GetItem(strValue, m_nAutoWsiGoAckAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_WSI_MOVE_COUNT_ADDR");
|
pFile->GetItem(strValue, m_nWsiMoveCountAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_WSI_TRIGGER_COUNT_ADDR");
|
pFile->GetItem(strValue, m_nWsiTriggerCountAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_WSI_MOTION_END_ADDR");
|
pFile->GetItem(strValue, m_nWsiMotionEndAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_WSI_NEXT_POS_MOVE_ADDR");
|
pFile->GetItem(strValue, m_nWsiNextPosMoveAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = m_strName + _T("_SOFTWARE_TRIGGER_ADDR");
|
pFile->GetItem(strValue,m_nSoftwareTriggerAddr,MOTOR_ADDRESS_NONE);
|
|
strValue = m_strName + _T("_SOFTWARE_TRIGGER_COMMAND_ADDR");
|
pFile->GetItem(strValue,m_nSoftwareTriggerCmdAdr,MOTOR_ADDRESS_NONE);
|
|
strValue = m_strName + _T("_IMAGE_SNAP_COMPLETE_ADDR");
|
pFile->GetItem(strValue,m_nImageSnapCompleteAddr,MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_AXIS_COUNT");
|
pFile->GetItem(strValue, temp, 0);
|
SetMotorAxisAddrCount(temp);
|
for (int nIdx=0; nIdx<GetMotorAxisAddrCount(); nIdx++)
|
{
|
CMotorAxisAddr* pNode = GetMotorAxisAddr(nIdx);
|
if (pNode==NULL) continue;
|
strValue.Format(_T("%s_AXIS_%02d"), strItemName, nIdx);
|
pNode->LoadInfo(pFile, strValue);
|
}
|
|
return TRUE;
|
}
|
|
BOOL SaveInfo(CMacroFile* pFile, const CString& strItemName)
|
{
|
if (pFile==NULL) return FALSE;
|
|
CString strValue = _T("");
|
|
strValue = strItemName + _T("_GANTRY_IDX");
|
pFile->SetItem(strValue, m_nGantryIdx);
|
|
strValue = strItemName + _T("_NAME");
|
pFile->SetItem(strValue, m_strName);
|
|
strValue = strItemName + _T("_MANUAL_GO_ADDR");
|
pFile->SetItem(strValue, m_nManualGoAddr);
|
|
strValue = strItemName + _T("_MANUAL_GO_ACK_ADDR");
|
pFile->SetItem(strValue, m_nManualGoAckAddr);
|
|
strValue = strItemName + _T("_AUTO_REVIEW_GO_ADDR");
|
pFile->SetItem(strValue, m_nAutoReviewGoAddr);
|
|
strValue = strItemName + _T("_AUTO_REVIEW_GO_ACK_ADDR");
|
pFile->SetItem(strValue, m_nAutoReviewGoAckAddr);
|
|
strValue = strItemName + _T("_REVIEW_MOVE_COUNT_ADDR");
|
pFile->SetItem(strValue, m_nReviewMoveCountAddr);
|
|
strValue = strItemName + _T("_REVIEW_TRIGGER_COUNT_ADDR");
|
pFile->SetItem(strValue, m_nReviewTriggerCountAddr);
|
|
strValue = strItemName + _T("_REVIEW_SCAN_END_POS_ADDR");
|
pFile->SetItem(strValue, m_nReviewScanEndPosAddr);
|
|
strValue = strItemName + _T("_REVIEW_SAFE_POS_ADDR");
|
pFile->SetItem(strValue, m_nReviewSafePosAddr);
|
|
strValue = strItemName + _T("_AUTO_MEASURE_GO_ADDR");
|
pFile->SetItem(strValue, m_nAutoMeasureGoAddr);
|
|
strValue = strItemName + _T("_AUTO_MEASURE_GO_ACK_ADDR");
|
pFile->SetItem(strValue, m_nAutoMeasureGoAckAddr);
|
|
strValue = strItemName + _T("_MEASURE_MOVE_COUNT_ADDR");
|
pFile->SetItem(strValue, m_nMeasureMoveCountAddr);
|
|
strValue = strItemName + _T("_MEASURE_TRIGGER_COUNT_ADDR");
|
pFile->SetItem(strValue, m_nMeasureTriggerCountAddr);
|
|
strValue = strItemName + _T("_AUTO_WSI_GO_ADDR");
|
pFile->SetItem(strValue, m_nAutoWsiGoAddr);
|
|
strValue = strItemName + _T("_AUTO_WSI_GO_ACK_ADDR");
|
pFile->SetItem(strValue, m_nAutoWsiGoAckAddr);
|
|
strValue = strItemName + _T("_WSI_MOVE_COUNT_ADDR");
|
pFile->SetItem(strValue, m_nWsiMoveCountAddr);
|
|
strValue = strItemName + _T("_WSI_TRIGGER_COUNT_ADDR");
|
pFile->SetItem(strValue, m_nWsiTriggerCountAddr);
|
|
strValue = strItemName + _T("_WSI_MOTION_END_ADDR");
|
pFile->SetItem(strValue, m_nWsiMotionEndAddr);
|
|
strValue = strItemName + _T("_WSI_NEXT_POS_MOVE_ADDR");
|
pFile->SetItem(strValue, m_nWsiNextPosMoveAddr);
|
|
strValue = m_strName + _T("_SOFTWARE_TRIGGER_ADDR");
|
pFile->SetItem(strValue,m_nSoftwareTriggerAddr);
|
|
strValue = m_strName + _T("_SOFTWARE_TRIGGER_COMMAND_ADDR");
|
pFile->SetItem(strValue,m_nSoftwareTriggerCmdAdr);
|
|
strValue = m_strName + _T("_IMAGE_SNAP_COMPLETE_ADDR");
|
pFile->SetItem(strValue,m_nImageSnapCompleteAddr);
|
|
strValue = strItemName + _T("_AXIS_COUNT");
|
pFile->SetItem(strValue, GetMotorAxisAddrCount());
|
for (int nIdx=0; nIdx<GetMotorAxisAddrCount(); nIdx++)
|
{
|
CMotorAxisAddr* pNode = GetMotorAxisAddr(nIdx);
|
if (pNode==NULL) continue;
|
strValue.Format(_T("%s_AXIS_%02d"), strItemName, nIdx);
|
pNode->SaveInfo(pFile, strValue);
|
}
|
|
return TRUE;
|
}
|
|
CMotorAxisAddr* GetMotorAxisAddr(int nIndex)
|
{
|
if (nIndex<0 || nIndex>=(int)m_vecMotorAxisAddr.size()) return NULL;
|
return &(m_vecMotorAxisAddr[nIndex]);
|
}
|
const CMotorAxisAddr* GetMotorAxisAddr(int nIndex) const
|
{
|
if (nIndex<0 || nIndex>=(int)m_vecMotorAxisAddr.size()) return NULL;
|
return &(m_vecMotorAxisAddr[nIndex]);
|
}
|
int GetMotorAxisAddrCount() const { return (int)m_vecMotorAxisAddr.size(); }
|
VectorMotorAxisAddr* GetVectorMotorAxisAddr() {return &m_vecMotorAxisAddr;}
|
const VectorMotorAxisAddr* GetVectorMotorAxisAddr() const {return &m_vecMotorAxisAddr;}
|
void SetMotorAxisAddrCount(int nCount) { m_vecMotorAxisAddr.resize(nCount); }
|
void SetMotorAxisAddr(const VectorMotorAxisAddr& vecData) {m_vecMotorAxisAddr = vecData; }
|
|
public:
|
int m_nManualGoAddr; // Manual À̵¿¸í·É
|
int m_nManualGoAckAddr; // Manual À̵¿¸í·É ACK
|
int m_nCollisionXAddr; // collision x position address
|
int m_nCollisionYAddr; // collision y position address
|
|
int m_nAutoReviewGoAddr; // Review ÀÚµ¿À̵¿¸í·É (À̵¿°¹¼ö)
|
int m_nAutoReviewGoAckAddr; // Review ÀÚµ¿À̵¿¸í·É ACK
|
int m_nReviewMoveCountAddr; // Review ÀÚµ¿À̵¿°¹¼ö
|
int m_nReviewTriggerCountAddr; // Review Æ®¸®°Å ¼ö
|
int m_nReviewScanEndPosAddr; // Review Scan End À§Ä¡
|
int m_nReviewSafePosAddr; // Review Safe À§Ä¡
|
|
int m_nAutoMeasureGoAddr; // Measure ÀÚµ¿À̵¿¸í·É (À̵¿°¹¼ö)
|
int m_nAutoMeasureGoAckAddr; // Measure ÀÚµ¿À̵¿¸í·É ACK
|
int m_nMeasureMoveCountAddr; // Measure ÀÚµ¿À̵¿°¹¼ö
|
int m_nMeasureTriggerCountAddr; // Measure Æ®¸®°Å ¼ö
|
|
int m_nAutoWsiGoAddr; // WSI ÀÚµ¿À̵¿¸í·É (À̵¿°¹¼ö)
|
int m_nAutoWsiGoAckAddr; // WSI ÀÚµ¿À̵¿¸í·É ACK
|
int m_nWsiMoveCountAddr; // WSI ÀÚµ¿À̵¿°¹¼ö
|
int m_nWsiTriggerCountAddr; // WSI Æ®¸®°Å ¼ö
|
int m_nWsiMotionEndAddr; // WSI MotionEnd ½ÅÈ£ ÁÖ¼Ò (Motor->Review)
|
int m_nWsiNextPosMoveAddr; // WSI NextPosMove ½ÅÈ£ ÁÖ¼Ò (Review->Motor)
|
|
int m_nSoftwareTriggerAddr; // ¼ÒÇÁÆ®¿þ¾î Æ®¸®°Å ÁÖ¼Ò
|
int m_nSoftwareTriggerCmdAdr; // ¼ÒÇÁÆ®¿þ¾î Æ®¸®°Å ¸í·É ÁÖ¼Ò
|
int m_nImageSnapCompleteAddr; // À̹ÌÁö ½º³À ¿Ï·á ÁÖ¼Ò
|
|
CString m_strName; // °ÕÆ®¸® À̸§
|
int m_nGantryIdx;
|
|
protected:
|
VectorMotorAxisAddr m_vecMotorAxisAddr;
|
};
|
typedef std::vector<CMotorGantryAddr> VectorMotorGantryAddr;
|
typedef std::vector<CMotorGantryAddr>::iterator VectorMotorGantryAddrIt;
|
typedef std::vector<CMotorGantryAddr>::const_iterator constVectorMotorGantryAddrIt;
|
|
class CMotorThetaAxisAddr : public CMotorAxisAddr
|
{
|
public:
|
CMotorThetaAxisAddr(void) { Reset(); }
|
~CMotorThetaAxisAddr(void) { Reset(); }
|
|
void Reset()
|
{
|
CMotorAxisAddr::Reset();
|
m_nManualGoAddr = MOTOR_ADDRESS_NONE;
|
m_nManualGoAckAddr = MOTOR_ADDRESS_NONE;
|
}
|
|
BOOL LoadInfo(CMacroFile* pFile, const CString& strItemName)
|
{
|
if (CMotorAxisAddr::LoadInfo(pFile, strItemName)==FALSE) return FALSE;
|
|
CString strValue = _T("");
|
|
strValue = strItemName + _T("_MANUAL_GO_ADDR");
|
pFile->GetItem(strValue, m_nManualGoAddr, MOTOR_ADDRESS_NONE);
|
|
strValue = strItemName + _T("_MANUAL_GO_ACK_ADDR");
|
pFile->GetItem(strValue, m_nManualGoAckAddr, MOTOR_ADDRESS_NONE);
|
|
return TRUE;
|
}
|
|
BOOL SaveInfo(CMacroFile* pFile, const CString& strItemName)
|
{
|
if (CMotorAxisAddr::SaveInfo(pFile, strItemName)==FALSE) return FALSE;
|
|
CString strValue = _T("");
|
|
strValue = strItemName + _T("_MANUAL_GO_ADDR");
|
pFile->SetItem(strValue, m_nManualGoAddr);
|
|
strValue = strItemName + _T("_MANUAL_GO_ACK_ADDR");
|
pFile->SetItem(strValue, m_nManualGoAckAddr);
|
|
return TRUE;
|
}
|
|
public:
|
int m_nManualGoAddr; // Manual À̵¿¸í·É
|
int m_nManualGoAckAddr; // Manual À̵¿¸í·É ACK
|
|
};
|
|
class CMotorControlInfo
|
{
|
public:
|
CMotorControlInfo(int nIndex=0) : m_nIndex(nIndex) { Reset(); }
|
~CMotorControlInfo(void) { }
|
void Reset()
|
{
|
m_strName = _T("");
|
|
m_nControllerType = 0;
|
m_strConnectionPort = _T("");
|
|
m_nOriginDirection = 0;
|
|
m_nAfDelaytime = 150;
|
m_nImageDelaytime = 50;
|
m_nWsiDelaytime = 3000;
|
|
m_nMaxAxisMoveCount = 200;
|
|
m_MotorCommonAddr.Reset();
|
m_vecMotorGantryAddr.clear();
|
|
m_bUseThetaMotor = FALSE;
|
m_ThetaMotorAxisAddr.Reset();
|
|
m_dStartMotorXpos = 200;
|
m_dStartMotorYpos = 200;
|
|
}
|
|
BOOL LoadInfo(CMacroFile* pFile, const CString& strItemName)
|
{
|
if (pFile==NULL) return FALSE;
|
|
CString strValue = _T("");
|
int temp = 0;
|
|
strValue = strItemName + _T("_INDEX");
|
pFile->GetItem(strValue, m_nIndex, 0);
|
|
strValue = strItemName + _T("_NAME");
|
pFile->GetItem(strValue, m_strName, _T(""));
|
|
strValue = strItemName + _T("_CONTROL_TYPE");
|
pFile->GetItem(strValue, m_nControllerType, 0);
|
|
strValue = strItemName + _T("_CONNECT_PORT");
|
pFile->GetItem(strValue, m_strConnectionPort, _T(""));
|
|
strValue = strItemName + _T("_ORIGIN_DIRECTION");
|
pFile->GetItem(strValue, m_nOriginDirection, 0);
|
|
strValue = strItemName + _T("_MAX_AXIS_MOVE_COUNT");
|
pFile->GetItem(strValue, m_nMaxAxisMoveCount, 200);
|
|
strValue = strItemName + _T("_AF_DELAY_TIME");
|
pFile->GetItem(strValue, m_nAfDelaytime, 150);
|
|
strValue = strItemName + _T("_IMAGE_DELAY_TIME");
|
pFile->GetItem(strValue, m_nImageDelaytime, 50);
|
|
strValue = strItemName + _T("_WSI_DELAY_TIME");
|
pFile->GetItem(strValue, m_nWsiDelaytime, 3000);
|
|
strValue = strItemName + _T("_START_POINT_XPOS");
|
pFile->GetItem(strValue, m_dStartMotorXpos, 200);
|
|
strValue = strItemName + _T("_START_POINT_YPOS");
|
pFile->GetItem(strValue, m_dStartMotorYpos, 200);
|
|
// common
|
strValue = strItemName + _T("_COMMON");
|
if (m_MotorCommonAddr.LoadInfo(pFile, strValue)==FALSE) return FALSE;
|
|
// gantry
|
strValue = strItemName + _T("_MOTOR_GANTRY_COUNT");
|
pFile->GetItem(strValue,temp, 0);
|
SetMotorGantryAddrCount(temp);
|
for (int nIdx=0; nIdx<GetMotorGantryAddrCount(); nIdx++)
|
{
|
CMotorGantryAddr *pNode = GetMotorGantryAddr(nIdx);
|
if (pNode==NULL) continue;
|
|
strValue.Format(_T("%s_GANTRY_%02d"), strItemName, nIdx);
|
pNode->LoadInfo(pFile, strValue);
|
}
|
|
// theta
|
strValue = strItemName + _T("_USE_THETA_MOTOR");
|
pFile->GetItem(strValue, m_bUseThetaMotor, 0);
|
|
strValue = strItemName + _T("_THETA_AXIS");
|
m_ThetaMotorAxisAddr.LoadInfo(pFile, strValue);
|
|
return TRUE;
|
}
|
|
BOOL SaveInfo(CMacroFile* pFile, const CString& strItemName)
|
{
|
if (pFile==NULL) return FALSE;
|
|
CString strValue = _T("");
|
|
strValue = strItemName + _T("_INDEX");
|
pFile->SetItem(strValue, m_nIndex);
|
|
strValue = strItemName + _T("_NAME");
|
pFile->SetItem(strValue, m_strName);
|
|
strValue = strItemName + _T("_CONTROL_TYPE");
|
pFile->SetItem(strValue, m_nControllerType);
|
|
strValue = strItemName + _T("_CONNECT_PORT");
|
pFile->SetItem(strValue, m_strConnectionPort);
|
|
strValue = strItemName + _T("_ORIGIN_DIRECTION");
|
pFile->SetItem(strValue, m_nOriginDirection);
|
|
strValue = strItemName + _T("_MAX_AXIS_MOVE_COUNT");
|
pFile->SetItem(strValue, m_nMaxAxisMoveCount);
|
|
strValue = strItemName + _T("_AF_DELAY_TIME");
|
pFile->SetItem(strValue, m_nAfDelaytime);
|
|
strValue = strItemName + _T("_IMAGE_DELAY_TIME");
|
pFile->SetItem(strValue, m_nImageDelaytime);
|
|
strValue = strItemName + _T("_WSI_DELAY_TIME");
|
pFile->SetItem(strValue, m_nWsiDelaytime);
|
|
strValue = strItemName + _T("_START_POINT_XPOS");
|
pFile->GetItem(strValue, m_dStartMotorXpos);
|
|
strValue = strItemName + _T("_START_POINT_YPOS");
|
pFile->GetItem(strValue, m_dStartMotorYpos);
|
|
// common
|
strValue = strItemName + _T("_COMMON");
|
if (m_MotorCommonAddr.SaveInfo(pFile, strValue)==FALSE) return FALSE;
|
|
// gantry
|
strValue = strItemName + _T("_MOTOR_GANTRY_COUNT");
|
pFile->SetItem(strValue, GetMotorGantryAddrCount());
|
for (int nIdx=0; nIdx<GetMotorGantryAddrCount(); nIdx++)
|
{
|
CMotorGantryAddr *pNode = GetMotorGantryAddr(nIdx);
|
if (pNode==NULL) continue;
|
|
strValue.Format(_T("%s_GANTRY_%02d"), strItemName, nIdx);
|
pNode->SaveInfo(pFile, strValue);
|
}
|
|
// theta
|
strValue = strItemName + _T("_USE_THETA_MOTOR");
|
pFile->SetItem(strValue, m_bUseThetaMotor);
|
|
strValue = strItemName + _T("_THETA_AXIS");
|
m_ThetaMotorAxisAddr.SaveInfo(pFile, strValue);
|
|
return TRUE;
|
}
|
|
int GetTotalAxisIndex(const CString& strName) const
|
{
|
int nAxisIdx = 0;
|
for (int nG_idx=0; nG_idx<GetMotorGantryAddrCount(); nG_idx++)
|
{
|
const CMotorGantryAddr *pG_Addr = GetMotorGantryAddr(nG_idx);
|
if (pG_Addr==NULL) continue;
|
|
for (int nA_idx=0; nA_idx<pG_Addr->GetMotorAxisAddrCount(); nA_idx++)
|
{
|
const CMotorAxisAddr *pA_Addr = pG_Addr->GetMotorAxisAddr(nA_idx);
|
if (pA_Addr==NULL) continue;
|
|
if (pA_Addr->m_strName.CollateNoCase(strName)==0)
|
{
|
return nAxisIdx;
|
}
|
|
nAxisIdx++;
|
}
|
}
|
|
return -1;
|
}
|
|
CMotorCommonAddr* GetMotorCommonAddr()
|
{
|
return &m_MotorCommonAddr;
|
}
|
|
const CMotorCommonAddr* GetMotorCommonAddr() const
|
{
|
return &m_MotorCommonAddr;
|
|
}
|
CMotorGantryAddr* GetMotorGantryAddr(int nIndex)
|
{
|
if (nIndex<0 || nIndex>=(int)m_vecMotorGantryAddr.size()) return NULL;
|
return &(m_vecMotorGantryAddr[nIndex]);
|
}
|
|
const CMotorGantryAddr* GetMotorGantryAddr(int nIndex) const
|
{
|
if (nIndex<0 || nIndex>=(int)m_vecMotorGantryAddr.size()) return NULL;
|
return &(m_vecMotorGantryAddr[nIndex]);
|
}
|
|
int GetMotorGantryAddrCount() const
|
{
|
return (int)m_vecMotorGantryAddr.size();
|
}
|
|
void CMotorControlInfo::SetMotorGantryAddrCount(int nCount)
|
{
|
if (nCount<0) return;
|
m_vecMotorGantryAddr.resize(nCount);
|
}
|
|
int GetIndex() const { return m_nIndex; }
|
CString GetName() const { return m_strName; }
|
int GetControllerType() const { return m_nControllerType; }
|
CString GetConnectionPort() const { return m_strConnectionPort; }
|
int GetOriginDirection() const { return m_nOriginDirection; }
|
int GetAfDelayTime() const { return m_nAfDelaytime; }
|
int GetImageDelayTime() const { return m_nImageDelaytime; }
|
int GetWsiDelayTime() const { return m_nWsiDelaytime; }
|
int GetMaxAxisMoveCount() const { return m_nMaxAxisMoveCount; }
|
double GetStartMotorXpos() const {return m_dStartMotorXpos;}
|
double GetStartMotorYpos() const {return m_dStartMotorYpos;}
|
|
|
void SetIndex(int nIndex) { m_nIndex = nIndex; }
|
void SetName(const CString& strName) { m_strName = strName; }
|
void SetControllerType(int nType) { m_nControllerType = nType; }
|
void SetConnectionPort(const CString& strPort) { m_strConnectionPort = strPort; }
|
void SetOriginDirection(int nDir) { m_nOriginDirection = nDir; }
|
void SetAfDelayTime(int nTime) { m_nAfDelaytime = nTime; }
|
void SetImageDelayTime(int nTime) { m_nImageDelaytime = nTime; }
|
void SetWsiDelayTime(int nTime) { m_nWsiDelaytime= nTime; }
|
void SetMaxAxisMoveCount(int nCount) { m_nMaxAxisMoveCount = nCount; }
|
void SetStartMotorXpos(double Xpos) {m_dStartMotorXpos=Xpos;}
|
void SetStartMotorYpos(double Ypos) {m_dStartMotorYpos=Ypos;}
|
|
|
BOOL GetUseThetaMotor() const { return m_bUseThetaMotor; }
|
void SetUseThetaMotor(BOOL bUse) { m_bUseThetaMotor = bUse; }
|
CMotorThetaAxisAddr* GetThetaMotorAxisAddr() { return &m_ThetaMotorAxisAddr; }
|
const CMotorThetaAxisAddr* GetThetaMotorAxisAddr() const { return &m_ThetaMotorAxisAddr; }
|
|
VectorMotorGantryAddr* GetVectorMotorGantryAddr() {return &m_vecMotorGantryAddr;}
|
const VectorMotorGantryAddr*GetVectorMotorGantryAddr() const {return &m_vecMotorGantryAddr;}
|
|
void SetMotorCommonAddr(const CMotorCommonAddr& src) {m_MotorCommonAddr = src;}
|
void SetMotorGantryAddr(const VectorMotorGantryAddr& vecData) {m_vecMotorGantryAddr = vecData; }
|
void SetMotorThetaAxisAddr(const CMotorThetaAxisAddr& src) {m_ThetaMotorAxisAddr = src;}
|
|
protected:
|
int m_nIndex;
|
CString m_strName;
|
|
int m_nControllerType;
|
CString m_strConnectionPort;
|
|
int m_nOriginDirection;
|
int m_nAfDelaytime;
|
int m_nImageDelaytime;
|
int m_nWsiDelaytime;
|
int m_nMaxAxisMoveCount;
|
|
CMotorCommonAddr m_MotorCommonAddr;
|
VectorMotorGantryAddr m_vecMotorGantryAddr;
|
|
int m_bUseThetaMotor;
|
CMotorThetaAxisAddr m_ThetaMotorAxisAddr;
|
double m_dStartMotorXpos;
|
double m_dStartMotorYpos;
|
|
|
};
|