Esempio n. 1
0
        public virtual void ReportProgress()
        {
            if (Run.ScanSetCollection == null || Run.ScanSetCollection.ScanSetList.Count == 0)
            {
                return;
            }

            var userState = new ScanBasedProgressInfo(Run, Run.CurrentScanSet);

            var percentDone = _scanCounter / (float)(Run.ScanSetCollection.ScanSetList.Count) * 100;

            userState.PercentDone = percentDone;

            var logText = "Scan= " + Run.GetCurrentScanOrFrame() + "; PercentComplete= " +
                          percentDone.ToString("0.0");

            BackgroundWorker?.ReportProgress((int)percentDone, userState);

            if (_scanCounter % NumScansBetweenProgress == 0)
            {
                Logger.Instance.AddEntry(logText, true);

                if (BackgroundWorker == null)
                {
                    Console.WriteLine(DateTime.Now + "\t" + logText);
                }
            }
        }
        public override void ReportProgress()
        {
            if (Run.ScanSetCollection == null || Run.ScanSetCollection.ScanSetList.Count == 0)
            {
                return;
            }

            var userstate = new ScanBasedProgressInfo(Run, Run.CurrentScanSet, null);

            var percentDone = (float)(_scanCounter) / (float)(Run.ScanSetCollection.ScanSetList.Count) * 100;

            userstate.PercentDone = percentDone;

            var logText = "Scan/Frame= " + Run.GetCurrentScanOrFrame() + "; PercentComplete= " + percentDone.ToString("0.0") + "; AccumlatedFeatures= " + Run.ResultCollection.getTotalIsotopicProfiles();

            if (BackgroundWorker != null)
            {
                BackgroundWorker.ReportProgress((int)percentDone, userstate);
            }

            if (_scanCounter % NumScansBetweenProgress == 0 || mShowTraceMessages)
            {
                Logger.Instance.AddEntry(logText, Logger.Instance.OutputFilename);

                if (BackgroundWorker == null)
                {
                    Console.WriteLine(DateTime.Now + "\t" + logText);
                }
            }
        }
Esempio n. 3
0
        public virtual void ReportProgress()
        {
            if (Run.ScanSetCollection == null || Run.ScanSetCollection.ScanSetList.Count == 0)
            {
                return;
            }

            var userState = new ScanBasedProgressInfo(Run, Run.CurrentScanSet);

            var percentDone = (_datasetCounter + 1) / (float)(DatasetFileNameList.Count()) * 100;

            userState.PercentDone = percentDone;

            var logText = "Dataset= \t" + Run.DatasetName + "; PercentComplete= \t" + percentDone.ToString("0.0") + "; Total peaks= \t" + _peaksProcessedInLastDataset;

            BackgroundWorker?.ReportProgress((int)percentDone, userState);

            if (_datasetCounter % NumScansBetweenProgress == 0)
            {
                Logger.Instance.AddEntry(logText, true);

                if (BackgroundWorker == null)
                {
                    Console.WriteLine(DateTime.Now + "\t" + logText);
                }
            }
        }
        public virtual void ReportProgress()
        {
            if (Run.ScanSetCollection == null || Run.ScanSetCollection.ScanSetList.Count == 0)
            {
                return;
            }

            var userState = new ScanBasedProgressInfo(Run, Run.CurrentScanSet);

            var percentDone = _scanCounter / (float)(Run.ScanSetCollection.ScanSetList.Count) * 100;

            userState.PercentDone = percentDone;

            var progressMessage = GetProgressMessage(percentDone);

            BackgroundWorker?.ReportProgress((int)percentDone, userState);

            var reportProgress = _scanCounter % NumScansBetweenProgress == 0 ||
                                 DateTime.UtcNow.Subtract(_lastProgressTime).TotalMinutes > 5 ||
                                 mShowTraceMessages;

            if (!reportProgress)
            {
                return;
            }

            _lastProgressTime = DateTime.UtcNow;

            Logger.Instance.AddEntry(progressMessage, true);

            if (BackgroundWorker == null)
            {
                Console.WriteLine(DateTime.Now + "\t" + progressMessage);
            }
        }
 internal IMSScanBasedWorkflow(DeconToolsParameters parameters, Run run, string outputDirectoryPath = null, BackgroundWorker backgroundWorker = null)
     : base(parameters, run, outputDirectoryPath, backgroundWorker)
 {
     DeconTools.Utilities.Check.Require(run is UIMFRun, "Cannot create workflow. Run is required to be a UIMFRun for this type of workflow");
     mCachedProgressMessage = string.Empty;
     mCachedUserState       = new ScanBasedProgressInfo(Run, new ScanSet(), new IMSScanSet(0));
 }
Esempio n. 6
0
        public override void ReportProgress()
        {
            var uimfRun = (UIMFRun)Run;

            if (uimfRun.ScanSetCollection == null || uimfRun.ScanSetCollection.ScanSetList.Count == 0)
            {
                return;
            }

            var userstate = new ScanBasedProgressInfo(Run, uimfRun.CurrentScanSet, uimfRun.CurrentIMSScanSet);
            var framenum  = uimfRun.ScanSetCollection.ScanSetList.IndexOf(uimfRun.CurrentScanSet);

            var scanNum   = uimfRun.IMSScanSetCollection.ScanSetList.IndexOf(uimfRun.CurrentIMSScanSet);
            var scanTotal = uimfRun.IMSScanSetCollection.ScanSetList.Count;

            var frameTotal = uimfRun.ScanSetCollection.ScanSetList.Count;



            var percentDone = ((double)(framenum) / (double)frameTotal + ((double)scanNum / (double)scanTotal) / (double)frameTotal) * 100;

            userstate.PercentDone = (float)percentDone;


            var logText = "Scan/Frame= " + Run.GetCurrentScanOrFrame() + "; PercentComplete= " + percentDone.ToString("0.0") + "; AccumlatedFeatures= " + Run.ResultCollection.getTotalIsotopicProfiles();

            var numScansBetweenProgress = 1;

            var imsScanIsLastInFrame = uimfRun.IMSScanSetCollection.GetLastScanSet() == uimfRun.CurrentIMSScanSet.PrimaryScanNumber;

            if (imsScanIsLastInFrame)
            {
                Logger.Instance.AddEntry(logText, Logger.Instance.OutputFilename);
                Console.WriteLine(DateTime.Now + "\t" + logText);
            }

            if (BackgroundWorker != null && scanNum % numScansBetweenProgress == 0)
            {
                BackgroundWorker.ReportProgress((int)percentDone, userstate);
            }
        }
        public virtual void ReportProgress()
        {
            var uimfRun = (UIMFRun)Run;
            var imsScanIsLastInFrame = uimfRun.IMSScanSetCollection.GetLastScanSet() == uimfRun.CurrentIMSScanSet.PrimaryScanNumber;

            if (imsScanIsLastInFrame ||
                string.IsNullOrWhiteSpace(mCachedProgressMessage) ||
                DateTime.UtcNow.Subtract(mLastProgress).TotalSeconds >= 3)
            {
                if (uimfRun.ScanSetCollection == null || uimfRun.ScanSetCollection.ScanSetList.Count == 0)
                {
                    return;
                }

                mCachedUserState = new ScanBasedProgressInfo(Run, uimfRun.CurrentScanSet, uimfRun.CurrentIMSScanSet);
                var frameNum = uimfRun.ScanSetCollection.ScanSetList.IndexOf(uimfRun.CurrentScanSet);

                var scanNum   = uimfRun.IMSScanSetCollection.ScanSetList.IndexOf(uimfRun.CurrentIMSScanSet);
                var scanTotal = uimfRun.IMSScanSetCollection.ScanSetList.Count;

                var frameTotal = uimfRun.ScanSetCollection.ScanSetList.Count;

                var percentDone = (frameNum / (double)frameTotal + scanNum / (double)scanTotal / frameTotal) * 100;
                mCachedUserState.PercentDone = (float)percentDone;

                mCachedProgressMessage = GetProgressMessage(percentDone);
                mLastProgress          = DateTime.UtcNow;
            }

            if (imsScanIsLastInFrame)
            {
                Logger.Instance.AddEntry(mCachedProgressMessage, true);
                Console.WriteLine(DateTime.Now + "\t" + mCachedProgressMessage);
            }

            BackgroundWorker?.ReportProgress((int)mCachedUserState.PercentDone, mCachedUserState);
        }