/// <summary> /// Initializes a new instance of the <see cref="ActiveSensorViewModel" /> class. /// </summary> /// <param name="logger">The logger.</param> /// <param name="setActiveSensorToDetect">The set active sensor to detect.</param> /// <param name="activeSensorEventHandler">The active sensor event handler.</param> /// <param name="canIsConnectedEventHandler">The can is connected event handler.</param> public ActiveSensorViewModel(ILogger logger, ISetActiveSensorToDetect setActiveSensorToDetect, IActiveSensorEventHandler activeSensorEventHandler, ICanIsConnectedEventHandler canIsConnectedEventHandler) { this.Logger = logger; this.SetActiveSensorToDetect = setActiveSensorToDetect; this.ActiveSensorEventHandler = activeSensorEventHandler; canIsConnectedEventHandler.EventIsReached += this.CanIsConnectedEventHandler_EventIsReached; this.ActiveSensorEventHandler.EventIsReached += this.ActiveSensorEventHandler_EventIsReached; this.SetSensorCommand = new RelayCommand(this.SetSensorCommandAction); this.LoadActiveSensorCommand = new RelayCommand(this.LoadActiveSensorCommandAction); IsEnabled = true; }
/// <summary> /// Initializes a new instance of the <see cref="HandleInputs" /> class. /// </summary> /// <param name="logger">The logger.</param> /// <param name="pulseEventHandler">The pulse event handler.</param> /// <param name="readCanMessage">The read can message.</param> /// <param name="inputBinaryEventHandler">The input binary event handler.</param> /// <param name="aliveEventHandler">The alive event handler.</param> /// <param name="getActualNodeId">The get actual node identifier.</param> /// <param name="channelConfigurationResponseEventHandler">The channel configuration response event handler.</param> /// <param name="canIsConnectedEventHandler">The can is connected event handler.</param> /// <param name="flipFlopEventHandler">The flip flop event handler.</param> /// <param name="activeSensorEventHandler">The active sensor event handler.</param> /// <param name="canTextEventHandler">The can text event handler.</param> /// <param name="textResponseEventHandler">The text response event handler.</param> /// <param name="analogEventHandler">The analog event handler.</param> public HandleInputs(ILogger logger, IPulseEventHandler pulseEventHandler, IReadCanMessage readCanMessage, IInputBinaryEventHandler inputBinaryEventHandler, IAliveEventHandler aliveEventHandler, IGetActualNodeId getActualNodeId, IChannelConfigurationResponseEventHandler channelConfigurationResponseEventHandler, ICanIsConnectedEventHandler canIsConnectedEventHandler, IFlipFlopEventHandler flipFlopEventHandler, IActiveSensorEventHandler activeSensorEventHandler, ICanTextEventHandler canTextEventHandler, ITextResponseEventHandler textResponseEventHandler, IAnalogEventHandler analogEventHandler) { this.Logger = logger; this.PulseEventHandler = pulseEventHandler; this.ReadCanMessage = readCanMessage; this.InputBinaryEventHandler = inputBinaryEventHandler; this.AliveEventHandler = aliveEventHandler; this.GetActualNodeId = getActualNodeId; this.ChannelConfigurationResponseEventHandler = channelConfigurationResponseEventHandler; this.CanIsConnectedEventHandler = canIsConnectedEventHandler; this.FlipFlopEventHandler = flipFlopEventHandler; this.ActiveSensorEventHandler = activeSensorEventHandler; this.CanTextEventHandler = canTextEventHandler; this.TextResponseEventHandler = textResponseEventHandler; this.AnalogEventHandler = analogEventHandler; }