public DeviceConfigurationApiController(IDeviceFunctionService deviceFunctionService, DevicePluginService devicePluginService, DevicePluginPropertyService devicePluginPropertyService, IConfiguration configuration, IDeviceConfigurationService deviceConfigurationService) { _deviceFunctionService = deviceFunctionService; _devicePluginService = devicePluginService; _devicePluginPropertyService = devicePluginPropertyService; _configuration = configuration; _deviceConfigurationService = deviceConfigurationService; }
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; }
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>(); }
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(); }
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>(); }
public MessageDispatcher(IConnection connection, IDeviceConfigurationService deviceConfigService) { _connection = connection ?? throw new ArgumentNullException(nameof(connection)); //TODO нужен кэш конфигураций и подписка на события для его актуализации, неправильно долбить сервис по сети на каждый запрос _deviceConfigService = deviceConfigService ?? throw new ArgumentNullException(nameof(deviceConfigService)); }