|
|
|
|
#include "StdAfx.h"
|
|
|
|
|
#include "Camera.h"
|
|
|
|
|
#include "Propertie.h"
|
|
|
|
|
#include "PropertieMgr.h"
|
|
|
|
|
#include "LogMgr.h"
|
|
|
|
|
#include "AuthorityMgr.h"
|
|
|
|
|
#include "GlobalDrawMgr.h"
|
|
|
|
|
#include "DrawSimpleShape.h"
|
|
|
|
|
#include "PlatformXY.h"
|
|
|
|
|
#include "ExceptionMsg.h"
|
|
|
|
|
|
|
|
|
|
CCamera::CCamera(void)
|
|
|
|
|
{
|
|
|
|
|
m_OnePixDis = 1;//һ<><D2BB><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>Ӧ<EFBFBD><D3A6>ʵ<EFBFBD>ʳߴ<CAB3>(mm/pix)
|
|
|
|
|
m_bIni = false;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>ɹ<EFBFBD>
|
|
|
|
|
m_bRotatoPtByAngle = false;//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>İ<EFBFBD>װ<EFBFBD>Ƕ<EFBFBD><C7B6><EFBFBD><EFBFBD><EFBFBD>ץȡ<D7A5><C8A1><EFBFBD><EFBFBD>
|
|
|
|
|
m_Angle = 0;
|
|
|
|
|
m_bUse = true;//<2F>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9>
|
|
|
|
|
m_bLeftTop = true;//<2F><><EFBFBD><D7BC><EFBFBD>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD>Ͻ<EFBFBD>(false Ϊ<><CEAA><EFBFBD>½<EFBFBD>)
|
|
|
|
|
m_bPixCoord = true;//<2F><><EFBFBD><EFBFBD>ץȡ<D7A5><C8A1><EFBFBD>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>ʿ<EFBFBD><CABF><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>mm <20><>λ<EFBFBD><CEBB>ֵ)
|
|
|
|
|
m_bCatch = true;//ʵ<><CAB5>ץȡ
|
|
|
|
|
m_CatchFrontDelay = 100;//ץȡǰ<C8A1><C7B0>ʱms
|
|
|
|
|
m_CatchWaitDelay = 200;//ץȡ<D7A5>ȴ<EFBFBD><C8B4><EFBFBD>ʱms
|
|
|
|
|
}
|
|
|
|
|
CCamera::~CCamera(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
CMFCPropertyGridProperty *CCamera::CreatGridProperty()
|
|
|
|
|
{
|
|
|
|
|
CString PropertyName;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CString Description;//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
CString Path = _T("Camera");;//<2F>洢·<E6B4A2><C2B7>
|
|
|
|
|
CString Name;
|
|
|
|
|
//-------------------------------------------------------------------------------//
|
|
|
|
|
PropertyName = _T("<EFBFBD><EFBFBD>ͨ<EFBFBD>趨");
|
|
|
|
|
CMFCPropertyGridProperty* pGroup = new CMFCPropertyGridProperty(PropertyName);
|
|
|
|
|
//-------------------------------------------------------------------------------//
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY))
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
|
|
|
|
|
Name = _T("m_bUse");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CPropertie *pPropertie = new CPropertie;
|
|
|
|
|
pPropertie->SetpVal((void*)&m_bUse);
|
|
|
|
|
pPropertie->SetType(_PROP_TYPE_BOOL );
|
|
|
|
|
pPropertie->SetpModule(this);
|
|
|
|
|
pPropertie->SetPath(Path);
|
|
|
|
|
pPropertie->SetName(Name);
|
|
|
|
|
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
PropertyName = _T("<EFBFBD>Ƿ<EFBFBD>ʹ<EFBFBD><EFBFBD>");
|
|
|
|
|
Description = _T("<EFBFBD>Ƿ<EFBFBD>ʹ<EFBFBD><EFBFBD>camera");
|
|
|
|
|
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_bUse, Description);
|
|
|
|
|
pGroup->AddSubItem(p1);
|
|
|
|
|
|
|
|
|
|
gDevicePropertieMgr.Insert(p1, pPropertie);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
|
|
|
|
|
Name = _T("m_bCatch");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CPropertie *pPropertie = new CPropertie;
|
|
|
|
|
pPropertie->SetpVal((void*)&m_bCatch);
|
|
|
|
|
pPropertie->SetType(_PROP_TYPE_BOOL );
|
|
|
|
|
pPropertie->SetpModule(this);
|
|
|
|
|
pPropertie->SetPath(Path);
|
|
|
|
|
pPropertie->SetName(Name);
|
|
|
|
|
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
PropertyName = _T("<EFBFBD>Ƿ<EFBFBD>ץȡ");
|
|
|
|
|
Description = _T("FALSE <20><>ʱ<EFBFBD><EFBFBD>0,<2C><><EFBFBD>Dz<EFBFBD><C7B2><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_bCatch, Description);
|
|
|
|
|
pGroup->AddSubItem(p1);
|
|
|
|
|
|
|
|
|
|
gDevicePropertieMgr.Insert(p1, pPropertie);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
|
|
|
|
|
Name = _T("m_CatchFrontDelay");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CPropertie *pPropertie = new CPropertie;
|
|
|
|
|
pPropertie->SetpVal((void*)&m_CatchFrontDelay);
|
|
|
|
|
pPropertie->SetType(_PROP_TYPE_INT);
|
|
|
|
|
pPropertie->SetpModule(this);
|
|
|
|
|
pPropertie->SetPath(Path);
|
|
|
|
|
pPropertie->SetName(Name);
|
|
|
|
|
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
PropertyName = _T("ץȡǰ<EFBFBD><EFBFBD>ʱ");
|
|
|
|
|
Description = _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ץȡǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱms");
|
|
|
|
|
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_CatchFrontDelay, Description);
|
|
|
|
|
pGroup->AddSubItem(p1);
|
|
|
|
|
|
|
|
|
|
gDevicePropertieMgr.Insert(p1, pPropertie);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
|
|
|
|
|
Name = _T("m_CatchWaitDelay");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CPropertie *pPropertie = new CPropertie;
|
|
|
|
|
pPropertie->SetpVal((void*)&m_CatchWaitDelay);
|
|
|
|
|
pPropertie->SetType(_PROP_TYPE_INT);
|
|
|
|
|
pPropertie->SetpModule(this);
|
|
|
|
|
pPropertie->SetPath(Path);
|
|
|
|
|
pPropertie->SetName(Name);
|
|
|
|
|
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
PropertyName = _T("ץȡ<EFBFBD>ȴ<EFBFBD><EFBFBD><EFBFBD>ʱ");
|
|
|
|
|
Description = _T("ʶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD><EFBFBD><EFBFBD>ocx <20><><EFBFBD><EFBFBD>ʱms");
|
|
|
|
|
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_CatchWaitDelay, Description);
|
|
|
|
|
pGroup->AddSubItem(p1);
|
|
|
|
|
|
|
|
|
|
gDevicePropertieMgr.Insert(p1, pPropertie);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
|
|
|
|
|
Name = _T("m_bRotatoPtByAngle");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CPropertie *pPropertie = new CPropertie;
|
|
|
|
|
pPropertie->SetpVal((void*)&m_bRotatoPtByAngle);
|
|
|
|
|
pPropertie->SetType(_PROP_TYPE_BOOL );
|
|
|
|
|
pPropertie->SetpModule(this);
|
|
|
|
|
pPropertie->SetPath(Path);
|
|
|
|
|
pPropertie->SetName(Name);
|
|
|
|
|
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
PropertyName = _T("<EFBFBD>Ƕ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
Description = _T("<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>İ<EFBFBD>װ<EFBFBD>Ƕ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ץȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_bRotatoPtByAngle, Description);
|
|
|
|
|
pGroup->AddSubItem(p1);
|
|
|
|
|
gDevicePropertieMgr.Insert(p1, pPropertie);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
|
|
|
|
|
Name = _T("m_Angle");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CPropertie *pPropertie = new CPropertie;
|
|
|
|
|
pPropertie->SetpVal((void*)&m_Angle);
|
|
|
|
|
pPropertie->SetType(_PROP_TYPE_DOUBLE);
|
|
|
|
|
pPropertie->SetpModule(this);
|
|
|
|
|
pPropertie->SetPath(Path);
|
|
|
|
|
pPropertie->SetName(Name);
|
|
|
|
|
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
PropertyName = _T("<EFBFBD><EFBFBD>װ<EFBFBD>Ƕ<EFBFBD>");
|
|
|
|
|
Description = _T("CCD X <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>X <20><><EFBFBD>ĽǶ<C4BD>");
|
|
|
|
|
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_Angle, Description);
|
|
|
|
|
pGroup->AddSubItem(p1);
|
|
|
|
|
gDevicePropertieMgr.Insert(p1, pPropertie);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
|
|
|
|
|
Name = _T("m_bLeftTop");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CPropertie *pPropertie = new CPropertie;
|
|
|
|
|
pPropertie->SetpVal((void*)&m_bLeftTop);
|
|
|
|
|
pPropertie->SetType(_PROP_TYPE_BOOL );
|
|
|
|
|
pPropertie->SetpModule(this);
|
|
|
|
|
pPropertie->SetPath(Path);
|
|
|
|
|
pPropertie->SetName(Name);
|
|
|
|
|
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
PropertyName = _T("<EFBFBD><EFBFBD><EFBFBD>Ͻǻ<EFBFBD>");
|
|
|
|
|
Description = _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD>Ͻ<EFBFBD>(false Ϊ<><CEAA><EFBFBD>½<EFBFBD>)");
|
|
|
|
|
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_bLeftTop, Description);
|
|
|
|
|
pGroup->AddSubItem(p1);
|
|
|
|
|
gDevicePropertieMgr.Insert(p1, pPropertie);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
|
|
|
|
|
Name = _T("m_bPixCoord");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CPropertie *pPropertie = new CPropertie;
|
|
|
|
|
pPropertie->SetpVal((void*)&m_bPixCoord);
|
|
|
|
|
pPropertie->SetType(_PROP_TYPE_BOOL );
|
|
|
|
|
pPropertie->SetpModule(this);
|
|
|
|
|
pPropertie->SetPath(Path);
|
|
|
|
|
pPropertie->SetName(Name);
|
|
|
|
|
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
PropertyName = _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
Description = _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ץȡ<EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_bPixCoord, Description);
|
|
|
|
|
pGroup->AddSubItem(p1);
|
|
|
|
|
gDevicePropertieMgr.Insert(p1, pPropertie);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
|
|
|
|
|
Name = _T("m_OnePixDis");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CPropertie *pPropertie = new CPropertie;
|
|
|
|
|
pPropertie->SetpVal((void*)&m_OnePixDis);
|
|
|
|
|
pPropertie->SetType(_PROP_TYPE_DOUBLE);
|
|
|
|
|
pPropertie->SetpModule(this);
|
|
|
|
|
pPropertie->SetPath(Path);
|
|
|
|
|
pPropertie->SetName(Name);
|
|
|
|
|
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
PropertyName = _T("<EFBFBD><EFBFBD><EFBFBD>سߴ<EFBFBD>");
|
|
|
|
|
Description = _T("һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>Ӧ<EFBFBD><EFBFBD>ʵ<EFBFBD>ʳߴ絥λ<EFBFBD><EFBFBD>(mm/<2F><><EFBFBD><EFBFBD>)");
|
|
|
|
|
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_OnePixDis, Description);
|
|
|
|
|
pGroup->AddSubItem(p1);
|
|
|
|
|
|
|
|
|
|
gDevicePropertieMgr.Insert(p1, pPropertie);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
|
|
|
|
|
Name = _T("m_Coord_x");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CPropertie *pPropertie = new CPropertie;
|
|
|
|
|
pPropertie->SetpVal((void*)&m_Coord.x);
|
|
|
|
|
pPropertie->SetType(_PROP_TYPE_DOUBLE);
|
|
|
|
|
pPropertie->SetpModule(this);
|
|
|
|
|
pPropertie->SetPath(Path);
|
|
|
|
|
pPropertie->SetName(Name);
|
|
|
|
|
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
PropertyName = _T("<EFBFBD>ӳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>x");
|
|
|
|
|
Description = _T("CCD <20><><EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽ̨ԭ<CCA8><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><>λ:mm)");
|
|
|
|
|
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_Coord.x, Description);
|
|
|
|
|
pGroup->AddSubItem(p1);
|
|
|
|
|
|
|
|
|
|
gDevicePropertieMgr.Insert(p1, pPropertie);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
|
|
|
|
|
Name = _T("m_Coord_y");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CPropertie *pPropertie = new CPropertie;
|
|
|
|
|
pPropertie->SetpVal((void*)&m_Coord.y);
|
|
|
|
|
pPropertie->SetType(_PROP_TYPE_DOUBLE);
|
|
|
|
|
pPropertie->SetpModule(this);
|
|
|
|
|
pPropertie->SetPath(Path);
|
|
|
|
|
pPropertie->SetName(Name);
|
|
|
|
|
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
PropertyName = _T("<EFBFBD>ӳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>y");
|
|
|
|
|
Description = _T("CCD <20><><EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽ̨ԭ<CCA8><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><>λ:mm)");
|
|
|
|
|
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_Coord.y, Description);
|
|
|
|
|
pGroup->AddSubItem(p1);
|
|
|
|
|
|
|
|
|
|
gDevicePropertieMgr.Insert(p1, pPropertie);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
|
|
|
|
|
Name = _T("m_Size_w");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CPropertie *pPropertie = new CPropertie;
|
|
|
|
|
pPropertie->SetpVal((void*)&m_Size.w);
|
|
|
|
|
pPropertie->SetType(_PROP_TYPE_DOUBLE);
|
|
|
|
|
pPropertie->SetpModule(this);
|
|
|
|
|
pPropertie->SetPath(Path);
|
|
|
|
|
pPropertie->SetName(Name);
|
|
|
|
|
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
PropertyName = _T("<EFBFBD>ӳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
Description = _T("CCD <20>ӳ<EFBFBD><D3B3><EFBFBD>ʵ<EFBFBD>ʿ<EFBFBD><CABF><EFBFBD>(<28><>λ:mm)");
|
|
|
|
|
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_Size.w, Description);
|
|
|
|
|
pGroup->AddSubItem(p1);
|
|
|
|
|
|
|
|
|
|
gDevicePropertieMgr.Insert(p1, pPropertie);
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
|
|
|
|
|
Name = _T("m_Size_h");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CPropertie *pPropertie = new CPropertie;
|
|
|
|
|
pPropertie->SetpVal((void*)&m_Size.h);
|
|
|
|
|
pPropertie->SetType(_PROP_TYPE_DOUBLE);
|
|
|
|
|
pPropertie->SetpModule(this);
|
|
|
|
|
pPropertie->SetPath(Path);
|
|
|
|
|
pPropertie->SetName(Name);
|
|
|
|
|
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
PropertyName = _T("<EFBFBD>ӳ<EFBFBD><EFBFBD>߶<EFBFBD>");
|
|
|
|
|
Description = _T("CCD <20>ӳ<EFBFBD><D3B3><EFBFBD>ʵ<EFBFBD>ʸ߶<CAB8>(<28><>λ:mm)");
|
|
|
|
|
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_Size.h, Description);
|
|
|
|
|
pGroup->AddSubItem(p1);
|
|
|
|
|
|
|
|
|
|
gDevicePropertieMgr.Insert(p1, pPropertie);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//-------------------------------------------------------------------------------//
|
|
|
|
|
return pGroup;
|
|
|
|
|
}
|
|
|
|
|
void CCamera::ExportPar(ofstream *pFile)
|
|
|
|
|
{
|
|
|
|
|
(*pFile)<<"[ģ<><C4A3>] [Camera]------------------------------------------------"<<endl;
|
|
|
|
|
(*pFile)<<"[CCD <20><><EFBFBD><EFBFBD>x][m_Coord.x] = "<<m_Coord.x<<endl;
|
|
|
|
|
(*pFile)<<"[CCD <20><><EFBFBD><EFBFBD>y][m_Coord.y] = "<<m_Coord.y<<endl;
|
|
|
|
|
(*pFile)<<"[<5B><><EFBFBD>سߴ<D8B3>(mm/pix) ][m_OnePixDis] = "<<m_OnePixDis<<endl;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
void CCamera::Draw(CDC* pDC)
|
|
|
|
|
{
|
|
|
|
|
if(gDraw->IsShowPlatformPos())
|
|
|
|
|
{
|
|
|
|
|
DbRect Rect(m_Coord,gDraw->GetCatchNodeSize());
|
|
|
|
|
DrawCrossX(pDC,gDraw->GetMarkPointPen(),Rect);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>CCD <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void CCamera::SetCoord(Dbxy pt)
|
|
|
|
|
{
|
|
|
|
|
m_Coord = pt;
|
|
|
|
|
//ǿ<>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD>Ե<EFBFBD><D4B5>ļ<EFBFBD>
|
|
|
|
|
gDevicePropertieMgr.SaveAllPropertie();
|
|
|
|
|
}
|
|
|
|
|
//<2F><>ȡCCD <20><><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD>(һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD>CCD <20>۲<EFBFBD>)
|
|
|
|
|
Dbxy CCamera::GetCenterPt()
|
|
|
|
|
{
|
|
|
|
|
Dbxy CenterPt;
|
|
|
|
|
CenterPt.x = m_Coord.x + m_Size.w/2;
|
|
|
|
|
if(m_bLeftTop)
|
|
|
|
|
{
|
|
|
|
|
CenterPt.y = m_Coord.y - m_Size.h/2;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
CenterPt.y = m_Coord.y + m_Size.h/2;
|
|
|
|
|
}
|
|
|
|
|
return CenterPt;
|
|
|
|
|
}
|
|
|
|
|
Dbxy CCamera::CCDpt2Platcoord(Dbxy CCDpt)
|
|
|
|
|
{
|
|
|
|
|
Dbxy pt;
|
|
|
|
|
pt.x = m_Coord.x + CCDpt.x;
|
|
|
|
|
|
|
|
|
|
if(m_bLeftTop)//<2F><><EFBFBD><EFBFBD>CCD <20>Ļ<EFBFBD><EFBFBD><D7BC>,y ֵ<><D6B5>һ<EFBFBD><D2BB>
|
|
|
|
|
pt.y = m_Coord.y - CCDpt.y;
|
|
|
|
|
else
|
|
|
|
|
pt.y = m_Coord.y + CCDpt.y;
|
|
|
|
|
return pt;
|
|
|
|
|
}
|
|
|
|
|
//<2F><>CCD ץȡ<D7A5><C8A1><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽ̨ԭ<CCA8><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
//CCDpt <20><>CCD ץȡ<D7A5><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>CCD ԭ<><D4AD><EFBFBD><EFBFBD>ֵ)
|
|
|
|
|
Dbxy CCamera::CCDcoord2Platformcoord(Dbxy CCDpt)
|
|
|
|
|
{
|
|
|
|
|
CString LogStr;
|
|
|
|
|
LogStr.Format(_T("CCDcoord2Platformcoord : CCD <20><><EFBFBD><EFBFBD>ֵ[x] = [%0.3f] ,[y] = [%0.3f]"),CCDpt.x,CCDpt.y);
|
|
|
|
|
gLogMgr->WriteDebugLog(LogStr);
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>Ϊmm <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>-----------------------
|
|
|
|
|
if(m_bPixCoord)
|
|
|
|
|
{
|
|
|
|
|
CCDpt.x *= m_OnePixDis;
|
|
|
|
|
CCDpt.y *= m_OnePixDis;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(((CCDpt.x<0)||(CCDpt.x>m_Size.w))||((CCDpt.y<0)||(CCDpt.y>m_Size.h)))//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD>ֵ
|
|
|
|
|
{
|
|
|
|
|
CString str = _T("<EFBFBD><EFBFBD>λץȡʧ<EFBFBD><EFBFBD>");
|
|
|
|
|
CExceptionMsg Msg;
|
|
|
|
|
Msg.SetMsg(str);
|
|
|
|
|
throw Msg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LogStr.Format(_T("[MM_Coordx] = [%0.3f] ,[MM_Coordy] = [%0.3f]"),CCDpt.x,CCDpt.y);
|
|
|
|
|
gLogMgr->WriteDebugLog(LogStr);
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD>Ϊƽ̨ <20><><EFBFBD><EFBFBD>-------------------------------------------
|
|
|
|
|
#if 0
|
|
|
|
|
Dbxy pt = CCDpt2Platcoord(CCDpt);
|
|
|
|
|
|
|
|
|
|
LogStr.Format(_T("[m_Coordx] = [%0.3f] ,[m_Coordy] = [%0.3f]"),m_Coord.x,m_Coord.y);
|
|
|
|
|
gLogMgr->WriteDebugLog(LogStr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽ̨<C6BD><CCA8>ǰ<EFBFBD><C7B0><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD>,<2C><><EFBFBD><EFBFBD>ʵ<EFBFBD>ʲ<EFBFBD><CAB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Dbxy PlatformPt = gPlatformXY->GetCoord();
|
|
|
|
|
LogStr.Format(_T("[PlatformPtx] = [%0.3f] ,[PlatformPty] = [%0.3f]"),PlatformPt.x,PlatformPt.y);
|
|
|
|
|
gLogMgr->WriteDebugLog(LogStr);
|
|
|
|
|
|
|
|
|
|
pt.x -= PlatformPt.x;
|
|
|
|
|
pt.y -= PlatformPt.y;
|
|
|
|
|
#else
|
|
|
|
|
Dbxy CameraCoord = m_Coord;
|
|
|
|
|
LogStr.Format(_T("[CameraCoord.x] = [%0.3f] ,[CameraCoord.y] = [%0.3f]"),CameraCoord.x,CameraCoord.y);
|
|
|
|
|
gLogMgr->WriteDebugLog(LogStr);
|
|
|
|
|
Dbxy PlatformPt = gPlatformXY->GetCoord();
|
|
|
|
|
LogStr.Format(_T("[PlatformCoord.x] = [%0.3f] ,[PlatformCoord.y] = [%0.3f]"),PlatformPt.x,PlatformPt.y);
|
|
|
|
|
gLogMgr->WriteDebugLog(LogStr);
|
|
|
|
|
CameraCoord.x = CameraCoord.x - PlatformPt.x;
|
|
|
|
|
CameraCoord.y = CameraCoord.y + PlatformPt.y;
|
|
|
|
|
LogStr.Format(_T("[CameraCoord_Now.x] = [%0.3f] ,[CameraCoord_Now.y] = [%0.3f]"),CameraCoord.x,CameraCoord.y);
|
|
|
|
|
gLogMgr->WriteDebugLog(LogStr);
|
|
|
|
|
|
|
|
|
|
Dbxy pt;
|
|
|
|
|
pt.x = CameraCoord.x + CCDpt.x;
|
|
|
|
|
pt.y = CameraCoord.y - CCDpt.y;
|
|
|
|
|
|
|
|
|
|
LogStr.Format(_T("[CatchPt.x] = [%0.3f] ,[CatchPt.y] = [%0.3f]"),pt.x,pt.y);
|
|
|
|
|
gLogMgr->WriteDebugLog(LogStr);
|
|
|
|
|
#endif
|
|
|
|
|
return pt;
|
|
|
|
|
}
|
|
|
|
|
//ץȡ<D7A5><C8A1>, <20><>ת<EFBFBD><D7AA>Ϊƽ̨<C6BD><CCA8><EFBFBD><EFBFBD>(pt <20><><EFBFBD><EFBFBD>ץȡ<D7A5>Ľ<EFBFBD><C4BD><EFBFBD>)
|
|
|
|
|
bool CCamera::CatchPtToPlatformcoord(Dbxy &pt)
|
|
|
|
|
{
|
|
|
|
|
Dbxy CatchPt;
|
|
|
|
|
bool ret;
|
|
|
|
|
if(!m_bCatch)//<2F><>ʵ<EFBFBD><CAB5>ץȡ
|
|
|
|
|
{
|
|
|
|
|
ret = true;
|
|
|
|
|
CatchPt.x = CatchPt.y = 10;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ret = CatchPoint(CatchPt);
|
|
|
|
|
}
|
|
|
|
|
if(IsDbxyZero(CatchPt))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if(ret)
|
|
|
|
|
{
|
|
|
|
|
pt = CCDcoord2Platformcoord(CatchPt);
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|