diff --git a/App.config b/App.config index abb2fba..2757a33 100644 --- a/App.config +++ b/App.config @@ -19,7 +19,7 @@ - + diff --git a/Model/Helper/NetworkSpeedHelper.cs b/Model/Helper/NetworkSpeedHelper.cs index df0d1e2..62086f8 100644 --- a/Model/Helper/NetworkSpeedHelper.cs +++ b/Model/Helper/NetworkSpeedHelper.cs @@ -17,10 +17,11 @@ public class NetworkSpeedHelper get => _ignore; set { - if (_ignore) + if (value) { DisposeTimer(); } + _ignore = value; } } diff --git a/Model/Services/SOCClientService.cs b/Model/Services/SOCClientService.cs index 6ec502e..8e85136 100644 --- a/Model/Services/SOCClientService.cs +++ b/Model/Services/SOCClientService.cs @@ -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); // 提前读取内容并存储 diff --git a/ViewModel/Grading/GradingLoadingVM.cs b/ViewModel/Grading/GradingLoadingVM.cs index f5bb51e..d177d1e 100644 --- a/ViewModel/Grading/GradingLoadingVM.cs +++ b/ViewModel/Grading/GradingLoadingVM.cs @@ -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 } diff --git a/Views/Dialog/MessageBoxHasCheck.xaml.cs b/Views/Dialog/MessageBoxHasCheck.xaml.cs index 81dc27b..1b9a3bf 100644 --- a/Views/Dialog/MessageBoxHasCheck.xaml.cs +++ b/Views/Dialog/MessageBoxHasCheck.xaml.cs @@ -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; } } \ No newline at end of file