Skip to content

Commit 1f48e91

Browse files
committed
Updated simulator to match connection pattern for other sources
1 parent fc5d7c5 commit 1f48e91

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

src/DotnetSimulator/SimulatedDeviceSource.cs renamed to src/DotnetSimulator/SimulatedDeviceConnection.cs

+1-11
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,7 @@ namespace Qkmaxware.Astro.Control {
88
/// <summary>
99
/// Simulated device source with a simulated connection to the source
1010
/// </summary>
11-
public class SimulatedDeviceSource : IServerSpecification, IServerConnection, IDeviceSource {
12-
#region Fake Host
13-
public string Host => "localhost";
14-
public int Port => 0;
15-
public bool TryConnect(out IServerConnection connection, IConnectionLogger logger = null) {
16-
connection = this;
17-
this.Connect();
18-
this.InputLogger = logger;
19-
return true;
20-
}
21-
#endregion
11+
public class SimulatedDeviceConnection : IServerConnection, IDeviceSource {
2212

2313
#region Fake Connection
2414

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System.Collections.Generic;
2+
using System.Linq;
3+
using Qkmaxware.Astro.Control;
4+
using Qkmaxware.Astro.Control.Devices;
5+
6+
namespace Qkmaxware.Astro.Control {
7+
8+
/// <summary>
9+
/// Simulated device source with a simulated connection to the source
10+
/// </summary>
11+
public class SimulatedDeviceServer : IServerSpecification {
12+
#region Fake Host
13+
public string Host => "localhost";
14+
public int Port => 0;
15+
public bool TryConnect(out IServerConnection connection, IConnectionLogger logger = null) {
16+
connection = new SimulatedDeviceConnection();
17+
connection.Connect();
18+
connection.InputLogger = logger;
19+
return true;
20+
}
21+
#endregion
22+
}
23+
24+
}

0 commit comments

Comments
 (0)