示例#1
0
        void ConfigurarCanales(EmisoraUSB wfly)
        {
            if (!configurado)
            {
                byte[] mask = new byte[11];
                for (int i = 0; i < mask.Length; i++)
                {
                    mask[i] = 0;
                }

                if (singleton.servo_ch[(int)Singleton.Canales.CTRL] < mask.Length)
                {
                    mask[singleton.servo_ch[(int)Singleton.Canales.CTRL]] = 2;

                    int[] slot0 = WflyUplink.SetSwitches(WflyUplink.Ruta.Casa, WflyUplink.Autopilot.Manual, _modem_hud, _modem_cam);
                    int[] slot1 = WflyUplink.SetAltura((int)_modem_alt);
                    int[] slot2 = WflyUplink.SetLon(_modem_lon);
                    int[] slot3 = WflyUplink.SetLat(modem_lat);
                    int[] slot4 = new int[0]; // WflyUplink.SetDebugVar(0xff, 0.0f);

                    int[] seq = new int[] { 0, 1, 0, 2, 0, 3, 0, 4 };

                    wfly.SetSlot(0, slot0);
                    wfly.SetSlot(1, slot1);
                    wfly.SetSlot(2, slot2);
                    wfly.SetSlot(3, slot3);
                    wfly.SetSlot(4, slot4);

                    wfly.SetSequence((int)Singleton.Canales.CTRL, 1, seq);
                }

                this.SetMasks(joy_enabled);
                configurado = true;
            }
        }
示例#2
0
 void SetSwitches(WflyUplink.Ruta ruta, WflyUplink.Autopilot autopilot, byte hud, bool cam)
 {
     int[] slot0 = WflyUplink.SetSwitches(ruta, autopilot, hud, cam);
     if (wfly.IsOpen())
     {
         wfly.SetSlot(0, slot0);
     }
 }