#pragma once
|
|
#include "CHCommonClasses/MacroFile.h"
|
|
interface ILensChangeControl2Parent
|
{
|
virtual void ILCC2P_DisplayMessage(int nIndex, const TCHAR* lpstrFormat, ...) = 0;
|
virtual void ILCC2P_ChangePosition(int nIndex, int nPos) = 0;
|
};
|
|
class CLensChangeControlInfo
|
{
|
public:
|
CLensChangeControlInfo(int nIndex=0) : m_nIndex(nIndex) { Reset(); }
|
~CLensChangeControlInfo(void) { Reset(); }
|
void Reset()
|
{
|
m_strName = _T("");
|
m_nControllerType = 0;
|
m_strConnectionPort = _T("");
|
m_nBaudRate = CBR_9600;
|
m_nDefaultLevel = 0;
|
m_nCurrentLevel = 0;
|
m_nMaxLevel = 0;
|
m_nMinLevel = 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("_BAUD_RATE");
|
pFile->GetItem(strValue, m_nBaudRate, CBR_9600);
|
|
strValue = strItemName + _T("_DEFAULT_LEVEL");
|
pFile->GetItem(strValue, m_nDefaultLevel, 0);
|
|
strValue = strItemName + _T("_CURRENT_LEVEL");
|
pFile->GetItem(strValue, m_nCurrentLevel, 0);
|
|
strValue = strItemName + _T("_MAX_LEVEL");
|
pFile->GetItem(strValue, m_nMaxLevel, 0);
|
|
strValue = strItemName + _T("_MIN_LEVEL");
|
pFile->GetItem(strValue, m_nMinLevel, 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("_BAUD_RATE");
|
pFile->SetItem(strValue, m_nBaudRate);
|
|
strValue = strItemName + _T("_DEFAULT_LEVEL");
|
pFile->SetItem(strValue, m_nDefaultLevel);
|
|
strValue = strItemName + _T("_CURRENT_LEVEL");
|
pFile->SetItem(strValue, m_nCurrentLevel);
|
|
strValue = strItemName + _T("_MAX_LEVEL");
|
pFile->SetItem(strValue, m_nMaxLevel);
|
|
strValue = strItemName + _T("_MIN_LEVEL");
|
pFile->SetItem(strValue, m_nMinLevel);
|
|
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; }
|
int GetBaudRate() const { return m_nBaudRate; }
|
int GetDefaultLevel() const { return m_nDefaultLevel; }
|
int GetCurrentLevel() const { return m_nCurrentLevel; }
|
int GetMaxLevel() const { return m_nMaxLevel; }
|
int GetMinLevel() const { return m_nMinLevel; }
|
|
|
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 SetBaudRate(int nValue) { m_nBaudRate = nValue; }
|
void SetDefaultLevel(int nValue) { m_nDefaultLevel = nValue; }
|
void SetCurrentLevel(int nValue) { m_nCurrentLevel = nValue; }
|
void SetMaxLevel(int nValue) { m_nMaxLevel = nValue; }
|
void SetMinLevel(int nValue) { m_nMinLevel = nValue; }
|
|
|
protected:
|
int m_nIndex;
|
CString m_strName;
|
|
int m_nControllerType;
|
CString m_strConnectionPort;
|
int m_nBaudRate; // ¿¬°á ¼Óµµ
|
|
int m_nDefaultLevel;
|
int m_nCurrentLevel;
|
int m_nMaxLevel; //ÃÖ´ë Á¶¸í ¹à±â
|
int m_nMinLevel; //ÃÖ¼Ò Á¶¸í ¹à±â
|
};
|