Exemplo n.º 1
0
        /// <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;
        }
Exemplo n.º 2
0
        /// <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;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Инициализация экземпляра класса для взаимодействия с роботом.
 /// </summary>
 /// <param name="communicationHelper">Уже проинициализированный экземпляр.</param>
 public void Initialize(CommunicationHelper communicationHelper)
 {
     this.communicationHelper = communicationHelper;
 }
Exemplo n.º 4
0
        /// <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);
        }
Exemplo n.º 5
0
        /// <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);
        }