diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2022-04-28 02:30:11 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2022-04-28 02:30:11 +0300 |
| commit | 357d86202db77f6860b8f514e910b967ce4c3034 (patch) | |
| tree | accd34365d7450d82544ec2b287db87549355b1a /Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs | |
| parent | 59aa6065ebb3481e50c13ec6b4850448fe66186a (diff) | |
| download | Tango-357d86202db77f6860b8f514e910b967ce4c3034.tar.gz Tango-357d86202db77f6860b8f514e910b967ce4c3034.zip | |
Spool Type Firmware Notifications.
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 777f0b199..049d78d9c 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -88,6 +88,7 @@ namespace Tango.Integration.Operation private DateTime? _jobActualStartDate; private List<Event> _emulatedEvents; private List<BitResultComposition> _bitResults; + private JobSpoolType _currentSpoolType; public static String EmbeddedLogsFolder { get; private set; } public static String EmbeddedLogsTag { get; private set; } @@ -1480,7 +1481,8 @@ namespace Tango.Integration.Operation ConnectRequest request = new ConnectRequest() { Password = "1234", - UnixTime = DateTimeOffset.UtcNow.ToUnixTimeSeconds() + UnixTime = DateTimeOffset.UtcNow.ToUnixTimeSeconds(), + SpoolType = _currentSpoolType }; try @@ -4426,6 +4428,33 @@ namespace Tango.Integration.Operation return _bitResults; } + /// <summary> + /// Notifies the remote machine about spool type change. + /// If the machine is not connected the spool type will be added to the connection request. + /// </summary> + /// <param name="spoolType">Type of the spool.</param> + public async Task SetSpoolType(JobSpoolType spoolType) + { + _currentSpoolType = spoolType; + + LogManager.Log($"Spool type changed to: '{spoolType}'."); + + if (IsConnected) + { + try + { + await SendRequest<SpoolTypeChangedRequest, SpoolTypeChangedResponse>(new SpoolTypeChangedRequest() + { + SpoolType = spoolType + }); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error changing the spool type on the machine."); + } + } + } + #endregion } } |
