public void ShowImage(HWndCtrl viewCtrl) { if (ImageTestOut != null && ImageTestOut.IsInitialized()) { viewCtrl.AddIconicVar(ImageTestOut); } }
protected override void RunAct() { try { if (isExtTrigger == false) { HOperatorSet.CountSeconds(out runStartTime); StartTime = runStartTime.D; //由于这里是图像的源头,可以直接清除图像 DisposeHobject(ImageTestOut); if (OffLineMode == true) { ImageTestOut = new HImage(); if (imageFiles == null || imageFiles.TupleLength() < 1) { Util.Notify(string.Format("工具{0}无离线数据", this.Name)); return; } ImageTestOut.ReadImage(imageFiles.TupleSelect(offLineImageIndex)); Result = "图像采集完成"; offLineImageIndex++; if ((offLineImageIndex > (imageFiles.TupleLength() - 1)) || isStopOffLineTest) { allReadFinish = true; offLineImageIndex = 0; } else { allReadFinish = false; } } } else { //ImageTestOut已经通过RunThreadData中的RunAllTool()调用SettExtTriggerData()获取。 //外触发,收到图像时间就是图像处理的开始时间 runStartTime = StartTime; } if (ImageTestOut != null && ImageTestOut.IsInitialized()) { IsOk = true; isRealOk = true; Result = "OK"; } } catch (Exception ex) { Util.WriteLog(this.GetType(), ex); string message = ""; if (OffLineMode) { message = "离线图像路径异常,请检查设置"; } else { message = "相机图像采集异常,请检查设置"; } Util.Notify(string.Format("工具{0}运行异常:{1}", Name, message)); } }