This is the piece of code that stalls all. Attached are sample files. They are archived because of the number of files limit/ the file type limit.
procedure TForm1.FormCreate(Sender: TObject);
begin
off11.Click;
SysUtils.FormatSettings.DecimalSeparator := '.';
DTS1.DateTimeFormat:='hh:mm'+#13#10+'DD.MM.';
for i:=1 to 11 do begin
for j:=1 to 2 do begin
pingair[i,j]:=true;
pingheat[i,j]:=true;
pingvent[i,j]:=true;
pingcool[i,j]:=true;
end;
for j:=1 to 10 do
pingsensor[i,j]:=true;
end;
for i:=1 to 11 do
goTimer[i]:=false;
edit52.passwordchar := '*';
edit53.passwordchar := '*';
edit54.passwordchar := '*';
for i := 1 to 10 do
a[i] := True;
for i := 1 to 31 do
pingres[i] := True;
for i := 1 to 11 do
nosu6ene[i] := false;
host[1]:='192.168.1.101';
host[2]:='192.168.1.102';
host[3]:='192.168.1.103';
host[4]:='192.168.1.104';
host[5]:='192.168.1.105';
host[6]:='192.168.1.106';
host[7]:='192.168.1.107';
host[8]:='192.168.1.108';
host[9]:='192.168.1.109';
host[10]:='192.168.1.110';
host[11]:='192.168.1.111';
host[12]:='192.168.1.112';
host[13]:='192.168.1.113';
host[14]:='192.168.1.114';
host[15]:='192.168.1.115';
host[16]:='192.168.1.116';
host[17]:='192.168.1.117';
host[18]:='192.168.1.118';
host[19]:='192.168.1.153';
host[20]:='192.168.1.177';
host[21]:='';
host[22]:='';
host[23]:='192.168.1.215';
host[24]:='192.168.1.217';
host[25]:='192.168.1.218';
host[26]:='192.168.1.220';
host[27]:='192.168.1.225';
host[28]:='192.168.1.226';
host[29]:='192.168.1.227';
host[30]:='192.168.1.230';
host[31]:='192.168.1.220';
servlist.Clear;
pathString:=ExtractFilePath(Application.ExeName);
pathString:=pathString+'\data\setobr';
if FindFirst(pathString,faAnyFile, FindIt)=0 then begin
servlist.items.loadfromfile(pathString);
for i := 1 to 10 do
begin
sRecord := servlist.Items[i - 1];
ParseRecordOBR(sRecord, i);
end;
end;
FindClose(FindIt);
servlist.Clear;
pathString:=ExtractFilePath(Application.ExeName);
pathString:=pathString+'\data\znil';
if FindFirst(pathString,faAnyFile, FindIt)=0 then begin
servlist.items.loadfromfile(pathString);
for i := 1 to 10 do
begin
sRecord := servlist.Items[i - 1];
ParseRecordNIL(sRecord, i);
end;
end;
FindClose(FindIt);
//password
servlist.Clear;
pathString:=ExtractFilePath(Application.ExeName);
pathString:=pathString+'\data\rpm1';
if FindFirst(pathString,faAnyFile, FindIt)=0 then begin
servlist.items.loadfromfile(pathString);
label256.caption := servlist.Items[0];
end;
FindClose(FindIt);
j := 0;
for i := 0 to 23 do
for n := 0 to 5 do
begin
j := j + 1;
HH := i;
MM := 10 * n;
SS := 00;
MS := 00;
chas[j] := encodetime(HH, MM, SS, MS);
end;
//regime
for n := 1 to 11 do
for m := 1 to 8 do
for i := 1 to 20 do
regime[n, m, i] := 0;
for n := 1 to 11 do
begin
listbox5.Clear;
FN := 'regimesetR' + IntToStr(n);
pathString:=ExtractFilePath(Application.ExeName);
pathString:=pathString+'\data\'+FN;
if FindFirst(pathString,faAnyFile, FindIt)=0 then begin
listbox5.items.loadfromfile(pathstring);
m := n;
for i := 1 to 4 do
begin
sRecord := ListBox5.Items[i - 1];
ParseRecordREG(sRecord, i);
end; // 4.
end;
end;
listbox5.Clear;
pathString:=ExtractFilePath(Application.ExeName);
pathString:=pathString+'\data\general';
if FindFirst(pathString,faAnyFile, FindIt)=0 then
begin
sRecord := StringReplace(sRecord, '"', '', [rfReplaceAll]);
Col := 1;
repeat
PosComma := Pos(',', sRecord);
if PosComma > 0 then
sField := Copy(sRecord, 1, PosComma - 1)
else
sField := sRecord;
generalset[Col]:= strtoint(sField);
if PosComma > 0 then
begin
Delete(sRecord, 1, PosComma);
Col := Col + 1;
end;
until (PosComma = 0);
case generalset[1] of
1:radiobutton1.Checked:=true;
2:radiobutton2.Checked:=true;
3:radiobutton3.Checked:=true;
end;
priority1.ItemIndex:=generalset[2]-1;
priority2.ItemIndex:=generalset[3]-1;
priority3.ItemIndex:=generalset[4]-1;
priority4.ItemIndex:=generalset[5]-1;
priority5.ItemIndex:=generalset[6]-1;
priority6.ItemIndex:=generalset[7]-1;
priority7.ItemIndex:=generalset[8]-1;
priority8.ItemIndex:=generalset[9]-1;
priority9.ItemIndex:=generalset[10]-1;
end;
listbox4.Clear;
pathString:=ExtractFilePath(Application.ExeName);
pathString:=pathString+'\data\netsettings.csv;
if FindFirst(pathString,faAnyFile, FindIt)=0 then
begin
listbox4.items.loadfromfile(pathstring);
for i := 1 to 12 do
begin
sRecord := ListBox4.Items[i - 1];
ParseRecordSET(sRecord, i); // 4.
end;
end
else
ShowMessage('Не са намерени настройки за мрежата!');
//restart
for i:=1 to 12 do
for j:=1 to 144 do
for n:=1 to 20 do
danni[i,j,n]:=0;
for i:=1 to 2 do
for j:=1 to 144 do
for n:=1 to 20 do
dataINC[i,j,n]:=0;
P := 'C:\Mushroom_Master_beta';
for i := 1 to 12 do
begin
FN := '';
listbox3.Clear;
decodedate(Date, yy, mon, dd);
if (mon > 9) and (dd > 9) then
FN := IntToStr(yy) + IntToStr(mon) + IntToStr(dd);
if (mon > 9) and (dd <= 9) then
FN := IntToStr(yy) + IntToStr(mon) + '0' + IntToStr(dd);
if (mon <= 9) and (dd > 9) then
FN := IntToStr(yy) + '0' + IntToStr(mon) + IntToStr(dd);
if (mon <= 9) and (dd <= 9) then
FN := IntToStr(yy) + '0' + IntToStr(mon) + '0' + IntToStr(dd);
FN := FN + 'R' + IntToStr(i);
pathString:=ExtractFilePath(Application.ExeName);
pathString:=pathString+'\chronology\'+FN;
if FindFirst(pathString,faAnyFile, FindIt)=0 then begin
ListBox3.Items.LoadFromFile(pathstring);
for j := 1 to 144 do
begin
n := j - 1;
sRecord := ListBox3.Items[n];
m := 1;
repeat
PosComma := Pos(',', sRecord);
if PosComma > 0 then
sField := Copy(sRecord, 1, PosComma - 1)
else
sField := sRecord;
case m of
2: danni[i, j, 1] := strtofloat(sField);
3: danni[i, j, 2] := strtofloat(sField);
4: danni[i, j, 3] := strtofloat(sField);
5: danni[i, j, 4] := strtofloat(sField);
6: danni[i, j, 5] := strtofloat(sField);
7: danni[i, j, 6] := strtofloat(sField);
8: danni[i, j, 7] := strtofloat(sField);
9: danni[i, j, 8] := strtofloat(sField);
10: danni[i, j, 9] := strtofloat(sField);
11: danni[i, j, 10] := strtofloat(sField);
12: danni[i, j, 11] := strtofloat(sField);
13: danni[i, j, 12] := strtofloat(sField);
14: danni[i, j, 13] := strtofloat(sField);
15: danni[i, j, 14] := strtofloat(sField);
16: danni[i, j, 15] := strtofloat(sField);
17: danni[i, j, 16] := strtofloat(sField);
18: danni[i, j, 17] := strtofloat(sField);
19: danni[i, j, 18] := strtofloat(sField);
20: danni[i, j, 19] := strtofloat(sField);
21: danni[i, j, 20] := strtofloat(sField);
end;
if PosComma > 0 then
begin
Delete(sRecord, 1, PosComma);
m := m + 1;
end;
until PosComma = 0;
room[i,j].c1:=danni[i, j, 1];
room[i,j].c2:=danni[i, j, 2];
room[i,j].cav:=danni[i, j, 3];
room[i,j].air:=danni[i, j, 4];
room[i,j].rh:=danni[i, j, 5];
room[i,j].co2:=danni[i, j, 6];
end;
end;
end;
for i:=10 to 1 do
for j:=1 to 144 do
for n:=1 to 20 do
dataINC[i,j,n]:=danni[i,j,n];
startlog.Enabled:=true;
end;