Ejemplo n.º 1
0
        void ParamChanged()
        {
            ElementoOSD elem = (ElementoOSD)hud.getElement(Selected_Item);

            if (Selected_Item == (int)IkarusScreenConfig.Instrumento.NombreHUD)
            {
                hud.StrNombreHUD = textBoxParam.Text;
            }
            else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.Auxiliary)
            {
                elem.param = (byte)0;
                if (checkBoxAbsoluto.Checked)
                {
                    elem.param |= 1;
                }
                if (checkBoxOpaco.Checked)
                {
                    elem.param |= 2;
                }
                if (checkBoxServo.Checked)
                {
                    elem.param |= 4;
                }
            }
            else
            {
                int i = 0;
                if (int.TryParse(textBoxParam.Text, out i))
                {
                    elem.param = (byte)i;
                }
            }
            pictureBox1.Invalidate();
        }
Ejemplo n.º 2
0
        private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (Selected_Item >= 0)
            {
                ElementoOSD elem = (ElementoOSD)hud.getElement(Selected_Item);

                elem.tipo = (byte)comboBox3.SelectedIndex;
                pictureBox1.Invalidate();
                EnableInstrumentos();
            }
        }
Ejemplo n.º 3
0
        private void textBoxCol_TextChanged(object sender, EventArgs e)
        {
            int         i;
            ElementoOSD elem = (ElementoOSD)hud.getElement(Selected_Item);

            if (int.TryParse(textBoxCol.Text, out i))
            {
                elem.col = (sbyte)i;
            }
            pictureBox1.Invalidate();
        }
Ejemplo n.º 4
0
        void EnableInstrumentos()
        {
            ElementoOSD elem = (ElementoOSD)hud.getElement(Selected_Item);

            if (Selected_Item == (int)IkarusScreenConfig.Instrumento.Auxiliary)
            {
                checkBoxAbsoluto.Visible = true;
                checkBoxOpaco.Visible    = true;
                checkBoxServo.Visible    = true;
                label3.Visible           = false;
                textBoxParam.Visible     = false;
            }
            else
            {
                checkBoxAbsoluto.Visible = false;
                checkBoxOpaco.Visible    = false;
                checkBoxServo.Visible    = false;
                label3.Visible           = true;
                textBoxParam.Visible     = true;
            }

            if (elem.tipo == 0)
            {
                textBoxCol.Enabled   = false;
                textBoxFila.Enabled  = false;
                textBoxParam.Enabled = false;
                //label3.Text = "Parametro";

                checkBoxAbsoluto.Enabled = false;
                checkBoxOpaco.Enabled    = false;
                checkBoxServo.Enabled    = false;
                label3.Enabled           = false;
                textBoxParam.Enabled     = false;
                label2.Enabled           = false;
                label4.Enabled           = false;
            }
            else
            {
                textBoxCol.Enabled  = true;
                textBoxFila.Enabled = true;
                label2.Enabled      = true;
                label4.Enabled      = true;

                if (Selected_Item == (int)IkarusScreenConfig.Instrumento.V1_bar && elem.tipo == 1)
                {
                    label3.Text          = "Ancho";
                    label3.Enabled       = true;
                    textBoxParam.Enabled = true;
                }
                else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.V2_bar && elem.tipo == 1)
                {
                    label3.Text          = "Ancho";
                    label3.Enabled       = true;
                    textBoxParam.Enabled = true;
                }
                else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.Variometro && elem.tipo == 2)
                {
                    label3.Text          = "Fila 2";
                    label3.Enabled       = true;
                    textBoxParam.Enabled = true;
                }
                else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.Compas && elem.tipo == 2)
                {
                    label3.Text          = "Ancho";
                    label3.Enabled       = true;
                    textBoxParam.Enabled = true;
                }
                else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.Velocimetro && elem.tipo == 2)
                {
                    label3.Text          = "Alto";
                    label3.Enabled       = true;
                    textBoxParam.Enabled = true;
                }
                else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.Altimetro && elem.tipo == 2)
                {
                    label3.Text          = "Alto";
                    label3.Enabled       = true;
                    textBoxParam.Enabled = true;
                }
                else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.mAh && elem.tipo == 2)
                {
                    label3.Text          = "Ancho";
                    label3.Enabled       = true;
                    textBoxParam.Enabled = true;
                }
                else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.HorizonteArtificial)
                {
                    label3.Text          = "Tamaño";
                    label3.Enabled       = true;
                    textBoxParam.Enabled = true;
                }
                else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.NombreHUD)
                {
                    label3.Text          = "HUD Str";
                    label3.Enabled       = true;
                    textBoxParam.Enabled = true;
                }
                else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.Auxiliary)
                {
                    checkBoxAbsoluto.Enabled = true;
                    checkBoxOpaco.Enabled    = true;
                    checkBoxServo.Enabled    = true;
                }
                else
                {
                    label3.Text              = "Parametro";
                    textBoxParam.Enabled     = false;
                    checkBoxAbsoluto.Enabled = false;
                    checkBoxOpaco.Enabled    = false;
                    checkBoxServo.Enabled    = false;
                }
            }
        }
Ejemplo n.º 5
0
        void UpdateTextBoxes()
        {
            if (Selected_Item >= 0)
            {
                comboBox3.Enabled = true;
                comboBox3.Items.Clear();
                if (me.Idioma == 0)
                {
                    if (Selected_Item == (int)IkarusScreenConfig.Instrumento.Bearing)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "Texto", "On (1x2)", "On (2x4)", "Absoluto (TXT)" });
                    }
                    else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.Variometro)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "On (1ch)", "On (2ch)" });
                    }
                    else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.Compas)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "On (texto)", "On (Caza)" });
                    }
                    else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.Velocimetro)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "On (texto)", "On (Caza)" });
                    }
                    else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.Altimetro)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "On (texto)", "On (Caza)" });
                    }
                    else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.mAh)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "On (texto)", "On (Barra)" });
                    }
                    else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.Hora)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "On (HH:MM)", "On (HH:MM:SS)" });
                    }
                    else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.TiempoVuelo)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "On (HH:MM)", "ON (HH:MM:SS)", "On (texto)" });
                    }
                    else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.HorizonteArtificial)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "On (Modo 1)", "ON (Modo2)" });
                    }
                    else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.PosAntena)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "On (Modo 1)", "ON (Modo2)" });
                    }
                    else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.TotalDist)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "On (Breve)", "ON (Resumen)" });
                    }
                    else
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "Enable" });
                    }
                }
                else
                {
                    if (Selected_Item == (int)IkarusScreenConfig.Instrumento.Bearing)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "Texto", "On (1x2)", "On (2x4)", "Absolute (TXT)" });
                    }
                    else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.Variometro)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "On (1ch)", "On (2ch)" });
                    }
                    else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.Compas)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "On (texto)", "On (Caza)" });
                    }
                    else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.Velocimetro)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "On (texto)", "On (Caza)" });
                    }
                    else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.Altimetro)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "On (texto)", "On (Caza)" });
                    }
                    else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.mAh)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "On (texto)", "On (Barra)" });
                    }
                    else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.Hora)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "On (HH:MM)", "On (HH:MM:SS)" });
                    }
                    else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.TiempoVuelo)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "On (HH:MM)", "ON (HH:MM:SS)", "On (texto)" });
                    }
                    else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.HorizonteArtificial)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "On (Modo 1)", "ON (Modo2)" });
                    }
                    else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.PosAntena)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "On (Modo 1)", "ON (Modo2)" });
                    }
                    else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.TotalDist)
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "On (Breve)", "ON (Resumen)" });
                    }
                    else
                    {
                        comboBox3.Items.AddRange(new object[] { "Disable", "Enable" });
                    }
                }
                EnableInstrumentos();
                ElementoOSD elem = (ElementoOSD)hud.getElement(Selected_Item);

                if (elem.tipo < comboBox3.Items.Count)
                {
                    comboBox3.SelectedIndex = elem.tipo;
                }
                else
                {
                    comboBox3.SelectedIndex = 0;
                    elem.tipo = 0;
                }

                textBoxFila.Text = "" + elem.fila;
                textBoxCol.Text  = "" + elem.col;
                //textBoxParam.Enabled = false;

                if (Selected_Item == (int)IkarusScreenConfig.Instrumento.NombreHUD)
                {
                    textBoxParam.Text = hud.StrNombreHUD;
                }
                else if (Selected_Item == (int)IkarusScreenConfig.Instrumento.Auxiliary)
                {
                    checkBoxAbsoluto.Checked = ((elem.param & 1) != 0);
                    checkBoxOpaco.Checked    = ((elem.param & 2) != 0);
                    checkBoxServo.Checked    = ((elem.param & 4) != 0);
                }
                else
                {
                    textBoxParam.Text = "" + elem.param;
                }
            }
        }