// v1View.cpp : implementation of the CV1View class // // // RomaNets Software, RomaNets Hardware, 2003 // // // #include "stdafx.h" #include "v1.h" #include "v1Doc.h" #include "v1View.h" #include #include #include #include "MyLib\gpioctl.h" // This defines the IOCTL constants. #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif int g_Y[320]; bool g_bPause = false; bool g_bRecord = false; CByteArray g_aRecData; unsigned char n,f,e; int b,g; double d; double d256; //static HANDLE g_hThread0; // Fragments Ignite Thread //static CRNH6_00Dlg* g_pDlg; UCHAR OpenForReadByte(); void CloseForReadByte(); void WriteByte ( UCHAR data); /* ////////////////////////////////////////////////////////////////////////////// DWORD WINAPI s_Thread( LPVOID params) ////////////////////////////////////////////////////////////////////////////// { while ( 1) { //Sleep( 10); UCHAR b = ReadByte(); // get data from port 0x0301 g_pDlg->m_iEdit = b; g_pDlg->UpdateData( FALSE); WriteByte( b); // send data back to port 0x0300 //MessageBeep(-1); } return 0; } */ HANDLE g_hndFile; // Handle to device, obtain from CreateFile ////////////////////////////////////////////////////////////////////////////// UCHAR OpenForReadByte() ////////////////////////////////////////////////////////////////////////////// { UCHAR data = 0; // The following is returned by IOCTL. It is true if the read succeeds. BOOL IoctlResult; // The following parameters are used in the IOCTL call //HANDLE hndFile; // Handle to device, obtain from CreateFile ULONG PortNumber; // Buffer sent to the driver (Port #). union { ULONG LongData; USHORT ShortData; UCHAR CharData; } DataBuffer; // Buffer received from driver (Data). LONG IoctlCode; ULONG DataLength; DWORD ReturnedLength; // Number of bytes returned // The input buffer is a ULONG containing the port address. // The port data is returned in the output buffer DataBuffer; g_hndFile = CreateFile( "\\\\.\\GpdDev", // Open the Device "file" GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL ); if (g_hndFile == INVALID_HANDLE_VALUE) // Was the device opened? { //printf("Unable to open the device.\n"); //exit(1); AfxMessageBox("Unable to open the device.\n"); return 0; } IoctlCode = IOCTL_GPD_READ_PORT_UCHAR; DataLength = sizeof(DataBuffer.CharData); PortNumber = 1; // base + 1 = [0x0301] // Get the port number to be read IoctlResult = DeviceIoControl( g_hndFile, // Handle to device IoctlCode, // IO Control code for Read &PortNumber, // Buffer to driver. sizeof(PortNumber), // Length of buffer in bytes. &DataBuffer, // Buffer from driver. DataLength, // Length of buffer in bytes. &ReturnedLength, // Bytes placed in DataBuffer. NULL // NULL means wait till op. completes. ); if (IoctlResult) // Did the IOCTL succeed? { ULONG Data; if (ReturnedLength != DataLength) { //printf( // "Ioctl transfered %d bytes, expected %d bytes\n", //ReturnedLength, DataLength ); CString str; str.Format("Ioctl transfered %d bytes, expected %d bytes\n", ReturnedLength, DataLength ); AfxMessageBox( str); } switch (ReturnedLength) { case sizeof(UCHAR): Data = DataBuffer.CharData; break; // case sizeof(USHORT): // Data = DataBuffer.ShortData; // break; // // case sizeof(ULONG): // Data = DataBuffer.LongData; // break; default: //printf("Invalid return value from the DeviceIoControl\n"); //exit(1); AfxMessageBox( "Invalid return value from the DeviceIoControl\n"); return 0; } //printf("Read from port %x returned %x\n", PortNumber, Data); data = (UCHAR)Data; } else { //printf("Ioctl failed with code %ld\n", GetLastError() ); CString str; str.Format("Ioctl failed with code %ld\n", GetLastError() ); AfxMessageBox( str); } // if (!CloseHandle(g_hndFile)) // Close the Device "file". // { // //printf("Failed to close device.\n"); // AfxMessageBox("Failed to close device.\n"); // } return data; } // ReadByte ////////////////////////////////////////////////////////////////////////////// void CloseForReadByte() ////////////////////////////////////////////////////////////////////////////// { if (!CloseHandle(g_hndFile)) // Close the Device "file". { //printf("Failed to close device.\n"); AfxMessageBox("Failed to close device.\n"); } } ////////////////////////////////////////////////////////////////////////////// void WriteByte ( UCHAR data) ////////////////////////////////////////////////////////////////////////////// { HANDLE hndFile; // Handle to device, obtain from CreateFile GENPORT_WRITE_INPUT InputBuffer; // Input buffer for DeviceIoControl ULONG DataValue; ULONG DataLength; ULONG ReturnedLength; // Number of bytes returned in output buffer hndFile = CreateFile( "\\\\.\\GpdDev", // Open the Device "file" GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); if (hndFile == INVALID_HANDLE_VALUE) // Was the device opened? { //printf("Unable to open the device.\n"); //exit(1); AfxMessageBox("Unable to open the device.\n"); return; } // Create data InputBuffer.PortNumber = 0x0; // base + 0 = 0x300 DataValue = data; InputBuffer.CharData = (UCHAR)DataValue; DataLength = offsetof(GENPORT_WRITE_INPUT, CharData) + sizeof(InputBuffer.CharData); DeviceIoControl( hndFile, // Handle to device IOCTL_GPD_WRITE_PORT_UCHAR, // IO Control code for Write &InputBuffer, // Buffer to driver. Holds port & data. DataLength, // Length of buffer in bytes. NULL, // Buffer from driver. Not used. 0, // Length of buffer in bytes. &ReturnedLength, // Bytes placed in outbuf. Should be 0. NULL // NULL means wait till I/O completes. ); CloseHandle(hndFile); } // WriteByte /////////////////////////////////////////////////////////////////////////////// void comInit_ADC() /////////////////////////////////////////////////////////////////////////////// { b = 0x3F8; n = 8; _outp( b+4, 1); //delay(100); Sleep(100); //int i; //for ( i=0; i<2000000; i++) // ; _outp( b+3, 64); //delay(500); Sleep(500); //for ( i=0; i<20000000; i++) // ; } /////////////////////////////////////////////////////////////////////////////// void comAcquisition() /////////////////////////////////////////////////////////////////////////////// { _outp( b+4, 0); d = 0; for ( f=0; f < n; f++ ) { _outp( b+4, 2); e = _inp( b+6) & 16; _outp( b+4, 0); if ( e == 16) d = d + exp((n-1-f)*log(2)); } d256 = d; d = (5*d)/(exp((n)*log(2))-1); _outp( b+4, 1); } /////////////////////////////////////////////////////////////////////////////// void isaAcquisition() /////////////////////////////////////////////////////////////////////////////// { //const int n = 8; // d - double must be [0...5.0] UCHAR data = 0; // The following is returned by IOCTL. It is true if the read succeeds. BOOL IoctlResult; // The following parameters are used in the IOCTL call //HANDLE hndFile; // Handle to device, obtain from CreateFile ULONG PortNumber; // Buffer sent to the driver (Port #). union { ULONG LongData; USHORT ShortData; UCHAR CharData; } DataBuffer; // Buffer received from driver (Data). LONG IoctlCode; ULONG DataLength; DWORD ReturnedLength; // Number of bytes returned IoctlCode = IOCTL_GPD_READ_PORT_UCHAR; DataLength = sizeof(DataBuffer.CharData); PortNumber = 1; // base + 1 = [0x0301] // Get the port number to be read IoctlResult = DeviceIoControl( g_hndFile, // Handle to device IoctlCode, // IO Control code for Read &PortNumber, // Buffer to driver. sizeof(PortNumber), // Length of buffer in bytes. &DataBuffer, // Buffer from driver. DataLength, // Length of buffer in bytes. &ReturnedLength, // Bytes placed in DataBuffer. NULL // NULL means wait till op. completes. ); d = DataBuffer.CharData; d = (5*d)/255;//(exp((n)*log(2))-1); } // isaAcquisition /////////////////////////////////////////////////////////////////////////////// int Get_ADC_8Bit_Data() /////////////////////////////////////////////////////////////////////////////// { //comAcquisition(); isaAcquisition(); return (int(100*d)) / 1 - 248; } /////////////////////////////////////////////////////////////////////////////// // // LEDDisp0.cpp // // RomaNets Software, RomaNets Hardware, May 2003 // // // This prog is for "RNTH_#10_PCCOM+LEDDisplay" // // /////////////////////////////////////////////////////////////////////////////// // RNS_NOTES: // // COM1 Base port: 0x3F8 // COM2 Base port: 0x2F8 // // B+4 - [MCR] (Modem control register) // bit_0 - DTRC (Data terminal ready control) // 0 - -12V xxxxxxx0 0 // 1 - +12V xxxxxxx1 1 // pin4 on DB9 // We use this bit as [DATA] for LEDDisplay // // bit_1 - RTSC (Request to send control) // 0 - -12V xxxxxx0x 0 // 1 - +12V xxxxxx1x 2 // pin7 on DB9 // We use this bit as [CLOCK] for LEDDisplay // // 000000xx // __ // || // CLOCK || DATA // __________||__________ // // // B+3 - [LCR] (Line control register) // bit_6 - BRCON (Break control) // 1 - +12V on TXD ( Transmit data) x1xxxxxx 0x40 64 // pin3 on DB9 // We might be used this bit as [+12V] for circuit // // B+6 - [MSR] (Modem status register) // bit_4 - state of the line CTS (Clear to send) // 0 - -12V xxx0xxxx 0x00 // 1 - +12V xxx1xxxx 0x10 16 // pin8 on DB9 // We might be used this bit as [input DATA] from circuit //#include //#include //#include // DB9 pins /////////////////////////////////////////////////////////////////// // #define COM1 0x3F8 #define COM2 0x2F8 #define BASE_PORT COM1 #define MCR (BASE_PORT + 4) #define LCR (BASE_PORT + 3) #define DATA_PORT MCR #define CLOCK_PORT MCR #define DATA_CLOCK_PORT MCR #define CLOCK_UP 2 #define CLOCK_DOWN 0 #define DATA_UP 1 #define DATA_DOWN 0 #define LEDSEGMENT_OFF DATA_UP #define LEDSEGMENT_ON DATA_DOWN // GLOBAL FUNCTION PROTOTYPES ///////////////////////////////////////////////// // int convert( int digit); void loader( int digit); void segment_off(); void segment_on(); void mydelay(); //#define NOTHING loader( convert( 17));\ // delay( 500);\ // loader( convert( 17));\ // delay( 500);\ // loader( convert( 17));\ // delay( 500);\ // loader( convert( 17));\ // delay( 500);\ // /* void main() { loader( convert( 17)); loader( convert( 17)); loader( convert( 17)); loader( convert( 17)); while ( 1 ) { if ( kbhit() ) { int ch; ch = getch(); switch ( ch ) { case 27: return; case '1': loader( convert( 1)); break; case '2': loader( convert( 2)); break; case '3': loader( convert( 3)); break; case '4': loader( convert( 4)); break; case '5': loader( convert( 5)); break; case '6': loader( convert( 6)); break; case '7': loader( convert( 7)); break; case '8': loader( convert( 8)); break; case '9': loader( convert( 9)); break; case '0': loader( convert( 0)); break; case 'a': case 'A': loader( convert( 10)); break; case 'b': case 'B': loader( convert( 11)); break; case 'c': case 'C': loader( convert( 12)); break; case 'd': case 'D': loader( convert( 13)); break; case 'e': case 'E': loader( convert( 14)); break; case 'f': case 'F': loader( convert( 15)); break; case ' ': // SPACE loader( convert( 17)); break; case 13: // ENTER loader( convert( 17)); loader( convert( 17)); loader( convert( 17)); loader( convert( 17)); break; } } } } // main */ /////////////////////////////////////////////////////////////////////////////// int convert( int digit) /////////////////////////////////////////////////////////////////////////////// { int data = 0; switch ( digit ) { case 0: data = 0x3F; break; case 1: data = 0x06; break; case 2: data = 0x5B; break; case 3: data = 0x4F; break; case 4: data = 0x66; break; case 5: data = 0x6D; break; case 6: data = 0x7D; break; case 7: data = 0x07; break; case 8: data = 0x7F; break; case 9: data = 0x6F; break; case 10: //A data = 0x77; break; case 11: // b data = 0x7C; break; case 12: // C data = 0x39; break; case 13: // d data = 0x5E; break; case 14: // E data = 0x79; break; case 15: // F data = 0x71; break; case 16: // . data = 0x80; break; case 17: // nothing data = 0x00; break; case 18: // - data = 0x40; break; } //return data ^ 0xFF; return data; } // convert /* ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Must be in first 256 address bank ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; convert addwf PCL, f retlw b'00111111' ; 0 0x3F retlw b'00000110' ; 1 0x06 retlw b'01011011' ; 2 0x5B retlw b'01001111' ; 3 0x4F retlw b'01100110' ; 4 0x66 retlw b'01101101' ; 5 0x6D retlw b'01111101' ; 6 0x7D retlw b'00000111' ; 7 0x07 retlw b'01111111' ; 8 0x7F retlw b'01101111' ; 9 0x6F retlw b'01110111' ; A 10 0x77 retlw b'01111100' ; b 11 0x7C retlw b'00111001' ; C 12 0x39 retlw b'01011110' ; d 13 0x5E retlw b'01111001' ; E 14 0x79 retlw b'01110001' ; F 15 0x71 retlw b'10000000' ; . 16 0x80 retlw b'00000000' ; nothing 17 0x00 retlw b'01000000' ; - 18 0x40 ;retlw b'01110011' ; P 15 ;retlw b'01110110' ; H 16 ;-------------------------------------- ; _ ;retlw b'00110111' ; | | 17 ; | | ; ;-------------------------------------- ; _ ;retlw b'01100011' ; |_| 18 ; ; ;-------------------------------------- ; ;retlw b'01011100' ; 19 ; _ ; |_| ;-------------------------------------- ; _ ;retlw b'00110001' ; | 20 ; | ; ;-------------------------------------- ;-------------------------------------- ;-------------------------------------- ;-------------------------------------- ; ; End convert subroutin ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; */ //;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; //; //; 0) For every bit in byte //; 1) Set Sync to 0 //; 2) Set Data X (0 or 1) //; 3) Set Sync to 1 //; //; Source V.S. Jatsenkov p.263 //; /////////////////////////////////////////////////////////////////////////////// void loader( int digit) /////////////////////////////////////////////////////////////////////////////// { int mask = 0x80; for ( int i=0; i<8; i++ ) { if ( mask == (digit & mask) ) segment_on(); else segment_off(); mask >>= 1; } } /////////////////////////////////////////////////////////////////////////////// void segment_off() /////////////////////////////////////////////////////////////////////////////// { unsigned char D; D = LEDSEGMENT_OFF; _asm { mov dx, DATA_CLOCK_PORT mov al, CLOCK_DOWN // -_ or al, D // set data out dx, al } mydelay(); _asm { mov dx, DATA_CLOCK_PORT mov al,CLOCK_UP // _- or al, D out dx, al } mydelay(); } /////////////////////////////////////////////////////////////////////////////// void segment_on() /////////////////////////////////////////////////////////////////////////////// { unsigned char D; D = LEDSEGMENT_ON; _asm { mov dx, DATA_CLOCK_PORT mov al, CLOCK_DOWN // -_ or al, D // set data out dx, al } mydelay(); _asm { mov dx, DATA_CLOCK_PORT mov al,CLOCK_UP // _- or al, D out dx, al } mydelay(); } /////////////////////////////////////////////////////////////////////////////// void mydelay() /////////////////////////////////////////////////////////////////////////////// { // P4 1600 MHz: // if max_i == 2000 // CLOCK: -_-_-_-_-_-_-_-_------------------ ... -_-_-_-_-_-_-_-_------------------ // |-| | // 6 mks | // |-------------------------------------| // 30 ms //for ( int i=0; i<2000; i++) // ; for ( int i=0; i<2000; i++) ; //delay(1); } ///////////////////////////////////////////////////////////////////////////// // CV1View IMPLEMENT_DYNCREATE(CV1View, CView) BEGIN_MESSAGE_MAP(CV1View, CView) //{{AFX_MSG_MAP(CV1View) ON_WM_ERASEBKGND() ON_COMMAND(ID_BUTTON_1, OnButton1) ON_UPDATE_COMMAND_UI(ID_BUTTON_1, OnUpdateButton1) ON_COMMAND(ID_BUTTON_A, OnButtonA) ON_UPDATE_COMMAND_UI(ID_BUTTON_A, OnUpdateButtonA) ON_WM_TIMER() ON_WM_DESTROY() ON_COMMAND(ID_BUTTON_PAUSE, OnButtonPause) ON_UPDATE_COMMAND_UI(ID_BUTTON_PAUSE, OnUpdateButtonPause) ON_COMMAND(ID_BUTTON_RECORD, OnButtonRecord) ON_UPDATE_COMMAND_UI(ID_BUTTON_RECORD, OnUpdateButtonRecord) ON_COMMAND(ID_BUTTON_STOP_RECORD, OnButtonStopRecord) ON_UPDATE_COMMAND_UI(ID_BUTTON_STOP_RECORD, OnUpdateButtonStopRecord) //}}AFX_MSG_MAP // Standard printing commands ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CV1View construction/destruction CV1View::CV1View() { // TODO: add construction code here // open com 1 // Open_Serial( COM_1, // //SER_BAUD_600, // //SER_BAUD_1200, // //SER_BAUD_9600, // SER_BAUD_19200, // SER_PARITY_NONE | SER_BITS_8 | SER_STOP_1); OpenForReadByte(); srand( time( NULL)); for ( int i=0; i<140; i++) { g_Y[i] = rand()%50; } //comInit_ADC(); } //============================================================================= CV1View::~CV1View() //============================================================================= { // Close_Serial(COM_1); // close the connection and blaze // Save recorded sound data to file CFileException e; CFile myFile; if ( !myFile.Open( "_snd_test.dat", CFile::modeCreate | CFile::modeWrite | CFile::typeBinary, &e) ) MessageBeep(-1); CArchive ar(&myFile, CArchive::store); g_aRecData.Serialize( ar); //ar << m_nPositionX; // save last map position //ar << m_nPositionY; ar.Close(); myFile.Close(); // 10 sec sound file: address of the last file byte = 0x014859 CloseForReadByte(); } BOOL CV1View::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs return CView::PreCreateWindow(cs); } ///////////////////////////////////////////////////////////////////////////// // CV1View drawing void CV1View::OnDraw(CDC* pDC) { CV1Doc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw code for native data here CRect r( 10,200, 15, 205); // create and select a thick, black pen CPen penGreen; penGreen.CreatePen(PS_SOLID, 3, RGB(0, 255, 0)); CPen* pOldPen = pDC->SelectObject(&penGreen); // pDC->MoveTo( r.left + r.Width()/2, r.top + r.Height()/2); // pDC->LineTo( 300, 300); // create and select a solid blue brush CBrush brushGreen(RGB(0, 255, 0)); CBrush* pOldBrush = pDC->SelectObject(&brushGreen); for ( int i=0; i<140; i++) { // pDC->RoundRect( &r, CPoint( 5,5)); pDC->MoveTo( r.left + r.Width()/2, r.top + r.Height()/2); r.OffsetRect( 5, 0); r.top = 200 + g_Y[i]; r.bottom = r.top + 5; pDC->LineTo( r.left + r.Width()/2, r.top + r.Height()/2); } CString str; str.Format( "%d", g_aRecData.GetSize() ); pDC->TextOut( 10,10, str); //CPoint pt = pDC->GetCurrentPosition(); //r.OffsetRect( 300-10,300-10); //pDC->Rectangle( &r); //pDC->RoundRect( &r, CPoint( 10,10)); // put back the old objects pDC->SelectObject(pOldBrush); pDC->SelectObject(pOldPen); } ///////////////////////////////////////////////////////////////////////////// // CV1View printing BOOL CV1View::OnPreparePrinting(CPrintInfo* pInfo) { // default preparation return DoPreparePrinting(pInfo); } void CV1View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { // TODO: add extra initialization before printing } void CV1View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) { // TODO: add cleanup after printing } ///////////////////////////////////////////////////////////////////////////// // CV1View diagnostics #ifdef _DEBUG void CV1View::AssertValid() const { CView::AssertValid(); } void CV1View::Dump(CDumpContext& dc) const { CView::Dump(dc); } CV1Doc* CV1View::GetDocument() // non-debug version is inline { ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CV1Doc))); return (CV1Doc*)m_pDocument; } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // CV1View message handlers BOOL CV1View::OnEraseBkgnd(CDC* pDC) { // TODO: Add your message handler code here and/or call default CRect r; GetClientRect( &r); CBrush brush; brush.CreateSolidBrush( 0); CBrush * pOldBrush = pDC->SelectObject( &brush); pDC->Rectangle( r); pDC->SelectObject( pOldBrush); //return CView::OnEraseBkgnd(pDC); return TRUE; } void CV1View::OnButton1() { // TODO: Add your command handler code here // This code is for LEDDisplay // static int n = 0; // loader( convert( n++)); // // if ( n > 17 ) // n = 0; } void CV1View::OnUpdateButton1(CCmdUI* pCmdUI) { // TODO: Add your command update UI handler code here } //============================================================================= void CV1View::OnButtonA() //============================================================================= { // TODO: Add your command handler code here // This code is for ADC8 for ( int i=0; i<140; i++) { //g_Y[i] = rand()%50; int y = Get_ADC_8Bit_Data(); g_Y[i] = y; if ( g_bRecord ) { g_aRecData.Add( BYTE(d256) ); } } Invalidate(); } void CV1View::OnUpdateButtonA(CCmdUI* pCmdUI) { // TODO: Add your command update UI handler code here } //============================================================================= void CV1View::OnTimer(UINT nIDEvent) //============================================================================= { // TODO: Add your message handler code here and/or call default if ( !g_bPause ) { //MessageBeep(-1); OnButtonA(); } CView::OnTimer(nIDEvent); } //============================================================================= void CV1View::OnInitialUpdate() //============================================================================= { CView::OnInitialUpdate(); // TODO: Add your specialized code here and/or call the base class SetTimer( 0, 500, NULL); } //============================================================================= void CV1View::OnDestroy() //============================================================================= { CView::OnDestroy(); // TODO: Add your message handler code here if ( !KillTimer( 0) ) MessageBeep(-1); } //============================================================================= void CV1View::OnButtonPause() //============================================================================= { // TODO: Add your command handler code here g_bPause = !g_bPause; } void CV1View::OnUpdateButtonPause(CCmdUI* pCmdUI) { // TODO: Add your command update UI handler code here } //============================================================================= void CV1View::OnButtonRecord() //============================================================================= { // TODO: Add your command handler code here g_aRecData.RemoveAll(); g_bRecord = true; } void CV1View::OnUpdateButtonRecord(CCmdUI* pCmdUI) { // TODO: Add your command update UI handler code here pCmdUI->Enable( !g_bRecord); } //============================================================================= void CV1View::OnButtonStopRecord() //============================================================================= { // TODO: Add your command handler code here g_bRecord = false; } void CV1View::OnUpdateButtonStopRecord(CCmdUI* pCmdUI) { // TODO: Add your command update UI handler code here pCmdUI->Enable( g_bRecord); }