Beispiel #1
0
        public override string SkylineRunnerArgs(ImportContext importContext, bool toPrint = false)
        {
            if (!IsSelected() || (importContext.ImportExisting && !importContext.ImportingLast()))
            {
                // Do not upload to Panorama if this we are importing existing documents and this is not the
                // last file being imported.
                return(string.Empty);
            }

            var passwdArg  = toPrint ? "" : string.Format("--panorama-password=\"{0}\"", DecryptPassword(Settings.PanoramaPassword));
            var uploadArgs = string.Format(
                " --panorama-server=\"{0}\" --panorama-folder=\"{1}\" --panorama-username=\"{2}\" {3}",
                Settings.PanoramaServerUrl,
                Settings.PanoramaFolder,
                Settings.PanoramaUserEmail,
                passwdArg);

            return(uploadArgs);
        }
Beispiel #2
0
        public override ProcessInfo RunAfter(ImportContext importContext)
        {
            string archiveArgs = null;
            var    currentDate = DateTime.Today;

            if (importContext.ImportExisting && importContext.ImportingLast())
            {
                // If we are importing existing files in the folder, create an archive (if required) of the
                // Skyline document AFTER importing the last results file.
                var oldestFileDate = importContext.GetOldestImportedFileDate(Settings.LastAcquiredFileDate);
                var today          = DateTime.Today;
                if (oldestFileDate.Year < today.Year || oldestFileDate.Month < today.Month)
                {
                    archiveArgs = GetArchiveArgs(currentDate.AddMonths(-1), currentDate);
                }
            }
            if (String.IsNullOrEmpty(archiveArgs))
            {
                return(null);
            }
            var args = string.Format("--in=\"{0}\" {1}", Settings.SkylineFilePath, archiveArgs);

            return(new ProcessInfo(AutoQCForm.SkylineRunnerPath, AutoQCForm.SKYLINE_RUNNER, args, args));
        }
        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());
        }
Beispiel #4
0
 public override ProcessInfo RunAfter(ImportContext importContext)
 {
     string archiveArgs = null;
     var currentDate = DateTime.Today;
     if (importContext.ImportExisting && importContext.ImportingLast())
     {
         // If we are importing existing files in the folder, create an archive (if required) of the
         // Skyline document AFTER importing the last results file.
         var oldestFileDate = importContext.GetOldestImportedFileDate(Settings.LastAcquiredFileDate);
         var today = DateTime.Today;
         if(oldestFileDate.Year < today.Year || oldestFileDate.Month < today.Month)
         {
             archiveArgs = GetArchiveArgs(currentDate.AddMonths(-1), currentDate);
         }
     }
     if (String.IsNullOrEmpty(archiveArgs))
     {
         return null;
     }
     var args = string.Format("--in=\"{0}\" {1}", Settings.SkylineFilePath, archiveArgs);
     return new ProcessInfo(AutoQCForm.SkylineRunnerPath, AutoQCForm.SKYLINE_RUNNER, args, args);
 }
        public override string SkylineRunnerArgs(ImportContext importContext, bool toPrint = false)
        {
            if (!IsSelected() || (importContext.ImportExisting && !importContext.ImportingLast()))
            {
                // Do not upload to Panorama if this we are importing existing documents and this is not the
                // last file being imported.
                return string.Empty;
            }

            var passwdArg = toPrint ? "" : string.Format("--panorama-password=\"{0}\"", DecryptPassword(Settings.PanoramaPassword));
            var uploadArgs = string.Format(
                    " --panorama-server=\"{0}\" --panorama-folder=\"{1}\" --panorama-username=\"{2}\" {3}",
                    Settings.PanoramaServerUrl,
                    Settings.PanoramaFolder,
                    Settings.PanoramaUserEmail,
                    passwdArg);
            return uploadArgs;
        }