public static void PlaceFullScan(IScans m_scans, Parameters parameters) { if (m_scans.PossibleParameters.Length == 0) { return; } ICustomScan scan = m_scans.CreateCustomScan(); scan.Values["FirstMass"] = parameters.FullScanSetting.MzRangeLowBound.ToString(); scan.Values["LastMass"] = parameters.FullScanSetting.MzRangeHighBound.ToString(); scan.Values["IsolationRangeLow"] = parameters.FullScanSetting.MzRangeLowBound.ToString(); scan.Values["IsolationRangeHigh"] = parameters.FullScanSetting.MzRangeHighBound.ToString(); scan.Values["MaxIT"] = parameters.FullScanSetting.MaxInjectTimeInMillisecond.ToString(); scan.Values["Resolution"] = parameters.FullScanSetting.Resolution.ToString(); scan.Values["Polarity"] = parameters.GeneralSetting.Polarity.ToString(); scan.Values["NCE"] = "0.0"; scan.Values["NCE_NormCharge"] = parameters.MS1IonSelecting.NormCharge.ToString(); scan.Values["NCE_SteppedEnergy"] = "0"; scan.Values["NCE_Factors"] = "[]"; scan.Values["SourceCID"] = parameters.GeneralSetting.SourceCID.ToString(); scan.Values["Microscans"] = parameters.FullScanSetting.Microscans.ToString(); scan.Values["AGC_Target"] = parameters.FullScanSetting.AgcTarget.ToString(); scan.Values["AGC_Mode"] = parameters.GeneralSetting.AGC_Mode.ToString(); scan.Values["MsxInjectRanges"] = "[]"; scan.Values["MsxInjectTargets"] = "[]"; scan.Values["MsxInjectMaxITs"] = "[]"; scan.Values["MsxInjectNCEs"] = "[]"; scan.Values["MsxInjectDirectCEs"] = "[]"; Console.WriteLine("{0:HH:mm:ss,fff} placing Full MS1 scan", DateTime.Now); m_scans.SetCustomScan(scan); }
/// <summary> /// Start a new custom scan. /// </summary> private void StartNewScan() { ICustomScan cs = m_scans.CreateCustomScan(); cs.RunningNumber = m_runningNumber++; // Allow an extra delay of 500 ms, we will answer as fast as possible, so this is a maximum value. cs.SingleProcessingDelay = 0.50D; // Toggle the polarity: m_polarity = (m_polarity == 0) ? 1 : 0; cs.Values["Polarity"] = m_polarity.ToString(NumberFormatInfo.InvariantInfo); try { DateTime now = Instrument.Now; if (!m_scans.SetCustomScan(cs)) { Console.WriteLine("NEW CUSTOM SCAN HAS NOT BEEN PLACED, CONNECTION TO SERVICE BROKEN."); } Console.WriteLine(now.ToString(Program.TimeFormat) + ": Placed a new custom scan(" + cs.RunningNumber + ")"); } catch (Exception e) { Console.WriteLine("PLACING A NEW SCAN: " + e.Message); } }
private ICustomScan baseMS1() { ICustomScan newscan = ScanManager.CreateCustomScan(); newscan.SingleProcessingDelay = 10.0D; newscan.Values["FirstMass"] = Parameters["MS1_FirstMass"]; newscan.Values["LastMass"] = Parameters["MS1_LastMass"]; newscan.Values["Polarity"] = Parameters["MS1_Polarity"]; newscan.Values["NCE"] = "0"; // Whether this is set seems to control whether its an MS1 or MS2. newscan.Values["Resolution"] = Parameters["MS1_Resolution"]; newscan.Values["AGC_Target"] = Parameters["MS1_AGC_Target"]; newscan.Values["MaxIT"] = Parameters["MS1_MaxIT"]; newscan.Values["Microscans"] = Parameters["MS1_Microscans"]; newscan.RunningNumber = ScanCount++; return(newscan); }
private void GenerateMS1() { ICustomScan newscan = ScanManager.CreateCustomScan(); newscan.SingleProcessingDelay = 10.0D; newscan.Values["FirstMass"] = Parameters["MS1_FirstMass"]; newscan.Values["LastMass"] = Parameters["MS1_LastMass"]; newscan.Values["Polarity"] = Parameters["MS1_Polarity"]; newscan.Values["NCE"] = "0"; // Whether this is set seems to control whether its an MS1 or MS2. newscan.Values["Resolution"] = Parameters["MS1_Resolution"]; newscan.Values["AGC_Target"] = Parameters["MS1_AGC_Target"]; newscan.Values["MaxIT"] = Parameters["MS1_MaxIT"]; newscan.Values["Microscans"] = Parameters["MS1_Microscans"]; newscan.RunningNumber = ScanCount++; ScanID.Add(newscan.RunningNumber, ScanType.MS1); //Console.WriteLine("Submitting |" + scanlabel + "| starting from " + sweep_mz.ToString() + " scan number " + current_scan_number); scan_queue.Enqueue(newscan); //log_write("Submitting MS1."); }
private void PlaceScan() { // If no information about possible settings are available yet or if we finished our job, we bail out. if ((m_scanId > 10) || (m_scans.PossibleParameters.Length == 0)) { return; } ICustomScan scan = m_scans.CreateCustomScan(); scan.RunningNumber = m_scanId++; scan.Values["Polarity"] = "1"; Console.WriteLine("{0:HH:mm:ss,fff} placing scan {1}", DateTime.Now, scan.RunningNumber); m_scans.SetCustomScan(scan); }
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); } }
public static void PlaceMS2Scan(IScans m_scans, Parameters parameters, List <double> dynamicBox) { if (m_scans.PossibleParameters.Length == 0) { return; } double Range = parameters.MS1IonSelecting.IsolationWindow; ICustomScan scan = m_scans.CreateCustomScan(); scan.Values["FirstMass"] = parameters.MS2ScanSetting.MS2MzRangeLowBound.ToString(); scan.Values["LastMass"] = parameters.MS2ScanSetting.MS2MzRangeHighBound.ToString(); //TO THINK: Dynamic range as MqLive? scan.Values["IsolationRangeLow"] = parameters.MS2ScanSetting.MS2MzRangeLowBound.ToString(); scan.Values["IsolationRangeHigh"] = parameters.MS2ScanSetting.MS2MzRangeLowBound.ToString(); scan.Values["Resolution"] = parameters.MS2ScanSetting.MS2Resolution.ToString(); scan.Values["MaxIT"] = parameters.MS2ScanSetting.MS2MaxInjectTimeInMillisecond.ToString(); scan.Values["Resolution"] = parameters.MS2ScanSetting.MS2Resolution.ToString(); scan.Values["Polarity"] = parameters.GeneralSetting.Polarity.ToString(); scan.Values["NCE"] = parameters.MS2ScanSetting.NCE.ToString(); scan.Values["NCE_NormCharge"] = parameters.MS1IonSelecting.NormCharge.ToString(); scan.Values["NCE_SteppedEnergy"] = "0"; if (parameters.MS2ScanSetting.NCE_factors != "null") { scan.Values["NCE_Factors"] = parameters.MS2ScanSetting.NCE_factors; } scan.Values["SourceCID"] = parameters.GeneralSetting.SourceCID.ToString("0.00"); scan.Values["Microscans"] = parameters.MS2ScanSetting.MS2MicroScans.ToString(); scan.Values["AGC_Target"] = parameters.MS2ScanSetting.MS2AgcTarget.ToString(); scan.Values["AGC_Mode"] = parameters.GeneralSetting.AGC_Mode.ToString(); string dynamicTargets; string dynamicMaxIts; var dynamicBoxString = BuildDynamicBoxInclusionString(parameters, dynamicBox, out dynamicTargets, out dynamicMaxIts); scan.Values["MsxInjectRanges"] = dynamicBoxString; scan.Values["MsxInjectTargets"] = dynamicTargets; scan.Values["MsxInjectMaxITs"] = dynamicMaxIts; scan.Values["MsxInjectNCEs"] = "[]"; scan.Values["MsxInjectDirectCEs"] = "[]"; Console.WriteLine("{0:HH:mm:ss,fff} placing data dependent ms2 scan {1}", DateTime.Now, dynamicBoxString); m_scans.SetCustomScan(scan); }
private void PlaceScan() { if (m_scanId > 10) { return; } ICustomScan scan = m_scans.CreateCustomScan(); scan.RunningNumber = m_scanId++; scan.Values["Polarity"] = "1"; if (m_scanId == 5) { // Let the instrument wait for a maximum of 500 seconds, which will not happen under normal circumstances. // Within that time, the instrument waits for placing a new scan scan.SingleProcessingDelay = 500; } Console.WriteLine("{0:HH:mm:ss,fff} placing scan {1}", DateTime.Now, scan.RunningNumber); m_scans.SetCustomScan(scan); }
//parameter Tuple<double, double, double> for each box start m/z, end m/z, m/z length public static void PlaceDynamicBoxCarScan(IScans m_scans, Parameters parameters, Tuple <double, double, double>[] dynamicBox) { if (m_scans.PossibleParameters.Length == 0) { return; } ICustomScan scan = m_scans.CreateCustomScan(); scan.Values["FirstMass"] = parameters.BoxCarScanSetting.BoxCarMzRangeLowBound.ToString(); scan.Values["LastMass"] = parameters.BoxCarScanSetting.BoxCarMzRangeHighBound.ToString(); scan.Values["IsolationRangeLow"] = (parameters.BoxCarScanSetting.BoxCarMzRangeLowBound - 200).ToString(); scan.Values["IsolationRangeHigh"] = (parameters.BoxCarScanSetting.BoxCarMzRangeHighBound + 200).ToString(); scan.Values["MaxIT"] = parameters.BoxCarScanSetting.BoxCarMaxInjectTimeInMillisecond.ToString(); scan.Values["Resolution"] = parameters.BoxCarScanSetting.BoxCarResolution.ToString(); scan.Values["Polarity"] = parameters.GeneralSetting.Polarity.ToString(); scan.Values["NCE"] = "0.0"; scan.Values["NCE_NormCharge"] = parameters.BoxCarScanSetting.BoxCarNormCharge.ToString(); scan.Values["NCE_SteppedEnergy"] = "0"; scan.Values["NCE_Factors"] = "[]"; scan.Values["SourceCID"] = parameters.GeneralSetting.SourceCID.ToString("0.00"); scan.Values["Microscans"] = parameters.BoxCarScanSetting.BoxCarMicroScans.ToString(); scan.Values["AGC_Target"] = parameters.BoxCarScanSetting.BoxCarAgcTarget.ToString(); scan.Values["AGC_Mode"] = parameters.GeneralSetting.AGC_Mode.ToString(); string dynamicTargets; string dynamicMaxIts; var dynamicBoxString = BuildDynamicBoxString(parameters, dynamicBox, out dynamicTargets, out dynamicMaxIts); scan.Values["MsxInjectRanges"] = dynamicBoxString; scan.Values["MsxInjectTargets"] = dynamicTargets; scan.Values["MsxInjectMaxITs"] = dynamicMaxIts; scan.Values["MsxInjectNCEs"] = "[]"; scan.Values["MsxInjectDirectCEs"] = "[]"; Console.WriteLine("{0:HH:mm:ss,fff} placing Dynamic BoxCar MS1 scan {1}", DateTime.Now, dynamicBoxString); m_scans.SetCustomScan(scan); }
void send_inaugural_scan() { ICustomScan scan = scanner.CreateCustomScan(); scan.SingleProcessingDelay = 5.0D; scan.Values["FirstMass"] = "345"; scan.Values["LastMass"] = "789"; scan.Values["Polarity"] = "0"; scan.Values["NCE"] = "0"; // Whether this is set seems to control whether its an MS1 or MS2. scan.Values["Resolution"] = "15000"; scan.Values["AGC_Target"] = "10000"; scan.Values["MaxIT"] = "10"; scan.Values["Microscans"] = "1"; can_submit_scan.WaitOne(); while (!scanner.SetCustomScan(scan)) { Thread.Sleep(5); } Console.WriteLine("Submitted starting scan."); }
public static void PlaceStaticBoxCarScan(IScans m_scans, Parameters parameters) { if (m_scans.PossibleParameters.Length == 0) { return; } ICustomScan scan = m_scans.CreateCustomScan(); scan.Values["FirstMass"] = parameters.BoxCarScanSetting.BoxCarMzRangeLowBound.ToString(); scan.Values["LastMass"] = parameters.BoxCarScanSetting.BoxCarMzRangeHighBound.ToString(); scan.Values["IsolationRangeLow"] = (parameters.BoxCarScanSetting.BoxCarMzRangeLowBound).ToString(); scan.Values["IsolationRangeHigh"] = (parameters.BoxCarScanSetting.BoxCarMzRangeHighBound).ToString(); scan.Values["MaxIT"] = parameters.BoxCarScanSetting.BoxCarMaxInjectTimeInMillisecond.ToString(); scan.Values["Resolution"] = parameters.BoxCarScanSetting.BoxCarResolution.ToString(); scan.Values["Polarity"] = parameters.GeneralSetting.Polarity.ToString(); scan.Values["NCE"] = "0.0"; scan.Values["NCE_NormCharge"] = parameters.BoxCarScanSetting.BoxCarNormCharge.ToString(); scan.Values["NCE_SteppedEnergy"] = "0"; scan.Values["NCE_Factors"] = "[]"; scan.Values["SourceCID"] = parameters.GeneralSetting.SourceCID.ToString("0.00"); scan.Values["Microscans"] = parameters.BoxCarScanSetting.BoxCarMicroScans.ToString(); scan.Values["AGC_Target"] = parameters.BoxCarScanSetting.BoxCarAgcTarget.ToString(); scan.Values["AGC_Mode"] = parameters.GeneralSetting.AGC_Mode.ToString(); scan.Values["MsxInjectTargets"] = StaticBoxCarScanTargets; scan.Values["MsxInjectMaxITs"] = StaticBoxCarScanMaxIts; scan.Values["MsxInjectNCEs"] = "[]"; scan.Values["MsxInjectDirectCEs"] = "[]"; for (int i = 0; i < parameters.BoxCarScanSetting.NumberOfBoxCarScans; i++) { scan.Values["MsxInjectRanges"] = StaticBoxCarScanRanges[i]; Console.WriteLine("{0:HH:mm:ss,fff} placing BoxCar MS1 scan", DateTime.Now); m_scans.SetCustomScan(scan); } }
public static void PlaceMS2Scan(IScans m_scans, Parameters parameters, double mz) { if (m_scans.PossibleParameters.Length == 0) { return; } double Range = parameters.MS1IonSelecting.IsolationWindow; string xl = (mz - Range).ToString("0.000"); string xh = (mz + Range).ToString("0.000"); if (mz - Range < 50.0) { Console.WriteLine("placing data dependent ms2 scan wrong, the Ms2MzRangeLowBound should larger than 50!!!"); return; } ICustomScan scan = m_scans.CreateCustomScan(); scan.Values["FirstMass"] = parameters.MS2ScanSetting.MS2MzRangeLowBound.ToString(); scan.Values["LastMass"] = parameters.MS2ScanSetting.MS2MzRangeHighBound.ToString(); //TO THINK: Dynamic range as MqLive? scan.Values["IsolationRangeLow"] = xl; scan.Values["IsolationRangeHigh"] = xh; scan.Values["Resolution"] = parameters.MS2ScanSetting.MS2Resolution.ToString(); scan.Values["MaxIT"] = parameters.MS2ScanSetting.MS2MaxInjectTimeInMillisecond.ToString(); scan.Values["Resolution"] = parameters.MS2ScanSetting.MS2Resolution.ToString(); scan.Values["Polarity"] = parameters.GeneralSetting.Polarity.ToString(); scan.Values["NCE"] = parameters.MS2ScanSetting.NCE.ToString(); scan.Values["NCE_NormCharge"] = parameters.MS1IonSelecting.NormCharge.ToString(); scan.Values["NCE_SteppedEnergy"] = "0"; if (parameters.MS2ScanSetting.NCE_factors != "null") { scan.Values["NCE_Factors"] = parameters.MS2ScanSetting.NCE_factors; } scan.Values["SourceCID"] = parameters.GeneralSetting.SourceCID.ToString("0.00"); scan.Values["Microscans"] = parameters.MS2ScanSetting.MS2MicroScans.ToString(); scan.Values["AGC_Target"] = parameters.MS2ScanSetting.MS2AgcTarget.ToString(); scan.Values["AGC_Mode"] = parameters.GeneralSetting.AGC_Mode.ToString(); scan.Values["MsxInjectRanges"] = "[]"; scan.Values["MsxInjectTargets"] = "[]"; scan.Values["MsxInjectMaxITs"] = "[]"; scan.Values["MsxInjectNCEs"] = "[]"; scan.Values["MsxInjectDirectCEs"] = "[]"; //Console.WriteLine("++++++++++++++++++"); //Console.WriteLine("Target Isolation Mass: {0}, {1}", xl, xh); //foreach (var v in scan.Values) //{ // Console.WriteLine(v); //} ////This is the code where we find all the scan settings. ////foreach (var item in m_scans.PossibleParameters) ////{ //// Console.WriteLine(item.Name + "----" + item.DefaultValue + "----" + item.Help + "----" + item.Selection); ////} Console.WriteLine("{0:HH:mm:ss,fff} placing data dependent ms2 scan {1}", DateTime.Now, mz); m_scans.SetCustomScan(scan); }