Exemple #1
0
        public IRacingConnection(HostWindow window, DisplayConnection displayConnection)
        {
            this.hostWindow        = window;
            this.displayConnection = displayConnection;

            wrapper = new SdkWrapper();
            wrapper.TelemetryUpdated   += OnTelemetryUpdated;
            wrapper.SessionInfoUpdated += OnSessionInfoUpdated;
            wrapper.Connected          += OnWrapperConnected;
            wrapper.Disconnected       += OnWrapperDisconnected;
        }
Exemple #2
0
        private bool allowClose;       // ContextMenu's Exit command used


        public HostWindow()
        {
            InitializeComponent();

            displayConnection = new DisplayConnection(this);
            iracingConnection = new IRacingConnection(this, displayConnection);

            if (Properties.Settings.Default.AutoConnect)
            {
                autoConnectCheckbox.Checked = Properties.Settings.Default.AutoConnect;

                displayConnection.Open(Properties.Settings.Default.ComPort, Properties.Settings.Default.BaudRate);
                iracingConnection.Open(Properties.Settings.Default.RefreshRate);

                if (displayConnection.Connected())
                {
                    IracingStopped();
                    connectButton.Text = "Disconnect";
                }
            }
        }