Example #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;
            }
        }
Example #2
0
 void SaveFlash()
 {
     int[] slot4 = WflyUplink.CmdSaveFlash();
     if (wfly.IsOpen())
     {
         wfly.SetSlot(4, slot4);
     }
 }
Example #3
0
 void SetHome()
 {
     int[] slot4 = WflyUplink.CmdSetHome();
     if (wfly.IsOpen())
     {
         wfly.SetSlot(4, slot4);
     }
 }
Example #4
0
 void SetWptID(byte id)
 {
     int[] slot4 = WflyUplink.SetWptID(id);
     if (wfly.IsOpen())
     {
         wfly.SetSlot(4, slot4);
     }
 }
Example #5
0
 void SetDebugVar(byte id, float valor)
 {
     int[] slot4 = WflyUplink.SetDebugVar(id, valor);
     if (wfly.IsOpen())
     {
         wfly.SetSlot(4, slot4);
     }
 }
Example #6
0
 void SetAltitude(int altitud)
 {
     int[] slot1 = WflyUplink.SetAltura(altitud);
     if (wfly.IsOpen())
     {
         wfly.SetSlot(1, slot1);
     }
 }
Example #7
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);
     }
 }
Example #8
0
 void SetLonLat(float Longitude, float Latitude)
 {
     int[] slot2 = WflyUplink.SetLon(Longitude);
     int[] slot3 = WflyUplink.SetLat(Latitude);
     if (wfly.IsOpen())
     {
         wfly.SetSlot(2, slot2);
         wfly.SetSlot(3, slot3);
     }
 }