Escolar Documentos
Profissional Documentos
Cultura Documentos
GOIÂNIA
2003
3
SUMÁRIO
RESUMO........................................................................................... 5
1. INTRODUÇÃO................................................................................. 6
3. RELIGADOR AUTOMÁTICO....................................................... 14
3.1. DEFINIÇÃO....................................................................................... 14
3.2. PRINCÍPIO DE FUNCIONAMENTO..................................... .......... 15
3.3. CLASSIFICAÇÃO DOS RELIGADORES........................................ 16
3.3.1. Quanto ao número de fases.............................................................. 16
3.3.2. Quanto ao tipo de controle............................................................... 17
3.3.3. Quanto ao meio de interrupção........................................................18
3.4. CRITÉRIO PARA SELEÇÃO DE RELIGADORES.........................19
4. AJUSTES DO RELIGADOR...........................................................21
5. HISTÓRIA DA AUTOMAÇÃO...................................................... 23
8. CONCLUSÃO................................................................................... 31
REFERÊNCIAS BIBLIOGRÁFICAS............................................ 33
ANEXO.............................................................................................. 34
5
RESUMO
1. INTRODUÇÃO
2. PLANEJAMENTO DE UM SISTEMA DE
POTÊNCIA
3. RELIGADOR AUTOMÁTICO
3.1. DEFINIÇÃO
dada corrente In, o tempo de operação correspondente pode variar sobre uma
reta, de ±10% na base do tempo e ±10% na base da corrente. O maior desvio
será o limite aceitável.
4. AJUSTES DO RELIGADOR
5. HISTÓRIA DA AUTOMAÇÃO
Características principais:
8. CONCLUSÃO
Terminamos gratos com o trabalho pois ele nos deu uma visão prática
da viabilidade de estarmos aplicando nossos conhecimentos, adquiridos na
Escola de Engenharia Elétrica UFG, em atividades e processos rotineiros
tentando, assim, aperfeiçoá-los.
33
REFERÊNCIAS BIBLIOGRÁFICAS
ANEXO
35
PROGRAMA
unit Principal;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, CommInt, ExtCtrls, Mask, Buttons, VaClasses, VaComm, jpeg,
ComCtrls, Psock, NMFtp;
type
TfrmPrincipal = class(TForm)
sbtConfig: TSpeedButton;
sbtResultados: TSpeedButton;
sbtConectar: TSpeedButton;
sbtDesconectar: TSpeedButton;
Timer: TTimer;
Comm1: TComm;
mStatus: TMemo;
sbtSair: TSpeedButton;
Label1: TLabel;
editCorB: TEdit;
editCorA: TEdit;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
editFaseC: TEdit;
editCorC: TEdit;
editFaseB: TEdit;
editFaseA: TEdit;
editCorN: TEdit;
Image1: TImage;
Label8: TLabel;
Panel1: TPanel;
StatusBar1: TStatusBar;
NMFTP1: TNMFTP;
StatusBar2: TStatusBar;
procedure sbtConectarClick(Sender: TObject);
procedure sbtDesconectarClick(Sender: TObject);
procedure sbtSairClick(Sender: TObject);
procedure Comm1Break(Sender: TObject);
procedure TimerTimer(Sender: TObject);
procedure Comm1RxChar(Sender: TObject; Count: Integer);
36
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmPrincipal: TfrmPrincipal;
tempo: TTime;
FlagFechado: byte;
NumByte,ia,ib,ic,ineutro,fa,fb,fc: integer;
msg,via,vib,vic,vin,vfa,vfb,vfc,vtp: string;
mia,mib,mic,min,mfa,mfb,mfc,tp: array[1..1000] of integer;
implementation
{$R *.DFM}
procedure AlarmeA(s:string);
var
texto: text;
begin
CreateDir('c:\Resultados.');
If FileExists(concat('c:\Resultados.\Alarmes - ',FormatDateTime('dddd, d "de" mmmm "de"
yyyy',date),'.txt')) then
begin
assignfile(texto,concat('c:\Resultados.\Alarmes - ',FormatDateTime('dddd, d "de" mmmm
"de" yyyy',date),'.txt'));
Append(texto);
writeln(texto, 'Sobrecorrente na fase A' + FormatDateTime('hh:mm:ss',now) +
frmPrincipal.editCorB.Text);
Closefile(texto);
end
else
begin
37
procedure AlarmeB(s:string);
var
texto: text;
begin
CreateDir('c:\Resultados.');
If FileExists(concat('c:\Resultados.\Alarmes - ',FormatDateTime('dddd, d "de" mmmm "de"
yyyy',date),'.txt')) then
begin
assignfile(texto,concat('c:\Resultados.\Alarmes - ',FormatDateTime('dddd, d "de" mmmm
"de" yyyy',date),'.txt'));
Append(texto);
writeln(texto, 'Sobrecorrente na fase B' + FormatDateTime('hh:mm:ss',now) +
frmPrincipal.editCorB.Text);
Closefile(texto);
end
else
begin
assignfile(texto,concat('c:\Resultados.\Alarmes - ',FormatDateTime('dddd, d "de" mmmm
"de" yyyy',date),'.txt'));
Rewrite(texto);
writeln(texto,'HISTÓRICO DOS ALARMES');
writeln(texto);
writeln(texto);
writeln(texto, 'Tipo de Falta' + 'Horário' + 'Valor da Falta');
writeln(texto, 'Sobrecorrente na fase B' + FormatDateTime('hh:mm:ss',now) +
frmPrincipal.editCorB.Text);
Closefile(texto);
end;
end;
38
procedure AlarmeC(s:string);
var
texto: text;
begin
CreateDir('c:\Resultados.');
If FileExists(concat('c:\Resultados.\Alarmes - ',FormatDateTime('dddd, d "de" mmmm "de"
yyyy',date),'.txt')) then
begin
assignfile(texto,concat('c:\Resultados.\Alarmes - ',FormatDateTime('dddd, d "de" mmmm
"de" yyyy',date),'.txt'));
Append(texto);
writeln(texto, 'Sobrecorrente na fase C' + FormatDateTime('hh:mm:ss',now) +
frmPrincipal.editCorB.Text);
Closefile(texto);
end
else
begin
assignfile(texto,concat('c:\Resultados.\Alarmes - ',FormatDateTime('dddd, d "de" mmmm
"de" yyyy',date),'.txt'));
Rewrite(texto);
writeln(texto,'HISTÓRICO DOS ALARMES');
writeln(texto);
writeln(texto);
writeln(texto, 'Tipo de Falta' + 'Horário' + 'Valor da Falta');
writeln(texto, 'Sobrecorrente na fase C' + FormatDateTime('hh:mm:ss',now) +
frmPrincipal.editCorB.Text);
Closefile(texto);
end;
end;
procedure AlarmeN(s:string);
var
texto: text;
begin
CreateDir('c:\Resultados.');
If FileExists(concat('c:\Resultados.\Alarmes - ',FormatDateTime('dddd, d "de" mmmm "de"
yyyy',date),'.txt')) then
begin
assignfile(texto,concat('c:\Resultados.\Alarmes - ',FormatDateTime('dddd, d "de" mmmm
"de" yyyy',date),'.txt'));
Append(texto);
writeln(texto, 'Sobrecorrente no neutro' + FormatDateTime('hh:mm:ss',now) +
frmPrincipal.editCorB.Text);
Closefile(texto);
end
39
else
begin
assignfile(texto,concat('c:\Resultados.\Alarmes - ',FormatDateTime('dddd, d "de" mmmm
"de" yyyy',date),'.txt'));
Rewrite(texto);
writeln(texto,'HISTÓRICO DOS ALARMES');
writeln(texto);
writeln(texto);
writeln(texto, 'Tipo de Falta' + 'Horário' + 'Valor da Falta');
writeln(texto, 'Sobrecorrente no neutro' + FormatDateTime('hh:mm:ss',now) +
frmPrincipal.editCorB.Text);
Closefile(texto);
end;
end;
procedure AlarmeVa(s:string);
var
texto: text;
begin
CreateDir('c:\Resultados.');
If FileExists(concat('c:\Resultados.\Alarmes - ',FormatDateTime('dddd, d "de" mmmm "de"
yyyy',date),'.txt')) then
begin
assignfile(texto,concat('c:\Resultados.\Alarmes - ',FormatDateTime('dddd, d "de" mmmm
"de" yyyy',date),'.txt'));
Append(texto);
writeln(texto, 'Sobretensão na fase A' + FormatDateTime('hh:mm:ss',now) +
frmPrincipal.editCorB.Text);
Closefile(texto);
end
else
begin
assignfile(texto,concat('c:\Resultados.\Alarmes - ',FormatDateTime('dddd, d "de" mmmm
"de" yyyy',date),'.txt'));
Rewrite(texto);
writeln(texto,'HISTÓRICO DOS ALARMES');
writeln(texto);
writeln(texto);
writeln(texto, 'Tipo de Falta' + 'Horário' + 'Valor da Falta');
writeln(texto, 'Sobretensão na fase A' + FormatDateTime('hh:mm:ss',now) +
frmPrincipal.editCorB.Text);
Closefile(texto);
end;
end;
40
procedure AlarmeVb(s:string);
var
texto: text;
begin
CreateDir('c:\Resultados.');
If FileExists(concat('c:\Resultados.\Alarmes - ',FormatDateTime('dddd, d "de" mmmm "de"
yyyy',date),'.txt')) then
begin
assignfile(texto,concat('c:\Resultados.\Alarmes - ',FormatDateTime('dddd, d "de" mmmm
"de" yyyy',date),'.txt'));
Append(texto);
writeln(texto, 'Sobretensão na fase B' + FormatDateTime('hh:mm:ss',now) +
frmPrincipal.editCorB.Text);
Closefile(texto);
end
else
begin
assignfile(texto,concat('c:\Resultados.\Alarmes - ',FormatDateTime('dddd, d "de" mmmm
"de" yyyy',date),'.txt'));
Rewrite(texto);
writeln(texto,'HISTÓRICO DOS ALARMES');
writeln(texto);
writeln(texto);
writeln(texto, 'Tipo de Falta' + 'Horário' + 'Valor da Falta');
writeln(texto, 'Sobretensão na fase B' + FormatDateTime('hh:mm:ss',now) +
frmPrincipal.editCorB.Text);
Closefile(texto);
end;
end;
procedure AlarmeVc(s:string);
var
texto: text;
begin
CreateDir('c:\Resultados.');
If FileExists(concat('c:\Resultados.\Alarmes - ',FormatDateTime('dddd, d "de" mmmm "de"
yyyy',date),'.txt')) then
begin
assignfile(texto,concat('c:\Resultados.\Alarmes - ',FormatDateTime('dddd, d "de" mmmm
"de" yyyy',date),'.txt'));
Append(texto);
41
procedure SalvarArquivo(s:string);
var
texto: text;
begin
CreateDir('c:\Resultados.');
If FileExists(concat('c:\Resultados.\Entradas - ',FormatDateTime('dddd, d "de" mmmm "de"
yyyy',date),'.txt')) then
begin
assignfile(texto,concat('c:\Resultados.\Entradas - ',FormatDateTime('dddd, d "de" mmmm
"de" yyyy',date),'.txt'));
Append(texto);
writeln(texto,s);
Closefile(texto);
end
else
begin
assignfile(texto,concat('c:\Resultados.\Entradas - ',FormatDateTime('dddd, d "de" mmmm
"de" yyyy',date),'.txt'));
Rewrite(texto);
writeln(texto,'LEGENDA');
writeln(texto);
writeln(texto,'Ia: Corrente na fase A');
writeln(texto,'Ib: Corrente na fase B');
writeln(texto,'Ic: Corrente na fase C');
writeln(texto,'In: Corrente no neutro');
writeln(texto,'Va: Tensão na Fase A');
writeln(texto,'Vb: Tensão na fase B');
42
writeln(texto,'_____________________________________________________');
writeln(texto,'Horário Ia Ib Ic In Va Vb Vc ');
writeln(texto,'_____________________________________________________');
writeln(texto,s);
Closefile(texto);
end;
end;
end;
end
end;
2: Begin
ib := ib +1;
editCorB.Text := floattostr(integer(CharBuf(Buffer^)[P]));
mib[ib] := integer(CharBuf(Buffer^)[P]);
Begin if mia[ia] > integer(frmConfiguracao.editPar2.Text)then
StatusBar2.Panels.Items[0].Text := 'ALARME: Sobrecorrente na fase B';
AlarmeB(msg);
end
end;
3: Begin
ic := ic +1;
editCorC.Text := floattostr(integer(CharBuf(Buffer^)[P]));
mic[ic] := integer(CharBuf(Buffer^)[P]);
Begin if mia[ia] > integer(frmConfiguracao.editPar3.Text)then
AlarmeC(msg);
StatusBar2.Panels.Items[0].Text := 'ALARME: Sobrecorrente na fase C';
end
end;
4: Begin
ineutro := ineutro +1;
editCorN.Text := floattostr(integer(CharBuf(Buffer^)[P]));
min[ineutro] := integer(CharBuf(Buffer^)[P]);
Begin if mia[ia] > integer(frmConfiguracao.editPar4.Text)then
AlarmeN(msg);
StatusBar2.Panels.Items[0].Text := 'ALARME: Sobrecorrente no neutro';
end
end;
5: Begin
fa := fa +1;
editFaseA.Text := floattostr(integer(CharBuf(Buffer^)[P]));
mfa[fa] := integer(CharBuf(Buffer^)[P]);
Begin if mia[ia] > integer(frmConfiguracao.editPar5.Text)then
AlarmeVa(msg);
StatusBar2.Panels.Items[0].Text := 'ALARME: Subtensão na fase A';
end
end;
6: Begin
fb := fb +1;
editFaseB.Text := floattostr(integer(CharBuf(Buffer^)[P]));
mfb[fb] := integer(CharBuf(Buffer^)[P]);
Begin if mia[ia] > integer(frmConfiguracao.editPar6.Text)then
StatusBar2.Panels.Items[0].Text := 'ALARME: Subtensão na fase B';
AlarmeVb(msg);
end
end;
7: Begin
45
fc := fc +1;
editFaseC.Text := floattostr(integer(CharBuf(Buffer^)[P]));
mfc[fc] := integer(CharBuf(Buffer^)[P]);
Begin if mia[ia] > integer(frmConfiguracao.editPar7.Text)then
AlarmeVc(msg);
StatusBar2.Panels.Items[0].Text := 'ALARME: Subtensão na fase C';
end
end;
end;
msg := concat(msg,' ',inttostr(integer(CharBuf(Buffer^)[P])));
If NumByte = 7 then
Begin
msg := concat(FormatDateTime('hh"h"mm"m"ss"s"',now),' ',msg);
SalvarArquivo(msg);
msg := '';
NumByte := 0;
end;
end; //Fim do For
end;
Application.ProcessMessages;
finally
FreeMem(Buffer);
end;
end;
end;
editFaseC.Text:= '';
editCorN.Text:= '';
mStatus.Lines.Add('' + FormatDateTime('hh:mm:ss',tempo));
Timer.Enabled:=false;
end;
end.
unit Resultados;
interface
uses
47
type
TfrmResultados = class(TForm)
chartCorA: TChart;
sbtRelatorio: TBitBtn;
sbtSairII: TBitBtn;
editResultados: TMemo;
sbtSalvar: TBitBtn;
BitBtn1: TBitBtn;
sbtEditar: TButton;
sbtReset: TButton;
chartCorC: TChart;
Chart3: TChart;
Chart4: TChart;
Chart5: TChart;
Chart1: TChart;
Series3: TLineSeries;
Series1: TLineSeries;
Series4: TLineSeries;
Series5: TLineSeries;
Series6: TLineSeries;
Series7: TLineSeries;
Chart2: TChart;
Series2: TLineSeries;
procedure sbtSairIIClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure sbtSalvarClick(Sender: TObject);
procedure sbtRelatorioClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmResultados: TfrmResultados;
implementation
uses Principal;
{$R *.DFM}
begin
Close;
end;
Begin
For a := 1 to fa do
Begin
AddXY(tp[a],mfa[a]);
vfa := concat(vfa,' ',inttostr(min[a]));
end;
end;
With Series6 do
Begin
For a := 1 to fb do
Begin
AddXY(tp[a],mfb[a]);
vfb := concat(vfb,' ',inttostr(min[a]));
end;
end;
With Series7 do
Begin
For a := 1 to fc do
Begin
AddXY(tp[a],mfc[a]);
vfc := concat(vfc,' ',inttostr(min[a]));
end;
end;
end;
writeln(texto,concat('Ic=[',vic,'];'));
writeln(texto,concat('In=[',vin,'];'));
writeln(texto,concat('Va=[',vfa,'];'));
writeln(texto,concat('Vb=[',vfb,'];'));
writeln(texto,concat('Vc=[',vfc,'];'));
Closefile(texto);
end
else
Begin
assignfile(texto,concat('c:\Resultados.\Entradas - ','.m'));
Rewrite(texto);
writeln(texto,concat(char(#37),'Universidade Federal de Goiás - Núcleo PEQ'));
writeln(texto,concat(char(#37),'Criado em ',FormatDateTime('dd "de" mmmm "de"
yyyy',date),' às ',FormatDateTime('hh"h"mm"m"ss"s"',now)));
writeln(texto,concat(char(#37),'Autores:'));
writeln(texto,concat(char(#37),' Rogério Gomide - rogeriogomide@ig.com.br'));
writeln(texto,concat(char(#37),' Clarissa Hatsue - clarissa_frantz@ig.com.br'));
writeln(texto,'');
writeln(texto,concat('Ia=[',via,'];'));
writeln(texto,concat('Ib=[',vib,'];'));
writeln(texto,concat('Ic=[',vic,'];'));
writeln(texto,concat('In=[',vin,'];'));
writeln(texto,concat('Va=[',vfa,'];'));
writeln(texto,concat('Vb=[',vfb,'];'));
writeln(texto,concat('Vc=[',vfc,'];'));
Closefile(texto);
end;
editResultados.Lines.SaveToFile(concat('c:\Resultados.\Entradas - ',FormatDateTime('dddd, d
"de" mmmm "de" yyyy',date),'.txt'));
editResultados.ReadOnly := true;
editResultados.TabStop := false;
end;
Excel.Workbooks[1].Sheets[1].Name := 'Vetores';
Excel.Workbooks[1].Sheets[1].Cells[1,1] := 'VALORES:';
Excel.Workbooks[1].Sheets[1].Cells[1,2] := Datetostr(Now);
Excel.Workbooks[1].Sheets[1].Cells[1,3] := Timetostr(Now);
Excel.Workbooks[1].Sheets[1].Cells[3,1] := 'Corrente';
Excel.Workbooks[1].Sheets[1].Cells[3,2] := 'Horário';
For Linha := 1 to ia do Excel.Workbooks[1].Sheets[1].Cells[Linha+3,1] := mia[Linha];
For Linha := 1 to ia do Excel.Workbooks[1].Sheets[1].Cells[Linha+3,2] :=
Timetostr(Now);
Excel.Workbooks[1].SaveAs(concat('c:\Resultados.\Entradas - ',inttostr(cont),'.xls'));
Excel.Workbooks[1].Close;
Begin
while FileExists(concat('c:\Resultados.\Entradas - ',inttostr(cont),'.xls')) do
cont := cont +1;
Excel.Workbooks.Add;
Excel.Workbooks[1].Sheets[1].Name := 'Vetores';
Excel.Workbooks[1].Sheets[1].Cells[1,1] := 'VALORES:';
Excel.Workbooks[1].Sheets[1].Cells[1,2] := Datetostr(Now);
Excel.Workbooks[1].Sheets[1].Cells[1,3] := Timetostr(Now);
Excel.Workbooks[1].Sheets[1].Cells[3,1] := 'Corrente Fase A';
Excel.Workbooks[1].Sheets[1].Cells[3,2] := 'Corrente Fase B';
Excel.Workbooks[1].Sheets[1].Cells[3,3] := 'Corrente Fase C';
Excel.Workbooks[1].Sheets[1].Cells[3,4] := 'Corrente Neutro';
Excel.Workbooks[1].Sheets[1].Cells[3,5] := 'Tensão Fase A';
Excel.Workbooks[1].Sheets[1].Cells[3,6] := 'Tensão Fase B';
Excel.Workbooks[1].Sheets[1].Cells[3,7] := 'Tensão Fase C';
Excel.Workbooks[1].Sheets[1].Cells[3,8] := Timetostr(Now);
For Linha := 1 to ia do Excel.Workbooks[1].Sheets[1].Cells[Linha+3,1] := mia[Linha];
For Linha := 1 to ib do Excel.Workbooks[1].Sheets[1].Cells[Linha+3,2] := mib[Linha];
For Linha := 1 to ic do Excel.Workbooks[1].Sheets[1].Cells[Linha+3,3] := mic[Linha];
For Linha := 1 to ineutro do Excel.Workbooks[1].Sheets[1].Cells[Linha+3,4] :=
min[Linha];
For Linha := 1 to fa do Excel.Workbooks[1].Sheets[1].Cells[Linha+3,5] := mfa[Linha];
For Linha := 1 to fb do Excel.Workbooks[1].Sheets[1].Cells[Linha+3,6] := mfb[Linha];
For Linha := 1 to fc do Excel.Workbooks[1].Sheets[1].Cells[Linha+3,7] := mfc[Linha];
For Linha := 1 to ia do Excel.Workbooks[1].Sheets[1].Cells[Linha+3,8] :=
Timetostr(Now);
Excel.Workbooks[1].SaveAs(concat('c:\Resultados.\Entradas - ',inttostr(cont),'.xls'));
Excel.Workbooks[1].Close;
end
end
else
Begin
Excel.Workbooks.Add;
Excel.Workbooks[1].Sheets[1].Name := 'Vetores';
Excel.Workbooks[1].Sheets[1].Cells[1,1] := 'VALORES:';
Excel.Workbooks[1].Sheets[1].Cells[1,2] := Datetostr(Now);
52
Excel.Workbooks[1].Sheets[1].Cells[1,3] := Timetostr(Now);
Excel.Workbooks[1].Sheets[1].Cells[3,1] := 'Corrente Fase A';
Excel.Workbooks[1].Sheets[1].Cells[3,2] := 'Corrente Fase B';
Excel.Workbooks[1].Sheets[1].Cells[3,3] := 'Corrente Fase C';
Excel.Workbooks[1].Sheets[1].Cells[3,4] := 'Corrente Neutro';
Excel.Workbooks[1].Sheets[1].Cells[3,5] := 'Tensão Fase A';
Excel.Workbooks[1].Sheets[1].Cells[3,6] := 'Tensão Fase B';
Excel.Workbooks[1].Sheets[1].Cells[3,7] := 'Tensão Fase C';
Excel.Workbooks[1].Sheets[1].Cells[3,8] := 'Horário';
For Linha := 1 to ia do Excel.Workbooks[1].Sheets[1].Cells[Linha+3,1] := mia[Linha];
For Linha := 1 to ib do Excel.Workbooks[1].Sheets[1].Cells[Linha+3,2] := mib[Linha];
For Linha := 1 to ic do Excel.Workbooks[1].Sheets[1].Cells[Linha+3,3] := mic[Linha];
For Linha := 1 to ineutro do Excel.Workbooks[1].Sheets[1].Cells[Linha+3,4] :=
min[Linha];
For Linha := 1 to fa do Excel.Workbooks[1].Sheets[1].Cells[Linha+3,5] := mfa[Linha];
For Linha := 1 to fb do Excel.Workbooks[1].Sheets[1].Cells[Linha+3,6] :=
mfb[Linha];
For Linha := 1 to fc do Excel.Workbooks[1].Sheets[1].Cells[Linha+3,7] := mfc[Linha];
For Linha := 1 to ia do Excel.Workbooks[1].Sheets[1].Cells[Linha+3,8] :=
Timetostr(Now);
Excel.Workbooks[1].SaveAs(concat('c:\Resultados.\Entradas - ',inttostr(cont),'.xls'));
Excel.Workbooks[1].Close;
end;
sbtRelatorio.Enabled := false;
end;
end.
unit Configuracao;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, CommInt, ComCtrls;
type
TfrmConfiguracao = class(TForm)
editPar4: TEdit;
editPar2: TEdit;
editPar3: TEdit;
editPar5: TEdit;
editPar6: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
53
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
editPar1: TEdit;
editPar7: TEdit;
editPar8: TEdit;
editPar9: TEdit;
editPar10: TEdit;
editPar11: TEdit;
editPar12: TEdit;
editPar13: TEdit;
editPar14: TEdit;
editPar15: TEdit;
editPar16: TEdit;
editPar17: TEdit;
editPar18: TEdit;
editPar19: TEdit;
editPar20: TEdit;
editPar21: TEdit;
editPar22: TEdit;
editPar24: TEdit;
editPar23: TEdit;
editPar25: TEdit;
editPar26: TEdit;
editPar27: TEdit;
editPar28: TEdit;
editPar29: TEdit;
editPar30: TEdit;
editPar31: TEdit;
editPar32: TEdit;
editParSenha: TEdit;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
Label20: TLabel;
Label21: TLabel;
Label22: TLabel;
Label23: TLabel;
54
Label24: TLabel;
Label25: TLabel;
Label26: TLabel;
Label27: TLabel;
Label28: TLabel;
Label29: TLabel;
Label30: TLabel;
Label31: TLabel;
Label32: TLabel;
Label33: TLabel;
Label34: TLabel;
Label35: TLabel;
sbtConfigEnviar: TButton;
sbtConfigSalvar: TButton;
sbtConfigSair: TButton;
Panel1: TPanel;
Panel2: TPanel;
mStatus: TStatusBar;
ProgressBar1: TProgressBar;
procedure sbtConfigSairClick(Sender: TObject);
procedure sbtConfigEnviarClick(Sender: TObject);
procedure sbtConfigSalvarClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmConfiguracao: TfrmConfiguracao;
implementation
uses Principal;
{$R *.DFM}
begin
if Application.MessageBox('Tem certeza que deseja sair das configurações?','Confirmação',
MB_IconQuestion + MB_YesNo) = idYes
then
Close;
end;
begin
S := editPar1.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar2.text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar3.text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar4.text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar5.text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
56
S := editPar6.text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar7.text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar8.text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar9.text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar10.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar11.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar12.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar13.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar14.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar15.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
57
ProgressBar1.StepBy(3);
S := editPar16.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar17.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar18.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar19.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar20.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar21.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar22.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar23.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar24.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar25.Text;
58
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar26.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar27.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar28.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar29.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar30.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar31.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
S := editPar32.Text;
Count := Length(S);
Count := frmPrincipal.Comm1.Write(S[1], Count);
ProgressBar1.StepBy(3);
sbtConfigEnviar.Enabled := false;
end
finally
Free;
end;
end ;
59
begin
CreateDir('c:\ConfiguracaoReligador.');
If FileExists(concat('c:\ConfiguracaoReligador.\Parametros.txt')) then
begin
assignfile(texto,concat('c:\ConfiguracaoReligador.\Parametros.txt'));
rewrite(texto);
writeln(texto, editPar1.Text);
writeln(texto, editPar2.Text);
writeln(texto, editPar3.Text);
writeln(texto, editPar4.Text);
writeln(texto, editPar5.Text);
writeln(texto, editPar6.Text);
writeln(texto, editPar7.Text);
writeln(texto, editPar8.Text);
writeln(texto, editPar9.Text);
writeln(texto, editPar10.Text);
writeln(texto, editPar11.Text);
writeln(texto, editPar12.Text);
writeln(texto, editPar13.Text);
writeln(texto, editPar14.Text);
writeln(texto, editPar15.Text);
writeln(texto, editPar16.Text);
writeln(texto, editPar17.Text);
writeln(texto, editPar18.Text);
writeln(texto, editPar19.Text);
writeln(texto, editPar20.Text);
writeln(texto, editPar21.Text);
writeln(texto, editPar22.Text);
writeln(texto, editPar23.Text);
writeln(texto, editPar24.Text);
writeln(texto, editPar25.Text);
writeln(texto, editPar26.Text);
writeln(texto, editPar27.Text);
writeln(texto, editPar28.Text);
writeln(texto, editPar29.Text);
writeln(texto, editPar30.Text);
writeln(texto, editPar31.Text);
writeln(texto, editPar32.Text);
writeln(texto, editParSenha.Text);
Closefile(texto);
sbtConfigEnviar.Enabled := true;
60
readln(texto, F);
editPar18.Text :=F;
readln(texto, F);
editPar19.Text :=F;
readln(texto, F);
editPar20.Text :=F;
readln(texto, F);
editPar21.Text :=F;
readln(texto, F);
editPar22.Text :=F;
readln(texto, F);
editPar23.Text :=F;
readln(texto, F);
editPar24.Text :=F;
readln(texto, F);
editPar25.Text :=F;
readln(texto, F);
editPar26.Text :=F;
readln(texto, F);
editPar27.Text :=F;
readln(texto, F);
editPar28.Text :=F;
readln(texto, F);
editPar29.Text :=F;
readln(texto, F);
editPar30.Text :=F;
readln(texto, F);
editPar31.Text :=F;
readln(texto, F);
editPar32.Text :=F;
readln(texto, F);
editParSenha.Text :=F;
Closefile(texto);
end
else
begin
showmessage ('Não há parâmetros criados!');
end;
end;
end.