diff options
| author | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
|---|---|---|
| committer | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
| commit | 00a491d93733d4625ad329b2ba8237f445364b3f (patch) | |
| tree | 4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Visual_Studio/PPC/Tango.PPC.Common/ExternalBridge/PPCExternalBridgeService.cs | |
| parent | 124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff) | |
| download | Tango-00a491d9.tar.gz Tango-00a491d9.zip | |
merge
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/ExternalBridge/PPCExternalBridgeService.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Common/ExternalBridge/PPCExternalBridgeService.cs | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/ExternalBridge/PPCExternalBridgeService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/ExternalBridge/PPCExternalBridgeService.cs index 99951d812..c50202e86 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/ExternalBridge/PPCExternalBridgeService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/ExternalBridge/PPCExternalBridgeService.cs @@ -1,16 +1,12 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.BL.Entities; using Tango.Core.DI; -using Tango.Core.Helpers; -using Tango.CSV; using Tango.Integration.ExternalBridge; using Tango.Integration.Operation; -using Tango.PMR.Common; using Tango.PPC.Common.Application; using Tango.PPC.Common.Connection; using Tango.PPC.Common.Messages; @@ -18,11 +14,6 @@ using Tango.Settings; namespace Tango.PPC.Common.ExternalBridge { - public class CsvEntry - { - public String MessageType { get; set; } - } - /// <summary> /// Represents the PPC external bridge service capable of exposing a remote API for communicating and controlling the machine through the PPC. /// </summary> @@ -37,36 +28,11 @@ namespace Tango.PPC.Common.ExternalBridge /// <param name="machineProvider">The machine provider.</param> public PPCExternalBridgeService(IPPCApplicationManager applicationManager, IMachineProvider machineProvider) { - var csvStream = EmbeddedResourceHelper.GetEmbeddedResourceStream("Tango.PPC.Common.SafetyLevelOperations.csv"); - - List<CsvEntry> entries = CsvFile.Read<CsvEntry>(new CsvSource(csvStream)).ToList(); - - foreach (var entry in entries) - { - MessageType type; - if (Enum.TryParse<MessageType>(entry.MessageType, out type)) - { - ExternalBridgeService.SafetyLevelOperations.Add(type); - } - } - - applicationManager.ApplicationReady += (_, __) => + applicationManager.ApplicationReady += (_, __) => { var settings = SettingsManager.Default.GetOrCreate<PPCSettings>(); - //TODO: Configure external bridge for configure protocol enforce... MachineOperator = machineProvider.MachineOperator; Machine = machineProvider.Machine; - SignalRConfiguration.Enabled = settings.EnableExternalBridgeSignalR; - TcpTransportAdapterWriteMode = settings.TcpTransportAdapterWriteMode; - if (Environment.CommandLine.Contains("-webDebug")) - { - SignalRConfiguration.Address = "http://localhost:1111/"; //settings.DeploymentSlot.ToAddress(); - } - else - { - SignalRConfiguration.Address = settings.DeploymentSlot.ToAddress(); - } - SignalRConfiguration.Hub = settings.ExternalBridgeSignalRHub; Enabled = settings.EnableExternalBridge; }; } |
