資源簡介
配置好環境后,程序能完美運行,可以單排,實時顯示,存儲。可以調相機的曝光時間和增益,可以看到幾個相機的名稱(如果連了大于一個的相機)
代碼片段和文件信息
/*
????Note:?Before?getting?started?Basler?recommends?reading?the?“Programmer‘s?Guide“?topic
????in?the?pylon?C++?API?documentation?delivered?with?pylon.
????If?you?are?upgrading?to?a?higher?major?version?of?pylon?Basler?also
????strongly?recommends?reading?the?“Migrating?from?Previous?Versions“?topic?in?the?pylon?C++?API?documentation.
????
????This?sample?illustrates?the?use?of?a?MFC?GUI?together?with?the?pylon?C++?API?to?enumerate?the?attached?cameras?to
????configure?a?camera?to?start?and?stop?the?grab?and?to?display?and?store?grabbed?images.?
????It?shows?how?to?use?GUI?controls?to?display?and?modify?camera?parameters.
*/
#include?“stdafx.h“
#include?“GuiSample.h“
#include?“GuiSampleDoc.h“
#include?“ConfigView.h“
//?Stores?GenApi?enumeration?items?into?MFC?ComboBox
void?FillEnumerationListCtrl(?Pylon::CEnumParameter&?enumParameter?CComboBox*?pCtrl?)
{
????typedef?GenApi::StringList_t::iterator?Iterator_t;
????const?GenApi::IEnumEntry?*pCurrent?=?NULL;
????int?currentIndex?=?-1;
????GenApi::StringList_t?slist;
????if?(?enumParameter.IsReadable()?)
????{
????????pCurrent?=?enumParameter.GetCurrentEntry();
????????//?Retrieve?the?list?of?entries?with?nicely?formatted?names.
????????enumParameter.GetSymbolics(?slist?);
????????//?Add?items?if?not?already?present.
????????for?(Iterator_t?it?=?slist.begin()?end?=?slist.end();?it?!=?end;?++it)
????????{
????????????CString?item?=?CUtf82W(?it->c_str()?);
????????????if?(pCtrl->FindStringExact(?0?item?)?>=?0)
????????????{
????????????????continue;
????????????}
????????????//?Set?the?name?in?wide?character?format.
????????????const?int?index?=?pCtrl->AddString(?CUtf82W(?it->c_str()?)?);
????????????const?GenApi::IEnumEntry?*pEntry?=?enumParameter.GetEntryByName(?*it?);
????????????//?Store?the?pointer?for?easy?node?access.
????????????pCtrl->SetItemData(?index?reinterpret_cast(pEntry)?);
????????????if?(pEntry?==?pCurrent)
????????????{
????????????????currentIndex?=?index;
????????????}
????????}
????}
}
//?CConfigView
IMPLEMENT_DYNCREATE(?CConfigView?CFormView?)
CConfigView::CConfigView()
:?CFormView(?CConfigView::IDD?)
?m_updatingList(?FALSE?)
{
}
CConfigView::~CConfigView()
{
}
void?CConfigView::DoDataExchange(?CDataExchange*?pDX?)
{
????CFormView::DoDataExchange(?pDX?);
????DDX_Control(?pDX?IDC_DEVICELIST?m_deviceListCtrl?);
????DDX_Control(?pDX?IDC_EXPOSURE_SLIDER?m_ctrlExposureSlider?);
????DDX_Control(?pDX?IDC_EXPOSURE_STATIC?m_ctrlExposureText?);
????DDX_Control(?pDX?IDC_GAIN_SLIDER?m_ctrlGainSlider?);
????DDX_Control(?pDX?IDC_GAIN_STATIC?m_ctrlGainText?);
????DDX_Control(?pDX?IDC_TESTIMAGE_COMBO?m_ctrlTestImage?);
????DDX_Control(?pDX?IDC_PIXELFORMAT_COMBO?m_ctrlPixelFormat?);
}
BEGIN_MESSAGE_MAP(?CConfigView?CFormView?)
????ON_NOTIFY(?LVN_ITEMCHANGED?IDC_DEVICELIST?&CConfigView::OnItemchangedDevicelist?)
????ON_WM_HSCROLL()
????ON_CBN_SELENDOK(?IDC_TE
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????11264??2019-04-12?18:08??GUI_MFC\.vs\GuiSample_GigE\v14\.suo
?????文件???????2085??2019-04-11?08:50??GUI_MFC\AutoPacketSizeConfiguration.h
?????文件??????15093??2019-03-01?19:43??GUI_MFC\ConfigView.cpp
?????文件???????3035??2019-03-01?19:43??GUI_MFC\ConfigView.h
?????文件?????133672??2019-04-12?15:08??GUI_MFC\Debug\ConfigView.obj
?????文件??????93610??2019-04-12?14:19??GUI_MFC\Debug\GuiSample.obj
?????文件??????31596??2019-04-12?14:17??GUI_MFC\Debug\GuiSample.res
?????文件?????256498??2019-04-12?14:17??GUI_MFC\Debug\GuiSampleDoc.obj
?????文件??????38082??2019-04-12?14:17??GUI_MFC\Debug\GuiSampleView.obj
?????文件????????178??2019-04-12?15:12??GUI_MFC\Debug\GuiSample_GigE.log
?????文件???????2356??2019-04-12?14:17??GUI_MFC\Debug\GUI_Sample.Build.CppClean.log
?????文件?????260096??2019-04-12?15:08??GUI_MFC\Debug\GUI_Sample.exe
?????文件????2142672??2019-04-12?15:08??GUI_MFC\Debug\GUI_Sample.ilk
?????文件???64880640??2019-04-12?14:17??GUI_MFC\Debug\GUI_Sample.pch
?????文件????6590464??2019-04-12?15:08??GUI_MFC\Debug\GUI_Sample.pdb
?????文件???????5860??2019-04-12?15:08??GUI_MFC\Debug\GUI_Sample.tlog\CL.command.1.tlog
?????文件??????76868??2019-04-12?15:08??GUI_MFC\Debug\GUI_Sample.tlog\CL.read.1.tlog
?????文件???????3646??2019-04-12?15:08??GUI_MFC\Debug\GUI_Sample.tlog\CL.write.1.tlog
?????文件????????198??2019-04-12?15:12??GUI_MFC\Debug\GUI_Sample.tlog\GUI_Sample.lastbuildstate
?????文件???????2314??2019-04-12?15:08??GUI_MFC\Debug\GUI_Sample.tlog\li
?????文件???????7358??2019-04-12?15:08??GUI_MFC\Debug\GUI_Sample.tlog\li
?????文件???????1186??2019-04-12?15:08??GUI_MFC\Debug\GUI_Sample.tlog\li
?????文件????????386??2019-04-12?14:17??GUI_MFC\Debug\GUI_Sample.tlog\rc.command.1.tlog
?????文件???????2894??2019-04-12?14:17??GUI_MFC\Debug\GUI_Sample.tlog\rc.read.1.tlog
?????文件????????202??2019-04-12?14:17??GUI_MFC\Debug\GUI_Sample.tlog\rc.write.1.tlog
?????文件??????58748??2019-04-12?14:19??GUI_MFC\Debug\MainFrm.obj
?????文件??????59260??2019-04-12?14:17??GUI_MFC\Debug\PylonStringHelpers.obj
?????文件?????947838??2019-04-12?14:17??GUI_MFC\Debug\stdafx.obj
?????文件????5345280??2019-04-12?15:08??GUI_MFC\Debug\vc140.pdb
?????文件??????75448??2019-04-12?13:47??GUI_MFC\GuiSample.aps
............此處省略42個文件信息
- 上一篇:黃金礦工C++ 代碼程序
- 下一篇:boost庫頭文件
評論
共有 條評論