Skip to content

Commit

Permalink
Fixed counting
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin committed Mar 29, 2019
1 parent 9286d8f commit c8aeeda
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions Licor4300_Collect/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,15 @@ static void Main(string[] args)
var doc2 = new HtmlAgilityPack.HtmlDocument();

int groupCount = 0;
int allGroups = node.Descendants().Count();
int allGroups = 0;

foreach (var nNodeCnt in node.Descendants())
{
if (nNodeCnt.NodeType == HtmlNodeType.Element)
{
allGroups++;
}
}

foreach (var nNode in node.Descendants())
{
Expand All @@ -157,7 +165,7 @@ static void Main(string[] args)

groupCount++;

Console.WriteLine("Processing group: " + group + "("+groupCount+"/"+allGroups+")");
Console.WriteLine("Processing group: " + group + "("+groupCount+"/"+allGroups+")"+Environment.NewLine);
Directory.CreateDirectory(selectedPath + @"\" + group);


Expand Down Expand Up @@ -213,9 +221,17 @@ static void Main(string[] args)
string tmpResponseText2 = null;

int runCount = 0;
int allRuns = node2.Descendants().Count();
int allRuns = 0;

foreach (var nNode2Cnt in node2.Descendants())
{
if (nNode2Cnt.NodeType == HtmlNodeType.Element)
{
allRuns++;
}
}

foreach (var nNode2 in node2.Descendants())
foreach (var nNode2 in node2.Descendants())
{
if (nNode2.NodeType == HtmlNodeType.Element)
{
Expand All @@ -230,7 +246,7 @@ static void Main(string[] args)
runCount++;

//Console.WriteLine(" Processing scan: " + scan);
drawTextProgressBar(runCount, node2.Descendants().Count());
drawTextProgressBar(runCount, allRuns);
//Console.WriteLine(" Processing 700");

//Directory.CreateDirectory(selectedPath + @"LiCor4300\" + group + @"\" + scan);
Expand Down

0 comments on commit c8aeeda

Please sign in to comment.