first commit (2002-04-24)
This commit is contained in:
1009
LM2000_vcl/LM2000.cpp
Normal file
1009
LM2000_vcl/LM2000.cpp
Normal file
File diff suppressed because it is too large
Load Diff
BIN
LM2000_vcl/LM2000.dcr
Normal file
BIN
LM2000_vcl/LM2000.dcr
Normal file
Binary file not shown.
180
LM2000_vcl/LM2000.h
Normal file
180
LM2000_vcl/LM2000.h
Normal file
@ -0,0 +1,180 @@
|
||||
// #define PRUEBAS_SIN_VCL
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#ifndef LM2000H
|
||||
#define LM2000H
|
||||
//---------------------------------------------------------------------------
|
||||
#include <SysUtils.hpp>
|
||||
#include <Controls.hpp>
|
||||
#include <Classes.hpp>
|
||||
#include <Forms.hpp>
|
||||
//---------------------------------------------------------------------------
|
||||
/** Estructura que define a una tarjeta */
|
||||
typedef struct
|
||||
{
|
||||
int FLG; // Enabling flag
|
||||
int TYP; // Card Type
|
||||
int CDA; // Card Code
|
||||
int PIN; // PIN
|
||||
int GIS; // Expiration day
|
||||
int MES; // Expiration month
|
||||
int ANS; // Expiration year
|
||||
int ORS; // Expiration hour
|
||||
int MIS; // Expiration minute
|
||||
int SES; // Expiration second
|
||||
int REV; // Revision
|
||||
int CRD; // Credit
|
||||
} TCard;
|
||||
|
||||
/** Estructura que define el modo de lectura/escritura */
|
||||
typedef struct
|
||||
{
|
||||
int FMC; // Card memory flag
|
||||
int MAC; //
|
||||
int LFN; // Operation logic
|
||||
int NCR; // Cards in memory
|
||||
int CMN; // Minimum code
|
||||
int CMX; // Maximum code
|
||||
int NBN; // Number of bands
|
||||
int NMP; // Number of messages
|
||||
int NFA; // Number of periods
|
||||
int RMS; // Lines in messages
|
||||
int MCA; // Motive mode
|
||||
int MCR; // Credit mode
|
||||
} RMem;
|
||||
|
||||
/** Program Operation Parameters */
|
||||
typedef struct
|
||||
{
|
||||
int BKN; // Network block
|
||||
int BKP; // Printer block
|
||||
int PRN; // Print mode
|
||||
int MCL; // Mode for requesting information from P.C.
|
||||
int MCK; // Card control mode
|
||||
int ENF; // Enabling of keyboard functions
|
||||
int SNV; // Anomaly memorization mode
|
||||
int ENI; // Number of intrusions per apparatus block
|
||||
} POP;
|
||||
|
||||
/** Configuracion de fecha/hora */
|
||||
typedef struct
|
||||
{
|
||||
int GIA; // Day
|
||||
int MEA; // Month
|
||||
int ANA; // Year
|
||||
int ORA; // Hour
|
||||
int MIA; // Minute
|
||||
int SEA; // Second
|
||||
} RClock;
|
||||
|
||||
/** Estructura TSD */
|
||||
typedef struct
|
||||
{
|
||||
int CHN;
|
||||
int GSL;
|
||||
int MMS;
|
||||
int ASL;
|
||||
int HSL;
|
||||
int MSL;
|
||||
int SSL;
|
||||
} TSD;
|
||||
|
||||
/** Caracteres en la Banda */
|
||||
typedef struct
|
||||
{
|
||||
int GAP; // Number of empty characters preceding prefix
|
||||
int LEP; // Length of prefix in characters
|
||||
int GAC; // Number of empty characters preceding code
|
||||
int LEC; // Length of code in characters
|
||||
int GAR; // Number of empty characters preceding revision
|
||||
int LER; // Number of characters containing number of revision
|
||||
int GDI; // Number of empty characters preceding validity start date
|
||||
int GDF; // Number of empty characters preceding validity end date
|
||||
} CAB;
|
||||
|
||||
/** LM2000
|
||||
Clase que encapsula las funciones necesarias para comunicarse con el LM2000
|
||||
*/
|
||||
#ifdef PRUEBAS_SIN_VCL
|
||||
class PACKAGE TLm2000
|
||||
#else
|
||||
class PACKAGE TLm2000 : public TComponent
|
||||
#endif
|
||||
{
|
||||
private:
|
||||
int __fastcall GeneraChecksum( char *cadena );
|
||||
char * __fastcall ObtenerRespuesta( char *rcv );
|
||||
char * __fastcall EnviarComando( char *CMD, int ID, char *rcv );
|
||||
char * __fastcall ObtenerParametro( char *cadena, int narg, char *prm );
|
||||
bool __fastcall ProcesaTarjeta( int ID, char *msg );
|
||||
|
||||
/** Manejador que apunta al Puerto donde dialogamos */
|
||||
HANDLE LM_handle;
|
||||
/** Indica si estamos en comunicaci<63>n actualmente */
|
||||
bool LM_opened;
|
||||
|
||||
void __fastcall ProcesaTransito( char *FGT, char *TPT, char *CDT, char *O, char *DTT, char *CTT, char *ETT );
|
||||
|
||||
#ifndef PRUEBAS_SIN_VCL
|
||||
typedef bool __fastcall (__closure *Tprintfv)( AnsiString msg );
|
||||
typedef bool __fastcall (__closure *TBuscaTarjeta)( int ID, int FGA, int TPA, int CDA, int *TPR, int *PNR, char *message );
|
||||
typedef void __fastcall (__closure *TOnProcesaTransito)( char *FGT, char *TPT, char *CDT, char *O, char *DTT, char *CTT, char *ETT );
|
||||
Tprintfv printfv;
|
||||
TBuscaTarjeta FOnBuscaTarjeta;
|
||||
TOnProcesaTransito FOnProcesaTransito;
|
||||
#else
|
||||
void __fastcall printfv( AnsiString msg );
|
||||
#endif
|
||||
|
||||
protected:
|
||||
public:
|
||||
#ifdef PRUEBAS_SIN_VCL
|
||||
__fastcall TLm2000(void);
|
||||
#else
|
||||
__fastcall TLm2000(TComponent* Owner);
|
||||
#endif
|
||||
__fastcall ~TLm2000(void);
|
||||
|
||||
void __fastcall CierraPuerto(void);
|
||||
int __fastcall AbrePuerto(LPTSTR lpszPortName);
|
||||
|
||||
/** El 'polling' debe llamar continuamente a esta funci<63>n para conocer
|
||||
el estado de los dispositivos 'ID' */
|
||||
char * __fastcall SimpleInterrogation( int ID, char *rcv );
|
||||
|
||||
// LECTURA DE MEMORIA
|
||||
bool __fastcall ReadCardMemory( int ID, TCard *CRD );
|
||||
void __fastcall ReadEntireCardMemory( int ID );
|
||||
// ESCRITURA DE MEMORIA
|
||||
int __fastcall EnterCardMemory( int ID, TCard *CRD );
|
||||
int __fastcall DeleteCardMemory( int ID, int TIP, int COD );
|
||||
int __fastcall DeleteAllCardMemory( int ID, int TIP );
|
||||
// CONFIGURACION LM2000
|
||||
bool __fastcall ConfigureMemory( int ID, RMem *mem );
|
||||
RMem * __fastcall ReadMemoryCFG( int ID, RMem *mem );
|
||||
bool __fastcall ProgrammingPeriods( int ID, int NFS, int PBN, char *StarTime, char *EndTime, int GIF );
|
||||
bool __fastcall ResetClock( int ID, RClock *clock );
|
||||
int __fastcall ReadingPrefixes( int ID, int NPR );
|
||||
bool __fastcall ReadPersonalMessage( int ID );
|
||||
void __fastcall ReadAllPersonalMessage( int ID );
|
||||
void __fastcall SetTime( int ID, TSD *tsd );
|
||||
char * __fastcall ReadSystemMessages( int ID, int IDmsg, char *rcv );
|
||||
bool __fastcall ProgramOperationParameters( int ID, POP *pop );
|
||||
bool __fastcall SetCharsOnBand( int ID, CAB *cab );
|
||||
bool __fastcall GetCharsOnBand( int ID, CAB *cab );
|
||||
bool __fastcall PassageOpening( int ID, int Passage );
|
||||
|
||||
/* Llamadas que deben ser sobrecargadas CALLBACK*/
|
||||
// void __fastcall ProcesaTransito( char *FGT, char *TPT, char *CDT, char *O, char *DTT, char *CTT, char *ETT );
|
||||
// bool __fastcall BuscaTarjeta( int FGA, int TPA, int CDA, int *TPR, int *PNR, char *message );
|
||||
#ifndef PRUEBAS_SIN_VCL
|
||||
__published:
|
||||
__property Tprintfv OnVerboseMessage = {read=printfv, write=printfv };
|
||||
__property TOnProcesaTransito OnProcesaTransito = {read=FOnProcesaTransito, write=FOnProcesaTransito };
|
||||
__property TBuscaTarjeta OnBuscaTarjeta = {read=FOnBuscaTarjeta, write=FOnBuscaTarjeta };
|
||||
#endif
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
|
BIN
LM2000_vcl/LM2000_vcl.bpi
Normal file
BIN
LM2000_vcl/LM2000_vcl.bpi
Normal file
Binary file not shown.
159
LM2000_vcl/LM2000_vcl.bpk
Normal file
159
LM2000_vcl/LM2000_vcl.bpk
Normal file
@ -0,0 +1,159 @@
|
||||
<?xml version='1.0' encoding='utf-8' ?>
|
||||
<!-- C++Builder XML Project -->
|
||||
<PROJECT>
|
||||
<MACROS>
|
||||
<VERSION value="BCB.06.00"/>
|
||||
<PROJECT value="..\LM2000_vcl\LM2000_vcl.bpl"/>
|
||||
<OBJFILES value="..\obj\LM2000_vcl.obj ..\obj\LM2000.obj"/>
|
||||
<RESFILES value="LM2000.dcr"/>
|
||||
<IDLFILES value=""/>
|
||||
<IDLGENFILES value=""/>
|
||||
<DEFFILE value=""/>
|
||||
<RESDEPEN value="$(RESFILES)"/>
|
||||
<LIBFILES value=""/>
|
||||
<LIBRARIES value=""/>
|
||||
<SPARELIBS value="rtl.lib vcl.lib"/>
|
||||
<PACKAGES value="rtl.bpi vcl.bpi"/>
|
||||
<PATHCPP value=".;"/>
|
||||
<PATHPAS value=".;"/>
|
||||
<PATHRC value=".;"/>
|
||||
<PATHASM value=".;"/>
|
||||
<DEBUGLIBPATH value="$(BCB)\lib\debug"/>
|
||||
<RELEASELIBPATH value="$(BCB)\lib\release"/>
|
||||
<LINKER value="ilink32"/>
|
||||
<USERDEFINES value="_DEBUG"/>
|
||||
<SYSDEFINES value="_RTLDLL;NO_STRICT;USEPACKAGES"/>
|
||||
<MAINSOURCE value="LM2000_vcl.cpp"/>
|
||||
<INCLUDEPATH value="..\cap_control;$(BCB)\include;$(BCB)\include\vcl"/>
|
||||
<LIBPATH value="..\cap_control;$(BCB)\lib\obj;$(BCB)\lib"/>
|
||||
<WARNINGS value="-w-par"/>
|
||||
<OTHERFILES value=""/>
|
||||
</MACROS>
|
||||
<OPTIONS>
|
||||
<IDLCFLAGS value="-I..\cap_control -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp
|
||||
-D_DEBUG -boa"/>
|
||||
<CFLAG1 value="-Od -H=c:\ARCHIV~1\borland\CBUILD~2\lib\vcl60.csm -Hc -Vx -Ve -X- -r- -a8
|
||||
-b- -k -y -v -vi- -c -tWM"/>
|
||||
<PFLAGS value="-N2..\obj -N0..\obj -$YD -$W -$O- -$A8 -v -JPHNE -M"/>
|
||||
<RFLAGS value=""/>
|
||||
<AFLAGS value="/mx /w2 /zd"/>
|
||||
<LFLAGS value="-l..\LM2000_vcl -I..\obj -D"Funciones para el Manejo del LM2000" -aa -Tpp
|
||||
-x -Gn -Gl -Gi -v"/>
|
||||
<OTHERFILES value=""/>
|
||||
</OPTIONS>
|
||||
<LINKER>
|
||||
<ALLOBJ value="c0pkg32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES)"/>
|
||||
<ALLRES value="$(RESFILES)"/>
|
||||
<ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib"/>
|
||||
<OTHERFILES value=""/>
|
||||
</LINKER>
|
||||
<FILELIST>
|
||||
<FILE FILENAME="LM2000_vcl.cpp" FORMNAME="" UNITNAME="LM2000_vcl" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
|
||||
<FILE FILENAME="LM2000.cpp" FORMNAME="" UNITNAME="LM2000" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
|
||||
<FILE FILENAME="LM2000.dcr" FORMNAME="" UNITNAME="LM2000" CONTAINERID="DcrTool" DESIGNCLASS="" LOCALCOMMAND=""/>
|
||||
<FILE FILENAME="..\cap_control_CB5\rtl.bpi" FORMNAME="" UNITNAME="rtl" CONTAINERID="BPITool" DESIGNCLASS="" LOCALCOMMAND=""/>
|
||||
<FILE FILENAME="..\cap_control_CB5\vcl.bpi" FORMNAME="" UNITNAME="vcl" CONTAINERID="BPITool" DESIGNCLASS="" LOCALCOMMAND=""/>
|
||||
</FILELIST>
|
||||
<BUILDTOOLS>
|
||||
</BUILDTOOLS>
|
||||
|
||||
<IDEOPTIONS>
|
||||
[Version Info]
|
||||
IncludeVerInfo=1
|
||||
AutoIncBuild=0
|
||||
MajorVer=1
|
||||
MinorVer=0
|
||||
Release=0
|
||||
Build=0
|
||||
Debug=0
|
||||
PreRelease=0
|
||||
Special=0
|
||||
Private=0
|
||||
DLL=0
|
||||
Locale=3082
|
||||
CodePage=1252
|
||||
|
||||
[Version Info Keys]
|
||||
CompanyName=
|
||||
FileDescription=
|
||||
FileVersion=1.0.0.0
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=
|
||||
ProductName=
|
||||
ProductVersion=1.0.0.0
|
||||
Comments=
|
||||
|
||||
[HistoryLists\hlIncludePath]
|
||||
Count=3
|
||||
Item0=..\cap_control;$(BCB)\include;$(BCB)\include\vcl
|
||||
Item1=..\cap_control;$(BCB)\include;$(BCB)\include\vcl;C:\Mis documentos\Fuentes de Programacion\C++ Builder\CAP\LM2000_vcl
|
||||
Item2=;..\cap_control;$(BCB)\include;$(BCB)\include\vcl
|
||||
|
||||
[HistoryLists\hlLibraryPath]
|
||||
Count=3
|
||||
Item0=..\cap_control;$(BCB)\lib\obj;$(BCB)\lib
|
||||
Item1=..\cap_control;$(BCB)\lib\obj;$(BCB)\lib;C:\Mis documentos\Fuentes de Programacion\C++ Builder\CAP\LM2000_vcl
|
||||
Item2=;..\cap_control;$(BCB)\lib\obj;$(BCB)\lib
|
||||
|
||||
[HistoryLists\hlDebugSourcePath]
|
||||
Count=1
|
||||
Item0=$(BCB)\source\vcl
|
||||
|
||||
[HistoryLists\hlConditionals]
|
||||
Count=1
|
||||
Item0=_DEBUG
|
||||
|
||||
[HistoryLists\hlIntOutputDir]
|
||||
Count=1
|
||||
Item0=..\obj
|
||||
|
||||
[HistoryLists\hlFinalOutputDir]
|
||||
Count=3
|
||||
Item0=..\LM2000_vcl
|
||||
Item1=C:\Mis documentos\Fuentes de Programacion\C++ Builder\CAP\LM2000_vcl\
|
||||
Item2=C:\Mis documentos\Fuentes de Programacion\C++ Builder\CAP\LM2000_vcl
|
||||
|
||||
[HistoryLists\hIBPIOutputDir]
|
||||
Count=3
|
||||
Item0=..\LM2000_vcl
|
||||
Item1=C:\Mis documentos\Fuentes de Programacion\C++ Builder\CAP\LM2000_vcl\
|
||||
Item2=C:\Mis documentos\Fuentes de Programacion\C++ Builder\CAP\LM2000_vcl
|
||||
|
||||
[Debugging]
|
||||
DebugSourceDirs=$(BCB)\source\vcl
|
||||
|
||||
[Parameters]
|
||||
RunParams=
|
||||
Launcher=
|
||||
UseLauncher=0
|
||||
DebugCWD=
|
||||
HostApplication=
|
||||
RemoteHost=
|
||||
RemotePath=
|
||||
RemoteLauncher=
|
||||
RemoteCWD=
|
||||
RemoteDebug=0
|
||||
|
||||
[Compiler]
|
||||
ShowInfoMsgs=0
|
||||
LinkDebugVcl=0
|
||||
LinkCGLIB=0
|
||||
|
||||
[CORBA]
|
||||
AddServerUnit=1
|
||||
AddClientUnit=1
|
||||
PrecompiledHeaders=1
|
||||
|
||||
[Language]
|
||||
ActiveLang=
|
||||
ProjectLang=
|
||||
RootDir=
|
||||
|
||||
[Linker]
|
||||
LibPrefix=
|
||||
LibSuffix=
|
||||
LibVersion=
|
||||
</IDEOPTIONS>
|
||||
</PROJECT>
|
BIN
LM2000_vcl/LM2000_vcl.bpl
Normal file
BIN
LM2000_vcl/LM2000_vcl.bpl
Normal file
Binary file not shown.
16
LM2000_vcl/LM2000_vcl.cpp
Normal file
16
LM2000_vcl/LM2000_vcl.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
#pragma package(smart_init)
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
// Package source.
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#pragma argsused
|
||||
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
BIN
LM2000_vcl/LM2000_vcl.lib
Normal file
BIN
LM2000_vcl/LM2000_vcl.lib
Normal file
Binary file not shown.
BIN
LM2000_vcl/LM2000_vcl.res
Normal file
BIN
LM2000_vcl/LM2000_vcl.res
Normal file
Binary file not shown.
BIN
LM2000_vcl/LM2000_vcl.tds
Normal file
BIN
LM2000_vcl/LM2000_vcl.tds
Normal file
Binary file not shown.
8
LM2000_vcl/cleanup.bat
Normal file
8
LM2000_vcl/cleanup.bat
Normal file
@ -0,0 +1,8 @@
|
||||
del *.~*
|
||||
del *.tds
|
||||
del *.obj
|
||||
|
||||
del *.ilc
|
||||
del *.ild
|
||||
del *.ilf
|
||||
del *.ils
|
Reference in New Issue
Block a user