修正强制修改属性表内容BUG

之前功能大致OK,分出改坐标系
bestlqiang 4 years ago
parent 480db65c12
commit 9caa763186

@ -348,9 +348,11 @@ void CCamera::Draw(CDC* pDC)
void CCamera::SetCoord(Dbxy pt)
{
m_Coord = pt;
gDevicePropertieMgr.ChangePropertieByVal(&m_Coord.x, pt.x);
gDevicePropertieMgr.ChangePropertieByVal(&m_Coord.y, pt.y);
//m_Coord2=pt+
//强制保存所有的属性到文件
gDevicePropertieMgr.SaveAllPropertie();
//gDevicePropertieMgr.SaveAllPropertie();
}
//获取CCD 的中心点坐标(一般用来移动到CCD 观察)
Dbxy CCamera::GetCenterPt()

@ -10,6 +10,7 @@
#include "CommonFlowMgr.h"
#include "CameraHawkvis.h"
#include "ProgramCutMgr.h"
#include "PropertieMgr.h"
#include "SmartArchive.h"
#include <opencv2/opencv.hpp>
@ -218,11 +219,13 @@ void DlgHawkvisCamera::OnBnClickedSetExpore()
#ifdef __HAWKVIS_MINDVISION_CCD__
if (m_DlgCurCamIndex == 0)
{
gCameraHawkvis->m_nCam1Expore = m_nExpore;
//gCameraHawkvis->m_nCam1Expore = m_nExpore;
gDevicePropertieMgr.ChangePropertieByVal(&gCameraHawkvis->m_nCam1Expore, m_nExpore);
}
else
{
gCameraHawkvis->m_nCam2Expore = m_nExpore;
//gCameraHawkvis->m_nCam2Expore = m_nExpore;
gDevicePropertieMgr.ChangePropertieByVal(&gCameraHawkvis->m_nCam2Expore, m_nExpore);
}
m_HawkvisCtrl.MV_SetCameraExpTime(m_nExpore);
#else

Binary file not shown.

@ -7,11 +7,12 @@ public:
CPaneDevicePar(void);
~CPaneDevicePar(void);
void SetComboSelNull();
afx_msg void OnCbnSelPropertyChange();
protected:
virtual void IniObjectCombo();
virtual void RemoveAllProperty();
afx_msg LRESULT OnPropertyChanged(WPARAM,LPARAM);
afx_msg void OnCbnSelPropertyChange();
DECLARE_MESSAGE_MAP()
};

@ -11,6 +11,7 @@ public:
CPropertie();
~CPropertie();
void SetpVal(void *pVal){m_pVal = pVal;};
void * GetpVal() { return m_pVal; };
void SetType(PROPERTIE_TYPE Type){m_Type = Type;};
void SetpModule(CModule *pModule){m_pModule = pModule;};
void SetName(CString &Name){m_Name = Name;};

@ -1,7 +1,7 @@
#include "StdAfx.h"
#include "PropertieMgr.h"
#include "Propertie.h"
#include "GlobalFunction.h"
CPropertieMgr gDevicePropertieMgr;//设备属性管理
CPropertieMgr gDrawPropertieMgr;//绘制属性管理
@ -79,3 +79,54 @@ void CPropertieMgr::SaveAllPropertie()
}
}
}
bool CPropertieMgr::ChangePropertieByName(CString name, _variant_t newVal)
{
auto iter = m_PropertieValMap.begin();
auto iter_end = m_PropertieValMap.end();
for (;iter != iter_end;iter++)
{
if ((iter->first)->GetName() == name)
{
iter->second->PropertyChangeVal(newVal);
gDevicePropertieMgr.UpdateDevicePropertyPage();
return true;
}
}
return false;
}
bool CPropertieMgr::ChangePropertieByVal(void * pVal, _variant_t newVal)
{
auto iter = m_AllPropertieVec.begin();
auto iter_end = m_AllPropertieVec.end();
for (;iter != iter_end;iter++)
{
if ((*iter)->GetpVal() == pVal)
{
(*iter)->PropertyChangeVal(newVal);
gDevicePropertieMgr.UpdateDevicePropertyPage();
return true;
}
}
return false;
}
void CPropertieMgr::UpdateDevicePropertyPage()
{
GetFrame()->m_PaneDevicePar.OnCbnSelPropertyChange();
}
/*
CPropertie * CPropertieMgr::GetPropertie(void * pVal)
{
auto iter = m_AllPropertieVec.begin();
auto iter_end = m_AllPropertieVec.end();
for (;iter != iter_end;iter++)
{
if ((*iter)->GetpVal() == pVal)
{
return *iter;
}
}
return NULL;
}*/

@ -14,6 +14,12 @@ public:
void DelAllPropertie();
void SaveAllPropertie();
void SetSaveAllPropertie(bool b){m_bSaveAllPropertie = b;};
bool ChangePropertieByName(CString name, _variant_t newVal); //根据在属性列表中的名 ,获取属性
bool ChangePropertieByVal(void* pVal, _variant_t newVal); //根据变量地址,修改其数据并刷新到属性表
void UpdateDevicePropertyPage();
private:
void DelAllPropertieVec();
private:

Loading…
Cancel
Save