-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathl_coman_help.pas
194 lines (163 loc) · 4.98 KB
/
l_coman_help.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
unit l_coman_help;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComCtrls, Buttons, ExtCtrls;
type THelp = class
private
Nome_comando: string;
Sintaxe: string;
Descricao: string;
Notas: string;
Exemplo: string;
public
constructor create;
procedure compara;
// procedure set_Comando;
procedure set_Nome_comando(s: string);
procedure set_Sintaxe(s: string);
procedure set_Descricao(s: string);
procedure set_Notas(s: string);
procedure set_Exemplo(s: string);
function get_Nome_comando: string;
function get_Sintaxe: string;
function get_Descricao: string;
function get_Notas: string;
function get_Exemplo: string;
end;
type
TL_Comandos = class(TForm)
GroupBox1: TGroupBox;
TreeView1: TTreeView;
Panel1: TPanel;
GroupBox2: TGroupBox;
BitBtn1: TBitBtn;
RichEdit1: TRichEdit;
BitBtn2: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
procedure TreeView1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
L_Comandos: TL_Comandos;
help1: Thelp;
implementation
uses ats_acl_full;
{$R *.DFM}
constructor Thelp.create;
begin
descricao:='';
exemplo:='';
nome_comando:='';
notas:='';
sintaxe:='';
end;
procedure THelp.compara;
begin
if help1.get_Nome_comando = 'MOVE/MOVED' then
begin
l_comandos.RichEdit1.Lines.Add(help1.get_nome_comando);
//******************************************************************************
help1.set_Sintaxe(#13+'SINTAXE:' + #13 +
'MOVE <pos> {<tempo>}' + #13
+ 'MOVED <pos> {<tempo>}' + #13
+ 'Onde:' + #13 +
'<pos> é o nome definido pelo usuário.' + #13 +
'<tempo> é uma variável ou constante definida.');
//******************************************************************************
help1.set_Descricao(#13+'DESCRIÇÃO:' +#13+
'O comando MOVE deposita um movimento no buffer de movimento.' +
' O programa usa o comando MOVE mas não espera que o movimento' +
' acabe para começar o próximo.' + #13 +
'O comando MOVED deposita um movimento no buffer de movimento e' +
' só executa o próximo comando quando o comando corrente acabou.');
//******************************************************************************
help1.set_Exemplo(#13 + 'EXEMPLOS:' + #13 +
'PROGRAM EX1 // Não existe sincronismo entre os movimentos' + #13 +
' MOVE POS1 // Move para POS1' + #13 +
' MOVE POS2 800 // Move para POS2 em 8 segundos' + #13 +
' MOVE POS3 // Move para POS3' + #13 +
'END' +#13#13 +
'PROGRAM EX2 // Existe sincronismo entre os movimentos' + #13 +
' MOVE POS4 // Move para POS4' + #13 +
' MOVE POS5 900 // Move para POS5 em 9 segundos' + #13 +
' MOVE POS6 // Move para POS6' + #13 +
'END' +#13#13);
//******************************************************************************
l_comandos.RichEdit1.Lines.Add(help1.get_sintaxe);
l_comandos.RichEdit1.Lines.Add(help1.get_descricao);
l_comandos.RichEdit1.Lines.Add(help1.get_exemplo);
end;
end;
procedure THelp.set_Nome_comando(s: string);
begin
nome_comando:=s;
end;
procedure THelp.set_Sintaxe(s: string);
begin
sintaxe:=s;
end;
procedure Thelp.set_Descricao(s: string);
begin
descricao:=s;
end;
procedure THelp.set_Notas(s: string);
begin
Notas:=s;
end;
procedure Thelp.set_Exemplo(s: string);
begin
exemplo:=s;
end;
function Thelp.get_Nome_comando: string;
begin
l_comandos.RichEdit1.SelAttributes.Name:='MS Sans Serif';
l_comandos.RichEdit1.SelAttributes.Size:=14;
l_comandos.RichEdit1.SelAttributes.Style:=[fsbold];
result:= nome_comando;
end;
function Thelp.get_Sintaxe: string;
begin
l_comandos.RichEdit1.SelAttributes.Name:='MS Sans Serif';
l_comandos.RichEdit1.SelAttributes.Size:=8;
l_comandos.RichEdit1.SelAttributes.Style:=[];
result:= sintaxe;
end;
function Thelp.get_Descricao: string;
begin
l_comandos.RichEdit1.SelAttributes.Name:='MS Sans Serif';
l_comandos.RichEdit1.SelAttributes.Size:=8;
result:= descricao;
end;
function Thelp.get_Notas: string;
begin
l_comandos.RichEdit1.SelAttributes.Name:='MS Sans Serif';
l_comandos.RichEdit1.SelAttributes.Size:=8;
result:=Notas;
end;
function Thelp.get_Exemplo: string;
begin
l_comandos.RichEdit1.SelAttributes.Size:=8;
l_comandos.RichEdit1.SelAttributes.Name:='Courier New';
result:=exemplo;
end;
procedure TL_Comandos.BitBtn1Click(Sender: TObject);
begin
L_Comandos.Hide;
robomain.Refresh;
end;
procedure TL_Comandos.TreeView1Click(Sender: TObject);
begin
richedit1.Clear;
help1.set_Nome_comando(treeview1.Selected.Text);
help1.compara;
end;
procedure TL_Comandos.FormCreate(Sender: TObject);
begin
help1:=Thelp.create;
end;
end.