/// <summary> /// Initializes a new instance of the FlashlightHelper class. /// </summary> /// <param name="communicationHelper"> /// Класс для взаимодействия с головой робота. /// </param> public FlashlightHelper(CommunicationHelper communicationHelper) { if (communicationHelper == null) { throw new ArgumentNullException("communicationHelper"); } this.communicationHelper = communicationHelper; }
/// <summary> /// Initializes a new instance of the GunHelper class. /// </summary> /// <param name="communicationHelper"> /// Объект для взаимодействия с головой робота. /// </param> /// <param name="controlSettings"> /// Опции управления роботом. /// </param> public GunHelper(CommunicationHelper communicationHelper, ControlSettings controlSettings) { if (communicationHelper == null) { throw new ArgumentNullException("communicationHelper"); } if (controlSettings == null) { throw new ArgumentNullException("controlSettingsHelper"); } this.communicationHelper = communicationHelper; this.controlSettings = controlSettings; }
/// <summary> /// Инициализация экземпляра класса для взаимодействия с роботом. /// </summary> /// <param name="communicationHelper">Уже проинициализированный экземпляр.</param> public void Initialize(CommunicationHelper communicationHelper) { this.communicationHelper = communicationHelper; }
/// <summary> /// Initialization of communication with robot through COM-port. /// </summary> private void InitializeComPortCommunication() { this.communicationHelper = new ComPortCommunicationHelper( this.settingsHelper.Settings.ComPort, this.settingsHelper.Settings.BaudRate, this.settingsHelper.Settings.SingleMessageRepetitionsCount); this.communicationHelper.TextReceived += this.OnTextReceived; this.commandProcessor = new CommandProcessor( this.textBoxSend, this.historyBox, this.communicationHelper, this.commandHistory); }
/// <summary> /// Initialization of communication with robot through UDP-socket. /// </summary> private void InitializeUdpCommunication() { this.communicationHelper = new UdpCommunicationHelper( this.settingsHelper.Settings.RoboHeadAddress, this.settingsHelper.Settings.UdpSendPort, this.settingsHelper.Settings.UdpReceivePort, this.settingsHelper.Settings.SingleMessageRepetitionsCount); this.communicationHelper.TextReceived += this.OnTextReceived; this.commandProcessor = new CommandProcessor( this.textBoxSend, this.historyBox, this.communicationHelper, this.commandHistory); }