Exemplo n.º 1
0
        public override void makeElements()
        {
            for (int i = 0; i < 4; i++)
            {
                screenScrews.Add(null);                                     // Initialize Screws
            }
            for (int i = 0; i < 20; i++)
            {
                screenLabels.Add(null);                                      // Initialize Labels
            }
            for (int i = 0; i < 60; i++)
            {
                screenButtons.Add(null);                                      // Initialize Buttons
            }
            for (int i = 0; i < 40; i++)
            {
                screenDigits.Add(null);                                      // Initialize Digits
            }
            for (int i = 0; i < 1; i++)
            {
                screenInputs.Add(null);                                     // Initialize Inputs
            }
            screenInputs[0] = Helper.CreateInput(-2, -2, 1, 2);             // Every page must have an input to capture keypresses on Unix

            screenLabels[0]      = Helper.CreateLabel(39, 8, 454, 29, "MANEUVER NODE CONFIGURATION", true, true);
            screenLabels[0].type = CustomLabel.LabelType.ENGRAVED;

            string[] digits = new string[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", " " };
            string[] signs  = new string[] { " ", "+", "-" };


            // NODE SELECT
            screenLabels[1] = Helper.CreateLabel(64, 45, 50, 19, "┌NODE┐", true, true);

            screenDigits[0] = Helper.CreateConsoleDigit(80, 64, digits, true);
            screenDigits[0].setDigID(10);

            screenButtons[0]        = Helper.CreateButton(78, 102, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[0].Click += (sender, e) => nextNode();
            screenButtons[1]        = Helper.CreateButton(78, 129, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[1].Click += (sender, e) => prevNode();

            // MET
            screenLabels[2] = Helper.CreateLabel(233, 45, 235, 19, "┌───── MET OF NODE ──────┐", true, true);
            screenLabels[3] = Helper.CreateLabel(326, 80, 9, 19, ":", true, true);
            screenLabels[4] = Helper.CreateLabel(393, 80, 9, 19, ":", true, true);

            screenDigits[1] = Helper.CreateConsoleDigit(244, 64, digits, true);
            screenDigits[1].setDigID(10);
            screenDigits[2] = Helper.CreateConsoleDigit(271, 64, digits, true);
            screenDigits[2].setDigID(10);
            screenDigits[3] = Helper.CreateConsoleDigit(298, 64, digits, true);
            screenDigits[3].setDigID(10);

            screenDigits[4] = Helper.CreateConsoleDigit(338, 64, digits, true);
            screenDigits[4].setDigID(10);
            screenDigits[5] = Helper.CreateConsoleDigit(365, 64, digits, true);
            screenDigits[5].setDigID(10);

            screenDigits[6] = Helper.CreateConsoleDigit(405, 64, digits, true);
            screenDigits[6].setDigID(10);
            screenDigits[7] = Helper.CreateConsoleDigit(432, 64, digits, true);
            screenDigits[7].setDigID(10);

            screenButtons[2]            = Helper.CreateButton(241, 102, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[2].MouseDown += (sender, e) => changeMET(360000);
            screenButtons[3]            = Helper.CreateButton(241, 129, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[3].MouseDown += (sender, e) => changeMET(-360000);

            screenButtons[4]            = Helper.CreateButton(268, 102, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[4].MouseDown += (sender, e) => changeMET(36000);
            screenButtons[5]            = Helper.CreateButton(268, 129, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[5].MouseDown += (sender, e) => changeMET(-36000);

            screenButtons[6]            = Helper.CreateButton(295, 102, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[6].MouseDown += (sender, e) => changeMET(3600);
            screenButtons[7]            = Helper.CreateButton(295, 129, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[7].MouseDown += (sender, e) => changeMET(-3600);

            screenButtons[8]            = Helper.CreateButton(335, 102, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[8].MouseDown += (sender, e) => changeMET(600);
            screenButtons[9]            = Helper.CreateButton(335, 129, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[9].MouseDown += (sender, e) => changeMET(-600);

            screenButtons[10]            = Helper.CreateButton(362, 102, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[10].MouseDown += (sender, e) => changeMET(60);
            screenButtons[11]            = Helper.CreateButton(362, 129, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[11].MouseDown += (sender, e) => changeMET(-60);

            screenButtons[12]            = Helper.CreateButton(402, 102, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[12].MouseDown += (sender, e) => changeMET(10);
            screenButtons[13]            = Helper.CreateButton(402, 129, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[13].MouseDown += (sender, e) => changeMET(-10);

            screenButtons[14]            = Helper.CreateButton(429, 102, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[14].MouseDown += (sender, e) => changeMET(1);
            screenButtons[15]            = Helper.CreateButton(429, 129, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[15].MouseDown += (sender, e) => changeMET(-1);


            // PRO/RETRO
            screenLabels[5] = Helper.CreateLabel(64, 161, 200, 19, "┌──── PRO/RETRO ─────┐", true, true);
            screenLabels[6] = Helper.CreateLabel(214, 202, 9, 19, ".", true, true);

            screenDigits[8] = Helper.CreateConsoleDigit(78, 180, signs, true);
            screenDigits[8].setDigID(10);
            screenDigits[9] = Helper.CreateConsoleDigit(105, 180, digits, true);
            screenDigits[9].setDigID(10);
            screenDigits[10] = Helper.CreateConsoleDigit(132, 180, digits, true);
            screenDigits[10].setDigID(10);
            screenDigits[11] = Helper.CreateConsoleDigit(159, 180, digits, true);
            screenDigits[11].setDigID(10);
            screenDigits[12] = Helper.CreateConsoleDigit(186, 180, digits, true);
            screenDigits[12].setDigID(10);
            screenDigits[13] = Helper.CreateConsoleDigit(226, 180, digits, true);
            screenDigits[13].setDigID(10);

            screenButtons[16]            = Helper.CreateButton(102, 218, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[16].MouseDown += (sender, e) => changeV(1000, "PRO");
            screenButtons[17]            = Helper.CreateButton(102, 245, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[17].MouseDown += (sender, e) => changeV(-1000, "PRO");
            screenButtons[18]            = Helper.CreateButton(129, 218, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[18].MouseDown += (sender, e) => changeV(100, "PRO");
            screenButtons[19]            = Helper.CreateButton(129, 245, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[19].MouseDown += (sender, e) => changeV(-100, "PRO");
            screenButtons[20]            = Helper.CreateButton(156, 218, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[20].MouseDown += (sender, e) => changeV(10, "PRO");
            screenButtons[21]            = Helper.CreateButton(156, 245, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[21].MouseDown += (sender, e) => changeV(-10, "PRO");
            screenButtons[22]            = Helper.CreateButton(183, 218, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[22].MouseDown += (sender, e) => changeV(1, "PRO");
            screenButtons[23]            = Helper.CreateButton(183, 245, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[23].MouseDown += (sender, e) => changeV(-1, "PRO");
            screenButtons[24]            = Helper.CreateButton(223, 218, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[24].MouseDown += (sender, e) => changeV(0.1, "PRO");
            screenButtons[25]            = Helper.CreateButton(223, 245, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[25].MouseDown += (sender, e) => changeV(-0.1, "PRO");



            // RAD/ANTIRAD
            screenLabels[7] = Helper.CreateLabel(268, 161, 200, 19, "┌─── RAD/ANTIRAD ────┐", true, true);
            screenLabels[8] = Helper.CreateLabel(418, 202, 9, 19, ".", true, true);

            screenDigits[14] = Helper.CreateConsoleDigit(282, 180, signs, true);
            screenDigits[14].setDigID(10);
            screenDigits[15] = Helper.CreateConsoleDigit(309, 180, digits, true);
            screenDigits[15].setDigID(10);
            screenDigits[16] = Helper.CreateConsoleDigit(336, 180, digits, true);
            screenDigits[16].setDigID(10);
            screenDigits[17] = Helper.CreateConsoleDigit(363, 180, digits, true);
            screenDigits[17].setDigID(10);
            screenDigits[18] = Helper.CreateConsoleDigit(390, 180, digits, true);
            screenDigits[18].setDigID(10);
            screenDigits[19] = Helper.CreateConsoleDigit(430, 180, digits, true);
            screenDigits[19].setDigID(10);

            screenButtons[26]            = Helper.CreateButton(306, 218, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[26].MouseDown += (sender, e) => changeV(1000, "RAD");
            screenButtons[27]            = Helper.CreateButton(306, 245, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[27].MouseDown += (sender, e) => changeV(-1000, "RAD");
            screenButtons[28]            = Helper.CreateButton(333, 218, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[28].MouseDown += (sender, e) => changeV(100, "RAD");
            screenButtons[29]            = Helper.CreateButton(333, 245, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[29].MouseDown += (sender, e) => changeV(-100, "RAD");
            screenButtons[30]            = Helper.CreateButton(360, 218, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[30].MouseDown += (sender, e) => changeV(10, "RAD");
            screenButtons[31]            = Helper.CreateButton(360, 245, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[31].MouseDown += (sender, e) => changeV(-10, "RAD");
            screenButtons[32]            = Helper.CreateButton(387, 218, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[32].MouseDown += (sender, e) => changeV(1, "RAD");
            screenButtons[33]            = Helper.CreateButton(387, 245, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[33].MouseDown += (sender, e) => changeV(-1, "RAD");
            screenButtons[34]            = Helper.CreateButton(427, 218, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[34].MouseDown += (sender, e) => changeV(0.1, "RAD");
            screenButtons[35]            = Helper.CreateButton(427, 245, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[35].MouseDown += (sender, e) => changeV(-0.1, "RAD");


            // NORMAL/ANTINORM
            screenLabels[9]  = Helper.CreateLabel(268, 276, 200, 19, "┌── NORN/ANTINORM ───┐", true, true);
            screenLabels[10] = Helper.CreateLabel(418, 317, 9, 19, ".", true, true);

            screenDigits[20] = Helper.CreateConsoleDigit(282, 295, signs, true);
            screenDigits[20].setDigID(10);
            screenDigits[21] = Helper.CreateConsoleDigit(309, 295, digits, true);
            screenDigits[21].setDigID(10);
            screenDigits[22] = Helper.CreateConsoleDigit(336, 295, digits, true);
            screenDigits[22].setDigID(10);
            screenDigits[23] = Helper.CreateConsoleDigit(363, 295, digits, true);
            screenDigits[23].setDigID(10);
            screenDigits[24] = Helper.CreateConsoleDigit(390, 295, digits, true);
            screenDigits[24].setDigID(10);
            screenDigits[25] = Helper.CreateConsoleDigit(430, 295, digits, true);
            screenDigits[25].setDigID(10);

            screenButtons[36]            = Helper.CreateButton(306, 333, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[36].MouseDown += (sender, e) => changeV(1000, "NORM");
            screenButtons[37]            = Helper.CreateButton(306, 360, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[37].MouseDown += (sender, e) => changeV(-1000, "NORM");
            screenButtons[38]            = Helper.CreateButton(333, 333, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[38].MouseDown += (sender, e) => changeV(100, "NORM");
            screenButtons[39]            = Helper.CreateButton(333, 360, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[39].MouseDown += (sender, e) => changeV(-100, "NORM");
            screenButtons[40]            = Helper.CreateButton(360, 333, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[40].MouseDown += (sender, e) => changeV(10, "NORM");
            screenButtons[41]            = Helper.CreateButton(360, 360, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[41].MouseDown += (sender, e) => changeV(-10, "NORM");
            screenButtons[42]            = Helper.CreateButton(387, 333, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[42].MouseDown += (sender, e) => changeV(1, "NORM");
            screenButtons[43]            = Helper.CreateButton(387, 360, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[43].MouseDown += (sender, e) => changeV(-1, "NORM");
            screenButtons[44]            = Helper.CreateButton(427, 333, 28, 28, "+", true, MocrButton.style.TINY_PUSH);
            screenButtons[44].MouseDown += (sender, e) => changeV(0.1, "NORM");
            screenButtons[45]            = Helper.CreateButton(427, 360, 28, 28, "-", true, MocrButton.style.TINY_PUSH);
            screenButtons[45].MouseDown += (sender, e) => changeV(-0.1, "NORM");


            // ADD/DELETE NODE
            screenButtons[50]             = Helper.CreateButton(130, 65, 84, 38, "ADD NODE", true);
            screenButtons[50].buttonStyle = MocrButton.style.LIGHT;
            screenButtons[50].Click      += (sender, e) => addNode(600);
            screenButtons[51]             = Helper.CreateButton(130, 105, 84, 38, "REM NODE", true);
            screenButtons[51].buttonStyle = MocrButton.style.LIGHT;
            screenButtons[51].Click      += (sender, e) => remNode();


            // SELECT TARGET

            /*
             * string[] targets = getTargetList(true);
             * screenDigits[28] = Helper.CreateConsoleDigit(78, 333, targets, true);
             * screenDigits[28].setDigID(0);
             * screenButtons[50] = Helper.CreateButton(223, 333, 28, 28, "+", true, Helper.ButtonType.TINY_PUSH);
             * screenButtons[50].MouseDown += (sender, e) => changeTarget(1);
             * screenButtons[51] = Helper.CreateButton(223, 360, 28, 28, "-", true, Helper.ButtonType.TINY_PUSH);
             * screenButtons[51].MouseDown += (sender, e) => changeTarget(-1);
             * /**/


            screenScrews[0] = Helper.CreateScrew(4, 71, true);
            screenScrews[1] = Helper.CreateScrew(500, 71, true);
            screenScrews[2] = Helper.CreateScrew(4, 295, true);
            screenScrews[3] = Helper.CreateScrew(500, 295, true);
        }