connectcentersrc.pas

来自「该程序可作为386的接警程序使用」· PAS 代码 · 共 49 行

PAS
49
字号
unit ConnectCenterSrc;

interface

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

type
  TFormConnectCenter = class(TForm)
    Label1: TLabel;
    Button1: TButton;
    Button2: TButton;
    procedure ButtonOKClick(Sender: TObject);
    procedure ButtonCancelClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormConnectCenter: TFormConnectCenter;

implementation
uses
   HardwareInterfaceSrc;

{$R *.dfm}

procedure TFormConnectCenter.ButtonOKClick(Sender: TObject);

begin
    //先关闭串口, 然后再打开串口,避免对端口的操作错误
    FormHardwareInterface.ListenComm.StopComm;
    //开启串口
    FormHardwareInterface.ListenComm.StartComm;
    Close;
end;

procedure TFormConnectCenter.ButtonCancelClick(Sender: TObject);
begin
   //关闭串口
   FormHardwareInterface.ListenComm.StopComm;
   Close;
end;

end.

⌨️ 快捷键说明

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