Ejemplo n.º 1
0
        //$GPHDT,123.456,T*00

        public MainForm()
        {
            InitializeComponent();

            comboBox_ports.Items.Clear();
            serial_worker = new SerialWorkerClass2(Application.StartupPath + @"\config.ini");
            serial_worker.AnswerReceived   = SerialPortReceivedHandler;
            serial_worker.SerialFailSignal = SerialFailSignal_function;

            string serial = serial_worker.settings_holder.GetSetting("SERIAL_SETTINGS", "serial");

            if (comboBox_ports.Items.Count == 0)
            {
                comboBox_ports.Items.Add(serial);
                comboBox_ports.SelectedItem = comboBox_ports.Items[0];                //нашелся хотя бы один порт
            }

            rotation_angles      = new euler_angles_class();
            game_rotation_angles = new euler_angles_class();
            rotation_angles_t1   = new euler_angles_class();

            mavlink_obj = new Mavlink();
            mavlink_obj.PacketReceived += new PacketReceivedEventHandler(ProcessRxMavlinkPacket);

            anglesDisplayRotation.update_name("Rotation vector");
            anglesDisplay1.update_name("Gyro vector");

            NMEAPublisherObj = new NMEAPublisherClass();
            NMEAPublisherObj.Start();
        }
Ejemplo n.º 2
0
        static MavlinkController()
        {
            mavlink = new Mavlink();
            mavlink.PacketReceived += Mavlink_PacketReceived;
            FlightData              = new FlightData();

            string portName = CustomSerialPort.GetPortNames()[0];

            serialPort = new SerialPort(portName, 115200, Parity.None, 8, StopBits.One);
            serialPort.DataReceived += SerialPort_DataReceived;
            serialPort.Open();
        }
Ejemplo n.º 3
0
        public void SendTest()
        {
            Mavlink      mavlink      = new Mavlink();
            Msg_attitude msg_Attitude = new Msg_attitude();

            msg_Attitude.roll = 1;
            MavlinkPacket packet = new MavlinkPacket(msg_Attitude);
            var           res    = mavlink.Send(packet);

            mavlink.PacketReceived += Mavlink_PacketReceived;
            mavlink.ParseBytes(res);
            Assert.AreNotEqual(mavlink.PacketsReceived, 0);
        }
Ejemplo n.º 4
0
        public override void OnCreate()
        {
            base.OnCreate();
            if (running == false)
            {
                Start("SPP-CA");
                running = true;

                mavlink_obj = new Mavlink();
                mavlink_obj.PacketReceived += new PacketReceivedEventHandler(ProcessRxMavlinkPacket);
            }

            ActivityMap.CalibrationAngleEvent += CalibAngleEvent;
            ActivityMap2.SetTargetAngleEvent  += SetTargetEvent;
        }
Ejemplo n.º 5
0
        public MainForm()
        {
            InitializeComponent();

            StateMachineUpdate(StateMachineStep.None);

            mavlink_packet             = new MavlinkPacket();
            mavlink_packet.ComponentId = (int)MAV_COMPONENT.MAV_COMP_ID_SYSTEM_CONTROL;
            mavlink_packet.SystemId    = 0xCE;

            mavlink = new Mavlink();
            mavlink.PacketReceived += mavlink_PacketReceived;


            byte[] ver = BitConverter.GetBytes(FIRMWARE_VERSION);

            Text = string.Format("AnySense {0}.{1}.{2} - Konfiguration Manager", ver[2], ver[1], ver[0]);
        }