public override void makeElements() { for (int i = 0; i < 1; i++) { screenInputs.Add(null); // Initialize Inputs } for (int i = 0; i < 2; i++) { screenLabels.Add(null); // Initialize Labels } for (int i = 0; i < 5; i++) { screenIndicators.Add(null); // Initialize Indicators } for (int i = 0; i < 5; i++) { screenButtons.Add(null); // Initialize Buttons } screenInputs[0] = Helper.CreateInput(-2, -2, 1, 2); // Every page must have an input to capture keypresses on Unix // FDAI screenFDAI = new FDAI(); screenFDAI.Font = form.buttonFont; screenFDAI.Location = new Point(100, 0); screenFDAI.Size = new Size(form.ClientSize.Width - 100, form.ClientSize.Height); form.Controls.Add(screenFDAI); // MODE BUTTONS/INDICATORS screenLabels[0] = Helper.CreateLabel(2.5, 0, 4, 1, "MODE"); screenIndicators[0] = Helper.CreateIndicator(0, 1, 5, 1, "SURF"); screenButtons[0] = Helper.CreateButton(5, 1, 4, 1, ""); screenButtons[0].Click += (sender, e) => setMode(FDAIMode.SURF); screenIndicators[1] = Helper.CreateIndicator(0, 2, 5, 1, "INER"); screenButtons[1] = Helper.CreateButton(5, 2, 4, 1, ""); screenButtons[1].Click += (sender, e) => setMode(FDAIMode.INER); // RATE BUTTONS/INDICATORS screenLabels[1] = Helper.CreateLabel(0, 4, 9, 1, "E|R SCALE"); screenIndicators[2] = Helper.CreateIndicator(0, 5, 5, 1, "5|1"); screenButtons[2] = Helper.CreateButton(5, 5, 4, 1, ""); screenButtons[2].Click += (sender, e) => setScale(5, 1); screenIndicators[3] = Helper.CreateIndicator(0, 6, 5, 1, "5|5"); screenButtons[3] = Helper.CreateButton(5, 6, 4, 1, ""); screenButtons[3].Click += (sender, e) => setScale(5, 5); screenIndicators[4] = Helper.CreateIndicator(0, 7, 5, 1, "15|10"); screenButtons[4] = Helper.CreateButton(5, 7, 4, 1, ""); screenButtons[4].Click += (sender, e) => setScale(15, 10); // Load PySSSMQ-DATA loadPySSSMQData(); }
//abstract public void destroyStreams(); public void destroy() { lock (updateLock) { // Clear old lables foreach (Control label in screenLabels) { if (label != null) { label.Dispose(); } } screenLabels.Clear(); screenLabels.TrimExcess(); // Clear old Inputs foreach (TextBox box in screenInputs) { if (box != null) { box.Dispose(); } } screenInputs.Clear(); screenInputs.TrimExcess(); // Clear old Buttons foreach (MocrButton button in screenButtons) { if (button != null) { button.Dispose(); } } screenButtons.Clear(); screenButtons.TrimExcess(); // Clear old charts foreach (Plot chart in screenCharts) { if (chart != null) { chart.Dispose(); } } screenCharts.Clear(); screenCharts.TrimExcess(); // Clear old indicators foreach (Indicator indicator in screenIndicators) { if (indicator != null) { indicator.Dispose(); } } screenIndicators.Clear(); screenIndicators.TrimExcess(); // Clear old EngineIndicators foreach (EngineIndicator indicator in screenEngines) { if (indicator != null) { indicator.Dispose(); } } screenEngines.Clear(); screenEngines.TrimExcess(); // Clear old VerticalMeters foreach (VerticalMeter meter in screenVMeters) { if (meter != null) { meter.Dispose(); } } screenVMeters.Clear(); screenVMeters.TrimExcess(); // Clear old 7-segment displays foreach (SegDisp disp in screenSegDisps) { if (disp != null) { disp.Dispose(); } } screenSegDisps.Clear(); screenSegDisps.TrimExcess(); // Clear Drop Downs foreach (MocrDropdown drop in screenDropdowns) { if (drop != null) { drop.Dispose(); } } screenDropdowns.Clear(); screenDropdowns.TrimExcess(); // Clear Maps foreach (Map map in screenMaps) { if (map != null) { map.Dispose(); } } screenMaps.Clear(); screenMaps.TrimExcess(); // Clear Screws foreach (Screw screw in screenScrews) { if (screw != null) { screw.Dispose(); } } screenScrews.Clear(); screenScrews.TrimExcess(); // Clear EventIndicators foreach (EventIndicator indicator in screenEventIndicators) { if (indicator != null) { indicator.Dispose(); } } screenEventIndicators.Clear(); screenEventIndicators.TrimExcess(); // Clear ConsoleDigits foreach (ConsoleDigit digit in screenDigits) { if (digit != null) { digit.Dispose(); } } screenDigits.Clear(); screenDigits.TrimExcess(); // Clear misc controls foreach (Control control in screenControls) { if (control != null) { control.Dispose(); } } screenControls.Clear(); screenControls.TrimExcess(); // Clear old FDAI if (screenFDAI != null) { screenFDAI.Dispose(); screenFDAI = null; } // Clear old Orbit if (screenOrbit != null) { screenOrbit.Dispose(); screenOrbit = null; } // Clear all streams if (screenStreams != null) { screenStreams.CloseStreams(); screenStreams = null; } } }