/// <summary>
        /// Given a COM port, connect to USB Timing Box
        /// </summary>
        /// <param name="comPort">COM port to connect to</param>
        /// <returns>true, iff the connection attempt succeeds</returns>
        private bool Connect(string comPort)
        {
            byte port = byte.Parse(comPort.Substring(3));
            var  res  = rrActiveUsb.Connect(port);

            if (res)
            {
                Trace.WriteLine(string.Format("Successfully connected to race|result USB Timing Box @COM{0}.", port), Tools.TRACE_CATEGORY_INFO);
                Trace.WriteLine(string.Format("ID: {0}, HW: {1}, FW: {2}", rrActiveUsb.DecoderID, (float)rrActiveUsb.DecoderHardwareVersion / 10, (float)rrActiveUsb.DecoderFirmwareVersion / 10), Tools.TRACE_CATEGORY_INFO);
                rrActiveUsb.ResetPassings();
                rrActiveUsb.ChannelID = 1;

                return(true);
            }
            else
            {
                Trace.WriteLine(string.Format("Could not connect to race|result USB Timing Box @COM{0}.", port), Tools.TRACE_CATEGORY_ERROR);
                return(false);
            }
        }
Beispiel #2
0
 private void btnReset_Click(object sender, RoutedEventArgs e)
 {
     rrActiveUsb.ResetPassings();
 }