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-->
<add key="InternetCheckMbps" value="866" />
<add key="RunModel" value="0" />
<add key="RunModel" value="101" />
<add key="AppVersion" value="Nlsqq/kAPIXFHKk9dFcfqw==" />
</appSettings>
<connectionStrings>

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

@ -68,7 +68,7 @@ namespace SparkClient.Model.Services
{
Logger.Info($"Request sent to URL: {url}");
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);
// 提前读取内容并存储

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

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