diff --git a/ViewModel/Grading/DiamondSelectVM.cs b/ViewModel/Grading/DiamondSelectVM.cs index b953296..8954b4b 100644 --- a/ViewModel/Grading/DiamondSelectVM.cs +++ b/ViewModel/Grading/DiamondSelectVM.cs @@ -182,41 +182,41 @@ public class DiamondSelectVM : BaseViewModel parameter.CrownType = value.Split(" ")[1]; parameter.PavType = value.Split(" ")[2]; } - // // 初始化SOC客户端服务,传入SOC端的地址和认证Token - // _socClientService = new SOCClientService(); - // // 启动soc - // socResolt = await _socClientService.ProcessImageCollectionAsync(); - // switch (socResolt.Status) - // { - // case StatusCodes.OpenOfTheHatch: - // ShowErrorMessage(MultilingualHelper.getString("OpenOfTheHatch"), loading); - // return; - // case StatusCodes.DeviceNotFound: - // ShowErrorMessage(MultilingualHelper.getString("DeviceNotFound"), loading); - // return; - // case StatusCodes.InProgress: - // ShowErrorMessage(MultilingualHelper.getString("InProgress"), loading); - // return; - // case StatusCodes.CacheCleared: - // ShowErrorMessage(MultilingualHelper.getString("CacheCleared"), loading); - // return; - // case StatusCodes.CannotSendCommand: - // ShowErrorMessage(MultilingualHelper.getString("CannotSendCommand"), loading); - // return; - // case StatusCodes.MicrocontrollerTimeout: - // ShowErrorMessage(MultilingualHelper.getString("MicrocontrollerTimeout"), loading); - // return; - // case StatusCodes.MicrocontrollerError: - // ShowErrorMessage(MultilingualHelper.getString("MicrocontrollerError"), loading); - // return; - // case StatusCodes.CameraNotConnected: - // ShowErrorMessage(MultilingualHelper.getString("CameraNotConnected"), loading); - // return; - // } + // 初始化SOC客户端服务,传入SOC端的地址和认证Token + _socClientService = new SOCClientService(); + // 启动soc + socResolt = await _socClientService.ProcessImageCollectionAsync(); + switch (socResolt.Status) + { + case StatusCodes.OpenOfTheHatch: + ShowErrorMessage(MultilingualHelper.getString("OpenOfTheHatch"), loading); + return; + case StatusCodes.DeviceNotFound: + ShowErrorMessage(MultilingualHelper.getString("DeviceNotFound"), loading); + return; + case StatusCodes.InProgress: + ShowErrorMessage(MultilingualHelper.getString("InProgress"), loading); + return; + case StatusCodes.CacheCleared: + ShowErrorMessage(MultilingualHelper.getString("CacheCleared"), loading); + return; + case StatusCodes.CannotSendCommand: + ShowErrorMessage(MultilingualHelper.getString("CannotSendCommand"), loading); + return; + case StatusCodes.MicrocontrollerTimeout: + ShowErrorMessage(MultilingualHelper.getString("MicrocontrollerTimeout"), loading); + return; + case StatusCodes.MicrocontrollerError: + ShowErrorMessage(MultilingualHelper.getString("MicrocontrollerError"), loading); + return; + case StatusCodes.CameraNotConnected: + ShowErrorMessage(MultilingualHelper.getString("CameraNotConnected"), loading); + return; + } _algorithmServer = new AlgorithmServer(); // //图片集合 - // string image_files = JsonConvert.SerializeObject(socResolt.Images, Formatting.Indented); - string image_files =$"[ \"image_0.bmp\", \"image_1.bmp\", \"image_2.bmp\", \"image_3.bmp\", \"image_4.bmp\", \"image_5.bmp\", \"image_6.bmp\", \"image_7.bmp\", \"image_8.bmp\", \"image_9.bmp\", \"image_10.bmp\", \"image_11.bmp\", \"image_12.bmp\", \"image_13.bmp\", \"image_14.bmp\", \"image_15.bmp\", \"image_16.bmp\", \"image_17.bmp\", \"image_18.bmp\", \"image_19.bmp\", \"image_20.bmp\", \"image_21.bmp\", \"image_22.bmp\", \"image_23.bmp\", \"image_24.bmp\", \"image_25.bmp\", \"image_26.bmp\", \"image_27.bmp\", \"image_28.bmp\", \"image_29.bmp\", \"image_30.bmp\", \"image_31.bmp\", \"image_32.bmp\", \"image_33.bmp\", \"image_34.bmp\", \"image_35.bmp\", \"image_36.bmp\", \"image_37.bmp\", \"image_38.bmp\", \"image_39.bmp\", \"image_40.bmp\", \"image_41.bmp\", \"image_42.bmp\", \"image_43.bmp\", \"image_44.bmp\", \"image_45.bmp\", \"image_46.bmp\", \"image_47.bmp\", \"image_48.bmp\", \"image_49.bmp\", \"image_50.bmp\", \"image_51.bmp\", \"image_52.bmp\", \"image_53.bmp\", \"image_54.bmp\", \"image_55.bmp\", \"image_56.bmp\", \"image_57.bmp\", \"image_58.bmp\", \"image_59.bmp\", \"image_60.bmp\", \"image_61.bmp\", \"image_62.bmp\", \"image_63.bmp\", \"image_64.bmp\", \"image_65.bmp\", \"image_66.bmp\", \"image_67.bmp\", \"image_68.bmp\", \"image_69.bmp\", \"image_70.bmp\", \"image_71.bmp\", \"image_72.bmp\", \"image_73.bmp\", \"image_74.bmp\", \"image_75.bmp\", \"image_76.bmp\", \"image_77.bmp\", \"image_78.bmp\", \"image_79.bmp\", \"image_80.bmp\", \"image_81.bmp\", \"image_82.bmp\", \"image_83.bmp\", \"image_84.bmp\", \"image_85.bmp\", \"image_86.bmp\", \"image_87.bmp\", \"image_88.bmp\", \"image_89.bmp\", \"image_90.bmp\", \"image_91.bmp\", \"image_92.bmp\", \"image_93.bmp\", \"image_94.bmp\", \"image_95.bmp\", \"image_96.bmp\", \"image_97.bmp\", \"image_98.bmp\", \"image_99.bmp\"]" ; + string image_files = JsonConvert.SerializeObject(socResolt.Images, Formatting.Indented); + //string image_files =$"[ \"image_0.bmp\", \"image_1.bmp\", \"image_2.bmp\", \"image_3.bmp\", \"image_4.bmp\", \"image_5.bmp\", \"image_6.bmp\", \"image_7.bmp\", \"image_8.bmp\", \"image_9.bmp\", \"image_10.bmp\", \"image_11.bmp\", \"image_12.bmp\", \"image_13.bmp\", \"image_14.bmp\", \"image_15.bmp\", \"image_16.bmp\", \"image_17.bmp\", \"image_18.bmp\", \"image_19.bmp\", \"image_20.bmp\", \"image_21.bmp\", \"image_22.bmp\", \"image_23.bmp\", \"image_24.bmp\", \"image_25.bmp\", \"image_26.bmp\", \"image_27.bmp\", \"image_28.bmp\", \"image_29.bmp\", \"image_30.bmp\", \"image_31.bmp\", \"image_32.bmp\", \"image_33.bmp\", \"image_34.bmp\", \"image_35.bmp\", \"image_36.bmp\", \"image_37.bmp\", \"image_38.bmp\", \"image_39.bmp\", \"image_40.bmp\", \"image_41.bmp\", \"image_42.bmp\", \"image_43.bmp\", \"image_44.bmp\", \"image_45.bmp\", \"image_46.bmp\", \"image_47.bmp\", \"image_48.bmp\", \"image_49.bmp\", \"image_50.bmp\", \"image_51.bmp\", \"image_52.bmp\", \"image_53.bmp\", \"image_54.bmp\", \"image_55.bmp\", \"image_56.bmp\", \"image_57.bmp\", \"image_58.bmp\", \"image_59.bmp\", \"image_60.bmp\", \"image_61.bmp\", \"image_62.bmp\", \"image_63.bmp\", \"image_64.bmp\", \"image_65.bmp\", \"image_66.bmp\", \"image_67.bmp\", \"image_68.bmp\", \"image_69.bmp\", \"image_70.bmp\", \"image_71.bmp\", \"image_72.bmp\", \"image_73.bmp\", \"image_74.bmp\", \"image_75.bmp\", \"image_76.bmp\", \"image_77.bmp\", \"image_78.bmp\", \"image_79.bmp\", \"image_80.bmp\", \"image_81.bmp\", \"image_82.bmp\", \"image_83.bmp\", \"image_84.bmp\", \"image_85.bmp\", \"image_86.bmp\", \"image_87.bmp\", \"image_88.bmp\", \"image_89.bmp\", \"image_90.bmp\", \"image_91.bmp\", \"image_92.bmp\", \"image_93.bmp\", \"image_94.bmp\", \"image_95.bmp\", \"image_96.bmp\", \"image_97.bmp\", \"image_98.bmp\", \"image_99.bmp\"]" ; // 保存图片到历史记录文件夹 HandleAlgorithmFailure(image_files);