Skip to content

Commit

Permalink
Add Sharp7Plc.ToString()
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter-B- committed Jul 30, 2024
1 parent 61e04c7 commit 75a893f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Sharp7.Rx/Sharp7Connector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public Sharp7Connector(PlcConnectionSettings settings, IVariableNameParser varia
}

public IObservable<ConnectionState> ConnectionState => connectionStateSubject.DistinctUntilChanged().AsObservable();
public ConnectionState CurrentConnectionState => connectionStateSubject.Value;

public ILogger Logger { get; set; }

Expand Down
2 changes: 2 additions & 0 deletions Sharp7.Rx/Sharp7Plc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ await s7Connector.ConnectionState
.ToTask(token);
}

public override string ToString() => $"S7 {s7Connector} ({s7Connector.CurrentConnectionState})";

/// <summary>
/// Initialize PLC and trigger connection. This method will not wait for the connection to be established.
/// <para>
Expand Down

0 comments on commit 75a893f

Please sign in to comment.