Ejemplo n.º 1
0
 /// <summary>
 /// Implements the Dispose pattern.
 /// </summary>
 /// <param name="disposing">True if disposing, false if finalizing.</param>
 private void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (this.logger != null)
         {
             this.logger.Dispose();
             this.logger = null;
         }
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Open the ECU interface.
        /// </summary>
        /// <param name="name">Name of the serial port to use for ECU communication.</param>
        private void OpenEcuInterface(string name)
        {
            Trace("Lumberjack.OpenEcuInterface: " + name);

            if (name == SsmUtility.OpenPort20DisplayName)
            {
                name = SsmUtility.OpenPort20PortName;
                Trace("Lumberjack.OpenEcuInterface: rewrote name to: " + name);
            }

            string configurationDirectory = Lumberjack.GetConfigurationDirectory();

            this.logger           = SsmRecordingLogger.GetInstance(database, configurationDirectory, name, this.CreateLogWriter);
            this.logger.LogStart += this.OnLogStart;
            this.logger.LogEntry += this.OnLogEntry;
            this.logger.LogStop  += this.OnLogStop;
            this.logger.LogError += this.OnLogError;

            this.logger.BeginConnect(ConnectCallback, name);
        }