📄 cameramanager.h
字号:
//-----------------------------------------------------------------------------
// (c) 2002 by Basler Vision Technologies
// Section: Vision Components
// Project: BCAM
// $Header: CameraManager.h, 8, 26.10.2002 16:13:10, Happe, A.$
//-----------------------------------------------------------------------------
/**
\file CameraManager.h
*
* \brief Interface for the CCameraManager class.
*
*/
//-----------------------------------------------------------------------------
#if !defined(AFX_CAMERAMANAGER_H__508A7274_978A_11D5_922E_0090278E5E96__INCLUDED_)
#define AFX_CAMERAMANAGER_H__508A7274_978A_11D5_922E_0090278E5E96__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CMainFrame;
class CChildFrame;
#include "Camera.h"
//------------------------------------------------------------------------------
// class CCameraManager
// Author:
// Date:
//------------------------------------------------------------------------------
/**
* \brief Manages CCamera objects and their associated MDI child windows
*
* The camera manager holds a map, which maps the device names of Bcam devices
* attached to the 1394 bus to CCamera objects representing the devices. CCamera
* inherits from CBcam.
* The camera manager holds a second map, which maps the CCamera objects to associated
* Image views, showing live images etc.
*
* The camera knows which device is the "current device", i.e. the device selected
* in the bus viewer's tree view. The application's main frame communicates with the
* camera manager to start stop continuous grabs, single grabs etc.
*
* The camera manager is also repsonsible for the creation of image windows.
*/
//------------------------------------------------------------------------------
class CCameraManager
{
public:
/// constructor
CCameraManager(CMainFrame& MainFrame);
/// Returns the device object for a given device name
CCamera* GetDevice(CString DeviceName);
/// The camera manager gets informed that the current device has been changed
DWORD CurrentDeviceChanged(CString* DeviceName);
/// Returns the current device
CCamera* GetCurrentDevice() { return m_pCurrentDevice; }
/// The camera manager gets informed that an image window has been closed
void MDIChildClosed(CChildFrame* pChild);
/// The camera manager gets informed that image window has been activated
void MDIChildActivated(CChildFrame* pChild);
/// Add a new device to the camera manager's list of devices
void AddDevice(CString DeviceName, HWND hWndNotify);
/// Delete a device which has been removed from the system
void RemoveDevice(CString DeviceName);
/// Create a new image window associated with the current device
void AddMDIChild();
/// Returns the image window assiciated with the current device
CChildFrame* GetCurrentChild();
/// Is there already a image window for the current device
bool ExistMDIChild();
/// Check if a given camera object is in the device manager's list of devices
bool IsDeviceValid(CCamera* pCamera);
/// Is the current device grabbing?
bool IsGrabActive();
/// Let the current device grag an image
void GrabSingle();
/// Let the current device grab continuosly images
void GrabContinuous();
/// Let the current device perform the auto white balance operation
void PerformWhiteBalance();
/// Cancel the current device's grab
void GrabCancel();
/// Load an image from a file show it in the image window associated with the current device
void GrabFromFile(CString FileName);
/// Create a shading correction table for the current device
void CreateShadingCorrectionTable();
/// Shows the pixel value under the cursor in the main frame's status bar
void ShowPixelValue();
/// Retrieves the current frame rate
void GetFrameRate(double& fps_acquired, double& fps_displayed);
/// The camera manager get's informed that the application is to be closed. The settings of the current device will be saved to the registry
void AppExit();
virtual ~CCameraManager();
private:
/// A device is to be removed
static void OnRemoveRequest(CBcam& Bcam, void* pv);
/// A device has been removed
static void OnRemoveComplete(CBcam& Bcam, void* pv);
/// Display an error message
void ReportError(BcamException& e);
/// maps device names to camera objects
typedef map<CString, CCamera*> DevName2Camera_t;
DevName2Camera_t m_DevName2Camera;
/// maps camera objects to child frames
typedef map<CCamera*, CChildFrame*> Device2ChildFrame_t;
Device2ChildFrame_t m_Device2ChildFrame;
/// reference to the application's main frame
CMainFrame& m_MainFrame;
/// pointer to the current device
CCamera* m_pCurrentDevice;
/// The name of the device which is currently selected. In general this should be
/// the name of the current device. But if the user has selected a non Bcam device in the
/// bus view, the m_pSelectedDeviceName is "", but the current device might not be NULL
/// (i.e. a child window is active for the current device)
CString m_SelectedDeviceName;
};
#endif // !defined(AFX_CAMERAMANAGER_H__508A7274_978A_11D5_922E_0090278E5E96__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -