Code-Formatting
This commit is contained in:
@@ -3,8 +3,15 @@ unit DynamicFMXControl;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
System.SysUtils, System.Types, System.UITypes, System.Classes,
|
System.SysUtils,
|
||||||
FMX.Controls, FMX.Graphics, FMX.Forms, FMX.StdCtrls, FMX.Types;
|
System.Types,
|
||||||
|
System.UITypes,
|
||||||
|
System.Classes,
|
||||||
|
FMX.Controls,
|
||||||
|
FMX.Graphics,
|
||||||
|
FMX.Forms,
|
||||||
|
FMX.StdCtrls,
|
||||||
|
FMX.Types;
|
||||||
|
|
||||||
type
|
type
|
||||||
// Dezidierte Event-Typen für virtuelle Methoden von TControl
|
// Dezidierte Event-Typen für virtuelle Methoden von TControl
|
||||||
@@ -127,7 +134,8 @@ type
|
|||||||
property OnHasHint: TControlHasHintEvent read FHasHintEvent write FHasHintEvent;
|
property OnHasHint: TControlHasHintEvent read FHasHintEvent write FHasHintEvent;
|
||||||
property OnCanShowHint: TControlCanShowHintEvent read FCanShowHintEvent write FCanShowHintEvent;
|
property OnCanShowHint: TControlCanShowHintEvent read FCanShowHintEvent write FCanShowHintEvent;
|
||||||
property OnGetDefaultSize: TControlGetDefaultSizeEvent read FGetDefaultSizeEvent write FGetDefaultSizeEvent;
|
property OnGetDefaultSize: TControlGetDefaultSizeEvent read FGetDefaultSizeEvent write FGetDefaultSizeEvent;
|
||||||
property OnRecalculateAbsoluteMatrices: TControlNotifyEvent read FRecalculateAbsoluteMatricesEvent write FRecalculateAbsoluteMatricesEvent;
|
property OnRecalculateAbsoluteMatrices: TControlNotifyEvent
|
||||||
|
read FRecalculateAbsoluteMatricesEvent write FRecalculateAbsoluteMatricesEvent;
|
||||||
property OnSetVisible: TControlSetVisibleEvent read FSetVisibleEvent write FSetVisibleEvent;
|
property OnSetVisible: TControlSetVisibleEvent read FSetVisibleEvent write FSetVisibleEvent;
|
||||||
property OnSetEnabled: TControlSetEnabledEvent read FSetEnabledEvent write FSetEnabledEvent;
|
property OnSetEnabled: TControlSetEnabledEvent read FSetEnabledEvent write FSetEnabledEvent;
|
||||||
property OnDoAbsoluteChanged: TControlDoAbsoluteChangedEvent read FDoAbsoluteChangedEvent write FDoAbsoluteChangedEvent;
|
property OnDoAbsoluteChanged: TControlDoAbsoluteChangedEvent read FDoAbsoluteChangedEvent write FDoAbsoluteChangedEvent;
|
||||||
|
|||||||
+12
-20
@@ -171,19 +171,14 @@ begin
|
|||||||
|
|
||||||
var OhlcPoint: ITicksToTimeframe := TTicksToTimeframe.Create(H1, stateText);
|
var OhlcPoint: ITicksToTimeframe := TTicksToTimeframe.Create(H1, stateText);
|
||||||
|
|
||||||
var Ohlc: IMycConverter<TDataPoint<TOhlcItem>, TOhlcItem> := TMycGenericConverter<TDataPoint<TOhlcItem>, TOhlcItem>.Create(
|
var Ohlc: IMycConverter<TDataPoint<TOhlcItem>, TOhlcItem> :=
|
||||||
function( const Ohlc: TDataPoint<TOhlcItem> ): TOhlcItem
|
TMycGenericConverter<TDataPoint<TOhlcItem>, TOhlcItem>
|
||||||
begin
|
.Create(function(const Ohlc: TDataPoint<TOhlcItem>): TOhlcItem begin Result := Ohlc.Data; end);
|
||||||
Result := Ohlc.Data;
|
|
||||||
end );
|
|
||||||
|
|
||||||
OhlcPoint.Sender.Link(Ohlc);
|
OhlcPoint.Sender.Link(Ohlc);
|
||||||
|
|
||||||
var Closes: IMycConverter<TOhlcItem, Double> := TMycGenericConverter<TOhlcItem, Double>.Create(
|
var Closes: IMycConverter<TOhlcItem, Double> :=
|
||||||
function( const Ohlc: TOhlcItem ): Double
|
TMycGenericConverter<TOhlcItem, Double>.Create(function(const Ohlc: TOhlcItem): Double begin Result := Ohlc.Close; end);
|
||||||
begin
|
|
||||||
Result := Ohlc.Close;
|
|
||||||
end );
|
|
||||||
|
|
||||||
Ohlc.Sender.Link(Closes);
|
Ohlc.Sender.Link(Closes);
|
||||||
|
|
||||||
@@ -197,12 +192,7 @@ begin
|
|||||||
|
|
||||||
/////
|
/////
|
||||||
|
|
||||||
stateLabel.ProcessSignal(
|
stateLabel.ProcessSignal(stateText.Changed, done, procedure begin stateLabel.Text := stateText.Value; end);
|
||||||
stateText.Changed, done,
|
|
||||||
procedure
|
|
||||||
begin
|
|
||||||
stateLabel.Text := stateText.Value;
|
|
||||||
end );
|
|
||||||
|
|
||||||
FProcessDone := TState.All([FProcessDone, done]);
|
FProcessDone := TState.All([FProcessDone, done]);
|
||||||
|
|
||||||
@@ -272,7 +262,6 @@ begin
|
|||||||
// Create an instance of the TAuraTABFileServer. The server can be reused for multiple stream creations. [364]
|
// Create an instance of the TAuraTABFileServer. The server can be reused for multiple stream creations. [364]
|
||||||
FServer := TAuraTABFileServer.Create('\\COFFEE\TickData\Pepperstone');
|
FServer := TAuraTABFileServer.Create('\\COFFEE\TickData\Pepperstone');
|
||||||
|
|
||||||
|
|
||||||
SymbolsComboBox.Enabled := false;
|
SymbolsComboBox.Enabled := false;
|
||||||
ChartButton.Enabled := false;
|
ChartButton.Enabled := false;
|
||||||
LoadButton.Enabled := false;
|
LoadButton.Enabled := false;
|
||||||
@@ -471,7 +460,8 @@ begin
|
|||||||
PathData.ClosePath;
|
PathData.ClosePath;
|
||||||
|
|
||||||
currPathData.Value := TObjectRef<TPathData>.Create(PathData);
|
currPathData.Value := TObjectRef<TPathData>.Create(PathData);
|
||||||
end )
|
end
|
||||||
|
)
|
||||||
);
|
);
|
||||||
end
|
end
|
||||||
);
|
);
|
||||||
@@ -520,7 +510,8 @@ var
|
|||||||
begin
|
begin
|
||||||
var terminated := TFlag.CreateObserver(FTerminate.Signal).State;
|
var terminated := TFlag.CreateObserver(FTerminate.Signal).State;
|
||||||
|
|
||||||
dataProvider := TMycGenericConverter<TArray<TDataPoint<TAuraAskBidFileItem>>, TArray<TDataPoint<TAskBidItem>>>.Create(
|
dataProvider :=
|
||||||
|
TMycGenericConverter<TArray<TDataPoint<TAuraAskBidFileItem>>, TArray<TDataPoint<TAskBidItem>>>.Create(
|
||||||
function(const Values: TArray<TDataPoint<TAuraAskBidFileItem>>): TArray<TDataPoint<TAskBidItem>>
|
function(const Values: TArray<TDataPoint<TAuraAskBidFileItem>>): TArray<TDataPoint<TAskBidItem>>
|
||||||
begin
|
begin
|
||||||
SetLength(Result, Length(Values));
|
SetLength(Result, Length(Values));
|
||||||
@@ -530,7 +521,8 @@ begin
|
|||||||
Result[i].Data.Ask := Values[i].Data.Ask;
|
Result[i].Data.Ask := Values[i].Data.Ask;
|
||||||
Result[i].Data.Bid := Values[i].Data.Bid;
|
Result[i].Data.Bid := Values[i].Data.Bid;
|
||||||
end;
|
end;
|
||||||
end );
|
end
|
||||||
|
);
|
||||||
|
|
||||||
dataProvider.Sender.Link(Processor);
|
dataProvider.Sender.Link(Processor);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ unit LLVM.Runner;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
System.SysUtils, Winapi.Windows, System.Classes;
|
System.SysUtils,
|
||||||
|
Winapi.Windows,
|
||||||
|
System.Classes;
|
||||||
|
|
||||||
type
|
type
|
||||||
// Callback-Prozedur, die von der DLL aufgerufen wird
|
// Callback-Prozedur, die von der DLL aufgerufen wird
|
||||||
@@ -14,7 +16,8 @@ type
|
|||||||
|
|
||||||
// NEUE, VEREINFACHTE Signatur der exportierten DLL-Funktion
|
// NEUE, VEREINFACHTE Signatur der exportierten DLL-Funktion
|
||||||
// Jetzt nur noch der Log-Callback und der neue Integer-Input-Parameter
|
// Jetzt nur noch der Log-Callback und der neue Integer-Input-Parameter
|
||||||
TStarteLogikProc = procedure(
|
TStarteLogikProc =
|
||||||
|
procedure(
|
||||||
ALogIntProc: TLogIntegerCallback;
|
ALogIntProc: TLogIntegerCallback;
|
||||||
AHostInputInteger: Integer;
|
AHostInputInteger: Integer;
|
||||||
AHostAddIntegersProc: THostAddIntegersCallback // <--- Der neue Host-Unterprogramm-Parameter
|
AHostAddIntegersProc: THostAddIntegersCallback // <--- Der neue Host-Unterprogramm-Parameter
|
||||||
|
|||||||
+41
-62
@@ -3,12 +3,32 @@ unit MainUnit;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
|
System.SysUtils,
|
||||||
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Controls.Presentation, FMX.StdCtrls, FMX.WebBrowser,
|
System.Types,
|
||||||
Winapi.WebView2, FMX.Memo.Types, FMX.ScrollBox, FMX.Memo, FMX.Edit, FMX.StdActns,
|
System.UITypes,
|
||||||
|
System.Classes,
|
||||||
|
System.Variants,
|
||||||
|
FMX.Types,
|
||||||
|
FMX.Controls,
|
||||||
|
FMX.Forms,
|
||||||
|
FMX.Graphics,
|
||||||
|
FMX.Dialogs,
|
||||||
|
FMX.Controls.Presentation,
|
||||||
|
FMX.StdCtrls,
|
||||||
|
FMX.WebBrowser,
|
||||||
|
Winapi.WebView2,
|
||||||
|
FMX.Memo.Types,
|
||||||
|
FMX.ScrollBox,
|
||||||
|
FMX.Memo,
|
||||||
|
FMX.Edit,
|
||||||
|
FMX.StdActns,
|
||||||
// FMX.Edit für TEdit, FMX.StdActns oft für Standardaktionen
|
// FMX.Edit für TEdit, FMX.StdActns oft für Standardaktionen
|
||||||
// Korrekte und vollständige Units
|
// Korrekte und vollständige Units
|
||||||
System.IOUtils, System.Threading, System.Diagnostics, Winapi.Windows, LLVM.Runner;
|
System.IOUtils,
|
||||||
|
System.Threading,
|
||||||
|
System.Diagnostics,
|
||||||
|
Winapi.Windows,
|
||||||
|
LLVM.Runner;
|
||||||
|
|
||||||
const
|
const
|
||||||
// Pfad zur HTML-Datei (BITTE HIER ANPASSEN!)
|
// Pfad zur HTML-Datei (BITTE HIER ANPASSEN!)
|
||||||
@@ -49,7 +69,6 @@ implementation
|
|||||||
|
|
||||||
{$R *.fmx}
|
{$R *.fmx}
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TWebMessageReceiver = class(TInterfacedObject, ICoreWebView2WebMessageReceivedEventHandler)
|
TWebMessageReceiver = class(TInterfacedObject, ICoreWebView2WebMessageReceivedEventHandler)
|
||||||
private
|
private
|
||||||
@@ -72,11 +91,7 @@ begin
|
|||||||
Result := args.TryGetWebMessageAsString(message);
|
Result := args.TryGetWebMessageAsString(message);
|
||||||
if Succeeded(Result) then
|
if Succeeded(Result) then
|
||||||
begin
|
begin
|
||||||
TThread.Queue( nil,
|
TThread.Queue(nil, procedure begin FOwner.HandleWebMessage(string(message)); end);
|
||||||
procedure
|
|
||||||
begin
|
|
||||||
FOwner.HandleWebMessage( string( message ) );
|
|
||||||
end );
|
|
||||||
end;
|
end;
|
||||||
Result := S_OK;
|
Result := S_OK;
|
||||||
end;
|
end;
|
||||||
@@ -130,18 +145,7 @@ begin
|
|||||||
|
|
||||||
cmdLine := Format('"%s" %s', [ACommand, AParameters]);
|
cmdLine := Format('"%s" %s', [ACommand, AParameters]);
|
||||||
|
|
||||||
success := CreateProcess(
|
success := CreateProcess(nil, PChar(cmdLine), nil, nil, True, CREATE_NO_WINDOW, nil, nil, si, pi);
|
||||||
nil,
|
|
||||||
PChar( cmdLine ),
|
|
||||||
nil,
|
|
||||||
nil,
|
|
||||||
True,
|
|
||||||
CREATE_NO_WINDOW,
|
|
||||||
nil,
|
|
||||||
nil,
|
|
||||||
si,
|
|
||||||
pi
|
|
||||||
);
|
|
||||||
|
|
||||||
// Schreib-Handle der Pipe sofort schließen
|
// Schreib-Handle der Pipe sofort schließen
|
||||||
CloseHandle(stdOutWrite);
|
CloseHandle(stdOutWrite);
|
||||||
@@ -236,56 +240,29 @@ begin
|
|||||||
try
|
try
|
||||||
TFile.WriteAllText(llFileLocal, AMessage);
|
TFile.WriteAllText(llFileLocal, AMessage);
|
||||||
|
|
||||||
TThread.Queue( nil,
|
TThread.Queue(nil, procedure begin Memo.Lines.Add('Kompiliere zu Objektdatei...'); end);
|
||||||
procedure
|
|
||||||
begin
|
|
||||||
Memo.Lines.Add( 'Kompiliere zu Objektdatei...' );
|
|
||||||
end );
|
|
||||||
compilerOutputLocal := ExecuteProcess(CLANG_PATH, Format('-c "%s" -o "%s"', [llFileLocal, objFileLocal]));
|
compilerOutputLocal := ExecuteProcess(CLANG_PATH, Format('-c "%s" -o "%s"', [llFileLocal, objFileLocal]));
|
||||||
TThread.Queue( nil,
|
TThread.Queue(nil, procedure begin Memo.Lines.Add(compilerOutputLocal); end);
|
||||||
procedure
|
|
||||||
begin
|
|
||||||
Memo.Lines.Add( compilerOutputLocal );
|
|
||||||
end );
|
|
||||||
|
|
||||||
if not TFile.Exists(objFileLocal) then
|
if not TFile.Exists(objFileLocal) then
|
||||||
begin
|
begin
|
||||||
TThread.Queue( nil,
|
TThread
|
||||||
procedure
|
.Queue(nil, procedure begin Memo.Lines.Add('FEHLER: Kompilierung fehlgeschlagen. .obj-Datei nicht erstellt.'); end);
|
||||||
begin
|
|
||||||
Memo.Lines.Add( 'FEHLER: Kompilierung fehlgeschlagen. .obj-Datei nicht erstellt.' );
|
|
||||||
end );
|
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TThread.Queue( nil,
|
TThread.Queue(nil, procedure begin Memo.Lines.Add('Linke zu DLL...'); end);
|
||||||
procedure
|
|
||||||
begin
|
|
||||||
Memo.Lines.Add( 'Linke zu DLL...' );
|
|
||||||
end );
|
|
||||||
compilerOutputLocal := ExecuteProcess(LLD_PATH, Format('/dll /noentry "%s" /out:"%s"', [objFileLocal, dllFileLocal]));
|
compilerOutputLocal := ExecuteProcess(LLD_PATH, Format('/dll /noentry "%s" /out:"%s"', [objFileLocal, dllFileLocal]));
|
||||||
TThread.Queue( nil,
|
TThread.Queue(nil, procedure begin Memo.Lines.Add(compilerOutputLocal); end);
|
||||||
procedure
|
|
||||||
begin
|
|
||||||
Memo.Lines.Add( compilerOutputLocal );
|
|
||||||
end );
|
|
||||||
|
|
||||||
if TFile.Exists(dllFileLocal) then
|
if TFile.Exists(dllFileLocal) then
|
||||||
begin
|
begin
|
||||||
successLocal := True;
|
successLocal := True;
|
||||||
TThread.Queue( nil,
|
TThread.Queue(nil, procedure begin Memo.Lines.Add(Format('ERFOLG: DLL wurde erstellt: %s', [dllFileLocal])); end);
|
||||||
procedure
|
|
||||||
begin
|
|
||||||
Memo.Lines.Add( Format( 'ERFOLG: DLL wurde erstellt: %s', [dllFileLocal] ) );
|
|
||||||
end );
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
TThread.Queue( nil,
|
TThread.Queue(nil, procedure begin Memo.Lines.Add('FEHLER: Linken fehlgeschlagen. .dll-Datei nicht erstellt.'); end);
|
||||||
procedure
|
|
||||||
begin
|
|
||||||
Memo.Lines.Add( 'FEHLER: Linken fehlgeschlagen. .dll-Datei nicht erstellt.' );
|
|
||||||
end );
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
finally
|
finally
|
||||||
@@ -297,7 +274,8 @@ begin
|
|||||||
TFile.Delete(dllFileLocal);
|
TFile.Delete(dllFileLocal);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TThread.Queue( nil,
|
TThread.Queue(
|
||||||
|
nil,
|
||||||
procedure
|
procedure
|
||||||
begin
|
begin
|
||||||
Memo.Lines.Add('---------------------------------------------------------');
|
Memo.Lines.Add('---------------------------------------------------------');
|
||||||
@@ -305,8 +283,7 @@ begin
|
|||||||
|
|
||||||
if TFile.Exists(dllFileLocal) then
|
if TFile.Exists(dllFileLocal) then
|
||||||
begin
|
begin
|
||||||
var
|
var Runner := TLLVMRunner.Create(dllFileLocal);
|
||||||
Runner := TLLVMRunner.Create( dllFileLocal );
|
|
||||||
try
|
try
|
||||||
Runner.Execute(InputInteger); // <--- HIER DEN INPUT-PARAMETER ÜBERGEBEN
|
Runner.Execute(InputInteger); // <--- HIER DEN INPUT-PARAMETER ÜBERGEBEN
|
||||||
finally
|
finally
|
||||||
@@ -316,8 +293,10 @@ begin
|
|||||||
|
|
||||||
Memo.Lines.Add('DLL beendet.');
|
Memo.Lines.Add('DLL beendet.');
|
||||||
Memo.CaretPosition := TCaretPosition.Create(Memo.Lines.Count - 1, 1);
|
Memo.CaretPosition := TCaretPosition.Create(Memo.Lines.Count - 1, 1);
|
||||||
end );
|
end
|
||||||
end );
|
);
|
||||||
|
end
|
||||||
|
);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainForm.WebBrowser1DidFinishLoad(ASender: TObject);
|
procedure TMainForm.WebBrowser1DidFinishLoad(ASender: TObject);
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ unit ApiKey;
|
|||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
const Value = 'AIzaSyALccoMxn0_wcHswavhu5rzdglLeH6gVlI';
|
const
|
||||||
|
Value = 'AIzaSyALccoMxn0_wcHswavhu5rzdglLeH6gVlI';
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,24 @@ unit MainUnit;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
Winapi.Windows,
|
||||||
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls,
|
Winapi.Messages,
|
||||||
System.Net.HttpClient, System.Net.HttpClientComponent, System.JSON, System.Net.Mime, Vcl.AppEvnts,
|
System.SysUtils,
|
||||||
Myc.Futures, System.Generics.Collections, ApiKey;
|
System.Variants,
|
||||||
|
System.Classes,
|
||||||
|
Vcl.Graphics,
|
||||||
|
Vcl.Controls,
|
||||||
|
Vcl.Forms,
|
||||||
|
Vcl.Dialogs,
|
||||||
|
Vcl.StdCtrls,
|
||||||
|
System.Net.HttpClient,
|
||||||
|
System.Net.HttpClientComponent,
|
||||||
|
System.JSON,
|
||||||
|
System.Net.Mime,
|
||||||
|
Vcl.AppEvnts,
|
||||||
|
Myc.Futures,
|
||||||
|
System.Generics.Collections,
|
||||||
|
ApiKey;
|
||||||
|
|
||||||
type
|
type
|
||||||
// NEU: Ein Record, um einen einzelnen Redebeitrag in der Konversation zu speichern
|
// NEU: Ein Record, um einen einzelnen Redebeitrag in der Konversation zu speichern
|
||||||
@@ -127,7 +141,8 @@ begin
|
|||||||
AnswerMemo.Lines.Add(userPrompt);
|
AnswerMemo.Lines.Add(userPrompt);
|
||||||
AnswerMemo.Lines.Add('... sende Anfrage an Gemini ...');
|
AnswerMemo.Lines.Add('... sende Anfrage an Gemini ...');
|
||||||
|
|
||||||
FAnswer := TFuture<string>.Construct(
|
FAnswer :=
|
||||||
|
TFuture<string>.Construct(
|
||||||
function: string
|
function: string
|
||||||
var
|
var
|
||||||
jsonRequest: TJSONObject;
|
jsonRequest: TJSONObject;
|
||||||
@@ -172,18 +187,27 @@ begin
|
|||||||
begin
|
begin
|
||||||
responseJson := TJSONObject.ParseJSONValue(response.ContentAsString(TEncoding.UTF8));
|
responseJson := TJSONObject.ParseJSONValue(response.ContentAsString(TEncoding.UTF8));
|
||||||
try
|
try
|
||||||
Result := responseJson.GetValue<TJSONArray>('candidates')
|
Result :=
|
||||||
.Items[0].GetValue<TJSONObject>('content')
|
responseJson
|
||||||
|
.GetValue<TJSONArray>('candidates')
|
||||||
|
.Items[0]
|
||||||
|
.GetValue<TJSONObject>('content')
|
||||||
.GetValue<TJSONArray>('parts')
|
.GetValue<TJSONArray>('parts')
|
||||||
.Items[0].GetValue<string>('text');
|
.Items[0]
|
||||||
|
.GetValue<string>('text');
|
||||||
finally
|
finally
|
||||||
responseJson.Free;
|
responseJson.Free;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
Result := 'Fehler! Status: ' + response.StatusCode.ToString + ' - ' + response.StatusText +
|
Result :=
|
||||||
sLineBreak + response.ContentAsString;
|
'Fehler! Status: '
|
||||||
|
+ response.StatusCode.ToString
|
||||||
|
+ ' - '
|
||||||
|
+ response.StatusText
|
||||||
|
+ sLineBreak
|
||||||
|
+ response.ContentAsString;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
requestBody.Free;
|
requestBody.Free;
|
||||||
@@ -197,8 +221,8 @@ begin
|
|||||||
Result := '--- FEHLER IM TASK ---' + sLineBreak + E.Message;
|
Result := '--- FEHLER IM TASK ---' + sLineBreak + E.Message;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end);
|
end
|
||||||
|
);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ TUnitInfo implementation }
|
{ TUnitInfo implementation }
|
||||||
constructor TUnitInfo.Create(const AFilePath: string);
|
constructor TUnitInfo.Create(const AFilePath: string);
|
||||||
begin
|
begin
|
||||||
@@ -588,7 +587,13 @@ begin
|
|||||||
outputFileName := ParamStr(currentParamIndex + 1);
|
outputFileName := ParamStr(currentParamIndex + 1);
|
||||||
Inc(currentParamIndex, 2);
|
Inc(currentParamIndex, 2);
|
||||||
end
|
end
|
||||||
else begin WriteLn('Error: Missing filename after -o option.'); WriteLn(usageStr); exitcode := 1; exit; end;
|
else
|
||||||
|
begin
|
||||||
|
WriteLn('Error: Missing filename after -o option.');
|
||||||
|
WriteLn(usageStr);
|
||||||
|
exitcode := 1;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else if SameText(currentParam, '-dirs') then
|
else if SameText(currentParam, '-dirs') then
|
||||||
begin
|
begin
|
||||||
@@ -610,12 +615,23 @@ begin
|
|||||||
WriteLn('Warning: File specified with -dirs not found: ' + dirsFileName);
|
WriteLn('Warning: File specified with -dirs not found: ' + dirsFileName);
|
||||||
Inc(currentParamIndex, 2);
|
Inc(currentParamIndex, 2);
|
||||||
end
|
end
|
||||||
else begin WriteLn('Error: Missing filename after -dirs option.'); WriteLn(usageStr); exitcode := 1; exit; end;
|
else
|
||||||
|
begin
|
||||||
|
WriteLn('Error: Missing filename after -dirs option.');
|
||||||
|
WriteLn(usageStr);
|
||||||
|
exitcode := 1;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else if SameText(currentParam, '-f') or SameText(currentParam, '-fx') then
|
else if SameText(currentParam, '-f') or SameText(currentParam, '-fx') then
|
||||||
begin
|
begin
|
||||||
if focusMode then
|
if focusMode then
|
||||||
begin WriteLn('Error: -f and -fx options cannot be used together.'); WriteLn(usageStr); exitcode := 1; exit; end;
|
begin
|
||||||
|
WriteLn('Error: -f and -fx options cannot be used together.');
|
||||||
|
WriteLn(usageStr);
|
||||||
|
exitcode := 1;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
if currentParamIndex + 1 <= ParamCount then
|
if currentParamIndex + 1 <= ParamCount then
|
||||||
begin
|
begin
|
||||||
@@ -626,7 +642,13 @@ begin
|
|||||||
filesToExcludeFromOutput.Text := initialFocusFiles.Text;
|
filesToExcludeFromOutput.Text := initialFocusFiles.Text;
|
||||||
Inc(currentParamIndex, 2);
|
Inc(currentParamIndex, 2);
|
||||||
end
|
end
|
||||||
else begin WriteLn('Error: Missing file list after ' + currentParam + ' option.'); WriteLn(usageStr); exitcode := 1; exit; end;
|
else
|
||||||
|
begin
|
||||||
|
WriteLn('Error: Missing file list after ' + currentParam + ' option.');
|
||||||
|
WriteLn(usageStr);
|
||||||
|
exitcode := 1;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@@ -650,7 +672,6 @@ begin
|
|||||||
Dec(i);
|
Dec(i);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
if writeToClipboard and (outputFileName <> '') then
|
if writeToClipboard and (outputFileName <> '') then
|
||||||
begin
|
begin
|
||||||
WriteLn('Error: -o (output to file) and -c (output to clipboard) cannot be used together.');
|
WriteLn('Error: -o (output to file) and -c (output to clipboard) cannot be used together.');
|
||||||
@@ -687,14 +708,20 @@ begin
|
|||||||
for var focusFile in initialFocusFiles do
|
for var focusFile in initialFocusFiles do
|
||||||
begin
|
begin
|
||||||
if not TFile.Exists(focusFile) then
|
if not TFile.Exists(focusFile) then
|
||||||
begin WriteLn('Warning: Focus file not found, skipping: ' + focusFile); Continue; end;
|
begin
|
||||||
|
WriteLn('Warning: Focus file not found, skipping: ' + focusFile);
|
||||||
|
Continue;
|
||||||
|
end;
|
||||||
if allFoundPasFilesList.IndexOf(focusFile) = -1 then
|
if allFoundPasFilesList.IndexOf(focusFile) = -1 then
|
||||||
allFoundPasFilesList.Add(focusFile);
|
allFoundPasFilesList.Add(focusFile);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if allFoundPasFilesList.Count = 0 then
|
if allFoundPasFilesList.Count = 0 then
|
||||||
begin WriteLn('No .pas files found in any specified directory (respecting exclusions).'); exit; end;
|
begin
|
||||||
|
WriteLn('No .pas files found in any specified directory (respecting exclusions).');
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
allUnits := TDictionary<string, TUnitInfo>.Create(TStringComparer.Ordinal);
|
allUnits := TDictionary<string, TUnitInfo>.Create(TStringComparer.Ordinal);
|
||||||
sortedUnits := TList<TUnitInfo>.Create;
|
sortedUnits := TList<TUnitInfo>.Create;
|
||||||
@@ -719,14 +746,23 @@ begin
|
|||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin WriteLn('Warning: Could not determine unit name for file: ' + filePathKey + '. Skipping.'); unitInfo.Free; end;
|
begin
|
||||||
|
WriteLn('Warning: Could not determine unit name for file: ' + filePathKey + '. Skipping.');
|
||||||
|
unitInfo.Free;
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin WriteLn('Warning: Failed to parse unit: ' + filePathKey + '. Skipping.'); unitInfo.Free; end;
|
begin
|
||||||
|
WriteLn('Warning: Failed to parse unit: ' + filePathKey + '. Skipping.');
|
||||||
|
unitInfo.Free;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if allUnits.Count = 0 then
|
if allUnits.Count = 0 then
|
||||||
begin WriteLn('No units successfully parsed.'); exit; end;
|
begin
|
||||||
|
WriteLn('No units successfully parsed.');
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
if focusMode then
|
if focusMode then
|
||||||
begin
|
begin
|
||||||
@@ -929,12 +965,15 @@ begin
|
|||||||
|
|
||||||
if item.InterfaceSection.Count > 0 then
|
if item.InterfaceSection.Count > 0 then
|
||||||
begin
|
begin
|
||||||
outputContent.Add('//==================================================================================================');
|
outputContent
|
||||||
|
.Add('//==================================================================================================');
|
||||||
outputContent.Add('//== UNIT START: ' + item.Name + ' (from ' + ExtractFileName(item.FilePath) + ')');
|
outputContent.Add('//== UNIT START: ' + item.Name + ' (from ' + ExtractFileName(item.FilePath) + ')');
|
||||||
outputContent.Add('//==================================================================================================');
|
outputContent
|
||||||
|
.Add('//==================================================================================================');
|
||||||
outputContent.AddStrings(item.InterfaceSection);
|
outputContent.AddStrings(item.InterfaceSection);
|
||||||
outputContent.Add('//== UNIT END: ' + item.Name);
|
outputContent.Add('//== UNIT END: ' + item.Name);
|
||||||
outputContent.Add('//==================================================================================================');
|
outputContent
|
||||||
|
.Add('//==================================================================================================');
|
||||||
outputContent.Add('');
|
outputContent.Add('');
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ uses
|
|||||||
Myc.Test.Core.Lazy in '..\Src\Myc.Test.Core.Lazy.pas',
|
Myc.Test.Core.Lazy in '..\Src\Myc.Test.Core.Lazy.pas',
|
||||||
Myc.Test.Lazy in '..\Src\Myc.Test.Lazy.pas',
|
Myc.Test.Lazy in '..\Src\Myc.Test.Lazy.pas',
|
||||||
Myc.Test.Core.Atomic in '..\Src\Myc.Test.Core.Atomic.pas',
|
Myc.Test.Core.Atomic in '..\Src\Myc.Test.Core.Atomic.pas',
|
||||||
Myc.Trade.Ticker in '..\Src\Myc.Trade.Ticker.pas',
|
|
||||||
Myc.Test.Signals.Latch in '..\Src\Myc.Test.Signals.Latch.pas',
|
Myc.Test.Signals.Latch in '..\Src\Myc.Test.Signals.Latch.pas',
|
||||||
Myc.Test.Signals.Dirty in '..\Src\Myc.Test.Signals.Dirty.pas',
|
Myc.Test.Signals.Dirty in '..\Src\Myc.Test.Signals.Dirty.pas',
|
||||||
Myc.Trade.DataPoint in '..\Src\Myc.Trade.DataPoint.pas',
|
Myc.Trade.DataPoint in '..\Src\Myc.Trade.DataPoint.pas',
|
||||||
|
|||||||
@@ -130,7 +130,6 @@ $(PreBuildEvent)]]></PreBuildEvent>
|
|||||||
<DCCReference Include="..\Src\Myc.Test.Core.Lazy.pas"/>
|
<DCCReference Include="..\Src\Myc.Test.Core.Lazy.pas"/>
|
||||||
<DCCReference Include="..\Src\Myc.Test.Lazy.pas"/>
|
<DCCReference Include="..\Src\Myc.Test.Lazy.pas"/>
|
||||||
<DCCReference Include="..\Src\Myc.Test.Core.Atomic.pas"/>
|
<DCCReference Include="..\Src\Myc.Test.Core.Atomic.pas"/>
|
||||||
<DCCReference Include="..\Src\Myc.Trade.Ticker.pas"/>
|
|
||||||
<DCCReference Include="..\Src\Myc.Test.Signals.Latch.pas"/>
|
<DCCReference Include="..\Src\Myc.Test.Signals.Latch.pas"/>
|
||||||
<DCCReference Include="..\Src\Myc.Test.Signals.Dirty.pas"/>
|
<DCCReference Include="..\Src\Myc.Test.Signals.Dirty.pas"/>
|
||||||
<DCCReference Include="..\Src\Myc.Trade.DataPoint.pas"/>
|
<DCCReference Include="..\Src\Myc.Trade.DataPoint.pas"/>
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user