|
|
|
@ -191,15 +191,29 @@ public class GradingLoadingVM : BaseViewModel,IDisposable |
|
|
|
|
LoadImages(processImage.Result.Images); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
string strImageModeImagePath = string.Empty; |
|
|
|
|
if (type == 1) |
|
|
|
|
{ |
|
|
|
|
ImageSelect jsonImport = new ImageSelect(); |
|
|
|
|
bool? a = jsonImport.ShowDialog(); |
|
|
|
|
if (a ?? false) |
|
|
|
|
{ |
|
|
|
|
strImageModeImagePath = jsonImport.FilePath.Text; |
|
|
|
|
string name = jsonImport.FileName.Text; |
|
|
|
|
List<string> mnFiles = new List<string>(); |
|
|
|
|
for (int i = 0; i < 100; i++) |
|
|
|
|
{ |
|
|
|
|
mnFiles.Add($"{i}.bmp"); |
|
|
|
|
mnFiles.Add(name.Replace("%d", i.ToString())); |
|
|
|
|
} |
|
|
|
|
LoadImages(mnFiles); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
return -1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ImageIsEnable = true; |
|
|
|
|
StartPlayback(); |
|
|
|
@ -217,10 +231,17 @@ public class GradingLoadingVM : BaseViewModel,IDisposable |
|
|
|
|
_algorithmConfigVM.InitAlgorithmData(null); |
|
|
|
|
string algo_config = _algorithmConfigVM.AlgorithmConfigJson; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string imageFileBasePath = string.Empty; |
|
|
|
|
//图片根目录 |
|
|
|
|
string? image_file_base_path = ConfigurationManager.AppSettings["ImageFileBasePath"]; |
|
|
|
|
if (string.IsNullOrEmpty(image_file_base_path)) |
|
|
|
|
if (type == 1) |
|
|
|
|
{ |
|
|
|
|
imageFileBasePath = strImageModeImagePath; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
imageFileBasePath = ConfigurationManager.AppSettings["ImageFileBasePath"]; |
|
|
|
|
} |
|
|
|
|
if (string.IsNullOrEmpty(imageFileBasePath)) |
|
|
|
|
{ |
|
|
|
|
throw new InvalidOperationException("ImageFileBasePath is not configured in AppSettings."); |
|
|
|
|
} |
|
|
|
@ -235,7 +256,7 @@ public class GradingLoadingVM : BaseViewModel,IDisposable |
|
|
|
|
JObject jsonData = new JObject( |
|
|
|
|
new JProperty("shape", _diamnondType.Split(" ")[0]), |
|
|
|
|
new JProperty("shape_mode", _diamnondType.Split(" ")[1]), |
|
|
|
|
new JProperty("image_file_base_path", image_file_base_path), |
|
|
|
|
new JProperty("image_file_base_path", imageFileBasePath), |
|
|
|
|
new JProperty("image_files", ImagePaths), |
|
|
|
|
new JProperty("half_circle", half_circle), |
|
|
|
|
new JProperty("algorithm_log_path", algorithm_log_path), |
|
|
|
@ -294,6 +315,7 @@ public class GradingLoadingVM : BaseViewModel,IDisposable |
|
|
|
|
Progress = (100.00); |
|
|
|
|
|
|
|
|
|
string strParam = JsonConvert.SerializeObject(detectTask.Result); |
|
|
|
|
//Logger.Info("序列化字符串:" + strParam); |
|
|
|
|
AlgorithmResultEntity parameter = JsonConvert.DeserializeObject<AlgorithmResultEntity>(strParam); |
|
|
|
|
if (parameter == null && _isCancel == false) |
|
|
|
|
{ |
|
|
|
@ -328,6 +350,12 @@ public class GradingLoadingVM : BaseViewModel,IDisposable |
|
|
|
|
|
|
|
|
|
Parameter = parameter; |
|
|
|
|
if (_isCancel == true) return -100; |
|
|
|
|
|
|
|
|
|
if (parameter.status == StatusCodes.Recheck) |
|
|
|
|
{ |
|
|
|
|
new MessageBox().Show(MultilingualHelper.getString("Recheck")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -366,7 +394,7 @@ public class GradingLoadingVM : BaseViewModel,IDisposable |
|
|
|
|
{ |
|
|
|
|
current = Math.Min(current + 1, 100); |
|
|
|
|
UpdateProgress(current); |
|
|
|
|
await Task.Delay(stepTime); |
|
|
|
|
await Task.Delay(stepTime/2); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
private void UpdateProgress(int value) |
|
|
|
|