using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.BL.Entities; using Tango.Core.DI; using Tango.Integration.ExternalBridge; using Tango.Integration.Operation; using Tango.PPC.Common.Application; using Tango.PPC.Common.Connection; using Tango.PPC.Common.Messages; using Tango.Settings; namespace Tango.PPC.Common.ExternalBridge { /// /// Represents the PPC external bridge service capable of exposing a remote API for communicating and controlling the machine through the PPC. /// /// /// public class PPCExternalBridgeService : ExternalBridgeService, IPPCExternalBridgeService { /// /// Initializes a new instance of the class. /// /// The application manager. /// The machine provider. public PPCExternalBridgeService(IPPCApplicationManager applicationManager, IMachineProvider machineProvider) { applicationManager.ApplicationReady += (_, __) => { var settings = SettingsManager.Default.GetOrCreate(); MachineOperator = machineProvider.MachineOperator; Machine = machineProvider.Machine; Enabled = settings.EnableExternalBridge; }; } } }