fix: image model bug

master
tongg 9 months ago
parent bbb8cc3c15
commit 232d81f61b
  1. 8
      ViewModel/Grading/GradingLoadingVM.cs

@ -10,6 +10,7 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using SparkClient.Model.Common; using SparkClient.Model.Common;
using SparkClient.Model.Entity.ApiEntity; using SparkClient.Model.Entity.ApiEntity;
using SparkClient.Model.Extension;
using SparkClient.Model.Helper; using SparkClient.Model.Helper;
using SparkClient.Model.Services; using SparkClient.Model.Services;
using SparkClient.ViewModel.BaseWindow; using SparkClient.ViewModel.BaseWindow;
@ -53,6 +54,8 @@ public class GradingLoadingVM : BaseViewModel,IDisposable
private Scanner _scanner; private Scanner _scanner;
private CancellationTokenSource _completionCts; private CancellationTokenSource _completionCts;
string strImageModeImagePath = string.Empty;
#region 图片播放控制 #region 图片播放控制
private PlayStatus _currentStatus = PlayStatus.Stopped; private PlayStatus _currentStatus = PlayStatus.Stopped;
public PlayStatus CurrentStatus public PlayStatus CurrentStatus
@ -197,7 +200,7 @@ public class GradingLoadingVM : BaseViewModel,IDisposable
LoadImages(processImage.Result.Images); LoadImages(processImage.Result.Images);
} }
string strImageModeImagePath = string.Empty;
if (type == 1) if (type == 1)
{ {
ImageSelect jsonImport = new ImageSelect(); ImageSelect jsonImport = new ImageSelect();
@ -345,6 +348,7 @@ public class GradingLoadingVM : BaseViewModel,IDisposable
parameter.Shape = _diamnondType.Split(" ")[0]; parameter.Shape = _diamnondType.Split(" ")[0];
parameter.CrownType = _diamnondType.Split(" ")[1]; parameter.CrownType = _diamnondType.Split(" ")[1];
parameter.PavType = _diamnondType.Split(" ")[2]; parameter.PavType = _diamnondType.Split(" ")[2];
parameter.error_msg = _diamnondType;
try try
{ {
@ -595,7 +599,7 @@ public class GradingLoadingVM : BaseViewModel,IDisposable
{ {
if (ImagePaths == null || CurrentIndex < 0 || CurrentIndex >= ImagePaths.Length) if (ImagePaths == null || CurrentIndex < 0 || CurrentIndex >= ImagePaths.Length)
return; return;
string? savePath = ConfigurationManager.AppSettings["ImageFileBasePath"]; string? savePath = strImageModeImagePath.IsNullOrEmpty()? ConfigurationManager.AppSettings["ImageFileBasePath"]:strImageModeImagePath;
var bitmap = new BitmapImage(); var bitmap = new BitmapImage();
bitmap.BeginInit(); bitmap.BeginInit();
bitmap.CacheOption = BitmapCacheOption.OnLoad; bitmap.CacheOption = BitmapCacheOption.OnLoad;

Loading…
Cancel
Save