Exemplo n.º 1
0
        public void TestSkylineRunnerArgs()
        {
            const string skyFile = @"C:\Dummy\path\Test_file.sky";
            const string dataFile1 = @"C:\Dummy\path\Test1.raw";

            var logger = new TestLogger();
            var mainSettings = new MainSettings()
            {
                SkylineFilePath = skyFile,
                ResultsWindowString = MainSettings.ACCUM_TIME_WINDOW.ToString()
            };

            var mainSettingsTab = new MainSettingsTab(null, logger)
            {
                Settings = mainSettings
            };

            var accumulationWindow = MainSettingsTab.AccumulationWindow.Get(DateTime.Now, MainSettings.ACCUM_TIME_WINDOW);
            Assert.AreEqual(accumulationWindow.EndDate.Subtract(accumulationWindow.StartDate).Days + 1,
                MainSettings.ACCUM_TIME_WINDOW);

            var expected =
                string.Format("--in=\"{0}\" --remove-before={1} --import-file=\"{3}\" --import-on-or-after={2} --save", skyFile,
                    accumulationWindow.StartDate.ToShortDateString(),
                    accumulationWindow.StartDate.ToShortDateString(), dataFile1);

            var importContext = new ImportContext(dataFile1);
            Assert.IsFalse(importContext.ImportExisting);

            var args = mainSettingsTab.SkylineRunnerArgs(importContext);
            Assert.AreEqual(expected, args.Trim());
        }
        public void TestBackgroundWorker_ProcessNewFiles()
        {
            // Create a test directory to monitor
            var dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            Assert.IsNotNull(dir);
            var testDir = Path.Combine(dir, "TestBackgroundWorker");

            if (Directory.Exists(testDir))
            {
                Directory.Delete(testDir, true);
            }
            Assert.IsFalse(Directory.Exists(testDir));
            Directory.CreateDirectory(testDir);
            Assert.IsTrue(Directory.Exists(testDir));

            var appControl = new TestAppControl();
            var logger = new TestLogger();
            var processControl = new TestProcessControl(logger);
            var mainSettings = new MainSettings
            {
                FolderToWatch = testDir,
                InstrumentType = "NoInstrument",
                ResultsWindowString = "31",
                AcquisitionTimeString = "0"
            };

            // Start the background worker.
            var backgroundWorker = new AutoQCBackgroundWorker(appControl, processControl, logger);
            backgroundWorker.Start(mainSettings);
            Assert.IsTrue(backgroundWorker.IsRunning());

            // Create a new file in the test directory.
            Thread.Sleep(1000);
            CreateNewFile(testDir, "test1.txt");

            // Wait till the the file has been processed.
            while (!processControl.IsDone())
            {
                Thread.Sleep(500);
            }
            Assert.IsTrue(backgroundWorker.IsRunning());

            // Create another file in the test directory.
            Thread.Sleep(1000);
            CreateNewFile(testDir, "test2.txt");

            // Wait till the the file has been processed.
            // Process4 returns exit code 1 both times. This should stop the program.
            while (!processControl.IsDone())
            {
                Thread.Sleep(500);
            }

            // Assert.IsTrue(appControl.Waiting);
            Thread.Sleep(2 * AutoQCBackgroundWorker.WAIT_5SEC);
            Assert.IsTrue(appControl.Stopped);

            Assert.AreEqual(Regex.Replace(logger.GetLog(), @"\s+", ""),
                Regex.Replace(GetExpectedLog_ProcessNew(), @"\s+", ""));
        }
Exemplo n.º 3
0
 private static IResultFileStatus GetFileStatusChecker(MainSettings mainSettings)
 {
     if (mainSettings.InstrumentType.Equals(MainSettings.THERMO))
     {
         return(new XRawFileStatus(mainSettings.AcquisitionTime));
     }
     return(new AcquisitionTimeFileStatus(mainSettings.AcquisitionTime));
 }
Exemplo n.º 4
0
        public void TestGetLastArchivalDate()
        {
            var mainSettings = new MainSettings() { SkylineFilePath = @"C:\Dummy\path\Test_file.sky" };
            var mainSettingsTab = new MainSettingsTab(null, null) {Settings = mainSettings};
            var fsUtil = new TestFileSystemUtil();

            Assert.AreEqual(new DateTime(2015, 06, 01), mainSettingsTab.GetLastArchivalDate(fsUtil));
        }
Exemplo n.º 5
0
        public void Validate()
        {
            if (string.IsNullOrEmpty(Name))
            {
                throw new ArgumentException("Please enter a name for the configuration.");
            }

            MainSettings.ValidateSettings();
            PanoramaSettings.ValidateSettings();
        }
Exemplo n.º 6
0
        public static AutoQcConfig GetDefault()
        {
            var config = new AutoQcConfig
            {
                MainSettings     = MainSettings.GetDefault(),
                PanoramaSettings = PanoramaSettings.GetDefault()
            };

            return(config);
        }
Exemplo n.º 7
0
 public AutoQcConfig Copy()
 {
     return(new AutoQcConfig
     {
         Name = Name,
         IsEnabled = false, // Disable by default
         User = PanoramaSettings.PanoramaUserEmail,
         MainSettings = MainSettings.Copy(),
         PanoramaSettings = PanoramaSettings.Copy()
     });
 }
Exemplo n.º 8
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ IsEnabled.GetHashCode();
         hashCode = (hashCode * 397) ^ (MainSettings != null ? MainSettings.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (PanoramaSettings != null ? PanoramaSettings.GetHashCode() : 0);
         return(hashCode);
     }
 }
Exemplo n.º 9
0
 protected bool Equals(MainSettings other)
 {
     return(string.Equals(SkylineFilePath, other.SkylineFilePath) &&
            string.Equals(FolderToWatch, other.FolderToWatch) &&
            IncludeSubfolders == other.IncludeSubfolders &&
            Equals(QcFileFilter, other.QcFileFilter) &&
            ResultsWindow == other.ResultsWindow &&
            string.Equals(InstrumentType, other.InstrumentType) &&
            AcquisitionTime == other.AcquisitionTime &&
            LastAcquiredFileDate.Equals(other.LastAcquiredFileDate));
 }
Exemplo n.º 10
0
 public void WriteXml(XmlWriter writer)
 {
     writer.WriteStartElement("autoqc_config");
     writer.WriteAttribute(ATTR.name, Name);
     writer.WriteAttributeIfString(ATTR.user, User);
     writer.WriteAttributeIfString(ATTR.created, Created.ToShortDateString() + " " + Created.ToShortTimeString());
     writer.WriteAttributeIfString(ATTR.modified, Modified.ToShortDateString() + " " + Modified.ToShortTimeString());
     MainSettings.WriteXml(writer);
     PanoramaSettings.WriteXml(writer);
     writer.WriteEndElement();
 }
Exemplo n.º 11
0
 public void SetUIMainSettings(MainSettings mainSettings)
 {
     RunUI(() =>
     {
         textSkylinePath.Text                 = mainSettings.SkylineFilePath;
         textFolderToWatchPath.Text           = mainSettings.FolderToWatch;
         textResultsTimeWindow.Text           = mainSettings.ResultsWindowString;
         textAquisitionTime.Text              = mainSettings.AcquisitionTimeString;
         comboBoxInstrumentType.SelectedItem  = mainSettings.InstrumentType;
         comboBoxInstrumentType.SelectedIndex = comboBoxInstrumentType.FindStringExact(mainSettings.InstrumentType);
     });
 }
Exemplo n.º 12
0
        public static MainSettings GetDefault()
        {
            var settings = new MainSettings
            {
                InstrumentType  = THERMO,
                ResultsWindow   = ACCUM_TIME_WINDOW,
                AcquisitionTime = ACQUISITION_TIME,
                QcFileFilter    = FileFilter.GetFileFilter(AllFileFilter.NAME, string.Empty)
            };

            return(settings);
        }
Exemplo n.º 13
0
        private MainSettings GetMainSettingsFromUI()
        {
            var mainSettings = new MainSettings()
            {
                SkylineFilePath       = textSkylinePath.Text,
                FolderToWatch         = textFolderToWatchPath.Text,
                ResultsWindowString   = textResultsTimeWindow.Text,
                InstrumentType        = comboBoxInstrumentType.SelectedItem.ToString(),
                AcquisitionTimeString = textAquisitionTime.Text
            };

            return(mainSettings);
        }
Exemplo n.º 14
0
        private MainSettings GetMainSettingsFromUI()
        {
            var mainSettings = new MainSettings();

            mainSettings.SkylineFilePath   = textSkylinePath.Text;
            mainSettings.FolderToWatch     = textFolderToWatchPath.Text;
            mainSettings.IncludeSubfolders = includeSubfoldersCb.Checked;
            mainSettings.QcFileFilter      = FileFilter.GetFileFilter(comboBoxFileFilter.SelectedItem.ToString(),
                                                                      textQCFilePattern.Text);
            mainSettings.ResultsWindow   = ValidateIntTextField(textResultsTimeWindow.Text, "Results Window");
            mainSettings.InstrumentType  = comboBoxInstrumentType.SelectedItem.ToString();
            mainSettings.AcquisitionTime = ValidateIntTextField(textAquisitionTime.Text, "Acquisition Time");
            return(mainSettings);
        }
Exemplo n.º 15
0
        public bool IsIntegrateAllChecked(IAutoQcLogger logger, MainSettings mainSettings)
        {
            try
            {
                using (var stream = new FileStream(mainSettings.SkylineFilePath, FileMode.Open))
                {
                    using (XmlReader reader = XmlReader.Create(stream))
                    {
                        reader.MoveToContent();

                        var done = false;
                        while (reader.Read() && !done)
                        {
                            switch (reader.NodeType)
                            {
                            case XmlNodeType.Element:

                                if (reader.Name == "transition_integration")
                                {
                                    if (reader.MoveToAttribute("integrate_all"))
                                    {
                                        bool integrateAll;
                                        Boolean.TryParse(reader.Value, out integrateAll);
                                        return(integrateAll);
                                    }
                                    done = true;
                                }
                                break;

                            case XmlNodeType.EndElement:
                                if (reader.Name.Equals("transition_settings"))     // We have come too far
                                {
                                    done = true;
                                }
                                break;
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                logger.LogException(e, "Error reading file {0}.", mainSettings.SkylineFilePath);
                return(false);
            }
            logger.LogError("\"Integrate all\" is not checked for the Skyline document. This setting is under the \"Settings\" menu in Skyline, and should be checked for " +
                            " documents with QC results.");
            return(false);
        }
Exemplo n.º 16
0
 private void SetUIMainSettings(MainSettings mainSettings)
 {
     RunUI(() =>
     {
         textSkylinePath.Text                 = mainSettings.SkylineFilePath;
         textFolderToWatchPath.Text           = mainSettings.FolderToWatch;
         includeSubfoldersCb.Checked          = mainSettings.IncludeSubfolders;
         textQCFilePattern.Text               = mainSettings.QcFileFilter.Pattern;
         comboBoxFileFilter.SelectedItem      = mainSettings.QcFileFilter.Name();
         textResultsTimeWindow.Text           = mainSettings.ResultsWindow.ToString();
         textAquisitionTime.Text              = mainSettings.AcquisitionTime.ToString();
         comboBoxInstrumentType.SelectedItem  = mainSettings.InstrumentType;
         comboBoxInstrumentType.SelectedIndex = comboBoxInstrumentType.FindStringExact(mainSettings.InstrumentType);
     });
 }
Exemplo n.º 17
0
        public void Init(MainSettings mainSettings)
        {
            _dataFiles  = new ConcurrentQueue <string>();
            _retryFiles = new Queue <RawFile>();

            _fileStatusChecker = GetFileStatusChecker(mainSettings);

            _fileWatcher.EnableRaisingEvents = false;

            _fileWatcher.Filter = GetFileFilter(mainSettings.InstrumentType, out _dataInDirectories);

            _fileWatcher.Path = mainSettings.FolderToWatch;

            _acquisitionTimeSetting = mainSettings.AcquisitionTime;
        }
Exemplo n.º 18
0
        public static MainSettings InitializeFromDefaults()
        {
            var settings = new MainSettings
            {
                SkylineFilePath = Settings.Default.SkylineFilePath,
                FolderToWatch   = Settings.Default.FolderToWatch,
            };

            var accumWin = Settings.Default.ResultsWindow;

            settings.ResultsWindowString = accumWin == 0 ? ACCUM_TIME_WINDOW.ToString() : accumWin.ToString();

            var instrumentType = Settings.Default.InstrumentType;

            settings.InstrumentType = string.IsNullOrEmpty(instrumentType) ? THERMO : instrumentType;

            var acquisitionTime = Settings.Default.AcquisitionTime;

            settings.AcquisitionTimeString = acquisitionTime == 0 ? ACQUISITION_TIME.ToString() : acquisitionTime.ToString();

            return(settings);
        }
Exemplo n.º 19
0
        public void ReadXml(XmlReader reader)
        {
            Name = reader.GetAttribute(ATTR.name);

            // TODO: Configurations shouldn't start automatically when the program starts up.
            //       Remove this attribute from the config XML?
            IsEnabled = false; // reader.GetBoolAttribute(ATTR.is_enabled);
            User      = reader.GetAttribute(ATTR.user);
            DateTime dateTime;

            DateTime.TryParse(reader.GetAttribute(ATTR.created), out dateTime);
            Created = dateTime;
            DateTime.TryParse(reader.GetAttribute(ATTR.modified), out dateTime);
            Modified = dateTime;

            do
            {
                reader.Read();
            } while (reader.NodeType != XmlNodeType.Element);

            var mainSettings = new MainSettings();

            mainSettings.ReadXml(reader);
            MainSettings = mainSettings;
            do
            {
                reader.Read();
            } while (reader.NodeType != XmlNodeType.Element);

            var panoramaSettings = new PanoramaSettings();

            panoramaSettings.ReadXml(reader);
            PanoramaSettings = panoramaSettings;
            do
            {
                reader.Read();
            } while (reader.NodeType != XmlNodeType.EndElement);
        }
Exemplo n.º 20
0
        public void TestAddArchiveArgs()
        {
            var mainSettings = new MainSettings() { SkylineFilePath = @"C:\Dummy\path\Test_file.sky" };
            var mainSettingsTab = new MainSettingsTab(null, new TestLogger()) {Settings = mainSettings};
            var date = new DateTime(2015, 6, 17);
            mainSettingsTab.LastArchivalDate = date;

            var args = mainSettingsTab.GetArchiveArgs(mainSettingsTab.LastArchivalDate, date);
            Assert.IsNull(args);
            Assert.AreEqual(date, mainSettingsTab.LastArchivalDate);

            date = date.AddMonths(1); // 07/17/2015
            var archiveArg = string.Format("--share-zip={0}", "Test_file_2015_06.sky.zip");
            args = mainSettingsTab.GetArchiveArgs(mainSettingsTab.LastArchivalDate, date);
            Assert.AreEqual(archiveArg, args);
            Assert.AreEqual(date, mainSettingsTab.LastArchivalDate);

            date = date.AddYears(1); // 06/17/2016
            archiveArg = string.Format("--share-zip={0}", "Test_file_2015_07.sky.zip");
            args = mainSettingsTab.GetArchiveArgs(mainSettingsTab.LastArchivalDate, date);
            Assert.AreEqual(archiveArg, args);
            Assert.AreEqual(date, mainSettingsTab.LastArchivalDate);
        }
Exemplo n.º 21
0
        public void ReadXml(XmlReader reader)
        {
            Name = reader.GetAttribute(ATTR.name);

            IsEnabled = reader.GetBoolAttribute(ATTR.is_enabled);
            User      = reader.GetAttribute(ATTR.user);
            DateTime dateTime;

            DateTime.TryParse(reader.GetAttribute(ATTR.created), out dateTime);
            Created = dateTime;
            DateTime.TryParse(reader.GetAttribute(ATTR.modified), out dateTime);
            Modified = dateTime;

            do
            {
                reader.Read();
            } while (reader.NodeType != XmlNodeType.Element);

            var mainSettings = new MainSettings();

            mainSettings.ReadXml(reader);
            MainSettings = mainSettings;
            do
            {
                reader.Read();
            } while (reader.NodeType != XmlNodeType.Element);

            var panoramaSettings = new PanoramaSettings();

            panoramaSettings.ReadXml(reader);
            PanoramaSettings = panoramaSettings;
            do
            {
                reader.Read();
            } while (reader.NodeType != XmlNodeType.EndElement);
        }
Exemplo n.º 22
0
        public void Init(MainSettings mainSettings)
        {
            _dataFiles = new ConcurrentQueue<string>();
            _retryFiles = new Queue<RawFile>();

            _fileStatusChecker = GetFileStatusChecker(mainSettings);

            _fileWatcher.EnableRaisingEvents = false;

            _fileWatcher.Filter = GetFileFilter(mainSettings.InstrumentType);

            _fileWatcher.Path = mainSettings.FolderToWatch;

            _acquisitionTimeSetting = mainSettings.AcquisitionTime;
        }
Exemplo n.º 23
0
 private static IResultFileStatus GetFileStatusChecker(MainSettings mainSettings)
 {
     if (mainSettings.InstrumentType.Equals(MainSettings.THERMO))
     {
         return new XRawFileStatus(mainSettings.AcquisitionTime);
     }
     return new AcquisitionTimeFileStatus(mainSettings.AcquisitionTime);
 }
Exemplo n.º 24
0
        public override bool ValidateSettings()
        {
            LogOutput("Validating settings...");

            var mainSettingsUI = _appControl.GetUIMainSettings();

            var error = false;

            // Path to the Skyline file.
            var path = mainSettingsUI.SkylineFilePath;
            if (string.IsNullOrWhiteSpace(path))
            {
                LogErrorOutput("Please specify path to a Skyline file.");
                error = true;
            }
            else if (!File.Exists(path))
            {
                LogErrorOutput("Skyline file {0} does not exist.", path);
                error = true;
            }

            // Path to the folder to monitor for mass spec. results files
            path = mainSettingsUI.FolderToWatch;
            if (string.IsNullOrWhiteSpace(path))
            {
                LogErrorOutput("Please specify path to a folder where mass spec. files will be written.");
                error = true;
            }
            else if (!Directory.Exists(path))
            {
                LogErrorOutput("Folder {0} does not exist.", path);
                error = true;
            }

            // Results time window.
            var accumWin = mainSettingsUI.ResultsWindowString;
            if (string.IsNullOrWhiteSpace(accumWin))
            {
                LogErrorOutput("Please specify a value for the \"Accumulation time window\".");
                error = true;
            }
            else
            {
                int accumWindow;
                if (!Int32.TryParse(mainSettingsUI.ResultsWindowString, out accumWindow))
                {
                    LogErrorOutput("Invalid value for \"Accumulation time window\": {0}.",
                        mainSettingsUI.ResultsWindowString);
                    error = true;
                }
                else if (accumWindow < MainSettings.ACCUM_TIME_WINDOW)
                {
                    LogErrorOutput("\"Accumulation time window\" cannot be less than {0} days.", MainSettings.ACCUM_TIME_WINDOW);
                    error = true;
                }
            }

            // Expected acquisition time
            var aquisitionTime = mainSettingsUI.AcquisitionTimeString;
            if (string.IsNullOrWhiteSpace(aquisitionTime))
            {
                LogErrorOutput("Please specify a value for the \"Expected acquisition time\".");
                error = true;
            }
            else
            {
                int aAcquisitionTime;
                if (!Int32.TryParse(mainSettingsUI.AcquisitionTimeString, out aAcquisitionTime))
                {
                    LogErrorOutput("Invalid value for \"Expected acquisition time\": {0}.",
                        mainSettingsUI.AcquisitionTimeString);
                    error = true;
                }
            }
            if (!error) Settings = mainSettingsUI;
            return !error;
        }
Exemplo n.º 25
0
        public void TestValidateSettings()
        {
            var logger = new TestLogger();
            var mainControl = new TestAppControl();
            var mainSettingsTab = new MainSettingsTab(mainControl, logger);
            Assert.IsFalse(mainSettingsTab.ValidateSettings());
            var log = logger.GetLog();
            Assert.IsTrue(log.Contains("Please specify path to a Skyline file."));
            Assert.IsTrue(log.Contains("Please specify path to a folder where mass spec. files will be written."));
            Assert.IsTrue(log.Contains("Please specify a value for the \"Accumulation time window\"."));

            const string skyPath = "C:\\dummy\\path\\Test.sky";
            const string folderPath = "C:\\dummy\\path";
            var accumWindow = "not a number";

            var settings = new MainSettings()
            {
                SkylineFilePath = skyPath,
                FolderToWatch = folderPath,
                ResultsWindowString = "not a number",
                // ImportExistingFiles = false
            };
            mainControl = new TestAppControl();
            mainControl.SetUIMainSettings(settings);

            mainSettingsTab = new MainSettingsTab(mainControl, logger);
            logger.Clear();
            Assert.IsFalse(mainSettingsTab.ValidateSettings());
            log = logger.GetLog();
            Assert.IsTrue(log.Contains(string.Format("Skyline file {0} does not exist.", skyPath)));
            Assert.IsTrue(log.Contains(string.Format("Folder {0} does not exist.", folderPath)));
            Assert.IsTrue(log.Contains(string.Format("Invalid value for \"Accumulation time window\": {0}.", accumWindow)));

            accumWindow = "-1";
            settings.ResultsWindowString = accumWindow;
            logger.Clear();
            mainSettingsTab = new MainSettingsTab(mainControl, logger);
            Assert.IsFalse(mainSettingsTab.ValidateSettings());
            log = logger.GetLog();
            Assert.IsTrue(
                log.Contains(string.Format("\"Accumulation time window\" cannot be less than {0} days.",
                    MainSettings.ACCUM_TIME_WINDOW)));
        }
Exemplo n.º 26
0
 public MainSettingsTab(IAppControl appControl, IAutoQCLogger logger)
     : base(appControl, logger)
 {
     Settings = new MainSettings();
 }
Exemplo n.º 27
0
 private static IResultFileStatus GetFileStatusChecker(MainSettings mainSettings)
 {
     return(new AcquisitionTimeFileStatus(mainSettings.AcquisitionTime));
 }
Exemplo n.º 28
0
 public override void InitializeFromDefaultSettings()
 {
     Settings = MainSettings.InitializeFromDefaults();
     _appControl.SetUIMainSettings(Settings);
 }
Exemplo n.º 29
0
        public void TestSkylineRunnerArgsImportExisting()
        {
            const string skyFile = @"C:\Dummy\path\Test_file.sky";
            const string dataFile1 = @"C:\Dummy\path\Test1.raw";
            const string dataFile2 = @"C:\Dummy\path\Test2.raw";

            var logger = new TestLogger();
            var mainSettings = new MainSettings()
            {
                SkylineFilePath = skyFile,
                ResultsWindowString = MainSettings.ACCUM_TIME_WINDOW.ToString()
            };

            var mainSettingsTab = new MainSettingsTab(null, logger)
            {
                Settings = mainSettings
            };

            // Create an import context.
            var importContext = new ImportContext(new List<string>() { dataFile1, dataFile2 });
            Assert.IsTrue(importContext.ImportExisting);

            // Arguments for the first file.
            var expected =
                string.Format("--in=\"{0}\" --import-file=\"{1}\" --save", skyFile, dataFile1);
            importContext.GetNextFile();
            var args = mainSettingsTab.SkylineRunnerArgs(importContext);
            Assert.AreEqual(expected, args.Trim());

            // Arguments for the second file
            importContext.GetNextFile();
            Assert.IsTrue(importContext.ImportingLast());
            expected =
                string.Format("--in=\"{0}\" --import-file=\"{1}\" --save", skyFile, dataFile2);

            args = mainSettingsTab.SkylineRunnerArgs(importContext);
            Assert.AreEqual(expected, args.Trim());

            Assert.IsNull(importContext.GetNextFile());
        }
Exemplo n.º 30
0
 public override void InitializeFromDefaultSettings()
 {
     Settings = MainSettings.InitializeFromDefaults();
     _appControl.SetUIMainSettings(Settings);
 }
Exemplo n.º 31
0
 public void Start(MainSettings mainSettings)
 {
     _lastAcquiredFileDate = mainSettings.LastAcquiredFileDate;
     _fileWatcher.Init(mainSettings);
     ProcessFiles();
 }
Exemplo n.º 32
0
 public void SetUIMainSettings(MainSettings mainSettings)
 {
     _mainSettings = mainSettings;
 }
Exemplo n.º 33
0
        public static MainSettings InitializeFromDefaults()
        {
            var settings = new MainSettings
            {
                SkylineFilePath = Settings.Default.SkylineFilePath,
                FolderToWatch = Settings.Default.FolderToWatch,
            };

            var accumWin = Settings.Default.ResultsWindow;
            settings.ResultsWindowString = accumWin == 0 ? ACCUM_TIME_WINDOW.ToString() : accumWin.ToString();

            var instrumentType = Settings.Default.InstrumentType;
            settings.InstrumentType = string.IsNullOrEmpty(instrumentType) ? THERMO : instrumentType;

            var acquisitionTime = Settings.Default.AcquisitionTime;
            settings.AcquisitionTimeString = acquisitionTime == 0 ? ACQUISITION_TIME.ToString() : acquisitionTime.ToString();

            return settings;
        }
 public void Start(MainSettings mainSettings)
 {
     _lastAcquiredFileDate = mainSettings.LastAcquiredFileDate;
     _fileWatcher.Init(mainSettings);
     ProcessFiles();
 }
Exemplo n.º 35
0
 public MainSettingsTab(IAppControl appControl, IAutoQCLogger logger)
     : base(appControl, logger)
 {
     Settings = new MainSettings();
 }