2 Star 0 Fork 1

Tomato/ZhiDev_D7_JingYou

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
FindPoint.pas 2.47 KB
一键复制 编辑 原始数据 按行查看 历史
Tomato 提交于 2024-02-01 17:16 . Initial commit
unit FindPoint;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,Unit0_globalVariant, ExtCtrls;
type
TFormFind = class(TForm)
btn1: TButton;
edt1: TEdit;
edt2: TEdit;
edt3: TEdit;
mmo1: TMemo;
lbl1: TLabel;
lbl2: TLabel;
lbl3: TLabel;
lbl4: TLabel;
tmr1: TTimer;
btn2: TButton;
btn3: TButton;
btn4: TButton;
mmo2: TMemo;
procedure btn1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure edt1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure tmr1Timer(Sender: TObject);
procedure btn2Click(Sender: TObject);
procedure btn3Click(Sender: TObject);
procedure btn4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormFind: TFormFind;
implementation
uses main;
{$R *.dfm}
procedure TFormFind.btn1Click(Sender: TObject);
begin
close;
end;
procedure TFormFind.FormShow(Sender: TObject);
begin
// modbusfun06dat:=$00F1; //读找点结果
// modbusfun06:=$0001;
btn1.SetFocus;
tmr1.Enabled:=True;
end;
procedure TFormFind.edt1Click(Sender: TObject);
var
str:string;
begin
if InputQuery('Pls Enter Command!', '111', str) then
begin
// str := InputBox('输入整数', '123', '000000');
if str='' then str:='0';
edt1.Text:=str;
modbusfun06dat:=StrToInt(str);
modbusfun06:=$1080;
end;
end;
procedure TFormFind.FormClose(Sender: TObject; var Action: TCloseAction);
begin
modbusfun05:=3; modbusfun05dat:=$FF;
tmr1.Enabled:=False;
end;
procedure TFormFind.tmr1Timer(Sender: TObject);
begin
if modbusfun06=0 then
begin
modbusfun06dat:=$00F1; //读找点结果
modbusfun06:=$0001;
end;
end;
procedure TFormFind.btn2Click(Sender: TObject);
begin
btn4.Caption:='继续找点';
tmr1.Enabled:=False;
modbusfun06dat:=114;
modbusfun06:=$1080;
form_line.ts3.TabVisible:=True;
form_line.PageControl1.TabIndex:=5-1;
//formwave.showmodal;
end;
procedure TFormFind.btn3Click(Sender: TObject);
begin
btn4.Caption:='继续找点';
tmr1.Enabled:=False;
form_line.ts3.TabVisible:=True;
form_line.PageControl1.TabIndex:=5-1;
//formwave.showmodal;
end;
procedure TFormFind.btn4Click(Sender: TObject);
begin
// if tmr1.Enabled then begin
// btn4.Caption:='继续找点';
// tmr1.Enabled:=False;
// end else begin
btn4.Caption:='停止找点';
tmr1.Enabled:=True;
// end;
end;
end.
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Pascal
1
https://gitee.com/wx_fb0d806ee4/ZhiDev_D7_JingYou.git
git@gitee.com:wx_fb0d806ee4/ZhiDev_D7_JingYou.git
wx_fb0d806ee4
ZhiDev_D7_JingYou
ZhiDev_D7_JingYou
master

搜索帮助