fix: test bugs

master
tongg 8 months ago
parent 02e9d9460f
commit cfb43f47a5
  1. 2
      App.config
  2. 3
      Model/Helper/NetworkSpeedHelper.cs
  3. 2
      Model/Services/SOCClientService.cs
  4. 9
      ViewModel/Grading/GradingLoadingVM.cs
  5. 4
      Views/Dialog/MessageBoxHasCheck.xaml.cs

@ -19,7 +19,7 @@
<!--网络质量检测阈值 Mbps--> <!--网络质量检测阈值 Mbps-->
<add key="InternetCheckMbps" value="866" /> <add key="InternetCheckMbps" value="866" />
<add key="RunModel" value="0" /> <add key="RunModel" value="101" />
<add key="AppVersion" value="Nlsqq/kAPIXFHKk9dFcfqw==" /> <add key="AppVersion" value="Nlsqq/kAPIXFHKk9dFcfqw==" />
</appSettings> </appSettings>
<connectionStrings> <connectionStrings>

@ -17,10 +17,11 @@ public class NetworkSpeedHelper
get => _ignore; get => _ignore;
set set
{ {
if (_ignore) if (value)
{ {
DisposeTimer(); DisposeTimer();
} }
_ignore = value;
} }
} }

@ -68,7 +68,7 @@ namespace SparkClient.Model.Services
{ {
Logger.Info($"Request sent to URL: {url}"); Logger.Info($"Request sent to URL: {url}");
client.DefaultRequestHeaders.Add("Authorization", "Basic " + _authToken); client.DefaultRequestHeaders.Add("Authorization", "Basic " + _authToken);
client.Timeout = new TimeSpan(0, 0, 5); client.Timeout = new TimeSpan(0, 0, 30);
HttpResponseMessage result = await client.GetAsync(url); HttpResponseMessage result = await client.GetAsync(url);
// 提前读取内容并存储 // 提前读取内容并存储

@ -91,7 +91,7 @@ public class GradingLoadingVM : BaseViewModel,IDisposable
{ {
_currentIndex = value; _currentIndex = value;
OnPropertyChanged(nameof(CurrentIndex)); OnPropertyChanged(nameof(CurrentIndex));
UpdateCurrentImage();
} }
} }
@ -241,6 +241,7 @@ public class GradingLoadingVM : BaseViewModel,IDisposable
return -100; return -100;
} }
Diamond diamond = new Diamond(); Diamond diamond = new Diamond();
string circleSql = $"SELECT VALUE FROM CUTTER_CONFIG WHERE KEY = 'half_circle'"; string circleSql = $"SELECT VALUE FROM CUTTER_CONFIG WHERE KEY = 'half_circle'";
DataTable circleTable = DataBaseHelper.ExecuteQuery(circleSql); DataTable circleTable = DataBaseHelper.ExecuteQuery(circleSql);
@ -556,7 +557,7 @@ public class GradingLoadingVM : BaseViewModel,IDisposable
string? savePath = ConfigurationManager.AppSettings["ImageFileBasePath"]; string? savePath = ConfigurationManager.AppSettings["ImageFileBasePath"];
for (int i = 0; i < 100; i++) for (int i = 0; i < 100; i++)
{ {
imagePaths.Add(Path.Combine(savePath, $"image_{i}.bmp")); imagePaths.Add($"image_{i}.bmp");
} }
ImagePaths = imagePaths.ToArray(); ImagePaths = imagePaths.ToArray();
@ -570,6 +571,7 @@ public class GradingLoadingVM : BaseViewModel,IDisposable
{ {
ImagePaths = folderPath.ToArray(); ImagePaths = folderPath.ToArray();
CurrentIndex = 0; CurrentIndex = 0;
UpdateCurrentImage();
CurrentStatus = PlayStatus.Stopped; CurrentStatus = PlayStatus.Stopped;
} }
@ -669,6 +671,7 @@ public class GradingLoadingVM : BaseViewModel,IDisposable
for (CurrentIndex = 0; CurrentIndex < ImagePaths.Length; CurrentIndex++) for (CurrentIndex = 0; CurrentIndex < ImagePaths.Length; CurrentIndex++)
{ {
if (_cts.Token.IsCancellationRequested) break; if (_cts.Token.IsCancellationRequested) break;
UpdateCurrentImage();
await Task.Delay(_playDelay); await Task.Delay(_playDelay);
} }
@ -717,6 +720,7 @@ public class GradingLoadingVM : BaseViewModel,IDisposable
PausePlayback(); PausePlayback();
CurrentIndex = (CurrentIndex - 1 + ImagePaths.Length) % ImagePaths.Length; CurrentIndex = (CurrentIndex - 1 + ImagePaths.Length) % ImagePaths.Length;
UpdateCurrentImage();
} }
[Log] [Log]
private void MoveNext() private void MoveNext()
@ -725,6 +729,7 @@ public class GradingLoadingVM : BaseViewModel,IDisposable
PausePlayback(); PausePlayback();
CurrentIndex = (CurrentIndex + 1) % ImagePaths.Length; CurrentIndex = (CurrentIndex + 1) % ImagePaths.Length;
UpdateCurrentImage();
} }
#endregion #endregion
} }

@ -1,5 +1,6 @@
using System.Windows; using System.Windows;
using System.Windows.Input; using System.Windows.Input;
using SparkClient.Model.Helper;
namespace SparkClient.Views.Dialog; namespace SparkClient.Views.Dialog;
@ -29,7 +30,6 @@ public partial class MessageBoxHasCheck : Window
{ {
var dialog = new MessageBoxHasCheck(); var dialog = new MessageBoxHasCheck();
dialog.ShowDialog(); dialog.ShowDialog();
var data = dialog.CheckBoxCancelCheck.IsChecked == true; return dialog.CheckBoxCancelCheck.IsChecked == true;
return data;
} }
} }
Loading…
Cancel
Save