AST development
This commit is contained in:
@@ -50,6 +50,7 @@ type
|
|||||||
FSpacing: TPointF;
|
FSpacing: TPointF;
|
||||||
FLastNode: TAuraNode;
|
FLastNode: TAuraNode;
|
||||||
FConnections: TList<TPinConnection>;
|
FConnections: TList<TPinConnection>;
|
||||||
|
FCurrentExec: TControl;
|
||||||
function CreateNodeControl(const ATitle, ADetails: string): TAuraNode;
|
function CreateNodeControl(const ATitle, ADetails: string): TAuraNode;
|
||||||
function CreatePin(
|
function CreatePin(
|
||||||
AParentNode: TAuraNode;
|
AParentNode: TAuraNode;
|
||||||
@@ -175,7 +176,10 @@ end;
|
|||||||
|
|
||||||
function TAstToAuraNodeVisitor.CreateInput(AParentNode: TAuraNode; const ACaption: string; AOffsetY: Single = 0): TControl;
|
function TAstToAuraNodeVisitor.CreateInput(AParentNode: TAuraNode; const ACaption: string; AOffsetY: Single = 0): TControl;
|
||||||
begin
|
begin
|
||||||
Result := CreatePin(AParentNode, psCircle, paLeft, cDataPinColor, 'data.in.' + ACaption, AOffsetY);
|
var cap := ACaption;
|
||||||
|
if cap <> '' then
|
||||||
|
cap := '.' + cap;
|
||||||
|
Result := CreatePin(AParentNode, psCircle, paLeft, cDataPinColor, 'data.in' + cap, AOffsetY);
|
||||||
Result.Hint := ACaption;
|
Result.Hint := ACaption;
|
||||||
Result.ShowHint := ACaption <> '';
|
Result.ShowHint := ACaption <> '';
|
||||||
end;
|
end;
|
||||||
@@ -188,6 +192,8 @@ end;
|
|||||||
function TAstToAuraNodeVisitor.CreateEntry(AParentNode: TAuraNode; AOffsetY: Single = 0): TControl;
|
function TAstToAuraNodeVisitor.CreateEntry(AParentNode: TAuraNode; AOffsetY: Single = 0): TControl;
|
||||||
begin
|
begin
|
||||||
Result := CreatePin(AParentNode, psTriangle, paLeft, cExecPinColor, 'exec.in', AOffsetY);
|
Result := CreatePin(AParentNode, psTriangle, paLeft, cExecPinColor, 'exec.in', AOffsetY);
|
||||||
|
if FCurrentExec <> nil then
|
||||||
|
FConnections.Add(TPinConnection.Create(FCurrentExec, Result));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TAstToAuraNodeVisitor.CreateExit(AParentNode: TAuraNode; const ACaption: string; AOffsetY: Single = 0): TControl;
|
function TAstToAuraNodeVisitor.CreateExit(AParentNode: TAuraNode; const ACaption: string; AOffsetY: Single = 0): TControl;
|
||||||
@@ -196,6 +202,8 @@ begin
|
|||||||
if cap <> '' then
|
if cap <> '' then
|
||||||
cap := '.' + cap;
|
cap := '.' + cap;
|
||||||
Result := CreatePin(AParentNode, psTriangle, paRight, cExecPinColor, 'exec.out' + cap, AOffsetY);
|
Result := CreatePin(AParentNode, psTriangle, paRight, cExecPinColor, 'exec.out' + cap, AOffsetY);
|
||||||
|
|
||||||
|
FCurrentExec := Result;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TAstToAuraNodeVisitor.CreateNodeControl(const ATitle, ADetails: string): TAuraNode;
|
function TAstToAuraNodeVisitor.CreateNodeControl(const ATitle, ADetails: string): TAuraNode;
|
||||||
@@ -747,7 +755,6 @@ begin
|
|||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
Canvas.Stroke.Kind := TBrushKind.Solid;
|
Canvas.Stroke.Kind := TBrushKind.Solid;
|
||||||
Canvas.Stroke.Color := TAlphaColors.Dodgerblue;
|
|
||||||
Canvas.Stroke.Thickness := 2;
|
Canvas.Stroke.Thickness := 2;
|
||||||
|
|
||||||
// Gehe durch alle gespeicherten Verbindungen und zeichne sie
|
// Gehe durch alle gespeicherten Verbindungen und zeichne sie
|
||||||
@@ -764,6 +771,12 @@ begin
|
|||||||
LStartPoint := AbsoluteToLocal(LAbsoluteStart);
|
LStartPoint := AbsoluteToLocal(LAbsoluteStart);
|
||||||
LEndPoint := AbsoluteToLocal(LAbsoluteEnd);
|
LEndPoint := AbsoluteToLocal(LAbsoluteEnd);
|
||||||
|
|
||||||
|
var str := LConnection.InputPin.TagString;
|
||||||
|
if Pos('data', str) = 0 then
|
||||||
|
Canvas.Stroke.Color := TAstToAuraNodeVisitor.cExecPinColor
|
||||||
|
else
|
||||||
|
Canvas.Stroke.Color := TAstToAuraNodeVisitor.cDataPinColor;
|
||||||
|
|
||||||
// Draw a Bezier curve with horizontal tangents at start and end points.
|
// Draw a Bezier curve with horizontal tangents at start and end points.
|
||||||
LPath := TPathData.Create;
|
LPath := TPathData.Create;
|
||||||
try
|
try
|
||||||
|
|||||||
Reference in New Issue
Block a user