aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Integration/ExternalBridge
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2020-02-19 20:36:55 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2020-02-19 20:36:55 +0200
commitb41a0cfe17a485abd077b7f059bb9620cf6e474c (patch)
treea7666002d5c9c6d0046c8734ce6647e77bdc1a6a /Software/Visual_Studio/Tango.Integration/ExternalBridge
parentd93df33fae0130ef3bd37f263e10d78faf091522 (diff)
downloadTango-b41a0cfe17a485abd077b7f059bb9620cf6e474c.tar.gz
Tango-b41a0cfe17a485abd077b7f059bb9620cf6e474c.zip
Implemented basic FSE machine provider...
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration/ExternalBridge')
-rw-r--r--Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs18
-rw-r--r--Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeTcpClient.cs6
2 files changed, 21 insertions, 3 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs
index f158af53f..da85ad531 100644
--- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs
+++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs
@@ -234,7 +234,14 @@ namespace Tango.Integration.ExternalBridge
ThreadsHelper.InvokeUINow(() =>
{
- AvailableMachines.Insert(1, newMachine);
+ if (AvailableMachines.Count > 0)
+ {
+ AvailableMachines.Insert(1, newMachine);
+ }
+ else
+ {
+ AvailableMachines.Add(newMachine);
+ }
MachineDiscovered?.Invoke(this, newMachine);
});
}
@@ -268,7 +275,14 @@ namespace Tango.Integration.ExternalBridge
ThreadsHelper.InvokeUINow(() =>
{
- AvailableMachines.Insert(1, newMachine);
+ if (AvailableMachines.Count > 0)
+ {
+ AvailableMachines.Insert(1, newMachine);
+ }
+ else
+ {
+ AvailableMachines.Add(newMachine);
+ }
MachineDiscovered?.Invoke(this, newMachine);
});
}
diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeTcpClient.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeTcpClient.cs
index 64220f231..0b596e07d 100644
--- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeTcpClient.cs
+++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeTcpClient.cs
@@ -239,7 +239,11 @@ namespace Tango.Integration.ExternalBridge
{
ComponentName = $"External Bridge TCP Client {_component_counter++}";
SerialNumber = serialNumber;
- Machine = ObservablesStaticCollections.Instance.Machines.SingleOrDefault(x => x.SerialNumber == serialNumber);
+
+ if (ObservablesStaticCollections.Instance.IsInitialized)
+ {
+ Machine = ObservablesStaticCollections.Instance.Machines.SingleOrDefault(x => x.SerialNumber == serialNumber);
+ }
IPAddress = ipAddress;
KeepAliveTimeout = TimeSpan.FromSeconds(5);
KeepAliveRetries = 2;