/*--------------------------------------------------------------------------------
'Nom du projet : Oscilloscope
'Outil : Visual C++ 6
'Nom du fichier: WaveDevCaps.cpp : implementation file
'Realisation:Mathieu Texier et Emmanuel Traineau
'Date: Juin 2003
'Responsable: Eric Meleiro
'--------------------------------------------------------------------------------
Explications : Affichage des données à l'écran
*/
#include "stdafx.h"
#include "oscillo.h"
#include "mmsystem.h"
#include "WaveDevCaps.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CWaveDevCaps dialog
CWaveDevCaps::CWaveDevCaps(CWnd* pParent /*=NULL*/)
: CDialog(CWaveDevCaps::IDD, pParent)
{
//{{AFX_DATA_INIT(CWaveDevCaps)
m_dcapsview = _T("");
m_Combo = -1;
//}}AFX_DATA_INIT
}
void CWaveDevCaps::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CWaveDevCaps)
DDX_Text(pDX, IDC_DCAPS, m_dcapsview);
DDX_CBIndex(pDX, IDC_COMBO_DEVS, m_Combo);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CWaveDevCaps, CDialog)
//{{AFX_MSG_MAP(CWaveDevCaps)
ON_CBN_SELCHANGE(IDC_COMBO_DEVS, OnSelchangeComboDevs)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// Macht einen Wert zum String
CString CWaveDevCaps::Str (int value)
{
wsprintf (m_str.GetBuffer(256), "%d", value);
m_str.ReleaseBuffer();
return m_str;
}
// information sur le matériel branché sur le port
void CWaveDevCaps::FillBox (int device)
{
WAVEOUTCAPS woc;
MMRESULT mmerr;
memset (&woc, 0, sizeof (WAVEOUTCAPS));
mmerr = waveOutGetDevCaps (device, &woc, sizeof (WAVEOUTCAPS));
m_dcapsview = "PARALLEL PORT: \r\n";
m_dcapsview += "data register port : 378 \r\n";
m_dcapsview += "state register port : 379 \r\n";
m_dcapsview += "command register port : 37A \r\n\r\n";
m_dcapsview += "ACQUISITION CARD CARACTERISTICS : \r\n";
m_dcapsview += "symmetrical supply voltage : +15V / -15V \r\n";
m_dcapsview += "symmetrical entrer voltage : +50V / -50V \r\n";
m_dcapsview += "sampling fraquency : 10MHz MAX \r\n";
if (mmerr != MMSYSERR_NOERROR)
{
m_dcapsview = "Err: " + Str(mmerr) +
" --- Cannot access port";
goto raus;
}
raus :
UpdateData (FALSE);
}
// Combobox angeklickt
void CWaveDevCaps::OnSelchangeComboDevs()
{
UpdateData();
if (!m_Combo)
FillBox (WAVE_MAPPER);
else
FillBox (m_Combo-1);
}
// Beim Start auf Device 1 schalten
BOOL CWaveDevCaps::OnInitDialog()
{
CDialog::OnInitDialog();
m_Combo = 1;
UpdateData (FALSE);
FillBox (0);
return TRUE;
}