📄 getevent.pas
字号:
unit GetEvent;
interface
uses
Classes, Windows, SysUtils, Driver, Event;
type
TGetEvent = class(TThread)
private
{ Private declarations }
protected
procedure Execute; override;
end;
implementation
uses Unit1;
{ Important: Methods and properties of objects in VCL or CLX can only be used
in a method called using Synchronize, for example,
Synchronize(UpdateCaption);
and UpdateCaption could look like,
procedure GetEvent.UpdateCaption;
begin
Form1.Caption := 'Updated in a thread';
end; }
{ GetEvent }
procedure TGetEvent.Execute;
var
ptCheckEvent: PT_CheckEvent;
usEventType: SHORT;
dwEventCount: Longint;
begin
dwEventCount := 0;
ptCheckEvent.EventType := @usEventType;
ptCheckEvent.Milliseconds := 1000;
while ( m_bContinue) do
begin
if (DRV_CheckEvent(m_DriverHandle, ptCheckEvent) = SUCCESS) then
begin
if (usEventType = ADS_EVT_INTERRUPT_TIMER4) then
begin
dwEventCount := dwEventCount + 1;
Unit1.Form1.editEventCount.Text := IntToStr(dwEventCount);
end;
end;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -