Ejemplo n.º 1
0
    public void ValueChangeCheck()
    {
        newText  = textBox.text;
        newValue = 10000;

        try{
            newValue = Convert.ToDouble(newText);
        }
                #pragma warning disable 0168
        catch (Exception e) {}
                #pragma warning restore 0168
        if (newValue <= 6378.137)
        {
            lib.setA(6378.137);
        }
        else if (newValue > 384372.282)
        {
            lib.setA(384372.281);
        }
        else
        {
            lib.setA(newValue);
        }
        if (pause.clicks == 1)
        {
        }
        else
        {
            reset.onButtonClick();
        }
    }
 public void addlitOmega()
 {
     perigeedouble = Convert.ToDouble(lib.getP());
     if (perigeedouble == 360.00)
     {
         perigeedouble = 5.00;
         perigee.text  = perigeedouble.ToString("N2");
     }
     else if (perigeedouble >= 355.00)
     {
         perigeedouble = 360.00;
         perigee.text  = perigeedouble.ToString("N2");
     }
     else if (perigee.text == "undef")
     {
     }
     else
     {
         perigeedouble += 5.00;
         perigee.text   = perigeedouble.ToString("N2");
     }
     if (pause.clicks == 1)
     {
     }
     else
     {
         reset.onButtonClick();
     }
 }
Ejemplo n.º 3
0
 public void addE()
 {
     eccentdouble = Convert.ToDouble(lib.getE());
     if (eccentdouble >= 0.900)
     {
         eccentdouble = 0.999;
         lib.setE(eccentdouble);
     }
     else
     {
         eccentdouble += 0.100;
         lib.setE(eccentdouble);
     }
     etoCompare       = 90.00;
     eccentricitytext = GameObject.Find("e").GetComponent <textBoxE>().textBox.text;
     if (eccentricitytext != lib.undef)
     {
         etoCompare = Convert.ToDouble(eccentricitytext);
     }
     itoCompare      = 90.00;
     inclinationtext = GameObject.Find("i").GetComponent <textBoxI>().textBox.text;
     if (inclinationtext != lib.undef)
     {
         itoCompare = Convert.ToDouble(inclinationtext);
     }
     if (itoCompare == 0.00 && etoCompare != 0)
     {
         GameObject.Find("argumentOfPerigeePackage").GetComponent <Text>().text = "Π";
         lib.setRundef();
         if (eccentricitytext == lib.undef)
         {
             lib.setP(90.00);
         }
     }
     else
     {
         lib.setP(90.00);
         GameObject.Find("argumentOfPerigeePackage").GetComponent <Text>().text = "ω";
     }
     if (itoCompare == 180 && GameObject.Find("bigOmega").GetComponent <textBoxBigOmega>().textBox.text == lib.undef)
     {
         lib.setR(90.00);
     }
     if (itoCompare != 0 && etoCompare == 0)
     {
         GameObject.Find("trueAnomalyPackage").GetComponent <Text>().text = "u";
     }
     else
     {
         GameObject.Find("trueAnomalyPackage").GetComponent <Text>().text = "v";
         lib.setP(90.00);
     }
     if (pause.clicks == 1)
     {
     }
     else
     {
         reset.onButtonClick();
     }
 }
Ejemplo n.º 4
0
 public void subBigOmega()
 {
     raandouble = Convert.ToDouble(lib.getR());
     if (raan.text == "undef")
     {
     }
     else if ((raandouble - 5) < 0)
     {
         lib.setR(355.0);
     }
     else if (raandouble <= 5.00)
     {
         lib.setR(0);
     }
     else
     {
         lib.setR(raandouble - 5.0);
     }
     if (pause.clicks == 1)
     {
     }
     else
     {
         reset.onButtonClick();
     }
 }
Ejemplo n.º 5
0
 public void sublitOmega()
 {
     perigeedouble = Convert.ToDouble(lib.getP());
     if (perigee.text == "undef")
     {
     }
     else if (perigeedouble == 0)
     {
         perigeedouble = 355.0;
         lib.setP(perigeedouble);
     }
     else if (perigeedouble <= 5.00)
     {
         perigeedouble = 0.00;
         lib.setP(perigeedouble);
     }
     else
     {
         perigeedouble -= 5.00;
         lib.setP(perigeedouble);
     }
     if (pause.clicks == 1)
     {
     }
     else
     {
         reset.onButtonClick();
     }
 }
Ejemplo n.º 6
0
 public void addBigOmega()
 {
     raandouble = Convert.ToDouble(lib.getR());
     if (raandouble == 360.00)
     {
         raandouble = 0.00;
         lib.setR(raandouble);
     }
     else if (raandouble >= 355.00)
     {
         raandouble = 0.00;
         lib.setR(raandouble);
     }
     else if (raan.text == "undef")
     {
     }
     else
     {
         raandouble += 5.00;
         lib.setR(raandouble);
     }
     if (pause.clicks == 1)
     {
     }
     else
     {
         reset.onButtonClick();
     }
 }
Ejemplo n.º 7
0
 public void addI()
 {
     inclinationdouble = Convert.ToDouble(lib.getI());
     if (inclinationdouble >= 175.00)
     {
         inclinationdouble = 180.00;
         lib.setI(inclinationdouble);
     }
     else
     {
         inclinationdouble = inclinationdouble + 5.00;
         lib.setI(inclinationdouble);
     }
     if (inclinationdouble > 0.00 && inclinationdouble != 180)
     {
         GameObject.Find("argumentOfPerigeePackage").GetComponent <Text>().text = "ω";
         lib.setR(90.0);
     }
     etoCompare       = 90.00;
     eccentricitytext = GameObject.Find("e").GetComponent <textBoxE>().textBox.text;
     if (eccentricitytext != lib.undef)
     {
         etoCompare = Convert.ToDouble(eccentricitytext);
     }
     if (etoCompare == 0 && inclinationdouble != 180)
     {
         GameObject.Find("trueAnomalyPackage").GetComponent <Text>().text = "u";
     }
     else if (etoCompare == 0 && (inclinationdouble == 180 || inclinationdouble == 0))
     {
         GameObject.Find("argumentOfPerigeePackage").GetComponent <Text>().text = "ω";
         GameObject.Find("trueAnomalyPackage").GetComponent <Text>().text       = "l";
         lib.setPundef();
         lib.setRundef();
     }
     else
     {
         GameObject.Find("trueAnomalyPackage").GetComponent <Text>().text = "v";
     }
     if (pause.clicks == 1)
     {
     }
     else
     {
         reset.onButtonClick();
     }
 }
Ejemplo n.º 8
0
    public void ValueChangeCheck()
    {
        newText  = textBox.text;
        newValue = 90.0;

        try
        {
            newValue = Convert.ToDouble(newText);
        }
        #pragma warning disable 0168
        catch (Exception e) {}
                #pragma warning restore 0168

        if (newValue < 0.00)
        {
            newValue = 0;
            lib.setR(newValue);
        }
        else if (newValue > 360.00)
        {
            newValue = 360;
            lib.setR(newValue);
        }
        else
        {
            lib.setR(newValue);
        }

        eccentricitytext = GameObject.Find("e").GetComponent <textBoxE>().textBox.text;
        etoCompare       = Convert.ToDouble(eccentricitytext);
        inclinationtext  = GameObject.Find("i").GetComponent <textBoxI>().textBox.text;
        itoCompare       = Convert.ToDouble(inclinationtext);

        if (etoCompare == 0 && itoCompare == 0)
        {
            lib.setRundef();
        }

        if (pause.clicks == 1)
        {
        }
        else
        {
            reset.onButtonClick();
        }
    }
Ejemplo n.º 9
0
 public void subI()
 {
     inclinationdouble = Convert.ToDouble(lib.getI());
     if (inclinationdouble <= 5.00)
     {
         inclinationdouble = 0.00;
         lib.setI(inclinationdouble);
     }
     else
     {
         inclinationdouble -= 5.00;
         lib.setI(inclinationdouble);
     }
     etoCompare       = 90.00;
     eccentricitytext = GameObject.Find("e").GetComponent <textBoxE>().textBox.text;
     if (eccentricitytext != lib.undef)
     {
         etoCompare = Convert.ToDouble(eccentricitytext);
     }
     if (inclinationdouble == 0.00 && etoCompare != 0)
     {
         GameObject.Find("argumentOfPerigeePackage").GetComponent <Text>().text = "Π";
         lib.setRundef();
     }
     else
     {
         GameObject.Find("argumentOfPerigeePackage").GetComponent <Text>().text = "ω";
     }
     if (etoCompare == 0 && inclinationdouble == 0)
     {
         GameObject.Find("trueAnomalyPackage").GetComponent <Text>().text = "l";
         lib.setPundef();
         lib.setRundef();
     }
     if (GameObject.Find("bigOmega").GetComponent <textBoxBigOmega>().textBox.text == lib.undef && inclinationdouble == 175)
     {
         lib.setR(90.00);
     }
     if (pause.clicks == 1)
     {
     }
     else
     {
         reset.onButtonClick();
     }
 }
Ejemplo n.º 10
0
 public void addA()
 {
     semimajordouble = Convert.ToDouble(lib.getA() * 290f);
     if (semimajordouble >= 384372.281) //max is 384472.282
     {
         lib.setA(semimajordouble);
     }
     else
     {
         lib.setA(semimajordouble + 100.000);
     }
     if (pause.clicks == 1)
     {
     }
     else
     {
         reset.onButtonClick();
     }
 }
Ejemplo n.º 11
0
 public void subA()
 {
     semimajordouble = Convert.ToDouble(lib.getA() * 290f);
     if (semimajordouble <= 6478.137) //min is 6378.137- radius of Earth
     {
         lib.setA(6478.137);
     }
     else
     {
         lib.setA(semimajordouble - 100.000);
     }
     if (pause.clicks == 1)
     {
     }
     else
     {
         reset.onButtonClick();
     }
 }
    public void buttonHit()
    {
        reset.onButtonClick();
        if (selected == 0)
        {
            lib.setA(10000); lib.setE(.01);
            lib.setI(45); lib.setR(90);
            lib.setP(90);
        }
        else if (selected == 1)
        {
            lib.setA(26845.637); lib.setE(0.0008830);
            lib.setI(54.9762); lib.setR(183.1958);
            lib.setP(206.1999); lib.setN(0.0008830);
        }
        else if (selected == 2)
        {
            lib.setA(42149.137); lib.setE(0.0009);
            lib.setI(4.3); lib.setR(0);
            lib.setP(90);
        }
        else if (selected == 3)
        {
            lib.setA(23237.137); lib.setE(0.7089928);
            lib.setI(62.5783); lib.setR(278.2967);
            lib.setP(282.6677);
        }
        else if (selected == 4)
        {
            lib.setA(7342.27); lib.setE(0.012);
            lib.setI(69); lib.setR(237.61);
            lib.setP(16.16);
        }
        else if (selected == 5)
        {
            lib.setA(6863.137); lib.setE(0.0009224);
            lib.setI(35.4259); lib.setR(32.4259);
            lib.setP(249.5203);
        }
        else if (selected == 6)
        {
            lib.setA(7100); lib.setE(0);
            lib.setI(24); lib.setR(0);
            lib.setPundef();

            GameObject.Find("trueAnomalyPackage").GetComponent <Text>().text = "u";
        }
        else if (selected == 7)
        {
            lib.setA(6600); lib.setE(0);
            lib.setI(90); lib.setR(0);
            lib.setPundef();

            GameObject.Find("trueAnomalyPackage").GetComponent <Text>().text = "u";
        }
        else if (selected == 8)
        {
            lib.setA(42164.137); lib.setE(0.0000628);
            lib.setI(0.0136); lib.setRundef();
            lib.setPundef();

            GameObject.Find("trueAnomalyPackage").GetComponent <Text>().text = "l";
        }
        else if (selected == 9)
        {
            lib.setA(6986.637); lib.setE(0.0007470);
            lib.setI(98.0692); lib.setR(54.6316);
            lib.setP(191.3684);
        }
        else if (selected == 10)
        {
            lib.setA(10000); lib.setE(0);
            lib.setI(0); lib.setRundef();
            lib.setPundef();

            GameObject.Find("trueAnomalyPackage").GetComponent <Text>().text = "l";
        }
        lib.setN(0);
    }
Ejemplo n.º 13
0
    public void ValueChangeCheck()
    {
        newText  = textBox.text;
        newValue = 0.01;

        try
        {
            newValue = Convert.ToDouble(newText);
        }
        #pragma warning disable 0168
        catch (Exception e) {}
                #pragma warning restore 0168

        if (newValue < 0.00)
        {
            newValue = 0;
            lib.setE(newValue);
        }
        else if (newValue > 0.999)
        {
            newValue = 0.999;
            lib.setE(newValue);
        }
        else
        {
            lib.setE(newValue);
        }

        etoCompare = 90.00;

        eccentricitytext = GameObject.Find("e").GetComponent <textBoxE>().textBox.text;
        if (eccentricitytext != lib.undef)
        {
            etoCompare = Convert.ToDouble(eccentricitytext);
        }

        itoCompare      = 90.00;
        inclinationtext = GameObject.Find("i").GetComponent <textBoxI>().textBox.text;
        if (inclinationtext != lib.undef)
        {
            itoCompare = Convert.ToDouble(inclinationtext);
        }

        if (itoCompare == 0.00 && etoCompare != 0)
        {
            GameObject.Find("argumentOfPerigeePackage").GetComponent <Text>().text = "Π";
            lib.setRundef();
        }
        else
        {
            GameObject.Find("argumentOfPerigeePackage").GetComponent <Text>().text = "ω";
        }

        if (etoCompare == 0 && itoCompare != 0)
        {
            GameObject.Find("trueAnomalyPackage").GetComponent <Text>().text = "u";
            lib.setPundef();
        }
        else
        {
            if (GameObject.Find("littleOmega").GetComponent <textBoxLittleOmega>().textBox.text == lib.undef)
            {
                lib.setP(90.00);
            }
            GameObject.Find("trueAnomalyPackage").GetComponent <Text>().text = "v";
        }

        if (etoCompare == 0 && itoCompare == 0 || etoCompare == 0 && itoCompare == 180)
        {
            GameObject.Find("trueAnomalyPackage").GetComponent <Text>().text = "l";
            lib.setPundef();
            lib.setRundef();
        }

        if (pause.clicks == 1)
        {
        }
        else
        {
            reset.onButtonClick();
        }
    }
    public void ValueChangeCheck()
    {
        newText  = textBox.text;
        newValue = 90.0;

        try
        {
            if (lib.checkP())
            {
                newValue = Convert.ToDouble(newText);
            }
        }
        #pragma warning disable 0168
        catch (Exception e) {}
                #pragma warning restore 0168

        if (newValue < 0.00)
        {
            newValue = 0;
            lib.setP(newValue);
        }
        else if (newValue > 360.00)
        {
            newValue = 360;
            lib.setP(newValue);
        }
        else
        {
            lib.setP(newValue);
        }
        etoCompare = 90.00;

        eccentricitytext = eT.text;
        if (eccentricitytext != lib.undef)
        {
            etoCompare = Convert.ToDouble(eccentricitytext);
        }

        itoCompare      = 90.00;
        inclinationtext = iT.text;
        if (inclinationtext != lib.undef)
        {
            itoCompare = Convert.ToDouble(inclinationtext);
        }


        if (etoCompare == 0.000)
        {
            lib.setPundef();
        }
        if (etoCompare == 0 && itoCompare == 0 || etoCompare == 0 && itoCompare == 180)
        {
            lib.setPundef();
            GameObject.Find("trueAnomalyPackage").GetComponent <Text>().text          = "l";
            GameObject.Find("bigOmega").GetComponent <textBoxBigOmega>().textBox.text = lib.undef;
        }

        if (pause.clicks == 1)
        {
        }
        else
        {
            reset.onButtonClick();
        }
    }