#include "StdAfx.h"
|
#include "ModuleStatus.h"
|
|
CModuleStatus::CModuleStatus(int nType, int nLens, int nModuleIdx, int nGantryIdx, int nHeaderIdx) :
|
nModuleType(nType), nLensType(nLens), nModuleIndex(nModuleIdx), nGantryIndex(nGantryIdx), nHeaderIndex(nHeaderIdx)
|
{
|
}
|
|
CModuleStatus::~CModuleStatus(void)
|
{
|
|
}
|
|
void CModuleStatus::SetSelected(BOOL bSelected)
|
{
|
sCameraControl.bSelected = bSelected;
|
}
|
|
void CModuleStatus::SetCameraControl(const SCameraControl& cameraControl)
|
{
|
sCameraControl = cameraControl;
|
}
|
|
void CModuleStatus::SetMotorPosition(const SMotorPosition& motorPosition)
|
{
|
sMotorPosition = motorPosition;
|
}
|
//181031
|
//void CModuleStatus::SetProtocolReviewModuleData1(const _ProtocalReviewModlueData& moduleData);
|
//{
|
// m_ModuleData = moduleData;
|
//}
|
|
void CModuleStatus::SetMotorStatus(const SMotorStatus& motorStatus)
|
{
|
sMotorStatus = motorStatus;
|
}
|
|
void CModuleStatus::SetAxisIndex(const SAxisIndex& axisIndex)
|
{
|
sAxisIndex = axisIndex;
|
}
|
|
void CModuleStatus::SetCoordInfo(const SCoordInfo& coordInfo)
|
{
|
sCoordInfo = coordInfo;
|
}
|
|
void CModuleStatus::SetCameraInfo(int nIndex, const SCameraInfo& cameraInfo)
|
{
|
if (nIndex<0 || nIndex>=vectorCameraInfo.size())
|
{
|
return;
|
}
|
vectorCameraInfo[nIndex] = cameraInfo;
|
}
|
|
void CModuleStatus::SetMagnificInfo(int nIndex, const SMagnificInfo& magnificInfo)
|
{
|
if(nIndex < 0 || nIndex >= vectorMagnificInfo.size())
|
{
|
return;
|
}
|
vectorMagnificInfo[nIndex] = magnificInfo;
|
}
|
|
void CModuleStatus::SetVectorCameraInfo(const VectorSCameraInfo& vCameraInfo)
|
{
|
vectorCameraInfo = vCameraInfo;
|
}
|
|
void CModuleStatus::SetVectorMagnificInfo(const VectorSMagnificInfo& vMagnificInfo)
|
{
|
vectorMagnificInfo = vMagnificInfo;
|
}
|
|
SCameraControl* CModuleStatus::GetCameraControl()
|
{
|
return &sCameraControl;
|
}
|
|
SMotorPosition* CModuleStatus::GetMotorPosition()
|
{
|
return &sMotorPosition;
|
}
|
|
SMotorStatus* CModuleStatus::GetMotorStatus()
|
{
|
return &sMotorStatus;
|
}
|
|
SAxisIndex* CModuleStatus::GetAxisIndex()
|
{
|
return &sAxisIndex;
|
}
|
|
SCoordInfo* CModuleStatus::GetCoordInfo()
|
{
|
return &sCoordInfo;
|
}
|
|
SExternalIndex* CModuleStatus::GetExternalIndex()
|
{
|
return &sExternalIndex;
|
}
|
|
SCameraInfo* CModuleStatus::GetCameraInfo(int nIndex)
|
{
|
if (nIndex<0) return NULL;
|
|
if (nLensType==0)
|
{
|
return &vectorCameraInfo[0];
|
}
|
|
if (nIndex>=(int)vectorCameraInfo.size())
|
{
|
return NULL;
|
}
|
|
return &vectorCameraInfo[nIndex];
|
}
|
|
SMagnificInfo* CModuleStatus::GetMagnificInfo(int nIndex)
|
{
|
if (nIndex<0 || nIndex>=(int)vectorMagnificInfo.size())
|
{
|
return NULL;
|
}
|
return &vectorMagnificInfo[nIndex];
|
}
|
|
VectorSCameraInfo* CModuleStatus::GetVectorCameraInfo()
|
{
|
return &vectorCameraInfo;
|
}
|
|
VectorSMagnificInfo* CModuleStatus::GetVectorSMagnificInfo()
|
{
|
return &vectorMagnificInfo;
|
}
|
|
int CModuleStatus::GetCameraInfoCount() const
|
{
|
return (int)vectorCameraInfo.size();
|
}
|
|
|
int CModuleStatus::GetMagnificInfoCount() const
|
{
|
return (int)vectorMagnificInfo.size();
|
}
|
|
SCameraInfo* CModuleStatus::GetCurrentCameraInfo()
|
{
|
return GetCameraInfo(nModuleIndex);
|
}
|
|
SMagnificInfo* CModuleStatus::GetCurrentMagnificInfo()
|
{
|
return GetMagnificInfo(sCameraControl.nZoomLevel);
|
}
|
|
const SMagnificInfo* CModuleStatus::GetCurrentMagnificInfo() const
|
{
|
return GetMagnificInfo(sCameraControl.nZoomLevel);
|
}
|
|
const SExternalIndex* CModuleStatus::GetExternalIndex() const
|
{
|
return &sExternalIndex;
|
}
|
|
const SCameraControl* CModuleStatus::GetCameraControl() const
|
{
|
return &sCameraControl;
|
}
|
|
const SMotorPosition* CModuleStatus::GetMotorPosition() const
|
{
|
return &sMotorPosition;
|
}
|
|
const SMotorStatus* CModuleStatus::GetMotorStatus() const
|
{
|
return &sMotorStatus;
|
}
|
|
const SAxisIndex* CModuleStatus::GetAxisIndex() const
|
{
|
return &sAxisIndex;
|
}
|
|
const SCoordInfo* CModuleStatus::GetCoordInfo() const
|
{
|
return &sCoordInfo;
|
}
|
|
const SCameraInfo* CModuleStatus::GetCameraInfo(int nIndex) const
|
{
|
if (nIndex<0) return NULL;
|
|
if (nLensType==0)
|
{
|
return &vectorCameraInfo[0];
|
}
|
|
if (nIndex>=(int)vectorCameraInfo.size())
|
{
|
return NULL;
|
}
|
|
return &vectorCameraInfo[nIndex];
|
}
|
|
const SMagnificInfo* CModuleStatus::GetMagnificInfo(int nIndex) const
|
{
|
if (nIndex<0 || nIndex>=(int)vectorMagnificInfo.size())
|
{
|
return NULL;
|
}
|
return &vectorMagnificInfo[nIndex];
|
}
|
|
const SCameraInfo* CModuleStatus::GetCurrentCameraInfo() const
|
{
|
return GetCameraInfo(sCameraControl.nZoomLevel);
|
}
|
|
const VectorSCameraInfo* CModuleStatus::GetVectorCameraInfo() const
|
{
|
return &vectorCameraInfo;
|
}
|
|
const VectorSMagnificInfo* CModuleStatus::GetVectorSMagnificInfo() const
|
{
|
return &vectorMagnificInfo;
|
}
|
|
void CModuleStatus::AddCameraInfo(const SCameraInfo& cameraInfo)
|
{
|
vectorCameraInfo.push_back(cameraInfo);
|
}
|
|
void CModuleStatus::AddMagnificInfo(const SMagnificInfo& magnificInfo)
|
{
|
vectorMagnificInfo.push_back(magnificInfo);
|
}
|