aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common
diff options
context:
space:
mode:
authorRoy <Roy.mail.net@gmail.com>2022-11-15 11:14:01 +0200
committerRoy <Roy.mail.net@gmail.com>2022-11-15 11:14:01 +0200
commit59052dd593c0d3d4eb2bf6c579e44c06daf7a038 (patch)
treed39dd9289e16d897e82efe8be4c48509c4895cbb /Software/Visual_Studio/PPC/Tango.PPC.Common
parent81b37f187ad6823bb27ce132782301fb0bbd0c75 (diff)
downloadTango-59052dd593c0d3d4eb2bf6c579e44c06daf7a038.tar.gz
Tango-59052dd593c0d3d4eb2bf6c579e44c06daf7a038.zip
Job runs extended info.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs3
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs28
2 files changed, 29 insertions, 2 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
index 18c0f6202..2b3bc2a99 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs
@@ -22,6 +22,7 @@ using Tango.Transport;
using System.Threading;
using Tango.Core.ExtensionMethods;
using System.IO.Ports;
+using Tango.Integration.JobRuns;
namespace Tango.PPC.Common.Connection
{
@@ -121,6 +122,8 @@ namespace Tango.PPC.Common.Connection
MachineOperator.EmergencyNotificationProvider.IsEnabled = settings.EnableEmergencyNotifications;
MachineOperator.EnableJobLiquidQuantityValidation = settings.EnableJobLiquidQuantityValidation;
+
+ (MachineOperator.JobRunsLogger as BasicJobRunsLogger).CreateJobRunsFiles = true;
}
private void MachineOperator_StatusChanged(object sender, MachineStatuses status)
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs
index 00381377d..7eee23925 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs
@@ -1,6 +1,8 @@
-using System;
+using Newtonsoft.Json;
+using System;
using System.Collections.Generic;
using System.Data.Entity;
+using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -11,6 +13,7 @@ using Tango.BL.Enumerations;
using Tango.Core;
using Tango.Core.DI;
using Tango.Integration.ExternalBridge;
+using Tango.Integration.JobRuns;
using Tango.PPC.Common.Connection;
using Tango.PPC.Common.ExternalBridge;
using Tango.PPC.Shared.Statistics;
@@ -189,9 +192,30 @@ namespace Tango.PPC.Common.Statistics
await receiver.SendGenericResponse(response, token);
}
- public void OnReceiverDisconnected(ExternalBridgeReceiver receiver)
+ [ExternalBridgeRequestHandlerMethod(typeof(GetJobRunExtendedInfoRequest), RequestHandlerLoggingMode.LogRequestName)]
+ public async Task OnGetJobRunExtendedInfoRequest(GetJobRunExtendedInfoRequest request, String token, ExternalBridgeReceiver receiver)
{
+ this.ThrowIfDisabled();
+
+ var response = new GetJobRunExtendedInfoResponse();
+
+ String filePath = Path.Combine((_machineProvider.MachineOperator.JobRunsLogger as BasicJobRunsLogger).JobRunsFolder, $"{request.JobRunID}.run");
+ String json = File.ReadAllText(filePath);
+
+ JobRunInfo info = JsonConvert.DeserializeObject<JobRunInfo>(json);
+
+ response.ExtendedInfo.JobRunID = info.JobRunID;
+ response.ExtendedInfo.JobTicket = info.JobTicket;
+ response.ExtendedInfo.Events = info.Events;
+ response.ExtendedInfo.StartMachineStatus = info.StartMachineStatus;
+ response.ExtendedInfo.EndMachineStatus = info.EndMachineStatus;
+ await receiver.SendGenericResponse(response, token);
+ }
+
+ public void OnReceiverDisconnected(ExternalBridgeReceiver receiver)
+ {
+
}
}
}