예제 #1
0
        public ControlzmoHub(IServiceProvider serviceProvider)
        {
            holder  = serviceProvider.GetRequiredService <SimConnectHolder>();
            _logger = serviceProvider.GetRequiredService <ILogger <ControlzmoHub> >();

            settables = serviceProvider
                        .GetServices <ISettable>()
                        .ToDictionary(settable => settable.GetId(), settable => settable);
        }
예제 #2
0
        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();
        }
예제 #3
0
        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;
        }
예제 #4
0
        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;
        }
예제 #5
0
 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
 }
예제 #6
0
 public ApuSystem(ApuToggle apuToggle, ApuStart apuStart, SimConnectHolder sch)
 {
     this.apuToggle = apuToggle;
     this.apuStart  = apuStart;
     this.sch       = sch;
 }
예제 #7
0
        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
        }