리크 테스트 gui
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

864 lines
19 KiB

// Util9113Dlg.cpp : implementation file
//
#include "stdafx.h"
#include "Util9113.h"
#include "Util9113Dlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
CRect plotRect0, plotRect1;
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
enum { IDD = IDD_ABOUTBOX };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
// Implementation
protected:
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
END_MESSAGE_MAP()
// CUtil9113Dlg dialog
CUtil9113Dlg::CUtil9113Dlg(I16 hCard, CWnd* pParent /*=NULL*/)
: CDialog(CUtil9113Dlg::IDD, pParent)
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
m_hCard = hCard;
n_PlotWidth = n_PlotHeight = -1;
OnBrush = OffBrush = NULL;
min_val = 0x00;
max_val = 0xFFFF;
for( int i=0; i<MAX_CHAN_9113; i++ )
{
m_AIEnable[i] = 0x00;
m_oldY[i] = -1;
}
m_OutData = 0x0000;
m_InData = 0x0000;
m_nTimer = -1;
}
void CUtil9113Dlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_COMBO_AI_RANGE, m_cbAIRange);
}
BEGIN_MESSAGE_MAP(CUtil9113Dlg, CDialog)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
//}}AFX_MSG_MAP
ON_WM_DESTROY()
ON_CBN_SELCHANGE(IDC_COMBO_AI_RANGE, &CUtil9113Dlg::OnAIRangeSelchange)
ON_BN_CLICKED(IDC_RADIO_CH0, &CUtil9113Dlg::OnAI00Enable)
ON_BN_CLICKED(IDC_RADIO_CH1, &CUtil9113Dlg::OnAI01Enable)
ON_BN_CLICKED(IDC_RADIO_CH2, &CUtil9113Dlg::OnAI02Enable)
ON_BN_CLICKED(IDC_RADIO_CH3, &CUtil9113Dlg::OnAI03Enable)
ON_BN_CLICKED(IDC_RADIO_CH4, &CUtil9113Dlg::OnAI04Enable)
ON_BN_CLICKED(IDC_RADIO_CH5, &CUtil9113Dlg::OnAI05Enable)
ON_BN_CLICKED(IDC_RADIO_CH6, &CUtil9113Dlg::OnAI06Enable)
ON_BN_CLICKED(IDC_RADIO_CH7, &CUtil9113Dlg::OnAI07Enable)
ON_BN_CLICKED(IDC_RADIO_CH8, &CUtil9113Dlg::OnAI08Enable)
ON_BN_CLICKED(IDC_RADIO_CH9, &CUtil9113Dlg::OnAI09Enable)
ON_BN_CLICKED(IDC_RADIO_CH10, &CUtil9113Dlg::OnAI10Enable)
ON_BN_CLICKED(IDC_RADIO_CH11, &CUtil9113Dlg::OnAI11Enable)
ON_BN_CLICKED(IDC_RADIO_CH12, &CUtil9113Dlg::OnAI12Enable)
ON_BN_CLICKED(IDC_RADIO_CH13, &CUtil9113Dlg::OnAI13Enable)
ON_BN_CLICKED(IDC_RADIO_CH14, &CUtil9113Dlg::OnAI14Enable)
ON_BN_CLICKED(IDC_RADIO_CH15, &CUtil9113Dlg::OnAI15Enable)
ON_WM_TIMER()
END_MESSAGE_MAP()
// CUtil9113Dlg message handlers
BOOL CUtil9113Dlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
BOOL bNameValid;
CString strAboutMenu;
bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
ASSERT(bNameValid);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
x_divider = 5; y_divider = 2;
OnBrush = CreateSolidBrush( RGB(255,0,0) );
OffBrush = CreateSolidBrush( RGB(125,0,0) );
RedPen.CreatePen( PS_SOLID, 1, RGB(255,0,0));
GreenPen.CreatePen( PS_SOLID, 1, RGB(0,255,0));
YellowPen.CreatePen( PS_SOLID, 1, RGB(255,255,0));
BluePen.CreatePen( PS_SOLID, 1, RGB(0,0,255));
LTBluePen.CreatePen( PS_SOLID, 1, RGB(0,128,255));
LTRedPen.CreatePen( PS_SOLID, 1, RGB(255,128,0));
LTGreenPen.CreatePen( PS_SOLID, 1, RGB(0,128,0));
WhitePen.CreatePen( PS_SOLID, 1, RGB(255,255,255));
if( n_PlotWidth == -1 && n_PlotHeight == -1 )
{
((CWnd*)GetDlgItem(IDC_STATIC_DRAW0))->GetWindowRect(&plotRect0);
ScreenToClient(&plotRect0);
n_PlotWidth = min( plotRect0.Width(), 512);
n_PlotHeight = plotRect0.Height();
((CWnd*)GetDlgItem(IDC_STATIC_DRAW1))->GetWindowRect(&plotRect1);
ScreenToClient(&plotRect1);
}
// TODO: Add extra initialization here
m_cbAIRange.SetCurSel( 0 );
max_range = 10.0;
min_range = -10.0;
m_wAdRange = AD_B_10_V;
m_nTimer = SetTimer( 1, 100, NULL );
return TRUE; // return TRUE unless you set the focus to a control
}
void CUtil9113Dlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CUtil9113Dlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
redraw_display_area();
CDialog::OnPaint();
}
}
// The system calls this function to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CUtil9113Dlg::OnQueryDragIcon()
{
return static_cast<HCURSOR>(m_hIcon);
}
void CUtil9113Dlg::OnDestroy()
{
CDialog::OnDestroy();
// TODO: Add your message handler code here
if( m_nTimer != -1 )
{
KillTimer( m_nTimer );
m_nTimer = -1;
}
if( OnBrush != NULL )
::DeleteObject( OnBrush );
if( OffBrush != NULL )
::DeleteObject( OffBrush );
RedPen.DeleteObject();
GreenPen.DeleteObject();
YellowPen.DeleteObject();
BluePen.DeleteObject();
LTBluePen.DeleteObject();
LTRedPen.DeleteObject();
LTGreenPen.DeleteObject();
WhitePen.DeleteObject();
}
void CUtil9113Dlg::OnAIRangeSelchange()
{
// TODO: Add your control notification handler code here
U16 tmpAdRange;
int nIndex;
double maxRange, minRange;
nIndex = m_cbAIRange.GetCurSel();
switch( nIndex )
{
case 0:
tmpAdRange = AD_B_10_V;
maxRange = 10.0;
minRange = -10.0;
break;
case 1:
tmpAdRange = AD_B_1_V;
maxRange = 1.0;
minRange = -1.0;
break;
case 2:
tmpAdRange = AD_B_0_1_V;
maxRange = 0.1;
minRange = -0.1;
break;
case 3:
tmpAdRange = AD_B_5_V;
maxRange = 5.0;
minRange = -5.0;
break;
case 4:
tmpAdRange = AD_B_0_5_V;
maxRange = 0.5;
minRange = -0.5;
break;
case 5:
tmpAdRange = AD_B_0_05_V;
maxRange = 0.05;
minRange = -0.05;
break;
case 6:
tmpAdRange = AD_U_10_V;
maxRange = 10.0;
minRange = 0.0;
break;
case 7:
tmpAdRange = AD_U_1_V;
maxRange = 1.0;
minRange = 0.0;
break;
case 8:
tmpAdRange = AD_U_0_1_V;
maxRange = 0.1;
minRange = 0.0;
break;
}
if( tmpAdRange != m_wAdRange )
{ // update m_InPortA and configure the target Port
m_wAdRange = tmpAdRange;
max_range = maxRange;
min_range = minRange;
redraw_display_area();
}
}
void CUtil9113Dlg::OnAI00Enable()
{
// TODO: Add your control notification handler code here
int CheckSts;
CheckSts = ((CButton*)GetDlgItem( IDC_RADIO_CH0 ))->GetCheck();
if( CheckSts == BST_CHECKED )
{
m_AIEnable[0] = 0x01;
}
else if( CheckSts == BST_UNCHECKED )
{
m_AIEnable[0] = 0x00;
}
}
void CUtil9113Dlg::OnAI01Enable()
{
// TODO: Add your control notification handler code here
int CheckSts;
CheckSts = ((CButton*)GetDlgItem( IDC_RADIO_CH1 ))->GetCheck();
if( CheckSts == BST_CHECKED )
{
m_AIEnable[1] = 0x01;
}
else if( CheckSts == BST_UNCHECKED )
{
m_AIEnable[1] = 0x00;
}
}
void CUtil9113Dlg::OnAI02Enable()
{
// TODO: Add your control notification handler code here
int CheckSts;
CheckSts = ((CButton*)GetDlgItem( IDC_RADIO_CH2 ))->GetCheck();
if( CheckSts == BST_CHECKED )
{
m_AIEnable[2] = 0x01;
}
else if( CheckSts == BST_UNCHECKED )
{
m_AIEnable[2] = 0x00;
}
}
void CUtil9113Dlg::OnAI03Enable()
{
// TODO: Add your control notification handler code here
int CheckSts;
CheckSts = ((CButton*)GetDlgItem( IDC_RADIO_CH3 ))->GetCheck();
if( CheckSts == BST_CHECKED )
{
m_AIEnable[3] = 0x01;
}
else if( CheckSts == BST_UNCHECKED )
{
m_AIEnable[3] = 0x00;
}
}
void CUtil9113Dlg::OnAI04Enable()
{
// TODO: Add your control notification handler code here
int CheckSts;
CheckSts = ((CButton*)GetDlgItem( IDC_RADIO_CH4 ))->GetCheck();
if( CheckSts == BST_CHECKED )
{
m_AIEnable[4] = 0x01;
}
else if( CheckSts == BST_UNCHECKED )
{
m_AIEnable[4] = 0x00;
}
}
void CUtil9113Dlg::OnAI05Enable()
{
// TODO: Add your control notification handler code here
int CheckSts;
CheckSts = ((CButton*)GetDlgItem( IDC_RADIO_CH5 ))->GetCheck();
if( CheckSts == BST_CHECKED )
{
m_AIEnable[5] = 0x01;
}
else if( CheckSts == BST_UNCHECKED )
{
m_AIEnable[5] = 0x00;
}
}
void CUtil9113Dlg::OnAI06Enable()
{
// TODO: Add your control notification handler code here
int CheckSts;
CheckSts = ((CButton*)GetDlgItem( IDC_RADIO_CH6 ))->GetCheck();
if( CheckSts == BST_CHECKED )
{
m_AIEnable[6] = 0x01;
}
else if( CheckSts == BST_UNCHECKED )
{
m_AIEnable[6] = 0x00;
}
}
void CUtil9113Dlg::OnAI07Enable()
{
// TODO: Add your control notification handler code here
int CheckSts;
CheckSts = ((CButton*)GetDlgItem( IDC_RADIO_CH7 ))->GetCheck();
if( CheckSts == BST_CHECKED )
{
m_AIEnable[7] = 0x01;
}
else if( CheckSts == BST_UNCHECKED )
{
m_AIEnable[7] = 0x00;
}
}
void CUtil9113Dlg::OnAI08Enable()
{
// TODO: Add your control notification handler code here
int CheckSts;
CheckSts = ((CButton*)GetDlgItem( IDC_RADIO_CH8 ))->GetCheck();
if( CheckSts == BST_CHECKED )
{
m_AIEnable[8] = 0x01;
}
else if( CheckSts == BST_UNCHECKED )
{
m_AIEnable[8] = 0x00;
}
}
void CUtil9113Dlg::OnAI09Enable()
{
// TODO: Add your control notification handler code here
int CheckSts;
CheckSts = ((CButton*)GetDlgItem( IDC_RADIO_CH9 ))->GetCheck();
if( CheckSts == BST_CHECKED )
{
m_AIEnable[9] = 0x01;
}
else if( CheckSts == BST_UNCHECKED )
{
m_AIEnable[9] = 0x00;
}
}
void CUtil9113Dlg::OnAI10Enable()
{
// TODO: Add your control notification handler code here
int CheckSts;
CheckSts = ((CButton*)GetDlgItem( IDC_RADIO_CH10 ))->GetCheck();
if( CheckSts == BST_CHECKED )
{
m_AIEnable[10] = 0x01;
}
else if( CheckSts == BST_UNCHECKED )
{
m_AIEnable[10] = 0x00;
}
}
void CUtil9113Dlg::OnAI11Enable()
{
// TODO: Add your control notification handler code here
int CheckSts;
CheckSts = ((CButton*)GetDlgItem( IDC_RADIO_CH11 ))->GetCheck();
if( CheckSts == BST_CHECKED )
{
m_AIEnable[11] = 0x01;
}
else if( CheckSts == BST_UNCHECKED )
{
m_AIEnable[11] = 0x00;
}
}
void CUtil9113Dlg::OnAI12Enable()
{
// TODO: Add your control notification handler code here
int CheckSts;
CheckSts = ((CButton*)GetDlgItem( IDC_RADIO_CH12 ))->GetCheck();
if( CheckSts == BST_CHECKED )
{
m_AIEnable[12] = 0x01;
}
else if( CheckSts == BST_UNCHECKED )
{
m_AIEnable[12] = 0x00;
}
}
void CUtil9113Dlg::OnAI13Enable()
{
// TODO: Add your control notification handler code here
int CheckSts;
CheckSts = ((CButton*)GetDlgItem( IDC_RADIO_CH13 ))->GetCheck();
if( CheckSts == BST_CHECKED )
{
m_AIEnable[13] = 0x01;
}
else if( CheckSts == BST_UNCHECKED )
{
m_AIEnable[13] = 0x00;
}
}
void CUtil9113Dlg::OnAI14Enable()
{
// TODO: Add your control notification handler code here
int CheckSts;
CheckSts = ((CButton*)GetDlgItem( IDC_RADIO_CH14 ))->GetCheck();
if( CheckSts == BST_CHECKED )
{
m_AIEnable[14] = 0x01;
}
else if( CheckSts == BST_UNCHECKED )
{
m_AIEnable[14] = 0x00;
}
}
void CUtil9113Dlg::OnAI15Enable()
{
// TODO: Add your control notification handler code here
int CheckSts;
CheckSts = ((CButton*)GetDlgItem( IDC_RADIO_CH15 ))->GetCheck();
if( CheckSts == BST_CHECKED )
{
m_AIEnable[15] = 0x01;
}
else if( CheckSts == BST_UNCHECKED )
{
m_AIEnable[15] = 0x00;
}
}
void CUtil9113Dlg::OnTimer(UINT_PTR nIDEvent)
{
// TODO: Add your message handler code here and/or call default
for( int i=0; i<MAX_CHAN_9113; i++ )
{
if ( m_AIEnable[i] == 0x01 )
{
AI_ReadChannel(m_hCard, i, m_wAdRange, &(m_AIData[i]) );
}
}
display_buffer_data();
CDialog::OnTimer(nIDEvent);
}
void CUtil9113Dlg::redraw_display_area(void)
{
CPen *oldPen;
int oldMode;
COLORREF oldColor;
CString y_lable;
CPen minor_tick( PS_SOLID,1,RGB(132,130,132) );
// CPen y_grid( PS_SOLID,1,RGB(206,203,132) );
int i, x_intv, y_intv;
// long total_sec;
CClientDC dc_plot(this);
// draw the base-line for x-y axises
oldPen = (CPen *)dc_plot.SelectStockObject(BLACK_PEN);
// redraw the background
dc_plot.FillSolidRect( plotRect0, RGB(0,0,0) );
dc_plot.FillSolidRect( plotRect1, RGB(0,0,0) );
// Re-Draw the AREA for Y-Lable
{
CBrush DIALOG_BRUSH;
CRect redraw_area, full_client;
GetClientRect(&full_client);
ScreenToClient(&full_client);
redraw_area.left = full_client.left;
redraw_area.top = plotRect0.top - 5;
redraw_area.right = plotRect0.left - 3;
redraw_area.bottom = plotRect0.bottom + 10;
DIALOG_BRUSH.CreateSysColorBrush( COLOR_3DFACE );
dc_plot.FillRect( redraw_area, &DIALOG_BRUSH );
redraw_area.left = full_client.left;
redraw_area.top = plotRect1.top - 5;
redraw_area.right = plotRect1.left - 3;
redraw_area.bottom = plotRect1.bottom + 10;
dc_plot.FillRect( redraw_area, &DIALOG_BRUSH );
DIALOG_BRUSH.DeleteObject();
}
dc_plot.MoveTo( plotRect0.left - 3, plotRect0.top );
dc_plot.LineTo( plotRect0.left - 3, plotRect0.bottom );
dc_plot.MoveTo( plotRect1.left - 3, plotRect1.top );
dc_plot.LineTo( plotRect1.left - 3, plotRect1.bottom );
// calculate the interval for tick/grid
y_intv = (plotRect0.Height() - 10) /y_divider;
x_intv = plotRect0.Width()/x_divider;
// set the color for tick
oldColor = dc_plot.SetTextColor( RGB(0,0,0) );
oldMode = dc_plot.SetBkMode( TRANSPARENT );
for( i=0; i<= y_divider; i++ )
{
CString tick_str;
CRect tmp_rect, tick_rect;
// draw the tick for y-axis
dc_plot.MoveTo( plotRect0.left -12, plotRect0.bottom -5 - (i*y_intv) );
dc_plot.LineTo( plotRect0.left -3, plotRect0.bottom -5 - (i*y_intv) );
tick_str.Format( _T("%.3f"), ( ((max_range-min_range)/y_divider) * i)+min_range );
// calculate the rectangle for text
dc_plot.DrawText( tick_str, &tmp_rect, DT_CALCRECT|DT_SINGLELINE );
tick_rect.right = plotRect0.left -14;
tick_rect.left = tick_rect.right - tmp_rect.Width();
tick_rect.top = plotRect0.bottom -5 - (i*y_intv) - tmp_rect.Height()/2;
tick_rect.bottom = tick_rect.top + tmp_rect.Height();
// draw the text
dc_plot.DrawText( tick_str, &tick_rect, DT_SINGLELINE|DT_RIGHT );
}
for( i=0; i<= y_divider; i++ )
{
CString tick_str;
CRect tmp_rect, tick_rect;
// draw the tick for y-axis
dc_plot.MoveTo( plotRect1.left -12, plotRect1.bottom -5 - (i*y_intv) );
dc_plot.LineTo( plotRect1.left -3, plotRect1.bottom -5 - (i*y_intv) );
tick_str.Format( _T("%.3f"), ( ((max_range-min_range)/y_divider) * i)+min_range );
// calculate the rectangle for text
dc_plot.DrawText( tick_str, &tmp_rect, DT_CALCRECT|DT_SINGLELINE );
tick_rect.right = plotRect1.left -14;
tick_rect.left = tick_rect.right - tmp_rect.Width();
tick_rect.top = plotRect1.bottom -5 - (i*y_intv) - tmp_rect.Height()/2;
tick_rect.bottom = tick_rect.top + tmp_rect.Height();
// draw the text
dc_plot.DrawText( tick_str, &tick_rect, DT_SINGLELINE|DT_RIGHT );
}
// draw the minor_tick for Y axises
dc_plot.SelectObject(&minor_tick);
for( i=0; i< y_divider; i++ )
{
dc_plot.MoveTo( plotRect0.left -9, plotRect0.bottom -5 - (i*y_intv) - y_intv/2 );
dc_plot.LineTo( plotRect0.left -4, plotRect0.bottom -5 - (i*y_intv) - y_intv/2 );
}
for( i=0; i< y_divider; i++ )
{
dc_plot.MoveTo( plotRect1.left -9, plotRect1.bottom -5 - (i*y_intv) - y_intv/2 );
dc_plot.LineTo( plotRect1.left -4, plotRect1.bottom -5 - (i*y_intv) - y_intv/2 );
}
dc_plot.SetTextColor( oldColor );
dc_plot.SetBkMode( oldMode );
dc_plot.SelectObject( oldPen );
}
int CUtil9113Dlg::display_buffer_data(void)
{
CClientDC dc_plot(this);
int nDraw_Bottom;
int newY;
I16 ai_data;
dc_plot.BitBlt( plotRect0.left+2, plotRect0.top, n_PlotWidth-2, n_PlotHeight, &dc_plot, plotRect0.left, plotRect0.top, SRCCOPY );
dc_plot.BitBlt( plotRect1.left+2, plotRect1.top, n_PlotWidth-2, n_PlotHeight, &dc_plot, plotRect1.left, plotRect1.top, SRCCOPY );
for( int i=0; i<MAX_CHAN_9113; i++ )
{
if ( m_AIEnable[i] == 0x01 )
{
switch (i)
{
case 0:
dc_plot.SelectObject( &YellowPen);
nDraw_Bottom = ( plotRect0.bottom );
break;
case 1:
dc_plot.SelectObject( &LTGreenPen);
nDraw_Bottom = ( plotRect0.bottom );
break;
case 2:
dc_plot.SelectObject( &BluePen);
nDraw_Bottom = ( plotRect0.bottom );
break;
case 3:
dc_plot.SelectObject( &RedPen);
nDraw_Bottom = ( plotRect0.bottom );
break;
case 4:
dc_plot.SelectObject( &LTBluePen);
nDraw_Bottom = ( plotRect0.bottom );
break;
case 5:
dc_plot.SelectObject( &LTRedPen);
nDraw_Bottom = ( plotRect0.bottom );
break;
case 6:
dc_plot.SelectObject( &LTGreenPen);
nDraw_Bottom = ( plotRect0.bottom );
break;
case 7:
dc_plot.SelectObject( &WhitePen);
nDraw_Bottom = ( plotRect0.bottom );
break;
case 8:
dc_plot.SelectObject( &YellowPen);
nDraw_Bottom = ( plotRect1.bottom );
break;
case 9:
dc_plot.SelectObject( &LTGreenPen );
nDraw_Bottom = ( plotRect1.bottom );
break;
case 10:
dc_plot.SelectObject( &BluePen);
nDraw_Bottom = ( plotRect1.bottom );
break;
case 11:
dc_plot.SelectObject( &RedPen);
nDraw_Bottom = ( plotRect1.bottom );
break;
case 12:
dc_plot.SelectObject( &LTBluePen);
nDraw_Bottom = ( plotRect1.bottom );
break;
case 13:
dc_plot.SelectObject( &LTRedPen);
nDraw_Bottom = ( plotRect1.bottom );
break;
case 14:
dc_plot.SelectObject( &LTGreenPen);
nDraw_Bottom = ( plotRect1.bottom );
break;
case 15:
dc_plot.SelectObject( &WhitePen);
nDraw_Bottom = ( plotRect1.bottom );
break;
}
ai_data = (I16)(m_AIData[i] & 0x0000FFFF);
newY = (int)( nDraw_Bottom - ((n_PlotHeight * ai_data) >> 12 ) ); // (n_PlotHeight * ai_data / 4096 )
if ( m_oldY[i] !=-1 )
{
if( i < 8 )
{
dc_plot.MoveTo( plotRect0.left+2, newY );
dc_plot.LineTo( plotRect0.left+5, m_oldY[i] );
}
else
{
dc_plot.MoveTo( plotRect1.left+2, newY );
dc_plot.LineTo( plotRect1.left+5, m_oldY[i] );
}
}
m_oldY[i] = newY;
}
}
return 0;
}