Ver Mensaje Individual
  #19  
Antiguo 26-02-2019
Avatar de oscarac
[oscarac] oscarac is offline
Miembro Premium
 
Registrado: sep 2006
Ubicación: Lima - Perú
Posts: 2.010
Reputación: 20
oscarac Va por buen camino
vayamos por partes a ver si estoy entendiendo bien
Código Delphi [-]
unit FrmMain_f;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Grids, Vcl.DBGrids, zkemkeeper_TLB, dateutils,
  Vcl.OleCtrls;

type
  TForm1 = class(TForm)
    edtIp: TEdit;
    edtPort: TEdit;
    btnDispositivoLoad: TButton;
    dbgrd1: TDBGrid;
    mmoLOG: TMemo;
    lbl1: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure LeerHuella(Sender: Tobject);
  private

    { Private declarations }
  public
      ZK1 : TCZKEM;
      Connected : Boolean;
      procedure OnConnect(Sender : TObject);
      procedure OnDisconnect(Sender : TObject);
      procedure Log(aMsj : string);
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  ZK1 := TCZKEM.Create(nil);
  ZK1.OnConnected := OnConnect;
  ZK1.OnFinger := LeerHuella;
  if not(ZK1.Connect_Net(EdtIP.Text, StrToInt(EdtPort.Text))) then
    begin
      lbl1.Caption := 'Error. No se pudo conectar';
      exit;
    end;
    if not ZK1.RegEvent(1, 65535) then  //65535
      lbl1.Caption := 'Error RegEvent';

    ZK1.PullMode := 1;
    Log('Conectado...');
end;

procedure TForm1.OnConnect(Sender: TObject);
begin
  Connected := True;
end;

procedure TForm1.OnDisconnect(Sender: TObject);
begin
  Connected := False;
end;


procedure TForm1.LeerHuella(sender: tobject);
  Var _Resultado : Integer;
_Sender : TObject;
EnrollNumber : Integer;
IsInValid, AttState, VerifyMethod, Year, Month, Day, Hour, Minute, Second : Integer;
begin
  Log ('Huella Detectada');
end;

procedure TForm1.Log(aMsj: string);
begin
  MmoLOG.Lines.Add(aMsj);
end;

end.

Código Delphi [-]
    procedure LeerHuella(Sender: Tobject);

es el procedimiento que se ejecutara cuando ponga el dedo en el huellero
Código Delphi [-]
  ZK1 := TCZKEM.Create(nil);
  ZK1.OnConnected := OnConnect;
  ZK1.OnFinger := LeerHuella;

cargo el "componente", lo conecto y le digo cuando se dispare el evento Onfinger (que es colocar el dedo en el huellero) ejecuta el procedimiento Leer huella

hasta ahi estamos bien si?
__________________
Dulce Regalo que Satanas manda para mi.....
Responder Con Cita