Prechádzať zdrojové kódy

修复执行ExecutephotoEx没有界面显示

KWD 6 mesiacov pred
rodič
commit
a3f9605eb2
1 zmenil súbory, kde vykonal 40 pridanie a 2 odobranie
  1. 40 2
      TeamAAS-VM/Services/RemoteCommandService.cs

+ 40 - 2
TeamAAS-VM/Services/RemoteCommandService.cs

@@ -1769,12 +1769,12 @@ namespace TeamAAS_VP.Services
                 bool succed = camera.SetExposureTime(procedure.ExposureTime);
                 bool succed = camera.SetExposureTime(procedure.ExposureTime);
                 if (!succed)
                 if (!succed)
                 {
                 {
-                    SendTaskMessage($"相机曝光设置失败!", MessageLevel.Error);
+                    SendTaskMessage(Lang.相机曝光设置失败, MessageLevel.Error);
                 }
                 }
                 succed = camera.SetGain(procedure.Gain);
                 succed = camera.SetGain(procedure.Gain);
                 if (!succed)
                 if (!succed)
                 {
                 {
-                    SendTaskMessage($"相机增益设置失败!", MessageLevel.Error);
+                    SendTaskMessage(Lang.相机增益设置失败, MessageLevel.Error);
                 }
                 }
                 DateTime nowtime = DateTime.Now;
                 DateTime nowtime = DateTime.Now;
                 LogHelper.WriteLogInfo("开始采集图像");
                 LogHelper.WriteLogInfo("开始采集图像");
@@ -1825,6 +1825,22 @@ namespace TeamAAS_VP.Services
                             record = item.Value as ICogRecord;
                             record = item.Value as ICogRecord;
                     }
                     }
                     outGraphicCollection = outputCollection["Graphic"].Value as CogGraphicCollection;
                     outGraphicCollection = outputCollection["Graphic"].Value as CogGraphicCollection;
+                    _eventAggregator.GetEvent<RenderUpdateNotification>().Publish(new ShowRender()
+                    {
+                        Id = procedure.Id,
+                        Image = (ICogImage)procedure.ToolBlock.Inputs["InputImage"].Value,
+                        Graphic = outputCollection["Graphic"].Value as CogGraphicCollection,
+                        Record = record,
+                        Result = (bool)(outputCollection["Found"].Value),
+                        IsShow = true,
+                        IsSaveImage = procedure.IsSaveImage,
+                        SaveImageModel = procedure.SaveImageModel,
+                        SaveImagePathModel = procedure.SaveImagePathModel,
+                        SavePath = procedure.SavePath,
+                        IsCompress = procedure.IsCompress,
+                        IsDelaySaveImage = procedure.IsDelaySaveImage,
+                        ProceductName = procedure.Name,
+                    });
                     return true;
                     return true;
                 }
                 }
                 else
                 else
@@ -1833,6 +1849,28 @@ namespace TeamAAS_VP.Services
                     SendTaskMessage(procedure.ToolBlock.RunStatus.Message, MessageLevel.Error);
                     SendTaskMessage(procedure.ToolBlock.RunStatus.Message, MessageLevel.Error);
                     outputCollection = null;
                     outputCollection = null;
                     outGraphicCollection = outputCollection["Graphic"].Value as CogGraphicCollection;
                     outGraphicCollection = outputCollection["Graphic"].Value as CogGraphicCollection;
+                    ICogRecord record = null;
+                    foreach (CogToolBlockTerminal item in outputCollection)
+                    {
+                        if (item.Value is ICogRecord)
+                            record = item.Value as ICogRecord;
+                    }
+                    _eventAggregator.GetEvent<RenderUpdateNotification>().Publish(new ShowRender()
+                    {
+                        Id = procedure.Id,
+                        Image = (ICogImage)procedure.ToolBlock.Inputs["InputImage"].Value,
+                        Graphic = outputCollection["Graphic"].Value as CogGraphicCollection,
+                        Record = record,
+                        Result = (bool)(outputCollection["Found"].Value),
+                        IsShow = true,
+                        IsSaveImage = procedure.IsSaveImage,
+                        SaveImageModel = procedure.SaveImageModel,
+                        SaveImagePathModel = procedure.SaveImagePathModel,
+                        SavePath = procedure.SavePath,
+                        IsCompress = procedure.IsCompress,
+                        IsDelaySaveImage = procedure.IsDelaySaveImage,
+                        ProceductName = procedure.Name,
+                    });
                     return false;
                     return false;
                 }
                 }
             }
             }