public AutoQCBackgroundWorker(IAppControl appControl, IProcessControl processControl, IAutoQCLogger logger) { _appControl = appControl; _processControl = processControl; _logger = logger; _fileWatcher = new AutoQCFileSystemWatcher(logger); }
private void RunConfiguration(object sender, DoWorkEventArgs e) { try { ChangeStatus(RunnerStatus.Starting); var originalPanoramaUrl = Config.PanoramaSettings.PanoramaServerUrl; Config.MainSettings.ValidateSettings(); Config.PanoramaSettings.ValidateSettings(); if (Config.PanoramaSettings.PublishToPanorama && !originalPanoramaUrl.Equals(Config.PanoramaSettings.PanoramaServerUrl)) { _uiControl.UpdatePanoramaServerUrl(Config); } // Thread.Sleep(2000); _fileWatcher = new AutoQCFileSystemWatcher(_logger, this); // Make sure "Integrate all" is checked in the Skyline settings if (!IsIntegrateAllChecked(_logger, Config.MainSettings)) { ChangeStatus(RunnerStatus.Error); return; } // Export a report from the Skyline document to get the most recent acquisition date on the results files // imported into the document. if (!ReadLastAcquiredFileDate(_logger, this)) { ChangeStatus(RunnerStatus.Error); return; } if (Config.PanoramaSettings.PublishToPanorama) { Log("Initializing Panorama pinger..."); _panoramaPinger = new PanoramaPinger(Config.PanoramaSettings, _logger); _panoramaPinger.Init(); } _fileWatcher.Init(Config); Log("Starting configuration..."); ChangeStatus(RunnerStatus.Running); if (ProcessExistingFiles(e)) { ProcessNewFiles(e); } e.Result = COMPLETED; } catch (ArgumentException x) { var err = new StringBuilder(string.Format("There was an error validating configuration \"{0}\"", Config.Name)); LogException(x, err.ToString()); ChangeStatus(RunnerStatus.Error); err.AppendLine().AppendLine().Append(x.Message); _uiControl.DisplayError("Configuration Validation Error", err.ToString()); } catch (FileWatcherException x) { var err = new StringBuilder(string.Format("There was an error looking for files for configuration \"{0}\".", Config.Name)); LogException(x, err.ToString()); ChangeStatus(RunnerStatus.Error); err.AppendLine().AppendLine().Append(x.Message); _uiControl.DisplayError("File Watcher Error", err.ToString()); } catch (Exception x) { LogException(x, string.Format("There was an error running configuration \"{0}\"", Config.Name)); ChangeStatus(RunnerStatus.Error); } }
public NetworkDriveUtil(AutoQCFileSystemWatcher fileSystemWatcher, IAutoQCLogger logger) { _fileSystemWatcher = fileSystemWatcher; _logger = logger; }