Skip to content

Commit 5c468bf

Browse files
committed
Progress report in "xic"
1 parent 59075e0 commit 5c468bf

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

XIC/XicReader.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ public class XicReader
1919
public static void ReadXic(string rawFilePath, bool base64, XicData xicData, ref XicParameters parameters)
2020
{
2121
IRawDataPlus rawFile;
22+
int _xicCount = 0;
23+
2224
using (rawFile = RawFileReaderFactory.ReadFile(rawFilePath))
2325
{
2426
Log.Info($"Started parsing {rawFilePath}");
@@ -61,7 +63,15 @@ public static void ReadXic(string rawFilePath, bool base64, XicData xicData, ref
6163
xicData.OutputMeta.base64 = base64;
6264
xicData.OutputMeta.timeunit = "minutes";
6365

64-
foreach (var xicUnit in xicData.Content)
66+
67+
System.Timers.Timer tick = new System.Timers.Timer(2000);
68+
if (!parameters.stdout)
69+
{
70+
tick.Elapsed += (object sender, System.Timers.ElapsedEventArgs e) => Console.Out.Write("\rCompleted XIC {0} of {1}", _xicCount, xicData.Content.Count);
71+
tick.Start();
72+
}
73+
74+
foreach (var xicUnit in xicData.Content)
6575
{
6676
IChromatogramSettings settings = null;
6777
if (!xicUnit.Meta.MzStart.HasValue && !xicUnit.Meta.MzEnd.HasValue)
@@ -173,6 +183,14 @@ public static void ReadXic(string rawFilePath, bool base64, XicData xicData, ref
173183
parameters.NewWarn();
174184
}
175185
}
186+
187+
_xicCount++;
188+
}
189+
190+
if (!parameters.stdout)
191+
{
192+
tick.Stop();
193+
Console.Out.Write("\r");
176194
}
177195

178196
Log.Info($"Finished parsing {rawFilePath}");

0 commit comments

Comments
 (0)