?? tempp.pas
字號:
unit tempp;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, ComCtrls;
type
Ttempform = class(TForm)
tempedit: TEdit;
tempbutton: TBitBtn;
UpDown1: TUpDown;
procedure tempbuttonClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
tempform: Ttempform;
implementation
uses econv230p, filedefine;
{$R *.DFM}
procedure Ttempform.tempbuttonClick(Sender: TObject);
var
temp: string;
i, j, k: integer;
begin
temp := tempform.caption;
i:=pos('兩幀間隔時間', temp);
if i>0 then
begin
econfile.comm.timepoll := strtointdef(tempedit.text, 10);
tempform.close;
exit;
end;
i := pos('超時時間', temp);
if i>0 then
begin
econfile.comm.timeout := strtointdef(tempedit.text, 100);
tempform.close;
exit;
end;
i := pos('控制', temp);
if i>0 then
begin
j := strtointdef(tempedit.text, -1);
case j of
0:
begin
econfile.comm.sendbuffer3 := '05' + inttohex(smindex-1, 4) + '0000';
econfile.comm.sendbuffer4 := '01' + inttohex(smindex-1, 4) + '0001';
addsendbuffer2(econfile, '01' + inttohex(smindex-1,4) + '0001');
end;
1:
begin
econfile.comm.sendbuffer3 := '05' + inttohex(smindex-1, 4) + 'ff00';
econfile.comm.sendbuffer4 := '01' + inttohex(smindex-1, 4) + '0001';
addsendbuffer2(econfile, '01' + inttohex(smindex-1,4) + '0001');
end;
end;
tempform.close;
exit;
end;
i := pos('修改',temp);
if i>0 then
begin
j := strtointdef(tempedit.text, -1);
if j>=0 then
begin
econfile.comm.sendbuffer3 := '06' + inttohex(smindex-1, 4) + inttohex(j, 4);
econfile.comm.sendbuffer4 := '03' + inttohex(smindex-1, 4) + '0001';
//addsendbuffer2(econfile, '06' + inttohex(smindex-1, 4) + inttohex(j, 4));
//addsendbuffer2(econfile, '03' + inttohex(smindex-1, 4) + '0001');
end;
tempform.Close;
exit;
end;
i := pos('基數', temp);
if i>0 then
begin
j := smindex;
if j>0 then
begin
if (j mod 2)=0 then
for k:=1 to 21 do econfile.xieboarray[k*2].address2 := tempedit.text;
if (j mod 2)=1 then
for k:=1 to 21 do econfile.xieboarray[k*2-1].address2 := tempedit.text;
end;
tempform.Close;
exit;
end;
i := pos('投退', temp);
if i>0 then
begin
i := strtointdef(tempedit.text, 0);
if i=0 then
begin
j := strtointdef(econfile.holdregisterarray[smindex].value, 0)and $000f;
econfile.comm.sendbuffer3 := '06' + inttohex(smindex-1, 4) + inttohex(j, 4);
econfile.comm.sendbuffer4 := '03' + inttohex(smindex-1, 4) + '0001';
//addsendbuffer2(econfile, '06' + inttohex(smindex-1, 4) + inttohex(i, 4));
//addsendbuffer2(econfile, '03' + inttohex(smindex-1, 4) + '0001');
// econfile.holdregisterarray[smindex].value:=inttohex(i,4);
tempform.Close;
exit;
end;
if i=1 then
begin
j := strtointdef(econfile.holdregisterarray[smindex].value, 0)or $8000;
econfile.comm.sendbuffer3 := '06' + inttohex(smindex-1, 4) + inttohex(j, 4);
econfile.comm.sendbuffer4 := '03' + inttohex(smindex-1, 4) + '0001';
//addsendbuffer2(econfile, '06' + inttohex(smindex-1, 4) + inttohex(i, 4));
//addsendbuffer2(econfile, '03' + inttohex(smindex-1, 4) + '0001');
end;
tempform.Close;
exit;
end;
i := pos('動作繼電器', temp);
if i>0 then
begin
i := strtointdef(tempedit.text, -1);
if (i>=0) then
begin
j := (strtointdef(econfile.holdregisterarray[smindex].value,0) and $8000)+i;
econfile.comm.sendbuffer3 := '06' + inttohex(smindex-1, 4) + inttohex(j, 4);
econfile.comm.sendbuffer4 := '03' + inttohex(smindex-1, 4) + '0001';
//addsendbuffer2(econfile, '06' + inttohex(smindex-1, 4) + inttohex(i, 4));
//addsendbuffer2(econfile, '03' + inttohex(smindex-1, 4) + '0001');
end;
tempform.Close;
exit;
end;
i := pos('設置', temp);
if i>0 then
begin
j := strtointdef(tempedit.text, -1);
if j>=0 then
begin
i := strtointdef(econfile.setpowerarray[smindex].address1, 0)-1;
econfile.comm.sendbuffer3 := '06' + inttohex(i,4) + inttohex(j mod 65536, 4);
//addsendbuffer2(econfile,'06' + inttohex(i,4) + inttohex(j mod 65536, 4));
//addsendbuffer2(econfile,'03' + inttohex(i, 4) + '0001');
i := strtointdef(econfile.setpowerarray[smindex].address2,0)-1;
addsendbuffer2(econfile,'06' + inttohex(i, 4) + inttohex(j div 65536, 4));
addsendbuffer2(econfile,'03' + inttohex(i, 4) + '0002');
tempform.updown1.Visible := true;
tempform.close;
end;
tempform.Close;
exit;
end;
tempform.Close;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -