📄 unit3.~pas
字号:
//***********************************************
//云台程序设置底层控制指令的窗体单元
//***********************************************
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TconfCodeForm = class(TForm)
gbNum: TGroupBox;
GroupBox2: TGroupBox;
GroupBox3: TGroupBox;
GroupBox4: TGroupBox;
GroupBox5: TGroupBox;
Label1: TLabel;
edtCodeReset: TEdit;
edtActUp: TEdit;
edtActLeft: TEdit;
edtActDown: TEdit;
edtActRight: TEdit;
Label34: TLabel;
Label35: TLabel;
Label36: TLabel;
Label37: TLabel;
edtMir0: TEdit;
edtMir4: TEdit;
edtMir2: TEdit;
edtMir1: TEdit;
edtMir3: TEdit;
edtMir5: TEdit;
Label38: TLabel;
Label39: TLabel;
Label40: TLabel;
Label41: TLabel;
Label42: TLabel;
Label43: TLabel;
Label44: TLabel;
Label45: TLabel;
Label46: TLabel;
edtCodeAuto: TEdit;
edtCodeBrush: TEdit;
edtCodeLight: TEdit;
Button1: TButton;
Button2: TButton;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
//声明动态时创建的对象
edtNum:Array[1..32] of TEdit;
lbNum:Array[1..32] of TLabel;
end;
var
confCodeForm: TconfCodeForm;
implementation
uses Unit1, Unit4;
{$R *.dfm}
//*****************************************
//功能:控制指令窗体创建时的处理过程
// 动态生成指令编辑栏,显示原有的指令设置
//*****************************************
procedure TconfCodeForm.FormCreate(Sender: TObject);
var
index,j,i:Integer;
begin
//载入云台选择指令集
index:=1;
for i:=1 to 4 do
begin
for j:=1 to 8 do
begin
{动态生成32个云台选择指令编辑栏 TEdit对象和相应的TLable}
edtNum[index]:=TEdit.Create(confCodeForm);
lbNum[index]:=TLabel.Create(confCodeForm);
{设置编辑栏,载入原指令}
with edtNum[index] do
begin
Parent:=gbNum;
Left:=36+100*(i-1);
Top:=30+21*(j-1);
Width:=55;
Height:=21;
MaxLength:=8;
Text:=CByteToBin(MainForm.ByteCodeChoose[index]);
end;
{设置对应的TLable}
with lbNum[index] do
begin
Parent:=gbNum;
Left:=16+100*(i-1);
Top:=35+21*(j-1);
Width:=30;
Height:=21;
Caption:=IntToStr(index);
Visible:=True;
end;
//下一对TEdit 和TLabel
Inc(index);
end
end;
{载入动作控制指令集}
edtActUp.Text:=CByteToBin(MainForm.ByteCodeAct[0]);
edtActDown.Text:=CByteToBin(MainForm.ByteCodeAct[1]);
edtActLeft.Text:=CByteToBin(MainForm.ByteCodeAct[2]);
edtActRight.Text:=CByteToBin(MainForm.ByteCodeAct[3]);
edtCodeReset.Text :=CByteToBin(MainForm.ByteCodeAct[4]);
{载入镜头控制指令集}
edtMir0.Text :=CByteToBin(MainForm.ByteCodeMir[0]);
edtMir1.Text :=CByteToBin(MainForm.ByteCodeMir[1]);
edtMir2.Text :=CByteToBin(MainForm.ByteCodeMir[2]);
edtMir3.Text :=CByteToBin(MainForm.ByteCodeMir[3]);
edtMir4.Text :=CByteToBin(MainForm.ByteCodeMir[4]);
edtMir5.Text :=CByteToBin(MainForm.ByteCodeMir[5]);
{载入状态控制指令集}
edtCodeLight.Text :=CByteToBin(MainForm.ByteCodeStatus[0]);
edtCodeBrush.Text :=CByteToBin(MainForm.ByteCodeStatus[1]);
edtCodeAuto.Text :=CByteToBin(MainForm.ByteCodeStatus[2]);
end;
//*****************************************
//功能:控制指令窗体释放时的处理过程
// 释放动态生成对象
//*****************************************
procedure TconfCodeForm.FormDestroy(Sender: TObject);
var
i:Integer;
begin
for i:=1 to 32 do
begin
edtNum[i].Free ;
lbNum[i].Free ;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -