Example #1
0
        public void InitializeTrack()
        {
            // Do we have overridden track settings?
            if (RaceDataStore.TrackSettings == null)
            {
                RaceDataStore.TrackSettings = new System.IO.Ports.SerialPort();
            }

            // Do we have track settings?
            if (_trackCommunication == null)
            {
                _trackCommunication = new TrackCommunication(RaceDataStore.TrackSettings);

                // Hook into the track's events
                _trackCommunication.OnTrackComplete += new TrackCommunication.OnTrackCompleteHandler(_trackCommunication_OnTrackComplete);
            }

            // Have we opened our serial port
            if (_trackCommunication.SerialPort.IsOpen == false)
            {
                _trackCommunication.OpenSerialPort();
            }
        }
        public void InitializeTrack()
        {
            // Do we have overridden track settings?
            if (RaceDataStore.TrackSettings == null)
            {
                RaceDataStore.TrackSettings = new System.IO.Ports.SerialPort();
            }

            // Do we have track settings?
            if (_trackCommunication == null)
            {
                _trackCommunication = new TrackCommunication(RaceDataStore.TrackSettings);

                // Hook into the track's events
                _trackCommunication.OnTrackComplete += new TrackCommunication.OnTrackCompleteHandler(_trackCommunication_OnTrackComplete);
            }

            // Have we opened our serial port
            if (_trackCommunication.SerialPort.IsOpen == false)
            {
                _trackCommunication.OpenSerialPort();
            }
        }