public ControlzmoHub(IServiceProvider serviceProvider) { holder = serviceProvider.GetRequiredService <SimConnectHolder>(); _logger = serviceProvider.GetRequiredService <ILogger <ControlzmoHub> >(); settables = serviceProvider .GetServices <ISettable>() .ToDictionary(settable => settable.GetId(), settable => settable); }
public SerializedExecutor(IServiceProvider sp) { _logging = sp.GetRequiredService <ILogger <SerializedExecutor> >(); holder = sp.GetRequiredService <SimConnectHolder>(); var thread = new Thread(new ThreadStart(OnStart)); thread.IsBackground = true; thread.Start(); }
public SerialPico(IServiceProvider serviceProvider) : base(serviceProvider) { _logger = serviceProvider.GetRequiredService <ILogger <SerialPico> >(); holder = serviceProvider.GetRequiredService <SimConnectHolder>(); inbound = serviceProvider.GetRequiredService <SerialInbound>(); _serialPort = new SerialPort(portName: "COM3", baudRate: 115200, parity: Parity.None, dataBits: 8); _serialPort.StopBits = StopBits.One; _serialPort.Handshake = Handshake.RequestToSend; _serialPort.DtrEnable = true; _serialPort.ReadTimeout = 10000; _serialPort.WriteTimeout = 10000; }
public AutothrustMode(IServiceProvider serviceProvider) : base(serviceProvider) { thrustLever1N1 = serviceProvider.GetRequiredService <ThrustLever1N1>(); thrustLever2N1 = serviceProvider.GetRequiredService <ThrustLever2N1>(); engine1N1 = serviceProvider.GetRequiredService <Engine1N1>(); engine2N1 = serviceProvider.GetRequiredService <Engine2N1>(); engine1N1.PropertyChanged += OnPropertyChanged; engine2N1.PropertyChanged += OnPropertyChanged; scHolder = serviceProvider.GetRequiredService <SimConnectHolder>(); hubContext = serviceProvider.GetRequiredService <IHubContext <ControlzmoHub, IControlzmoHub> >(); serviceProvider.GetRequiredService <RunwayCallsStateListener>().onGroundHandlers += OnGroundHandler; }
public FcuSystem(IServiceProvider sp) { this.scHolder = sp.GetRequiredService <SimConnectHolder>(); #region Speed this.speedSelectedListener = sp.GetRequiredService <FcuSpeedSelectedListener>(); this.speedModeSet = sp.GetRequiredService <FcuSpeedModeSet>(); this.speedIncrease = sp.GetRequiredService <FcuSpeedIncrease>(); this.speedDecrease = sp.GetRequiredService <FcuSpeedDecrease>(); #endregion #region Heading this.headingSelectedListener = sp.GetRequiredService <FcuHeadingSelectedListener>(); this.headingModeSet = sp.GetRequiredService <FcuHeadingModeSet>(); this.headingDecrease = sp.GetRequiredService <FcuHeadingDecrease>(); this.headingIncrease = sp.GetRequiredService <FcuHeadingIncrease>(); #endregion }
public ApuSystem(ApuToggle apuToggle, ApuStart apuStart, SimConnectHolder sch) { this.apuToggle = apuToggle; this.apuStart = apuStart; this.sch = sch; }
private readonly FSIMViewModel viewModel; //TODO: remove public FSIMTriggerHandler(FSIMTriggerBus triggerBus, SimConnectHolder scHolder, FSIMViewModel viewModel) { triggerBus.OnTrigger += OnTrigger; this.scHolder = scHolder; this.viewModel = viewModel; //TODO: remove this and do those things another way }