This commit is contained in:
Алексей Заблоцкий 2023-10-19 14:08:42 +03:00
parent f6fb6db5d7
commit 675fa2a89a
5 changed files with 30 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

@ -6,14 +6,22 @@
<General> <General>
<Flags> <Flags>
<MainUnitHasCreateFormStatements Value="False"/> <MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
</Flags> </Flags>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>
<Title Value="Daemon application"/> <Title Value="Daemon application"/>
<UseAppBundle Value="False"/> <UseAppBundle Value="False"/>
<ResourceType Value="res"/> <ResourceType Value="res"/>
</General> </General>
<MacroValues Count="1">
<Macro1 Name="LCLWidgetType" Value="nogui"/>
</MacroValues>
<BuildModes> <BuildModes>
<Item Name="Default" Default="True"/> <Item Name="Default" Default="True"/>
<SharedMatrixOptions Count="1">
<Item1 ID="700255898348" Modes="Default" Type="IDEMacro" MacroName="LCLWidgetType" Value="nogui"/>
</SharedMatrixOptions>
</BuildModes> </BuildModes>
<PublishOptions> <PublishOptions>
<Version Value="2"/> <Version Value="2"/>

BIN
lmsreport

Binary file not shown.

View File

@ -17,6 +17,15 @@ type
fFields: TStrings; fFields: TStrings;
fCommand: string; fCommand: string;
fOnComplete: TRequestComplete; fOnComplete: TRequestComplete;
fResult :TCommandData;
fmode: byte;
fCode:DWORD;
fValue:QWORD;
fAnswer: string;
fValues: TStrings;
fResData: TStream;
fResArray: TParamArray;
procedure SynchAnswer;
public public
property Host: string read fHost; property Host: string read fHost;
property Command: string read fCommand write fCommand; property Command: string read fCommand write fCommand;
@ -36,6 +45,12 @@ type
end; end;
implementation implementation
procedure TClientMainThread.SynchAnswer;
begin
fOnComplete(self,fmode,fResult.code,fResult.Param,fResult.Name,fResult.Keys,fResult.iValues,fResult.Data);
end;
constructor TClientMainThread.Create(ACommand: string; AFields: TStrings; constructor TClientMainThread.Create(ACommand: string; AFields: TStrings;
ALogger: TLogger; AHost: string; APort: integer; OnReceive: TRequestComplete); ALogger: TLogger; AHost: string; APort: integer; OnReceive: TRequestComplete);
begin begin
@ -83,7 +98,13 @@ procedure TClientMainThread.ProcessAnswer(const mode: byte; const Code: DWORD;
begin begin
try try
if assigned(fOnComplete) then if assigned(fOnComplete) then
fOnComplete(self,mode,code,qValue,Answer,Values,iValues,Data); begin
fResult := TCommandData.Create(code,qValue,answer,Values,iValues,Data);
fMode := mode;
Synchronize(@SynchAnswer);
end;
except on e:Exception do except on e:Exception do
begin begin