Example #1
0
        public void EditSettings(System.Windows.Forms.Control SettingsControl, System.Windows.Forms.IWin32Window owner = null)
        {
            if (_srvTelemetrySettings != null && _srvTelemetrySettings.IsDisposed)
            {
                _srvTelemetrySettings = null;
            }

            if (_srvTelemetrySettings == null)
            {
                _srvTelemetrySettings = new FormTelemetrySettings(_srvTelemetryWriter, VehicleTelemetry.TelemetryDescriptions, "SRV-", "SRV Telemetry Settings");
                _srvTelemetrySettings.SelectedReportsChanged += _srvTelemetrySettings_SelectedReportsChanged;;
                _srvTelemetrySettings.ExportToControlTag(SettingsControl);
                if (_srvTelemetryDisplay != null && !_srvTelemetryDisplay.IsDisposed)
                {
                    _srvTelemetryDisplay.Close();
                    _srvTelemetryDisplay = null;
                    _showTelemetryDisplayOnSettingsClose = true;
                    _srvTelemetrySettings.FormClosed    += _srvTelemetrySettings_FormClosed;
                }
            }
            if (!_srvTelemetrySettings.Visible)
            {
                _srvTelemetrySettings.Show(owner);
            }
        }
 private void _srvTelemetrySettings_SelectedReportsChanged(object sender, EventArgs e)
 {
     // We cannot update columns once first initialised, for some reason
     // So as a hack we'll just close and reopen the form
     if (_srvTelemetryDisplay != null && !_srvTelemetryDisplay.IsDisposed)
     {
         _srvTelemetryDisplay.Close();
         _srvTelemetryDisplay = null;
         DisplayTelemetry();
     }
 }
        public void HideTelemetry()
        {
            if (_srvTelemetryDisplay == null)
            {
                return;
            }

            if (!_srvTelemetryDisplay.IsDisposed)
            {
                _srvTelemetryDisplay.Close();
            }
            _srvTelemetryDisplay = null;
        }
Example #4
0
        public void DisplayTelemetry(System.Windows.Forms.IWin32Window owner = null)
        {
            if (_srvTelemetryWriter == null)
            {
                return;
            }

            if (_srvTelemetryDisplay == null || _srvTelemetryDisplay.IsDisposed)
            {
                _srvTelemetryDisplay = new FormTelemetryDisplay(_srvTelemetryWriter, "Commander Telemetry");
                //_srvTelemetryDisplay.FormClosing += _targetTelemetryDisplay_FormClosing;
                _srvTelemetryDisplay.InitialiseRows(TelemetryDescriptions);
                _srvTelemetryDisplay.UpdateTargetData(Telemetry());
                if (owner != null)
                {
                    _srvTelemetryDisplay.Show(owner);
                }
                else
                {
                    _srvTelemetryDisplay.Show();
                }
            }
            else if (!_srvTelemetryDisplay.Visible)
            {
                if (owner != null)
                {
                    _srvTelemetryDisplay.Show(owner);
                }
                else
                {
                    _srvTelemetryDisplay.Show();
                }
            }
            else
            {
                _srvTelemetryDisplay.Focus();
            }
        }