Exemple #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();
            //get the ip and port configuration
            string ip   = Configuration["Ip"];                // get the ip from appsettings.json
            int    port = Int32.Parse(Configuration["Port"]); // get the port from appsettings.json

            //Add the TelnetClient
            ITelnetClient tlc = new MyTelnetClient(ip, port);

            services.AddSingleton <ITelnetClient>(tlc);

            //Add singleton FlightGearClient
            IFlightGearClient fgc = new FlightGearClient(tlc);

            services.AddSingleton <IFlightGearClient>(fgc);
            //Strting going over the blocking queue
            fgc.Start();
        }
Exemple #2
0
 public CommandController(FlightGearClient client)
 {
     _client = client;
 }
Exemple #3
0
 public CommandController(IConfiguration conf)
 {
     this.client = FlightGearClient.GetFlightGearClient(conf);
 }
Exemple #4
0
 public CommandController(FlightGearClient client, IConfiguration configuration)
 {
     comm_thread = client;
     config      = configuration;
 }