www.pudn.com > PlateDSP.rar > main.cpp


//--------------------------------------------------------------------------- 
 
#include  
#pragma hdrstop 
 
#include "main.h" 
//--------------------------------------------------------------------------- 
#pragma package(smart_init) 
#pragma link "PlateDSP_OCX" 
#pragma resource "*.dfm" 
TForm1 *Form1; 
 
const int PlateDSP_StatSize = 16; 
 
//--------------------------------------------------------------------------- 
__fastcall TForm1::TForm1(TComponent* Owner) 
    : TForm(Owner) 
{ 
} 
//--------------------------------------------------------------------------- 
void __fastcall TForm1::FormShow(TObject *Sender) 
{ 
    PlateDSPX1->VideoConnect(0); 
} 
//--------------------------------------------------------------------------- 
void __fastcall TForm1::PlateDSPX1Recoged(TObject *Sender, long PlateNum) 
{ 
    if( PlateNum > 0 ) 
    { 
        long Count = PlateDSPX1->StatInsert(0,NULL); //insert current result 
        if( Count==1 ) 
        { 
            //新车牌号,此时可以进行SQL检索 
        } 
        long Color; 
        AnsiString Plate; 
        //取最新500亳秒的计数值最高的记录 
        Plate = WideString( PlateDSPX1->StatGetByIndex(-500,&Color,&Count) ); 
        if( Count > 0 ) 
        { 
            LabelCount1->Caption = AnsiString(Count); 
            LabelPlate1->Caption = Plate; 
        } 
    } 
} 
//---------------------------------------------------------------------------