Skip to content

Commit beb1648

Browse files
committed
feat: First entry from Székely Balázs
1 parent cb1b124 commit beb1648

File tree

4 files changed

+677
-0
lines changed

4 files changed

+677
-0
lines changed

entries/sbalazs/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Székely Balázs
2+
3+
This entry is made via email since the person in question no longer has a GitHub account.

entries/sbalazs/src/obrc.lpi

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<CONFIG>
3+
<ProjectOptions>
4+
<Version Value="12"/>
5+
<PathDelim Value="\"/>
6+
<General>
7+
<Flags>
8+
<MainUnitHasCreateFormStatements Value="False"/>
9+
<MainUnitHasTitleStatement Value="False"/>
10+
<MainUnitHasScaledStatement Value="False"/>
11+
<CompatibilityMode Value="True"/>
12+
</Flags>
13+
<SessionStorage Value="InProjectDir"/>
14+
<Title Value="obrc"/>
15+
<UseAppBundle Value="False"/>
16+
<ResourceType Value="res"/>
17+
</General>
18+
<BuildModes Count="1">
19+
<Item1 Name="Default" Default="True"/>
20+
</BuildModes>
21+
<PublishOptions>
22+
<Version Value="2"/>
23+
<UseFileFilters Value="True"/>
24+
</PublishOptions>
25+
<RunParams>
26+
<FormatVersion Value="2"/>
27+
</RunParams>
28+
<Units Count="2">
29+
<Unit0>
30+
<Filename Value="obrc.lpr"/>
31+
<IsPartOfProject Value="True"/>
32+
</Unit0>
33+
<Unit1>
34+
<Filename Value="uweatherstations.pas"/>
35+
<IsPartOfProject Value="True"/>
36+
<UnitName Value="uWeatherStations"/>
37+
</Unit1>
38+
</Units>
39+
</ProjectOptions>
40+
<CompilerOptions>
41+
<Version Value="11"/>
42+
<PathDelim Value="\"/>
43+
<Target>
44+
<Filename Value="..\..\..\bin\sbalazs"/>
45+
</Target>
46+
<SearchPaths>
47+
<IncludeFiles Value="$(ProjOutDir)"/>
48+
<UnitOutputDirectory Value="..\..\..\bin\lib\$(TargetCPU)-$(TargetOS)"/>
49+
</SearchPaths>
50+
<Linking>
51+
<Debugging>
52+
<DebugInfoType Value="dsDwarf3"/>
53+
</Debugging>
54+
</Linking>
55+
<Other>
56+
<CompilerMessages>
57+
<IgnoredMessages idx5024="True"/>
58+
</CompilerMessages>
59+
</Other>
60+
</CompilerOptions>
61+
<Debugging>
62+
<Exceptions Count="3">
63+
<Item1>
64+
<Name Value="EAbort"/>
65+
</Item1>
66+
<Item2>
67+
<Name Value="ECodetoolError"/>
68+
</Item2>
69+
<Item3>
70+
<Name Value="EFOpenError"/>
71+
</Item3>
72+
</Exceptions>
73+
</Debugging>
74+
</CONFIG>

entries/sbalazs/src/obrc.lpr

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
program obrc;
2+
3+
{$mode objfpc}{$H+}
4+
5+
uses
6+
{$IFDEF UNIX}
7+
cthreads,
8+
{$ENDIF}
9+
Classes,
10+
SysUtils,
11+
uWeatherStations;
12+
13+
var
14+
TC: Integer;
15+
FTick: QWord;
16+
FWSManager: TWSManager;
17+
MStart, MFinish: TMethod;
18+
19+
20+
procedure DoOnStart(Sender: TObject);
21+
begin
22+
Writeln('Process started at: ' + FormatDateTime('hh:mm:ss:zzz', Now));
23+
FTick := GetTickCount64;
24+
end;
25+
26+
procedure DoOnFinish(Sender: TObject);
27+
begin
28+
FTick := GetTickCount64 - FTick;
29+
Writeln('Process finished at: ' + FormatDateTime('hh:mm:ss:zzz', Now));
30+
Writeln('Duration: ' + IntToStr(FTick) + ' ms');
31+
Halt;
32+
end;
33+
34+
begin
35+
if (ParamStr(1) = '-h') or (ParamStr(1) = '/?') or (ParamStr(1) = '--help') then
36+
begin
37+
Writeln('USAGE: obrc <source_file> <destination_file> <threadCnt(optional-default 16)>');
38+
Halt;
39+
end;
40+
41+
if (Trim(ParamStr(1)) = '') or (not FileExists(ParamStr(1))) then
42+
begin
43+
Writeln('Please specify a valid source file');
44+
Halt;
45+
end;
46+
47+
if (Trim(ParamStr(2)) = '') then
48+
begin
49+
Writeln('Please specify a valid destination file');
50+
Halt;
51+
end;
52+
53+
if (Trim(ParamStr(3)) <> '') then
54+
TC := StrToIntDef(ParamStr(3), 16)
55+
else
56+
TC := 16;
57+
58+
FWSManager := TWSManager.Create(ParamStr(1), ParamStr(2), TC);
59+
MStart.Data := nil;
60+
MStart.Code := @DoOnStart;
61+
FWSManager.OnStart := TNotifyEvent(MStart);
62+
MFinish.Data := nil;
63+
MFinish.Code := @DoOnFinish;
64+
FWSManager.OnFinish := TNotifyEvent(MFinish);
65+
FWSManager.WSThreadsWatcher.Start;
66+
repeat
67+
Sleep(1500);
68+
until 0 = 1;
69+
end.
70+

0 commit comments

Comments
 (0)