コード例 #1
0
 public DeviceConfigurationApiController(IDeviceFunctionService deviceFunctionService, DevicePluginService devicePluginService,
                                         DevicePluginPropertyService devicePluginPropertyService, IConfiguration configuration,
                                         IDeviceConfigurationService deviceConfigurationService)
 {
     _deviceFunctionService       = deviceFunctionService;
     _devicePluginService         = devicePluginService;
     _devicePluginPropertyService = devicePluginPropertyService;
     _configuration = configuration;
     _deviceConfigurationService = deviceConfigurationService;
 }
コード例 #2
0
 public DeviceController(IConfiguration configuration, DeviceManagementService deviceManagementService, IDeviceStateService deviceStateService,
                         IDeviceConfigurationService deviceConfigurationService, IDeviceFunctionService deviceFunctionService, DevicePluginService devicePluginService,
                         IDeviceService deviceService) : base(deviceService)
 {
     _deviceManagementService    = deviceManagementService;
     _deviceStateService         = deviceStateService;
     _deviceConfigurationService = deviceConfigurationService;
     _deviceFunctionService      = deviceFunctionService;
     _configuration       = configuration;
     _devicePluginService = devicePluginService;
 }
コード例 #3
0
 public DeviceModulesController(
     [NotNull] Container container,
     [NotNull] IDeviceConfigurationService deviceConfigurationService,
     [NotNull] IDeviceControllerFactory deviceControllerFactory,
     [NotNull] IUiInvoker uiInvoker)
 {
     _container = container ?? throw new ArgumentNullException(nameof(container));
     _deviceConfigurationService = deviceConfigurationService ?? throw new ArgumentNullException(nameof(deviceConfigurationService));
     _deviceControllerFactory    = deviceControllerFactory ?? throw new ArgumentNullException(nameof(deviceControllerFactory));
     _uiInvoker         = uiInvoker ?? throw new ArgumentNullException(nameof(uiInvoker));
     _deviceModules     = new Dictionary <Guid, WpfDeviceModule>();
     _deviceTypeModules = new Dictionary <Guid, DeviceTypeModule>();
 }
コード例 #4
0
 public MqttClientHost(IDeviceConfigurationService deviceConfigurationService, IMessageDisaptcher messageHandler, AppConfiguration appConfiguration)
 {
     _deviceConfigurationService = deviceConfigurationService ??
                                   throw new ArgumentNullException(nameof(deviceConfigurationService));
     _messageHandler   = messageHandler ?? throw new ArgumentNullException(nameof(messageHandler));
     _appConfiguration = appConfiguration ?? throw new ArgumentNullException(nameof(appConfiguration));
     _mqttClient       = new MqttFactory().CreateMqttClient();
     _options          = new MqttClientOptionsBuilder()
                         .WithTcpServer(_appConfiguration.MqttServerName, int.Parse(_appConfiguration.MqttServerPort))
                         .WithCredentials(_appConfiguration.MqttUser, _appConfiguration.MqttPass)
                         .WithKeepAlivePeriod(TimeSpan.FromSeconds(30))
                         .WithKeepAliveSendInterval(TimeSpan.FromSeconds(15))
                         .Build();
 }
コード例 #5
0
        public DeviceConfigsViewModel(
            [NotNull] ILogger logger,
            [NotNull] IDeviceConfigurationService configurationService,
            [NotNull] IDeviceModulesController deviceModulesController, [NotNull] IUiInvoker uiInvoker,
            [NotNull] ToastNotifications.Notifier notifier,
            [NotNull] IEventBus eventBus)
        {
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
            _configurationService    = configurationService ?? throw new ArgumentNullException(nameof(configurationService));
            _deviceModulesController = deviceModulesController ?? throw new ArgumentNullException(nameof(deviceModulesController));
            _uiInvoker = uiInvoker;
            _notifier  = notifier ?? throw new ArgumentNullException(nameof(notifier));
            _eventBus  = eventBus ?? throw new ArgumentNullException(nameof(eventBus));

            _deviceTypes = new Dictionary <Guid, DeviceTypeInfo>();
            _deviceInfos = new Dictionary <Guid, DeviceInfo>();
        }
コード例 #6
0
 public MessageDispatcher(IConnection connection, IDeviceConfigurationService deviceConfigService)
 {
     _connection = connection ?? throw new ArgumentNullException(nameof(connection));
     //TODO нужен кэш конфигураций и подписка на события для его актуализации, неправильно долбить сервис по сети на каждый запрос
     _deviceConfigService = deviceConfigService ?? throw new ArgumentNullException(nameof(deviceConfigService));
 }