-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathactivate_ion_counter
30 lines (30 loc) · 1.44 KB
/
activate_ion_counter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
///-------------------------------------------------------------------------------------------------------------------------------------------------------------
/// <summary>
/// Activate or deactivate counter cups.
/// </summary>
/// <param name="activate">If <c>true</c> then activate all counter; otherwise deactivate the counter cups.</param>
///-------------------------------------------------------------------------------------------------------------------------------------------------------------
private static void ActivateAllCounterCups(bool activate)
{
Instrument.SetCDDActivationMode(new CollectorActivationMode((activate == true) ? DetectorActivateMode.Standby : DetectorActivateMode.Off));
IRMSBaseCupConfigurationData activeCupData = Instrument.CupConfigurationDataList.GetActiveCupConfiguration();
foreach(IRMSBaseCollectorItem col in activeCupData.CollectorItemList)
{
if ((col.CollectorType == IRMSBaseCollectorType.CounterCup) && (col.Mass.HasValue == true))
{
col.Active = activate;
}
}
if (activate)
{
List<string> cupNames = activeCupData.CollectorItemList.Where(col => col.Active).Select(c => c.Appearance.Label).ToList();
if (cupNames.Count > 0)
{
Instrument.UnprotectRequiredCounterCups(cupNames);
}
}
else
{
Instrument.ProtectAllCounterCupsWithPostDelay(Instrument.BaseSettingsData.CounterProtectionPreDelay);
}
}