aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Integration/ExternalBridge
diff options
context:
space:
mode:
authorRoy <Roy.mail.net@gmail.com>2022-11-23 23:12:46 +0200
committerRoy <Roy.mail.net@gmail.com>2023-02-16 23:46:46 +0200
commit5ed883227020212c8c9faac1f43bc22b9be7dd30 (patch)
treecc5de64c20d1f3a3c20d96cb408e0f8e5a4e08ce /Software/Visual_Studio/Tango.Integration/ExternalBridge
parentb8dd2f3dac6aefe2d14992085a131d961938ee1f (diff)
downloadTango-5ed883227020212c8c9faac1f43bc22b9be7dd30.tar.gz
Tango-5ed883227020212c8c9faac1f43bc22b9be7dd30.zip
Working on ExternalBridge TCP Firmware.
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration/ExternalBridge')
-rw-r--r--Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeTcpFirmwareClient.cs79
1 files changed, 79 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeTcpFirmwareClient.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeTcpFirmwareClient.cs
new file mode 100644
index 000000000..e5ae14d0f
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeTcpFirmwareClient.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.BL;
+using Tango.BL.Entities;
+using Tango.Integration.Operation;
+using Tango.Settings;
+using Tango.Transport.Adapters;
+
+namespace Tango.Integration.ExternalBridge
+{
+ public class ExternalBridgeTcpFirmwareClient : MachineOperator, IExternalBridgeClient
+ {
+ public bool RequiresAuthentication { get; } = false;
+
+ private String _serialNumber;
+ /// <summary>
+ /// Gets the machine serial number.
+ /// </summary>
+ public String SerialNumber
+ {
+ get { return _serialNumber; }
+ set
+ {
+ _serialNumber = value;
+ RaisePropertyChangedAuto();
+ }
+ }
+
+ private String _ipAddress;
+ /// <summary>
+ /// Gets or sets the machine IP address.
+ /// </summary>
+ public String IPAddress
+ {
+ get { return _ipAddress; }
+ private set { _ipAddress = value; RaisePropertyChangedAuto(); }
+ }
+
+ private int _port;
+ /// <summary>
+ /// Gets or sets the machine port.
+ /// </summary>
+ public int Port
+ {
+ get { return _port; }
+ private set { _port = value; RaisePropertyChangedAuto(); }
+ }
+
+ public Machine Machine { get; private set; }
+
+ public ExternalBridgeTcpFirmwareClient()
+ {
+ ComponentName = $"External Bridge TCP Firmware Client {_component_counter++}";
+
+ var settings = SettingsManager.Default.GetOrCreate<IntegrationSettings>();
+
+ IPAddress = settings.FirmwareIPAddress;
+ Port = settings.FirmwarePort;
+ UseKeepAlive = false;
+ EnableDiagnostics = true;
+
+ Adapter = new TcpTransportAdapter(IPAddress, Port);
+ }
+
+ public ExternalBridgeTcpFirmwareClient(Machine machine) : this()
+ {
+ SetMachine(machine);
+ }
+
+ public void SetMachine(Machine machine)
+ {
+ Machine = machine;
+ SerialNumber = Machine.SerialNumber;
+ }
+ }
+}