⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 propertiesdlg.h

📁 BCAM 1394 Driver
💻 H
字号:
//-----------------------------------------------------------------------------
//  (c) 2002 by Basler Vision Technologies
//  Section:  Vision Components
//  Project:  BCAM
//  $Header: propertiesdlg.h, 7, 13.12.2002 09:21:59, Nebelung, H.$
// Author: Margret Albrecht
// Date: 29.08.2002
//-----------------------------------------------------------------------------
/**
  \file     propertiesdlg.h
 *
  \brief   Declaration and definition of a dialog showing the properties of a device node
 *
 */
//-----------------------------------------------------------------------------


#if !defined(AFX_PROPERTIESDLG_H__D1547850_F457_4A5B_B249_3C7A9710984C__INCLUDED_)
#define AFX_PROPERTIESDLG_H__D1547850_F457_4A5B_B249_3C7A9710984C__INCLUDED_
#include "BcamAdapter.h"
#include "Atlmisc.h"
#include <atlddx.h>

#define fromDialog TRUE 
#define toDialog FALSE

//------------------------------------------------------------------------------
// class CPropertiesDlg
// Author: 
// Date: 29.08.2002
//------------------------------------------------------------------------------
/**
 * \brief   dialog showing the properties of a device node
 *  
 * 
 * 
 */
//------------------------------------------------------------------------------
class CPropertiesDlg : public CDialogImpl<CPropertiesDlg>,
  public CWinDataExchange<CPropertiesDlg>
{
public:
  enum { IDD = IDD_NODEPROPERTIES };

  BEGIN_MSG_MAP(CPropertiesDlg)
    MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
    COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
    COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
  END_MSG_MAP()
//------------------------------------------------------------------------------
// CPropertiesDlg::CPropertiesDlg(const CNode * node ) 
// Author: 
// Date: 29.08.2002
//------------------------------------------------------------------------------
/**
 * extracts the properties from the node 
 *
 * \param     node holding all information about the device
 * \todo     get the type information directly from the node, when the Type method is implemented 
 */
//------------------------------------------------------------------------------
  CPropertiesDlg::CPropertiesDlg(const CNode * node )
  {

    if (node != NULL)
    {
      enum NodeType nodeType =  node->Type(); 
      
      switch (nodeType)
      {
        case NT_Bcam: m_TypeText = "Basler 1394 Camera";break;
        case NT_Dcam: m_TypeText = "DCAM compliant camera";break;
                                case NT_Sbp2: m_TypeText = "SBP(2) device"; break;
        case NT_Unknown: m_TypeText = "not identified node";break;
        default: m_TypeText = "";
      };


      m_Model = node->ModelName();
      DWORD low = node->NodeID().LowPart;
      LONG high = node->NodeID().HighPart;
      LONGLONG serial = (unsigned long)low & 0xff;
      serial = (serial<<32) + (unsigned long)high;
      if ( nodeType == NT_Bcam)
      {
        m_Serial.Format(_T( "%I64u" ), serial);
      }
      else
      {
        m_Serial = "";
      }
      m_Vendor= node->VendorName();
      CString s1;
      s1.Format( _T( "%X -- %X%08X" ), 
        low >> 8, low & 0xff, high );   
      m_UniqueIDText = s1;
      m_NumPorts = node->NumPorts();
      m_PhysicalID = node->PhysicalId();
    }
    else 
    {
      m_TypeText = "";
      m_Model = "";
      m_Serial = "";
      m_Vendor = "";
      m_UniqueIDText ="";
      m_NumPorts = -1;
      m_PhysicalID = -1;
    
    }
  }

  LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
  {
    CenterWindow(GetParent());
      HWND hWndser = GetDlgItem(IDC_STATIC_SERIAL);
      if ( m_Serial != "")
      {
        ::ShowWindow (hWndser, SW_SHOW);
      }
      else
      {
        ::ShowWindow (hWndser, SW_HIDE);
      }
    DoDataExchange(toDialog);
    return TRUE;
  }


  LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
  {
    EndDialog(wID);
    return 0;
  }

  BEGIN_DDX_MAP(CPropertiesDlg)
    DDX_INT(IDC_NUMPORTS, m_NumPorts)
    DDX_INT(IDC_PHSICALID, m_PhysicalID)
    DDX_TEXT(IDC_MODEL, m_Model)
    DDX_TEXT(IDC_SERIAL, m_Serial)
    DDX_TEXT(IDC_VENDOR, m_Vendor)
    DDX_TEXT(IDC_UNIQUEID, m_UniqueIDText)
    DDX_TEXT(IDC_TYPE, m_TypeText)
  END_DDX_MAP()

  CString m_TypeText;
  CString m_Model;
  CString m_Serial;
  CString m_Vendor;
  CString m_UniqueIDText;
  int m_NumPorts;
  int m_PhysicalID;
};

//------------------------------------------------------------------------------
// class CNoDevicePropertiesDlg
// Author: 
// Date: 29.08.2002
//------------------------------------------------------------------------------
/**
 * \brief   dialog shown, when no device is connected
 *
 */
//------------------------------------------------------------------------------
class CNoDevicePropertiesDlg : public CDialogImpl<CNoDevicePropertiesDlg>
{
public:
  enum { IDD = IDD_NODEVICEPROPERTIES };

  BEGIN_MSG_MAP(CNoDevicePropertiesDlg)
    MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
    COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
    COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
  END_MSG_MAP()

  LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
  {
    CenterWindow(GetParent());
    return TRUE;
  }

  LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
  {
    EndDialog(wID);
    return 0;
  }
};


#endif // !defined(AFX_PROPERTIESDLG_H__D1547850_F457_4A5B_B249_3C7A9710984C__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -