Пример #1
0
        private void ReturnControlToPWM()
        {
            var message = new AngleControlMessage();

            try
            {
                var tcp = TcpConnect();

                tcp.Send(message.getBytes());

                tcp.Disconnect();
            }
            catch (Exception ex)
            {
                SetRichTextBox(richTextBox1, "Failed to send no control command to TCP server: " + ex.ToString());
            }
        }
Пример #2
0
        private void sendPosButton_Click(object sender, EventArgs e)
        {
            short roll  = Convert.ToInt16(setRollNumericUpDown.Value);
            short pitch = Convert.ToInt16(setPitchNumericUpDown.Value);
            short yaw   = Convert.ToInt16(setYawNumericUpDown.Value);

            var mode    = getCurrentControlMode();
            var message = new AngleControlMessage(pitch, roll, yaw, mode);

            try
            {
                var tcp = TcpConnect();

                tcp.Send(message.getBytes());

                tcp.Disconnect();
            }
            catch (Exception ex)
            {
                SetRichTextBox(richTextBox1, "Failed to send angle control command to TCP server: " + ex.ToString());
            }
        }