Skip to content

Commit f3248cb

Browse files
authored
Merge pull request StockSharp#662 from StockSharp/claude/debug-diagram-core-011CULxYdU215snGne9krCkU
Fix critical bugs in Diagram.Core
2 parents aa978ea + 8ad128d commit f3248cb

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

Diagram.Core/CompositionDiagramElement.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ public DiagramSocket InternalSocket
553553
get
554554
{
555555
var node = InternalNode;
556-
return (Directon == DiagramSocketDirection.In ? node?.InputSockets : node?.OutputSockets)?.FindById(InternalSocketId);
556+
return (Direction == DiagramSocketDirection.In ? node?.InputSockets : node?.OutputSockets)?.FindById(InternalSocketId);
557557
}
558558
}
559559
}
@@ -570,7 +570,7 @@ private void RefreshModelData()
570570
var sockets = Model.GetDisconnectedSockets().ToArray();
571571

572572
static (string nodeKey, DiagramSocketDirection dir, string socketId, DiagramSocketType sockType, int linkMax) CreateSocketKey(string nodeKey, DiagramSocket socket)
573-
=> (nodeKey, socket?.Directon ?? DiagramSocketDirection.In, socket?.Id, socket?.Type, socket?.LinkableMaximum ?? 0);
573+
=> (nodeKey, socket?.Direction ?? DiagramSocketDirection.In, socket?.Id, socket?.Type, socket?.LinkableMaximum ?? 0);
574574

575575
var needKeys = sockets.Select(s => CreateSocketKey(s.nodeKey, s.socket)).ToSet();
576576

@@ -610,7 +610,7 @@ private void RefreshModelData()
610610
else
611611
{
612612
var newSocketId = GenerateSocketId(nodeKey, socket.Id);
613-
var newSocket = (CompositionSocket)(socket.Directon == DiagramSocketDirection.In ? AddInput(newSocketId, socket.Name, socket.Type, linkableMax: socket.LinkableMaximum) : AddOutput(newSocketId, socket.Name, socket.Type, linkableMax: socket.LinkableMaximum));
613+
var newSocket = (CompositionSocket)(socket.Direction == DiagramSocketDirection.In ? AddInput(newSocketId, socket.Name, socket.Type, linkableMax: socket.LinkableMaximum) : AddOutput(newSocketId, socket.Name, socket.Type, linkableMax: socket.LinkableMaximum));
614614

615615
newSocket.InternalNodeKey = nodeKey;
616616
newSocket.InternalSocketId = socket.Id;

Diagram.Core/DiagramDebugger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ public void Load(SettingsStorage storage)
414414
continue;
415415

416416
if (_breakpoints.ContainsKey(socket))
417-
return;
417+
continue;
418418

419419
var obj = CreateSocketBreakpoint(socket);
420420
obj.Load(breakPoint);

Diagram.Core/DiagramElement.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ private void RemoveSocket(DiagramSocket socket, bool raiseSocketRemoved)
554554

555555
using var _ = SaveUndoState();
556556

557-
if(!GetSockets(socket.Directon).Remove(socket))
557+
if(!GetSockets(socket.Direction).Remove(socket))
558558
return;
559559

560560
socket.Connected -= OnSocketConnected;

Diagram.Core/DiagramSocket.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public DiagramSocketType Type
7171
/// <summary>
7272
/// The connection direction.
7373
/// </summary>
74-
public DiagramSocketDirection Directon { get; }
74+
public DiagramSocketDirection Direction { get; }
7575

7676
/// <summary>
7777
/// Dynamic sockets are removed during Load().
@@ -214,7 +214,7 @@ public DiagramSocket(DiagramSocketDirection dir, string socketId)
214214
GuiWrapper = new DispatcherNotifiableObject<DiagramSocket>(ConfigManager.GetService<IDispatcher>(), this);
215215

216216
Id = socketId ?? Guid.NewGuid().ToN();
217-
Directon = dir;
217+
Direction = dir;
218218
AvailableTypes = [];
219219
this.ResetAvailableTypes();
220220
}
@@ -265,12 +265,12 @@ public bool CanConnect(DiagramSocket to)
265265
/// <summary>
266266
/// Is input.
267267
/// </summary>
268-
public bool IsInput => Directon == DiagramSocketDirection.In;
268+
public bool IsInput => Direction == DiagramSocketDirection.In;
269269

270270
/// <summary>
271271
/// Is output.
272272
/// </summary>
273-
public bool IsOutput => Directon == DiagramSocketDirection.Out;
273+
public bool IsOutput => Direction == DiagramSocketDirection.Out;
274274

275275
private readonly HashSet<DiagramSocket> _connections = [];
276276

@@ -285,7 +285,7 @@ public bool CanConnect(DiagramSocket to)
285285
/// <param name="other"><see cref="DiagramSocket"/></param>
286286
public void Connect(DiagramSocket other)
287287
{
288-
if (other.Directon == Directon)
288+
if (other.Direction == Direction)
289289
throw new InvalidOperationException("invalid direction");
290290

291291
_connections.Add(other);

Diagram.Core/ICompositionModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ public void RemoveLink(TNode from, string fromPort, TNode to, string toPort)
514514
.Where(s => ports.All(p => !p.EqualsIgnoreCase(s.Id)))
515515
.Select(s =>
516516
{
517-
var socket = new DiagramSocket(s.Directon, s.Id)
517+
var socket = new DiagramSocket(s.Direction, s.Id)
518518
{
519519
Name = $"{s.Name} - {node.Element.Name}",
520520
Type = s.Type,

0 commit comments

Comments
 (0)