Browse Source

Merge branch 'master' of http://git.ius.plus/justin.xing/StationProbe

Justin 1 year ago
parent
commit
c3dc70d5eb

+ 2 - 0
StationProbe/ProbeTask.cs

@@ -517,6 +517,8 @@ namespace StationProbe
                 for (var i = 0; i < imageUrls.Count; i++)
                 {
                     await SaveExamImageAsync(page, examId, i, imageUrls[i]);
+                    //Do not save to fast to avoid network trouble.
+                    await Task.Delay(200);
                 }
 
                 if (DebugMode)

+ 7 - 1
StationProbe/Program.cs

@@ -1,7 +1,7 @@
 // See https://aka.ms/new-console-template for more information
 using PuppeteerSharp;
 using StationProbe;
-
+using System.Diagnostics;
 
 if (args.Length == 0)
 {
@@ -36,6 +36,12 @@ else
             bool error = true;
             while (error)
             {
+                //Kill all chrome exes before start.
+                var chromes = Process.GetProcesses("chrome.exe");
+                foreach(var chrome in chromes)
+                {
+                    chrome.Kill();
+                }
                 try
                 {
                     ProbeTask.InitDebugFolder();

+ 1 - 1
TestViewer/MainWindow.xaml

@@ -24,7 +24,7 @@
                 <Button Margin="2" Content=">" Click="OnNextPageClick"/>
             </UniformGrid>
         </Grid>
-        <ScrollViewer Grid.Column="1" >
+        <ScrollViewer x:Name="ExamControllScrollView" Grid.Column="1" >
             <StackPanel x:Name="ExamContent"/>
         </ScrollViewer>
         

+ 2 - 0
TestViewer/MainWindow.xaml.cs

@@ -62,6 +62,7 @@ namespace TestViewer
 
         private void OnExamSelectionChanged(object sender, SelectionChangedEventArgs e)
         {
+            ExamControllScrollView.ScrollToHome();
             ExamContent.Children.Clear();
             if (ExamList.SelectedValue != null)
             {
@@ -84,6 +85,7 @@ namespace TestViewer
                         img.EndInit();
                         ExamContent.Children.Add(new System.Windows.Controls.Image() 
                         { 
+                            Stretch = System.Windows.Media.Stretch.None,
                             Margin = new Thickness(4),
                             Source = img 
                         });