|
|
@@ -1615,7 +1615,7 @@ namespace TeamAAS_VP.Services
|
|
|
/// <param name="outImage"></param>
|
|
|
/// <param name="outGraphicCollection"></param>
|
|
|
/// <returns></returns>
|
|
|
- public bool ExecutePhotoEx(int index, ProcedureModel procedure, Dictionary<string, string> InputTerminal, out CogToolBlockTerminalCollection outputCollection, out ICogImage outImage, out CogGraphicCollection outGraphicCollection)
|
|
|
+ public bool ExecutePhotoEx(ProcedureModel procedure, Dictionary<string, string> InputTerminal, out CogToolBlockTerminalCollection outputCollection, out ICogImage outImage, out CogGraphicCollection outGraphicCollection)
|
|
|
{
|
|
|
outImage = null;
|
|
|
outGraphicCollection = null;
|
|
|
@@ -1627,12 +1627,12 @@ namespace TeamAAS_VP.Services
|
|
|
bool succed = camera.SetExposureTime(procedure.ExposureTime);
|
|
|
if (!succed)
|
|
|
{
|
|
|
- SendTaskMessage($"相机曝光设置失败!", MessageLevel.Error);
|
|
|
+ SendTaskMessage(Lang.相机曝光设置失败, MessageLevel.Error);
|
|
|
}
|
|
|
succed = camera.SetGain(procedure.Gain);
|
|
|
if (!succed)
|
|
|
{
|
|
|
- SendTaskMessage($"相机增益设置失败!", MessageLevel.Error);
|
|
|
+ SendTaskMessage(Lang.相机增益设置失败, MessageLevel.Error);
|
|
|
}
|
|
|
DateTime nowtime = DateTime.Now;
|
|
|
LogHelper.WriteLogInfo("开始采集图像");
|
|
|
@@ -1683,6 +1683,22 @@ namespace TeamAAS_VP.Services
|
|
|
record = item.Value as ICogRecord;
|
|
|
}
|
|
|
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;
|
|
|
}
|
|
|
else
|
|
|
@@ -1691,6 +1707,28 @@ namespace TeamAAS_VP.Services
|
|
|
SendTaskMessage(procedure.ToolBlock.RunStatus.Message, MessageLevel.Error);
|
|
|
outputCollection = null;
|
|
|
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;
|
|
|
}
|
|
|
}
|