⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 threadparaio.~pas

📁 dephi 7.0实现的TDMA工作原理.用于演示TDMA的工作流程
💻 ~PAS
字号:
unit ThreadparaIO;

interface

uses
  Windows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,
  Dialogs,StdCtrls, pubdata;

type
  TWriteParaIOThread = class(TThread)
  private
    { Private declarations }
    ObjFormHandle:HWND;
    Data:Pointer;
    PageIndex:Byte;
  protected
    procedure Execute; override;
    public
    constructor Create(CreateSuspend: Boolean; ObjHandle:HWND; PData:Pointer);
  end;
var
  TWrite:TWriteParaIOThread;
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 TWriteParaIOThread.UpdateCaption;
    begin
      Form1.Caption := 'Updated in a thread';
    end; }

{ TWriteParaIOThread }

procedure TWriteParaIOThread.Execute;
  { Place thread code here }
  var
 Temp1:^Byte;
 i:Integer;
 B:Byte;
 j:Integer;
begin
  { Place thread code here }
  temp1:=ptr(integer(data));
  Writing:=True;
for i:=0 to 8191 do
    begin
    if(i<=8191)then
       begin
       write37a($f4);
       write378(temp1^);
       write37a($f5);
       temp1:=ptr(Integer(temp1)+1);
       end;
    if(i=8191)then
       begin
       write37a($f4);
       write37a($f5);
       end;
    end;
  Writing:=False;
end;
constructor TwriteparaIOThread.Create(CreateSuspend: Boolean; ObjHandle:HWND; PData:Pointer);
 begin
  inherited create(False);
  Priority:=tpIdle;
  ObjFormHandle:=ObjHandle;
  Data:=PData;
  //FreeOnTerminate:=True;
end;
end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -