private void SubmitScan() { if (radioButton5.Checked) { IRepeatingScan rs = _scans.CreateRepeatingScan(); UpdateScan(rs); _scans.SetRepetitionScan(rs); } else if (radioButton6.Checked) { ICustomScan cs = _scans.CreateCustomScan(); cs.SingleProcessingDelay = (double)numericUpDown4.Value; UpdateScan(cs); _scans.SetCustomScan(cs); } }
/// <summary> /// Set a default repeating scan with a FirstMass of 400. /// </summary> /// <param name="access">used to get access to the needed IScans interface.</param> /// <param name="verbose">shall the output be verbose?</param> static internal bool SetRepeatingScan(IExactiveInstrumentAccess access, bool verbose) { try { using (IScans scans = access.Control.GetScans(false)) { bool parametersArrived = (scans.PossibleParameters.Length != 0); // Test if we have to wait for arrival of possible parameters: if (!parametersArrived) { EventHandler handler = (sender, args) => { parametersArrived = true; }; scans.PossibleParametersChanged += handler; DateTime end = DateTime.Now.AddSeconds(3); // Not elegant, but it works while (!parametersArrived && (DateTime.Now < end)) { // Sleep but perform COM communication in background. Thread.CurrentThread.Join(10); } scans.PossibleParametersChanged -= handler; // Fall into an error below if we didn't receive parameter descriptions. } DumpPossibleParameters(scans, verbose); IRepeatingScan scan = scans.CreateRepeatingScan(); scan.RunningNumber = 9999; scan.Values["FirstMass"] = "400"; if (scans.SetRepetitionScan(scan)) { return(true); } Console.WriteLine("SETTING A REPETITION SCAN HAS NOT BEEN DONE, CONNECTION TO SERVICE BROKEN."); } } catch (Exception e) { Console.WriteLine("SETTING A REPETITION SCAN: " + e.Message); } return(false); }
public bool SetRepetitionScan(IRepeatingScan scan) { throw new NotImplementedException(); }