Exemple #1
0
        public override void makeElements()
        {
            for (int i = 0; i < 1; i++)
            {
                screenCharts.Add(null);                                     // Initialize Charts
            }
            for (int i = 0; i < 60; i++)
            {
                screenLabels.Add(null);                                      // Initialize Labels
            }
            for (int i = 0; i < 10; i++)
            {
                screenInputs.Add(null);                                      // Initialize Inputs
            }
            for (int i = 0; i < 10; i++)
            {
                screenButtons.Add(null);                                      // Initialize Buttons
            }
            for (int i = 0; i < 1; i++)
            {
                screenDropdowns.Add(null);                                     // Initialize Dropdowns
            }
            for (int i = 0; i < 1; i++)
            {
                screenCharts.Add(null);                                     // Initialize Chart
            }
            //screenInputs[0] = Helper.CreateInput(-2, -2, 1, 2); // Every page must have an input to capture keypresses on Unix

            screenLabels[0] = Helper.CreateLabel(39, 0, 42, 1, "============ FLIGHT DYNAMICS =============");

            screenLabels[1] = Helper.CreateLabel(16, 1, 13);            // Local Time
            screenLabels[2] = Helper.CreateLabel(0, 1, 14);             // MET Time
            screenLabels[3] = Helper.CreateLabel(32, 1, 15);            // UT Time

            // BURN DATA LABLES
            screenLabels[4]  = Helper.CreateLabel(0, 2, 120, 1, "── CURRENT ORBITS DATA ──┬─────────── BURN DATA ───────────┬────────────────────");
            screenLabels[5]  = Helper.CreateLabel(25, 3, 1, 1, "│");
            screenLabels[25] = Helper.CreateLabel(42, 3, 15, 1, "HRS   MIN   SEC");
            screenLabels[6]  = Helper.CreateLabel(25, 4, 1, 1, "│");
            screenLabels[26] = Helper.CreateLabel(36, 4, 4, 1, "TIG:");
            screenLabels[7]  = Helper.CreateLabel(25, 6, 32, 1, "│    [+]          [-]     ΔV M/S");
            screenLabels[8]  = Helper.CreateLabel(25, 7, 25, 1, "│  PROGRADE / RETROGRADE:");
            screenLabels[9]  = Helper.CreateLabel(25, 8, 25, 1, "│ RADIAL IN / RADIAL OUT:");
            screenLabels[10] = Helper.CreateLabel(25, 9, 25, 1, "│    NORMAL / ANTINORMAL:");

            screenLabels[11] = Helper.CreateLabel(25, 5, 11, 1, "│ ItCount: ");
            screenLabels[12] = Helper.CreateLabel(59, 3, 1, 1, "│");
            screenLabels[13] = Helper.CreateLabel(59, 4, 1, 1, "│");
            screenLabels[14] = Helper.CreateLabel(59, 5, 1, 1, "│");
            screenLabels[15] = Helper.CreateLabel(59, 6, 1, 1, "│");
            screenLabels[16] = Helper.CreateLabel(59, 7, 1, 1, "│");
            screenLabels[17] = Helper.CreateLabel(59, 8, 1, 1, "│");
            screenLabels[18] = Helper.CreateLabel(59, 9, 1, 1, "│");
            screenLabels[19] = Helper.CreateLabel(25, 10, 37, 1, "├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┴─┐");

            // BURN DATA INPUTS
            screenInputs[0]           = Helper.CreateInput(41, 4, 5, 1);   // HRS
            screenInputs[0].TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            screenInputs[0].Text      = "000";
            screenInputs[1]           = Helper.CreateInput(47, 4, 5, 1);   // MIN
            screenInputs[1].TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            screenInputs[1].Text      = "00";
            screenInputs[2]           = Helper.CreateInput(53, 4, 5, 1);   // SEC
            screenInputs[2].TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            screenInputs[2].Text      = "00.0";

            screenInputs[3]           = Helper.CreateInput(51, 7, 7, 1);   // Z
            screenInputs[3].TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            screenInputs[3].Text      = "0.0";
            screenInputs[4]           = Helper.CreateInput(51, 8, 7, 1);   // X
            screenInputs[4].TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            screenInputs[4].Text      = "0.0";
            screenInputs[5]           = Helper.CreateInput(51, 9, 7, 1);   // Y
            screenInputs[5].TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            screenInputs[5].Text      = "0.0";

            // DEBUG BURN VALUES
            screenLabels[20] = Helper.CreateLabel(25, 11, 35, 1, "");
            screenLabels[21] = Helper.CreateLabel(25, 12, 35, 1, "");
            screenLabels[22] = Helper.CreateLabel(25, 13, 35, 1, "");

            // ZOOM LABEL
            screenLabels[23] = Helper.CreateLabel(62, 1, 12, 1, "ZOOM: ");

            // ZOOM BUTTONS
            screenButtons[0]        = Helper.CreateButton(74, 1, 5, 1, "-5");
            screenButtons[0].Font   = form.buttonFont;
            screenButtons[0].Click += (sender, e) => changeZoom(sender, e, -5f);
            screenButtons[1]        = Helper.CreateButton(80, 1, 5, 1, "-1");
            screenButtons[1].Font   = form.buttonFont;
            screenButtons[1].Click += (sender, e) => changeZoom(sender, e, -1f);
            screenButtons[2]        = Helper.CreateButton(86, 1, 5, 1, "-.1");
            screenButtons[2].Font   = form.buttonFont;
            screenButtons[2].Click += (sender, e) => changeZoom(sender, e, -0.1f);
            screenButtons[3]        = Helper.CreateButton(92, 1, 5, 1, "+.1");
            screenButtons[3].Font   = form.buttonFont;
            screenButtons[3].Click += (sender, e) => changeZoom(sender, e, 0.1f);
            screenButtons[4]        = Helper.CreateButton(98, 1, 5, 1, "+1");
            screenButtons[4].Font   = form.buttonFont;
            screenButtons[4].Click += (sender, e) => changeZoom(sender, e, 1f);
            screenButtons[5]        = Helper.CreateButton(104, 1, 5, 1, "+5");
            screenButtons[5].Font   = form.buttonFont;
            screenButtons[5].Click += (sender, e) => changeZoom(sender, e, 5f);


            // ORBIT(S) INFO
            screenLabels[30] = Helper.CreateLabel(1, 4, 24, 1, "NEXT PERIAPSE: ");
            screenLabels[31] = Helper.CreateLabel(1, 5, 24, 1, "NEXT APOAPSE: ");

            screenLabels[32] = Helper.CreateLabel(1, 7, 24, 18, "");

            // TARGET
            screenLabels[40] = Helper.CreateLabel(25, 14, 37, 1, "├───────────── TARGET ──────────────┤");
            screenLabels[41] = Helper.CreateLabel(25, 15, 17, 1, "│ SELECT TARGET: ");
            screenLabels[42] = Helper.CreateLabel(61, 15, 1, 1, "│");
            screenLabels[43] = Helper.CreateLabel(25, 16, 37, 1, "│        ── BODY DISTANCE ──        │");
            screenLabels[44] = Helper.CreateLabel(25, 17, 37, 1, "│      VESSEL     MUN      DELTA    │");
            screenLabels[45] = Helper.CreateLabel(25, 18, 37, 1, "│ X:  20000000  20000000  20000000  │");
            screenLabels[46] = Helper.CreateLabel(25, 19, 37, 1, "│ Y:  20000000  20000000  20000000  │");
            screenLabels[47] = Helper.CreateLabel(25, 20, 37, 1, "│ Z:  20000000  20000000  20000000  │");
            screenLabels[48] = Helper.CreateLabel(25, 21, 37, 1, "│                                   │");
            screenLabels[49] = Helper.CreateLabel(25, 22, 37, 1, "│CURRENT TOTAL DISTANCE:  20000000  │");
            screenLabels[50] = Helper.CreateLabel(25, 23, 37, 1, "│                                   │");
            screenLabels[51] = Helper.CreateLabel(25, 24, 37, 1, "│      ── CLOSEST APPROACH ──       │");
            screenLabels[52] = Helper.CreateLabel(25, 25, 37, 1, "┘ MET:  000:00:00  DIST:  20000000  │");
            screenLabels[53] = Helper.CreateLabel(0, 25, 25, 1, "─────────────────────────");

            // Target dropdown
            screenDropdowns[0] = Helper.CreateDropdown(41, 15, 20, 1);
            screenDropdowns[0].DisplayMember = "Name";

            screenButtons[8]             = Helper.CreateButton(26, 3, 10, 1, "ITERATE 5");
            screenButtons[8].Font        = form.buttonFont;
            screenButtons[8].buttonStyle = MocrButton.style.THIN_BORDER_LIGHT;
            screenButtons[8].Click      += (sender, e) => iterateDistances(sender, e, 5);
            screenButtons[9]             = Helper.CreateButton(26, 4, 10, 1, "ITERATE 1");
            screenButtons[9].Font        = form.buttonFont;
            screenButtons[9].buttonStyle = MocrButton.style.THIN_BORDER_LIGHT;
            screenButtons[9].Click      += (sender, e) => iterateDistances(sender, e, 1);

            screenInputs[6]           = Helper.CreateInput(36, 5, 10, 1);   // Iteration Count
            screenInputs[6].TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            screenInputs[6].Text      = "30000";

            IList <CelestialBody> sats = body.Satellites;

            foreach (CelestialBody sat in sats)
            {
                screenDropdowns[0].Items.Add(sat);
            }

            // OrbitGraph
            screenOrbit = Helper.CreateOrbit(62, 3, 58, 23);
            IList <CelestialBody> bodySatellites = body.Satellites;

            //screenOrbit.setBody(body, bodyRadius, bodyName, bodySatellites);

            // Closest approach chart
            screenCharts[0] = Helper.CreatePlot(0, 26, 62, 14);
            screenCharts[0].setSeriesColor(0, Color.FromArgb(255, 0, 0, 255));
            screenCharts[0].setSeriesColor(1, Color.FromArgb(255, 0, 255, 0));

            // Plane chart (Z-diff from target)
            screenCharts[1] = Helper.CreatePlot(62, 26, 58, 14, 0, -1, -200000, 200000);
            screenCharts[1].setSeriesColor(0, Color.FromArgb(255, 0, 0, 255));
            screenCharts[1].setSeriesColor(1, Color.FromArgb(255, 0, 255, 0));
        }