diff options
| author | Roy <Roy.mail.net@gmail.com> | 2023-02-06 19:47:59 +0200 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2023-02-06 19:47:59 +0200 |
| commit | 5f8a6184e8c0b6de2e61fd9845378eb4324c50a6 (patch) | |
| tree | cf4c5f2612168d22a5827588e081ea71da60aa39 /Software/Visual_Studio/Tango.Integration | |
| parent | 48c49f651b9acb1aa87f845d68ed5b4f49f3d447 (diff) | |
| download | Tango-5f8a6184e8c0b6de2e61fd9845378eb4324c50a6.tar.gz Tango-5f8a6184e8c0b6de2e61fd9845378eb4324c50a6.zip | |
Machine Type Connection, Discovery Handling.
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration')
5 files changed, 21 insertions, 2 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs index da55a13d3..a2b0d0f5b 100644 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs +++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeScanner.cs @@ -14,6 +14,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using Tango.BL.Entities; +using Tango.BL.Enumerations; using Tango.Core; using Tango.Core.Helpers; using Tango.Integration.ExternalBridge.Web; @@ -288,6 +289,7 @@ namespace Tango.Integration.ExternalBridge if (newMachine != null) { + newMachine.MachineType = (MachineTypes)discoveryPacket.MachineType; LogManager.Log("Found a new machine via TCP " + newMachine.SerialNumber); ThreadsHelper.InvokeUINow(() => @@ -346,6 +348,7 @@ namespace Tango.Integration.ExternalBridge if (newMachine != null) { + newMachine.MachineType = knownMachine.Type; LogManager.Log("Found a new machine via SignalR " + newMachine.SerialNumber); ThreadsHelper.InvokeUINow(() => @@ -429,6 +432,7 @@ namespace Tango.Integration.ExternalBridge if (newMachine != null) { + newMachine.MachineType = (MachineTypes)info.MachineType; LogManager.Log("Found a new machine via IP Address" + newMachine.SerialNumber); ThreadsHelper.InvokeUINow(() => diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs index ae7cace31..ef66275cf 100644 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs +++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/ExternalBridgeService.cs @@ -237,10 +237,11 @@ namespace Tango.Integration.ExternalBridge { SerialNumber = Machine.SerialNumber, Guid = Machine.Guid, + MachineType = (PMR.Common.MachineType)Machine.MachineType }) { MulticastGroupAddress = _multicastAddress, - TcpValidationInfo = new TcpValidationInfo() { Guid = Machine.Guid, SerialNumber = Machine.SerialNumber } + TcpValidationInfo = new TcpValidationInfo() { Guid = Machine.Guid, SerialNumber = Machine.SerialNumber, MachineType = Machine.MachineType } }; _discoveryService.BeforeBroadcasting -= _discoverySevice_BeforeBroadcasting; @@ -642,6 +643,7 @@ namespace Tango.Integration.ExternalBridge { SerialNumber = Machine.SerialNumber, Organization = Machine.Organization.Name, + MachineType = Machine.MachineType }); _isSignalRConnected = true; diff --git a/Software/Visual_Studio/Tango.Integration/ExternalBridge/Web/MachineInfo.cs b/Software/Visual_Studio/Tango.Integration/ExternalBridge/Web/MachineInfo.cs index cccc24c35..5e70be977 100644 --- a/Software/Visual_Studio/Tango.Integration/ExternalBridge/Web/MachineInfo.cs +++ b/Software/Visual_Studio/Tango.Integration/ExternalBridge/Web/MachineInfo.cs @@ -13,6 +13,7 @@ namespace Tango.Integration.ExternalBridge.Web public String SerialNumber { get; set; } public String Organization { get; set; } public String IPAddress { get; set; } + public int MachineType { get; set; } public MachineInfo() { diff --git a/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs index ca00f2891..5db477b6b 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs @@ -26,6 +26,7 @@ using Tango.PMR.MachineStatus; using Tango.PMR.ThreadLoading; using Tango.PMR.Power; using Tango.PMR.IFS; +using Tango.BL.Enumerations; namespace Tango.Integration.Operation { @@ -61,6 +62,11 @@ namespace Tango.Integration.Operation MachineStatuses Status { get; } /// <summary> + /// Gets or sets the type of the machine. + /// </summary> + MachineTypes MachineType { get; set; } + + /// <summary> /// Gets a value indicating whether the machine is connected and status is not disconnected. /// </summary> bool IsConnected { get; } diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 005121b88..9c94363df 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -664,6 +664,11 @@ namespace Tango.Integration.Operation /// </summary> public bool IsSpoolReplaced { get; private set; } + /// <summary> + /// Gets or sets the type of the machine. + /// </summary> + public MachineTypes MachineType { get; set; } + #endregion #region Virtual Methods @@ -1499,7 +1504,8 @@ namespace Tango.Integration.Operation { Password = "1234", UnixTime = DateTimeOffset.UtcNow.ToUnixTimeSeconds(), - SpoolType = _currentSpoolType + SpoolType = _currentSpoolType, + MachineType = (PMR.Common.MachineType)MachineType, }; try |
