コード例 #1
0
 /// <summary>
 /// Initializes an instance of the <see cref="KWLEC200Hub"/> class.
 /// </summary>
 /// <param name="kwlec200">The KWLEC200 instance.</param>
 /// <param name="logger">The application logger.</param>
 /// <param name="options">The application options.</param>
 public KWLEC200Hub(IKWLEC200 kwlec200,
                    ILogger <KWLEC200Hub> logger,
                    IOptions <AppSettings> options)
     : base(logger, options)
 {
     _kwlec200 = kwlec200;
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HealthCheck"/> class.
 /// </summary>
 /// <param name="kwlec200">The IKWLEC200 instance.</param>
 /// <param name="options">The application options.</param>
 /// <param name="logger">The application logger.</param>
 public HealthCheck(IKWLEC200 kwlec200,
                    IOptions <AppSettings> options,
                    ILogger <HealthCheck> logger)
     : base(logger, options)
 {
     _kwlec200 = kwlec200;
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="KWLEC200Controller"/> class.
 /// </summary>
 /// <param name="kwlec200">The KWLEC200 instance.</param>
 /// <param name="options">The application options.</param>
 /// <param name="logger">The application logger.</param>
 public KWLEC200Controller(IKWLEC200 kwlec200,
                           IOptions <AppSettings> options,
                           ILogger <KWLEC200Controller> logger)
     : base(logger, options)
 {
     _kwlec200 = kwlec200;
 }
コード例 #4
0
 /// <summary>
 /// Initializes an instance of the <see cref="KWLEC200Monitor"/> class.
 /// </summary>
 /// <param name="kwlec200">The KWLEC200 instance.</param>
 /// <param name="hub">The test data SignalR hub.</param>
 /// <param name="logger">The application logger.</param>
 /// <param name="options">The application options.</param>
 /// <param name="environment"></param>
 public KWLEC200Monitor(IKWLEC200 kwlec200,
                        IHubContext <KWLEC200Hub> hub,
                        ILogger <KWLEC200Monitor> logger,
                        IOptions <AppSettings> options,
                        IHostingEnvironment environment)
     : base(logger, options, environment)
 {
     _kwlec200 = kwlec200;
     _hub      = hub;
 }
コード例 #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ReadCommand"/> class.
        /// </summary>
        /// <param name="kwlec200">The KWLEC200 instance.</param>
        /// <param name="logger">The logger instance.</param>
        /// <param name="options">The setting options instance.</param>
        /// <param name="environment">The hosting environment instance.</param>
        public ReadCommand(IKWLEC200 kwlec200,
                           ILogger <InfoCommand> logger,
                           IOptions <AppSettings> options,
                           IHostingEnvironment environment)
            : base(logger, options, environment)
        {
            _logger?.LogDebug("ReadCommand()");

            // Setting the KWLEC200 instance.
            _kwlec200 = kwlec200;
        }
コード例 #6
0
ファイル: TestRead.cs プロジェクト: polytronicgr/HomeControl
        /// <summary>
        /// Initializes a new instance of the <see cref="TestRead"/> class.
        /// </summary>
        /// <param name="outputHelper"></param>
        public TestRead(KWLEC200Fixture fixture, ITestOutputHelper outputHelper)
        {
            // Set the default culture.
            CultureInfo.CurrentCulture = new CultureInfo("en-US");

            var loggerFactory = new LoggerFactory();

            loggerFactory.AddProvider(new XunitLoggerProvider(outputHelper));
            _logger = loggerFactory.CreateLogger <KWLEC200>();

            _kwlec200 = fixture.KWLEC200;
        }
コード例 #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RootCommand"/> class.
        /// The RootCommand sets default values for some properties using the application settings.
        /// </summary>
        /// <param name="kwlec200">The KWLEC200 instance.</param>
        /// <param name="logger">The logger instance.</param>
        /// <param name="options">The setting options instance.</param>
        /// <param name="environment">The hosting environment instance.</param>
        public RootCommand(IKWLEC200 kwlec200,
                           ILogger <RootCommand> logger,
                           IOptions <AppSettings> options,
                           IHostingEnvironment environment)
            : base(logger, options, environment)
        {
            _logger?.LogDebug("RootCommand()");

            // Setting default options from appsettings.json file.
            Address = _settings.TcpSlave.Address;
            Port    = _settings.TcpSlave.Port;
            SlaveID = _settings.TcpSlave.ID;

            // Setting the KWLEC200 instance.
            _kwlec200 = kwlec200;
        }