#pragma once
|
|
#include <vector>
|
#include "CHCommonClasses/MacroFile.h"
|
|
enum AfmJogCmdType { AfmJogCmd_Up=-1, AfmJogCmd_Down=1 };
|
|
struct SAfmRecipeInfo
|
{
|
SAfmRecipeInfo()
|
{
|
strRecipeName = _T("");
|
nZoomCount = 0;
|
}
|
CString strRecipeName;
|
int nZoomCount;
|
};
|
typedef std::vector<SAfmRecipeInfo> VectorAFMRecipeInfo;
|
typedef std::vector<SAfmRecipeInfo>::iterator VectorAFMRecipeInfoIt;
|
typedef std::vector<SAfmRecipeInfo>::const_iterator constVectorAFMRecipeInfoIt;
|
|
interface IAfmControl2Parent
|
{
|
virtual void IAFC2P_DisplayMessage(int nIndex, const TCHAR* lpstrFormat, ...) = 0;
|
virtual void IAFC2P_CurrentStatus(int nIndex, int nStatusCode) = 0;
|
virtual void IAFC2P_RecipeChangeComplete(int nIndex, int nResultCode) = 0;
|
};
|
|
class CAfmControlInfo
|
{
|
public:
|
CAfmControlInfo(int nIndex=0) : m_nIndex(nIndex) { Reset(); }
|
~CAfmControlInfo(void) { Reset(); }
|
void Reset()
|
{
|
m_strName = _T("");
|
m_nControllerType = 0;
|
m_strConnectionPort = _T("");
|
m_dDefaultJogSpeed = 1.0;
|
m_dMaxJogSpeed = 0.01;
|
m_dMinJogSpeed = 5.0;
|
m_dCurrentJogSpeed = 0;
|
}
|
|
BOOL LoadInfo(CMacroFile* pFile, const CString& strItemName)
|
{
|
if (pFile==NULL) return FALSE;
|
|
CString strValue = _T("");
|
|
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("_DEFAULT_JOG_SPPED");
|
pFile->GetItem(strValue, m_dDefaultJogSpeed, 1.0);
|
|
strValue = strItemName + _T("_MAX_JOG_SPEED");
|
pFile->GetItem(strValue, m_dMaxJogSpeed, 0.01);
|
|
strValue = strItemName + _T("_MIN_JOG_SPEED");
|
pFile->GetItem(strValue, m_dMinJogSpeed, 5.0);
|
|
strValue = strItemName + _T("_CURRENT_JOG_SPEED");
|
pFile->GetItem(strValue, m_dCurrentJogSpeed, 0);
|
|
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("_DEFAULT_JOG_SPPED");
|
pFile->SetItem(strValue, m_dDefaultJogSpeed);
|
|
strValue = strItemName + _T("_MAX_JOG_SPEED");
|
pFile->SetItem(strValue, m_dMaxJogSpeed);
|
|
strValue = strItemName + _T("_MIN_JOG_SPEED");
|
pFile->SetItem(strValue, m_dMinJogSpeed);
|
|
strValue = strItemName + _T("_CURRENT_JOG_SPEED");
|
pFile->SetItem(strValue, m_dCurrentJogSpeed);
|
|
return TRUE;
|
}
|
|
int GetIndex() const { return m_nIndex; }
|
CString GetName() const { return m_strName; }
|
int GetControllerType() const { return m_nControllerType; }
|
CString GetConnectionPort() const { return m_strConnectionPort; }
|
double GetDefaultJogSpeed() const { return m_dDefaultJogSpeed; }
|
double GetCurrentJogSpeed() const { return m_dCurrentJogSpeed; }
|
double GetMaxJogSpeed() const { return m_dMaxJogSpeed; }
|
double GetMinJogSpeed() const { return m_dMinJogSpeed; }
|
|
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 SetDefaultJogSpeed(double dValue) { m_dDefaultJogSpeed = dValue; }
|
void SetCurrentJogSpeed(double dValue) { m_dCurrentJogSpeed = dValue; }
|
void SetMaxJogSpeed(double dValue) { m_dMaxJogSpeed = dValue; }
|
void SetMinJogSpeed(double dValue) { m_dMinJogSpeed = dValue; }
|
|
protected:
|
int m_nIndex;
|
CString m_strName;
|
|
int m_nControllerType;
|
CString m_strConnectionPort;
|
double m_dDefaultJogSpeed;
|
|
double m_dMaxJogSpeed;
|
double m_dMinJogSpeed;
|
double m_dCurrentJogSpeed;
|
};
|