Skip to content

Commit d64ef3a

Browse files
committed
Merge branch 'develop' of https://github.com/JetStream96/QSimPlanner into develop
2 parents 7527cca + 2059527 commit d64ef3a

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/QSP/WindAloft/GribDownloader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class GribDownloader
1717
/// <exception cref="Exception"></exception>
1818
public void DownloadGribFile(string filePath)
1919
{
20-
var x = LastestDataSetFinder.Find();
20+
var x = LastestDataSetFinder.Find(HomePageUrl);
2121
webPageUrl = x.Url;
2222
webPageSrc = x.Source;
2323

src/QSP/WindAloft/LastestDataSetFinder.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ public static class LastestDataSetFinder
1111
// it's considered a valid page to return.
1212
// (The source of filter page has about 30000 chars,
1313
// a page with file unavailable has only 700.)
14-
private const int sourceCodeLenCriteria = 9000;
14+
private const int sourceCodeLenCriteria = 1000;
1515

1616
// @Throws
17-
public static FindResult Find()
17+
public static FindResult Find(string PageUrl)
1818
{
1919
using (var client = WebClientNoCache())
2020
{
21-
var mainPageSource = client.DownloadString(GribDownloader.HomePageUrl);
21+
var mainPageSource = client.DownloadString(PageUrl);
2222
var urls = GetUrls(mainPageSource);
2323

2424
foreach (var i in urls)
@@ -27,10 +27,14 @@ public static FindResult Find()
2727
{
2828
var src = client.DownloadString(i);
2929

30-
if (src.Length >= sourceCodeLenCriteria)
30+
if (src.Length >= sourceCodeLenCriteria*10)
3131
{
3232
return new FindResult() { Url = i, Source = src };
3333
}
34+
if (src.Length >= sourceCodeLenCriteria)
35+
{
36+
return LastestDataSetFinder.Find(i);
37+
}
3438
}
3539
catch { }
3640
}

0 commit comments

Comments
 (0)