private void SendRequest() { while (true) { try { var chromatogramCache = ChorusSession.GenerateChromatograms(ChorusAccount, ChorusUrl, ChromatogramRequestDocument); if (null == chromatogramCache) { return; } var chromKeyIndiceses = chromatogramCache.GetChromKeys(ChorusUrl).ToList(); lock (this) { _chromatogramCache = chromatogramCache; _chromKeyIndiceses = chromKeyIndiceses; } return; } catch (Exception exception) { ChromTaskList.HandleException(exception); return; } } }
public ChorusScanProvider(string docFilePath, ChorusUrl chorusUrl, ChromSource source, IList <float> times, TransitionFullScanInfo[] transitions) { ChorusUrl = chorusUrl; DocFilePath = docFilePath; DataFilePath = chorusUrl; Source = source; Times = times; Transitions = transitions; ChorusAccount chorusAccount = ChorusUrl.FindChorusAccount(Settings.Default.RemoteAccountList); _chorusSession = new ChorusSession(chorusAccount); }
public ChromTaskList(Action checkCancelledAction, SrmDocument srmDocument, ChorusAccount chorusAccount, ChorusUrl chorusUrl, IEnumerable <ChromatogramRequestDocument> chromatogramRequestDocuments) { SrmDocument = srmDocument; ChorusSession = new ChorusSession(chorusAccount); _checkCancelledAction = checkCancelledAction; _chromatogramGeneratorTasks = new List <ChromatogramGeneratorTask>(); _chromKeys = new Dictionary <ChromKey, ChromatogramGeneratorTask>(); foreach (var chunk in chromatogramRequestDocuments) { ChromatogramGeneratorTask task = new ChromatogramGeneratorTask(this, chorusAccount, chorusUrl, chunk); _chromatogramGeneratorTasks.Add(task); foreach (ChromKey chromKey in ListChromKeys(chunk)) { _chromKeys[chromKey] = task; } } _executingTasks = new HashSet <ChromatogramGeneratorTask>(); }
public void HandleException(Exception exception) { var webException = exception as WebException; if (null != webException) { exception = ChorusSession.WrapWebException(webException); } lock (LockObj) { if (null != _exception) { return; } _exception = exception; ChorusSession.Abort(); Monitor.PulseAll(LockObj); } }